repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
vongazman/libcloud
libcloud/test/compute/test_softlayer.py
5
10728
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
zodiac/incubator-airflow
airflow/operators/hive_to_druid.py
39
5457
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
tastynoodle/django
django/template/base.py
3
50055
from __future__ import unicode_literals import re from functools import partial from importlib import import_module from inspect import getargspec, getcallargs from django.conf import settings from django.template.context import (BaseContext, Context, RequestContext, ContextPopException) from django.utils.itercom...
bsd-3-clause
bankonmeOS/cjdns
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-strip.py
80
1538
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that stripping works. """ import TestGyp import re import subprocess import sys import time if sys.platform == 'darwin': t...
gpl-3.0
rafaelhenrique/rest-with-bdd
app.py
1
3044
from flask import Flask, jsonify, abort, make_response, request, url_for app = Flask(__name__) books = [ { 'id': 1, 'title': u'Python Cookbook', 'tags': [u'Python', u'Algorithms', u'Development'], 'authors': [u'David Beazley', u'Brian K. Jones'], 'publishing': [u"O'Reilly",...
lgpl-3.0
zhuyue1314/angr
tests/test_path_groups.py
9
4094
import nose import angr import logging l = logging.getLogger("angr_tests.path_groups") import os location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) addresses_fauxware = { 'armel': 0x8524, 'armhf': 0x104c9, # addr+1 to force thumb #'i386': 0x8048524, # comm...
bsd-2-clause
DirtyUnicorns/android_external_chromium-org
third_party/protobuf/python/google/protobuf/internal/containers.py
224
10004
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
nhenezi/kuma
vendor/packages/logilab-common/interface.py
6
2635
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
mpl-2.0
BryanCutler/spark
python/pyspark/pandas/tests/plot/test_frame_plot_plotly.py
1
9856
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
hwu25/AppPkg
Applications/Python/Python-2.7.2/Lib/test/test_codeccallbacks.py
9
32031
import test.test_support, unittest import sys, codecs, htmlentitydefs, unicodedata class PosReturn: # this can be used for configurable callbacks def __init__(self): self.pos = 0 def handle(self, exc): oldpos = self.pos realpos = oldpos if realpos<0: ...
bsd-2-clause
Kalyzee/edx-platform
lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py
114
14605
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Invoice' db.create_table('shoppingcart_invoice', ( ('id', self.gf('django.db.mod...
agpl-3.0
Vitallium/qtwebkit
Tools/Scripts/webkitpy/layout_tests/models/test_configuration_unittest.py
124
18096
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
gpl-2.0
chokribr/PIST
modules/webjournal/lib/widgets/bfe_webjournal_widget_latestPhoto.py
25
4058
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
girving/tensorflow
tensorflow/python/keras/layers/merge_test.py
6
8738
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
senguptasaikat/MRM_Sengupta_Moving_Table_Golden_Angle_MRI
code/CMT_Recon.py
2
26916
#!/usr/bin/env python from pylab import * from scipy.io import loadmat, savemat from scipy.fftpack import fftshift, ifftn, fftn, fft, ifft2 from scipy.linalg import lstsq from skimage.filter import threshold_otsu from numpy.linalg import pinv import numpy as np import os import sys import math import time #import pdb ...
mit
cytec/SickRage
lib/hachoir_parser/audio/modplug.py
95
10655
""" Modplug metadata inserted into module files. Doc: - http://modplug.svn.sourceforge.net/viewvc/modplug/trunk/modplug/soundlib/ Author: Christophe GISQUET <christophe.gisquet@free.fr> Creation: 10th February 2007 """ from hachoir_core.field import (FieldSet, UInt32, UInt16, UInt8, Int8, Float32, RawBytes, ...
gpl-3.0
uwdata/termite-stm
web2py/gluon/streamer.py
16
4302
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ import os import stat import time import re import errno import rewrite from gluon.http import HTTP fro...
bsd-3-clause
claudep/translate
translate/tools/porestructure.py
1
5484
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2005, 2006 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version ...
gpl-2.0
xiaofeiyangyang/physpetools
physpetool/tools/operateDB.py
1
4633
# ########################## Copyrights and License ############################# # # # Copyright 2016 Yang Fang <yangfangscu@gmail.com> # # ...
gpl-3.0
karlstroetmann/Artificial-Intelligence
Python/6 Classification/gender_prediction.py
1
1492
def read_names(file_name): Result = [] with open(file_name, 'r') as file: for name in file: Result.append(name[:-1]) # discard newline return Result FemaleNames = read_names('names-female.txt') MaleNames = read_names('names-male.txt' ) pFemale = len(FemaleNames) / (len(FemaleNames) ...
gpl-2.0
c0710204/edx-platform
lms/djangoapps/shoppingcart/migrations/0001_initial.py
182
12544
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Order' db.create_table('shoppingcart_order', ( ('id', self.gf('django.db.models....
agpl-3.0
JostCrow/django-post_office
post_office/south_migrations/0010_auto__add_field_log_exception_type.py
10
4547
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Log.exception_type' db.add_column(u'post_office_log', 'ex...
mit
chantera/blstm-cws
app/train.py
1
4297
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from chainer import cuda, optimizers, serializers from chainer.optimizer import WeightDecay from progressbar import ProgressBar from model import BLSTM, BLSTMCRF from libs.base import App as AbstractApp, Logger as Log from libs.tools import Preprocessor from d...
mit
PhysikOnline-FFM/sagenb
sagenb/testing/notebook_test_case.py
8
14502
# -*- coding: utf-8 -*- """ Notebook Test Case This contains the base class for all SageNB test cases. """ import copy import os import pexpect import re import shutil import signal import subprocess import tempfile import time import unittest from selenium.selenium import selenium # Default options. NB_OPTIONS = {...
gpl-3.0
40223141/w16b_test
static/Brython3.1.1-20150328-091302/Lib/long_int1/__init__.py
503
3858
from browser import html, document, window import javascript #memorize/cache? def _get_value(other): if isinstance(other, LongInt): return other.value return other class BigInt: def __init__(self): pass def __abs__(self): return LongInt(self.value.abs()) def __add__(self, other): ...
gpl-3.0
cswiercz/sympy
sympy/polys/tests/test_pythonrational.py
126
3907
"""Tests for PythonRational type. """ from sympy.polys.domains import PythonRational as QQ from sympy.utilities.pytest import raises def test_PythonRational__init__(): assert QQ(0).p == 0 assert QQ(0).q == 1 assert QQ(0, 1).p == 0 assert QQ(0, 1).q == 1 assert QQ(0, -1).p == 0 assert QQ(0, -1)...
bsd-3-clause
teeple/pns_server
work/install/Python-2.7.4/Lib/plat-mac/lib-scriptpackages/SystemEvents/Power_Suite.py
82
5192
"""Suite Power Suite: Terms and Events for controlling System power Level 1, version 1 Generated from /System/Library/CoreServices/System Events.app AETE/AEUT resource version 1/0, language 0, script 0 """ import aetools import MacOS _code = 'powr' class Power_Suite_Events: def restart(self, _object, _attribut...
gpl-2.0
savoirfairelinux/odoo
addons/sale_journal/__init__.py
443
1067
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
Aluriak/EvolAcc
evolacc/action/basic_actions.py
1
3951
# -*- coding: utf-8 -*- ######################### # BASIC ACTION # ######################### ######################### # IMPORTS # ######################### from evolacc.action.action import Action from evolacc.config import LOGGER ######################### # PRE-DECLARATIONS # #...
mit
schleichdi2/OpenNfr_E2_Gui-6.0
lib/python/Components/Converter/MPServicePosition.py
2
3905
import time from Converter import Converter from Poll import Poll from enigma import iPlayableService from Components.Element import cached, ElementError class MPServicePosition(Poll, Converter, object): TYPE_LENGTH = 0 TYPE_POSITION = 1 TYPE_REMAINING = 2 TYPE_GAUGE = 3 TYPE_ENDTIME = 4 def __init__(self, type...
gpl-2.0
gxx/lettuce
tests/integration/lib/Django-1.3/django/views/decorators/http.py
151
7044
""" Decorators for views based on HTTP headers. """ try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from calendar import timegm from datetime import timedelta from django.utils.decorators import decorator_from_middleware, available_attrs ...
gpl-3.0
stevekuznetsov/ansible
lib/ansible/modules/notification/pushbullet.py
25
6185
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
modulexcite/catapult
third_party/WebOb/webob/request.py
16
59799
import binascii import io import os import re import sys import tempfile import mimetypes try: import simplejson as json except ImportError: import json import warnings from webob.acceptparse import ( AcceptLanguage, AcceptCharset, MIMEAccept, MIMENilAccept, NoAccept, accept_property, ...
bsd-3-clause
drpngx/tensorflow
tensorflow/python/kernel_tests/priority_queue_test.py
134
12082
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
fqul/scrapy
scrapy/downloadermiddlewares/robotstxt.py
41
2943
""" This is a middleware to respect robots.txt policies. To activate it you must enable this middleware and enable the ROBOTSTXT_OBEY setting. """ import logging from six.moves.urllib import robotparser from scrapy.exceptions import NotConfigured, IgnoreRequest from scrapy.http import Request from scrapy.utils.http...
bsd-3-clause
EventRegistry/event-registry-python
eventregistry/QueryEvents.py
1
32251
import six, json from eventregistry.Base import * from eventregistry.ReturnInfo import * from eventregistry.Query import * class QueryEvents(Query): def __init__(self, keywords = None, conceptUri = None, categoryUri = None, sourceUri = None, ...
mit
justin-ho/security-tools
crypto/caesar.py
1
1908
#!/usr/bin/python """Python script to perform a caesar shift on a caesar cipher Shifting works with everything but these characters: $! This bug seems to be due to bash issues. -m, the message to cipher -n, the number of shifts to shift the cipher -e, Encrypt the message -d, Decrypt the message -a, ...
mit
rajalokan/nova
nova/cmd/api_os_compute.py
3
1559
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a ...
apache-2.0
debugger06/MiroX
tv/linux/plat/clconverter.py
1
3505
# Miro - an RSS based video player application # Copyright (C) 2010, 2011 # Participatory Culture Foundation # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or...
gpl-2.0
erwilan/ansible
lib/ansible/modules/cloud/cloudstack/cs_loadbalancer_rule_member.py
43
10208
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, Darren Worrall <darren@iweb.co.uk> # (c) 2015, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free So...
gpl-3.0
Chilledheart/depot_tools
third_party/gsutil/gslib/commands/config.py
42
28341
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
armab/st2
st2actions/st2actions/cmd/st2resultstracker.py
5
1314
import eventlet import os import sys from st2common import log as logging from st2common.service_setup import setup as common_setup from st2common.service_setup import teardown as common_teardown from st2actions.resultstracker import config from st2actions.resultstracker import resultstracker LOG = logging.getLogger...
apache-2.0
GreeKpl/pyslate
tests/test_parser.py
1
6017
# encoding: utf-8 import unittest from pyslate.parser import PyLexer, PyParser, InnerTagField, VariableField, SwitchField, PyslateException class LexerTest(unittest.TestCase): def setUp(self): self.lexer = PyLexer() self.lexer.build() def tokenize_to_list(self, text): return [(token...
mit
DeathPoison/tinker-cnc
tinkerforge/bricklet_io16.py
1
11646
# -*- coding: utf-8 -*- ############################################################# # This file was automatically generated on 2013-07-04. # # # # Bindings Version 2.0.8 # # ...
mit
tiagofrepereira2012/tensorflow
tensorflow/python/platform/control_imports.py
154
1105
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
ojii/sandlib
lib/lib-python/2.7/plat-irix5/IN.py
66
3097
# Generated by h2py from /usr/include/netinet/in.h from warnings import warnpy3k warnpy3k("the IN module has been removed in Python 3.0", stacklevel=2) del warnpy3k # Included from sys/endian.h LITTLE_ENDIAN = 1234 BIG_ENDIAN = 4321 PDP_ENDIAN = 3412 BYTE_ORDER = BIG_ENDIAN BYTE_ORDER = LITTLE_ENDIAN def ntohl(x): ret...
bsd-3-clause
Intuity/Tktr
ticketing/queue/views.py
1
6208
from datetime import datetime import json from .models import QueueItem from pyramid.httpexceptions import HTTPFound from pyramid.response import Response from pyramid.security import remember from pyramid.view import view_config from .queue import Queue from ticketing.macros.baselayout import BaseLayout from ticketing...
gpl-3.0
nyee/RMG-Py
rmgpy/tools/observablesRegression.py
5
17070
import sys import os.path import numpy from rmgpy.chemkin import loadChemkinFile from rmgpy.tools.plot import GenericData, GenericPlot, SimulationPlot, findNearest from rmgpy.tools.canteraModel import Cantera, generateCanteraConditions, getRMGSpeciesFromUserSpecies def curvesSimilar(t1, y1, t2, y2, tol): """ ...
mit
MKTCloud/MKTCloud
openstack_dashboard/dashboards/admin/projects/forms.py
9
1292
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
defionscode/ansible
lib/ansible/module_utils/k8s/common.py
3
8160
# Copyright 2018 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ans...
gpl-3.0
chuckfairy/three.js
utils/exporters/blender/addons/io_three/exporter/api/__init__.py
124
1502
import os import bpy from . import object as object_, mesh, material, camera, light from .. import logger def active_object(): """ :return: The actively selected object """ return bpy.context.scene.objects.active def batch_mode(): """ :return: Whether or not the session is interactive ...
mit
frishberg/django
tests/serializers/models/data.py
3
7724
""" ******** Models for test_data.py *********** The following classes are for testing basic data marshalling, including NULL values, where allowed. The basic idea is to have a model for each Django data type. """ from __future__ import unicode_literals from django.contrib.contenttypes.fields import ( GenericForei...
bsd-3-clause
2013Commons/hue
desktop/core/ext-py/tablib-develop/tablib/packages/omnijson/core.py
63
1863
# -*- coding: utf-8 -*- """ omijson.core ~~~~~~~~~~~~ This module provides the core omnijson functionality. """ import sys engine = None _engine = None options = [ ['ujson', 'loads', 'dumps', (ValueError,)], ['yajl', 'loads', 'dumps', (TypeError, ValueError)], ['jsonlib2', 'read', 'write', (ValueErro...
apache-2.0
jirikuncar/invenio-base
tests/test_flash_security.py
1
2705
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later...
gpl-2.0
stpx/canto-curses
canto_curses/story.py
1
11735
# -*- coding: utf-8 -*- #Canto-curses - ncurses RSS reader # Copyright (C) 2014 Jack Miller <jack@codezen.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. from canto_ne...
gpl-2.0
atomicobject/kinetic-c
vendor/protobuf-2.5.0/python/google/protobuf/service.py
590
9131
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
lgpl-2.1
rlmv/pyphi
pyphi/examples.py
1
29789
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # examples.py """ Example networks and subsystems to go along with the documentation. """ import numpy as np from .network import Network from .subsystem import Subsystem from .utils import all_states def basic_network(cm=False): """A simple 3-node network with ro...
gpl-3.0
turian/django-instantmessage
pinax-im-dist/apps/im/views.py
1
6985
# -*- coding: utf-8 -*- from datetime import datetime from django.http import HttpResponse, HttpResponseForbidden, HttpResponseBadRequest from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import get_o...
mit
ebal/pirsyncd
pyinotify3.py
2
84585
#!/usr/bin/env python # pyinotify.py - python interface to inotify # Copyright (c) 2005-2011 Sebastien Martini <seb@dbzteam.org> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without res...
gpl-2.0
thesagarpasrija/cosmos
code/graph-algorithms/eulerian_path/eulerian.py
4
2782
# Part of Cosmos by OpenGenus Foundation # Python program to check if a given graph is Eulerian of not using eulerian path identification #Complexity : O(V+E) from collections import defaultdict class Graph: def __init__(self,vertices): self.V= vertices #No. of vertices self.graph = defaultd...
gpl-3.0
rhyas/consul
vendor/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1232
3478
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
mpl-2.0
naslanidis/ansible
lib/ansible/modules/network/nxos/nxos_evpn_vni.py
8
16326
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
Volune/npm
node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py
1824
3474
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
artistic-2.0
postvakje/sympy
sympy/combinatorics/tests/test_subsets.py
120
1918
from sympy.combinatorics import Subset def test_subset(): a = Subset(['c', 'd'], ['a', 'b', 'c', 'd']) assert a.next_binary() == Subset(['b'], ['a', 'b', 'c', 'd']) assert a.prev_binary() == Subset(['c'], ['a', 'b', 'c', 'd']) assert a.next_lexicographic() == Subset(['d'], ['a', 'b', 'c', 'd']) as...
bsd-3-clause
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/numpy/numarray/numerictypes.py
13
15334
"""numerictypes: Define the numeric type objects This module is designed so 'from numerictypes import *' is safe. Exported symbols include: Dictionary with all registered number types (including aliases): typeDict Numeric type objects: Bool Int8 Int16 Int32 Int64 UInt8 UInt16 UInt32 UInt64 Fl...
mit
ryananguiano/requests-circuit
setup.py
1
1040
from setuptools import find_packages, setup version = __import__('requests_circuit').__version__ setup( name='requests-circuit', version=version, url='https://www.github.com/ryananguiano/requests-circuit', author='Ryan Anguiano', description=('A circuit breaker for Python requests'), license='...
mit
job/exscript
src/TkExscript/Notebook.py
6
3239
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
gpl-2.0
2ndQuadrant/ansible
lib/ansible/modules/network/onyx/onyx_magp.py
52
8310
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
lihui7115/ChromiumGStreamerBackend
build/get_landmines.py
16
3555
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This file emits the list of reasons why a particular build needs to be clobbered (or a list of 'landmines'). """ import sys impor...
bsd-3-clause
vipul-sharma20/oh-mainline
vendor/packages/Django/django/core/serializers/pyyaml.py
110
2353
""" YAML serializer. Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__. """ import decimal import yaml from io import StringIO from django.db import models from django.core.serializers.base import DeserializationError from django.core.serializers.python import Serializer as PythonSerializer fr...
agpl-3.0
sunlianqiang/kbengine
kbe/res/scripts/common/Lib/test/test_email/test_contentmanager.py
91
33538
import unittest from test.test_email import TestEmailBase, parameterize import textwrap from email import policy from email.message import EmailMessage from email.contentmanager import ContentManager, raw_data_manager @parameterize class TestContentManager(TestEmailBase): policy = policy.default message = Em...
lgpl-3.0
Jorge-Rodriguez/ansible
lib/ansible/modules/windows/win_chocolatey.py
11
11719
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2014, Trond Hindenes <trond@hindenes.com> # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the ...
gpl-3.0
superberny70/pelisalacarta
python/version-mediaserver/platformcode/controllers/proxy.py
4
2039
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta # Controlador para acceso indirecto a ficheros remotos # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ from controller import Controller fro...
gpl-3.0
crepererum/invenio
invenio/celery/__init__.py
17
5417
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
joshids/antlr4
runtime/Python3/src/antlr4/InputStream.py
17
4215
# # [The "BSD license"] # Copyright (c) 2012 Terence Parr # Copyright (c) 2012 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # ...
bsd-3-clause
JakeBrand/CMPUT410-E4
lab4/lib/python2.7/site-packages/pip-1.1-py2.7.egg/pip/basecommand.py
60
6183
"""Base Command class, and related routines""" import os import socket import sys import traceback import time from pip import commands from pip.log import logger from pip.baseparser import parser, ConfigOptionParser, UpdatingDefaultsHelpFormatter from pip.download import urlopen from pip.exceptions import (BadComman...
apache-2.0
ShineFan/odoo
addons/hr_holidays/tests/common.py
389
4347
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
openearth/PyWPS
pywps/processes/buffer.py
2
3882
""" OGR Buffer process Author: Jachym Cepicky (jachym@les-ejk.cz) """ from pywps.Process import WPSProcess from osgeo import ogr import os class Process(WPSProcess): def __init__(self): # init process WPSProcess.__init__(self, identifier = "ogrbu...
gpl-2.0
jorik041/dfvfs
dfvfs/compression/manager.py
2
2414
# -*- coding: utf-8 -*- """The compression manager.""" class CompressionManager(object): """Class that implements the compression manager.""" _decompressors = {} @classmethod def DeregisterDecompressor(cls, decompressor): """Deregisters a decompressor for a specific compression method. Args: ...
apache-2.0
tima/ansible
lib/ansible/modules/packaging/os/apt_key.py
33
12208
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2012, Jayson Vantuyl <jayson@aggressive.ly> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_...
gpl-3.0
ua-snap/downscale
snap_scripts/old_scripts/tem_iem_older_scripts_april2018/tem_inputs_v2/wrap_downscaler_cru_slurm_tem_iem.py
1
2340
# # # EXAMPLE RUN SINGLE MODEL def run_model( fn, command ): import os, subprocess head = '#!/bin/sh\n' + \ '#SBATCH --ntasks=32\n' + \ '#SBATCH --nodes=1\n' + \ '#SBATCH --ntasks-per-node=32\n' + \ '#SBATCH --account=snap\n' + \ '#SBATCH --mail-type=FAIL\n' + \ '#SBATCH --mail-user=malindgren@alask...
mit
elkingtonmcb/h2o-2
py/testdir_multi_jvm/test_parse_manyfiles_fvec.py
9
11371
import unittest, time, sys, random, logging sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm import h2o_exec as h2e, h2o_jobs DO_IMPORT_CHECK = True class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmetho...
apache-2.0
tambetm/simple_dqn
src/nvis/figure.py
2
3977
# ---------------------------------------------------------------------------- # Copyright 2015 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
mit
letouriste001/SmartForest_2.0
python3.4Smartforest/lib/python3.4/site-packages/django/contrib/gis/geos/prototypes/geom.py
1
4071
from ctypes import POINTER, c_char_p, c_int, c_size_t, c_ubyte from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero, ) # This is the return type used by bina...
mit
cluck/freeipa
ipapython/dnssec/ldapkeydb.py
1
12394
# # Copyright (C) 2014 FreeIPA Contributors see COPYING for license # from binascii import hexlify import collections import sys import time import ipalib from ipapython.dn import DN from ipapython import ipaldap from ipapython import ipautil from ipaserver.plugins.ldap2 import ldap2 from ipaplatform.paths import pa...
gpl-3.0
qtekfun/htcDesire820Kernel
external/chromium/build/compiler_version.py
97
1319
#!/usr/bin/python # Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Compiler version checking tool for gcc Print gcc version as XY if you are running gcc X.Y.*. This is used to tweak build flags for...
gpl-2.0
BD2KGenomics/toil-old
src/toil/batchSystems/mesos/badExecutor.py
1
1474
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
mit
DepthDeluxe/ansible
lib/ansible/modules/storage/infinidat/infini_host.py
69
4439
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Gregory Shulov (gregory.shulov@gmail.com) # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
krasch/smart-assistants
recsys/classifiers/bayes.py
1
6742
# -*- coding: UTF-8 -*- import pandas import numpy from base import BaseClassifier class NaiveBayesClassifier(BaseClassifier): """ Implements a standard Naive Bayes classifier. """ name = "NaiveBayes" def __init__(self, features, target_names): BaseClassifier.__init__(self, features, t...
mit
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/pyharmony/__main__.py
1
17393
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Module for querying and controlling Logitech Harmony devices.""" import argparse import json import logging from pyharmony import client as harmony_client from pyharmony import discovery as harmony_discovery import sys import time logger = logging.getLogger(__name__)...
gpl-2.0
harro/textfsm
clitable_test.py
8
11929
#!/usr/bin/python2.6 # # Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
aksnzhy/xLearn
gtest/test/gtest_xml_outfiles_test.py
2526
5340
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
apache-2.0
bdang2012/taiga-back-casting
tests/integration/test_stats.py
4
7177
import pytest from .. import factories as f from tests.utils import disconnect_signals, reconnect_signals from taiga.projects.services.stats import get_stats_for_project pytestmark = pytest.mark.django_db def setup_module(module): disconnect_signals() def teardown_module(module): reconnect_signals() @...
agpl-3.0
erjohnso/ansible
lib/ansible/plugins/inventory/yaml.py
2
6535
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' inventory: yaml version_added: "2.4" short_description: Uses a speci...
gpl-3.0
mgracer48/panda3d
direct/src/directnotify/DirectNotify.py
1
4238
""" DirectNotify module: this module contains the DirectNotify class """ import Notifier import Logger class DirectNotify: """ DirectNotify class: this class contains methods for creating mulitple notify categories via a dictionary of Notifiers. """ def __init__(self): """ DirectN...
bsd-3-clause
shs96c/buck
scripts/verify-javadoc.py
24
1264
#!/usr/bin/env python # # Examines the output from running Javadoc via Ant and checks to see if any # warnings were emitted. If so, fail the build unless the warning is in the # whitelist. When run in a CI build, Ant may not be able to reach external # URLs, so warnings about errors fetching expected URLs should be ign...
apache-2.0
ptisserand/ansible
lib/ansible/plugins/action/net_static_route.py
756
1058
# (c) 2017, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
Alpistinho/FreeCAD
src/Mod/PartDesign/Scripts/Epitrochoid.py
36
2581
#! python # -*- coding: utf-8 -*- # (c) 2011 Werner Mayer LGPL # from __future__ import division # allows floating point division from integers import FreeCAD, Part, math from FreeCAD import Base class Epitrochoid: def __init__(self, obj): ''' Add the properties: Radius1, Radius2, Distance, Segments ''' ...
lgpl-2.1
SLAC-OCIO/net-config
lib/netconfig/backup/configuration/f5_tmsh.py
3
6085
from netconfig.backup.configuration import Configuration from os import path, remove, devnull import subprocess import tempfile import logging import tarfile from copy import deepcopy from shutil import rmtree class F5Tmsh( Configuration ): """ ucs file is basically a tar.gz file in order to use them in n...
gpl-2.0
bitifirefly/edx-platform
lms/djangoapps/oauth2_handler/tests.py
76
7517
# pylint: disable=missing-docstring from django.core.cache import cache from django.test.utils import override_settings from lang_pref import LANGUAGE_KEY from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.modulestore.tests.django_utils import TEST_DATA_MIXED_TOY_MODULESTORE from student.models...
agpl-3.0