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
Venturi/oldcms
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
1004
9544
# The default socket timeout, used by httplib to indicate that no timeout was # specified by the user from socket import _GLOBAL_DEFAULT_TIMEOUT import time from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # urllib3 _Default = object() def current...
apache-2.0
rajmarndi/python-beaver
docs/conf.py
1
8186
# -*- coding: utf-8 -*- # # beaver documentation build configuration file, created by # sphinx-quickstart on Mon Oct 21 11:21:22 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
phaller0513/aima-python
envgui.py
22
11683
# ______________________________________________________________________________ # GUI - Graphical User Interface for Environments # If you do not have Tkinter installed, either get a new installation of Python # (Tkinter is standard in all new releases), or delete the rest of this file # and muddle through without a G...
mit
nathanielvarona/airflow
airflow/migrations/versions/338e90f54d61_more_logging_into_task_isntance.py
8
1453
# # 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...
apache-2.0
georgtroska/root
interpreter/llvm/src/utils/lit/lit/run.py
23
9442
import os import threading import time import traceback try: import Queue as queue except ImportError: import queue try: import win32api except ImportError: win32api = None try: import multiprocessing except ImportError: multiprocessing = None import lit.Test ### # Test Execution Implementat...
lgpl-2.1
keiserlab/e3fp
e3fp/fingerprint/array_ops.py
1
9285
"""Various array operations. Author: Seth Axen E-mail: seth.axen@gmail.com """ import numpy as np from scipy.spatial.distance import pdist, squareform QUATERNION_DTYPE = np.float64 X_AXIS, Y_AXIS, Z_AXIS = np.identity(3, dtype=np.float64) EPS = 1e-12 # epsilon, a number close to 0 # Vector Algebra Methods def as_u...
lgpl-3.0
viru/ansible-modules-core
cloud/openstack/_quantum_network.py
127
10265
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 ...
gpl-3.0
sawenzel/root
main/python/cmdLineUtils.py
4
50993
#!/usr/bin/env @python@ # ROOT command line tools module: cmdLineUtils # Author: Julien Ripoche # Mail: julien.ripoche@u-psud.fr # Date: 20/08/15 """Contain utils for ROOT command line tools""" ########## # Stream redirect functions # The original code of the these functions can be found here : # http://stackoverflo...
lgpl-2.1
Vishruit/DDP_models
tf1/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/mbcsgroupprober.py
2769
1967
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
ClimbsRocks/scikit-learn
sklearn/preprocessing/tests/test_data.py
6
62084
# Authors: # # Giorgio Patrini # # License: BSD 3 clause import warnings import numpy as np import numpy.linalg as la from scipy import sparse from distutils.version import LooseVersion from sklearn.utils import gen_batches from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing im...
bsd-3-clause
bmazin/ARCONS-pipeline
examples/Pal2012-crab/assignPNtoGRP.py
1
2372
import numpy as np import matplotlib.pyplot as plt import sys import os sys.stdout.flush() np.set_printoptions(precision=11) path = '/Scratch/dataProcessing/crabData/' path2 = '/Scratch/dataProcessing/crabData2/' pulseLabel = 1 labels='BTOA Noise_Offset Noise_RMS Max Mean Index TestMax TestMean TestIndex' labels = np....
gpl-2.0
supertuxkart/stk-stats
userreport/x86.py
2
3849
# CPUID feature bits, from LSB to MSB: # (Names and descriptions gathered from various Intel and AMD sources) def get_data(): cap_raw = ( # EAX=01H ECX: """SSE3 PCLMULQDQ DTES64: 64-bit debug store MONITOR: MONITOR/MWAIT DS-CPL: CPL qualified debug store VMX...
mit
davidharvey1986/pyRRG
unittests/bugFixPyRRG/lib/python3.7/site-packages/setuptools/depends.py
23
5517
import sys import marshal import contextlib from distutils.version import StrictVersion from .py33compat import Bytecode from .py27compat import find_module, PY_COMPILED, PY_FROZEN, PY_SOURCE from . import py27compat __all__ = [ 'Require', 'find_module', 'get_module_constant', 'extract_constant' ] class Requi...
mit
DominoTree/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/recwarn.py
32
8634
""" recording warnings during test function execution. """ from __future__ import absolute_import, division, print_function import inspect import _pytest._code import py import sys import warnings import re from _pytest.fixtures import yield_fixture from _pytest.outcomes import fail @yield_fixture def recwarn(): ...
mpl-2.0
crazy-canux/linux
Documentation/target/tcm_mod_builder.py
337
24391
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
mlaitinen/odoo
addons/account/wizard/account_invoice_refund.py
214
13008
# -*- 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
styx0x6/gremlins
lib/thirdparty/colorama/ansitowin32.py
450
9668
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. import re import sys import os from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style from .winterm import WinTerm, WinColor, WinStyle from .win32 import windll, winapi_test winterm = None if windll is not None: winterm = WinTerm() def ...
agpl-3.0
carlcarl/grabflickr
grabflickr/grabflickr.py
1
10748
#!/usr/bin/env python # -*- coding: utf-8 -*- try: import gevent import grequests except ImportError: pass else: from gevent import monkey import sys import os import hashlib import json import logging import argparse import multiprocessing from ConfigParser import SafeConfigParser import requests lo...
mit
selecsosi/django-cms
cms/management/commands/subcommands/delete_orphaned_plugins.py
18
2261
from django.core.management.base import NoArgsCommand from django.utils.six.moves import input from cms.management.commands.subcommands.list import plugin_report class DeleteOrphanedPluginsCommand(NoArgsCommand): help = "Delete plugins from the CMSPlugins table that should have instances but don't, and ones for ...
bsd-3-clause
siavooshpayandehazad/SoCDep2
src/main/python/Clusterer/Clustering_Functions.py
2
12178
# Copyright (C) 2015 Siavoosh Payandeh Azad import statistics from Clusterer import Clustering_Reports from ConfigAndPackages import Config import random def remove_task_from_ctg(tg, ctg, task): """ Removes a Task from TG from Clustred Task graph :param tg: Task graph :param ctg: Clustered Task Gra...
gpl-2.0
vwvww/servo
components/script/dom/bindings/codegen/parser/tests/test_identifier_conflict.py
53
1193
# Import the WebIDL module, so we can do isinstance checks and whatnot import WebIDL def WebIDLTest(parser, harness): try: parser.parse(""" enum Foo { "a" }; interface Foo; """) results = parser.finish() harness.ok(False, "Should fail to parse") except Ex...
mpl-2.0
EvenStrangest/tensorflow
tensorflow/contrib/lookup/lookup_ops_test.py
3
11467
# 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
xmission/d-note
venv/lib/python2.7/site.py
784
27543
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
agpl-3.0
grahamawelch/wordclock
svg/makediffuser.py
1
1482
from xml.etree.ElementTree import QName, ElementTree, Element, SubElement, register_namespace from sys import stdout, stderr # (Amt, Size) RECTS = [ (1, 2.6), # 1 (6, 2.25), # 1 (5, 4.6), # 2 (5, 7), # 3 (7, 9.25), # 4 (3, 12), # 5 (3, 14.5), # 6 (1, 17.25), # 7 ] class SVG(object): def __getattr__...
mit
krez13/scikit-learn
sklearn/decomposition/__init__.py
76
1490
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF, non_negative_factorization from .pca import PCA, Ra...
bsd-3-clause
steincastillo/img_utils
auto_canny.py
1
1359
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Fri Oct 28 17:43:30 2016 @author: Stein """ #import libraries import numpy as np import argparse import glob import cv2 def auto_canny(image, sigma=0.33): #compute the median of a single channel pixel intensity v = np.median(image) #apply ...
gpl-3.0
abridgett/boto
boto/cloudfront/signers.py
170
2074
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.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 restriction, including # without limitation the rights to use, copy, modi...
mit
ecreall/nova-ideo
novaideo/views/challenge_management/create_challenge.py
1
1710
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi from pyramid.view import view_config from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS from pontus.default_behavior import Cancel from pontus.form imp...
agpl-3.0
cliffano/swaggy-jenkins
clients/python-flask/generated/openapi_server/models/input_step_impllinks.py
1
2330
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from openapi_server.models.base_model_ import Model from openapi_server.models.link import Link # noqa: F401,E501 from openapi_server import util class InputStepImpl...
mit
trabacus-softapps/openerp-8.0-cc
openerp/addons/marketing/__openerp__.py
55
1677
# -*- 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
codedecde/ImageQA
Src/TheanoModel/Code/san_att_conv_twolayer_theano.py
1
16341
#!/usr/bin/env python import pdb import theano import theano.tensor as T from theano.tensor.nnet import conv from theano.tensor.signal import downsample import numpy import numpy as np from collections import OrderedDict import cPickle as pickle from theano import config from theano.sandbox.rng_mrg import MRG_Random...
mit
pla93/django-mantis
mantis/menus.py
2
2181
from menu import Menu, MenuItem from django.core.urlresolvers import reverse Menu.add_item( "mantis_main", MenuItem("List, Filter & Search", "", weight = 50, children = ( MenuItem("Info Object List (generic filter)", reverse("ur...
gpl-2.0
kurtrwall/wagtail
wagtail/wagtailembeds/rich_text.py
9
1316
from __future__ import absolute_import, unicode_literals from wagtail.wagtailembeds import format from wagtail.wagtailembeds.exceptions import EmbedException class MediaEmbedHandler(object): """ MediaEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-e...
bsd-3-clause
petewarden/tensorflow
tensorflow/python/kernel_tests/constant_op_test.py
9
38520
# 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
jymannob/CouchPotatoServer
couchpotato/core/media/__init__.py
9
3065
import os import traceback from couchpotato import CPLog from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.plugins.base import Plugin import six log = CPLog(__name__) class MediaBase(Plugin): _type = None d...
gpl-3.0
y12uc231/edx-platform
common/djangoapps/reverification/tests/test_models.py
17
2964
""" Tests for Reverification models """ from datetime import timedelta, datetime import pytz from django.core.exceptions import ValidationError from reverification.models import MidcourseReverificationWindow from reverification.tests.factories import MidcourseReverificationWindowFactory from xmodule.modulestore.tests...
agpl-3.0
mcgachey/edx-platform
lms/djangoapps/commerce/views.py
7
3654
""" Commerce views. """ import logging from django.conf import settings from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from edxmako.shortcuts import render_to_response from microsite_configuration import microsite from verify_student.models import Softwa...
agpl-3.0
DasIch/subrosa
docs/conf.py
1
10164
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Subrosa documentation build configuration file, created by # sphinx-quickstart on Tue Jul 19 10:00:23 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # au...
bsd-3-clause
yktoo/indicator-sound-switcher
lib/indicator_sound_switcher/stream.py
1
1764
from gi.repository import GObject class Stream(GObject.GObject): """Base class for sink and source. Call it Stream to be consistent with Gnome Sound Panel.""" def get_is_active(self): """is_active: defines whether the associated sink/source is the active (default) one.""" return self._is_acti...
gpl-3.0
jeremiahyan/lammps
tools/moltemplate/src/nbody_Dihedrals.py
19
2460
from nbody_graph_search import Ugraph # This file defines how dihedral interactions are generated by moltemplate.sh # by default. It can be overridden by supplying your own custom file. # To find 4-body "dihedral" interactions, we would use this subgraph: # # 1st bond connects atoms 0...
gpl-2.0
eggertec/lextend
configuration/config_manager.py
1
8184
# Lextend # Copyright (c) 2014-2015 Egger Enertech <http://www.egger-enertech.ch> # Released under the GNU Public License 3 (or higher, your choice) # See the file COPYING for details. import os from xmlsettings import XMLSettings from lxml import etree import pyinotify import logging import time class dummy: pass...
gpl-3.0
pfctdayelise/allseasons
tests/test_location.py
1
2668
import pytest from libs import location places = {'london': (51.507351, -0.127758), 'murmansk': (68.958524, 33.08266), 'buenos aires': (-34.603684, -58.381559), 'melbourne': (-37.813628, 144.963058), 'pontianak': (0.0, -109.20), 'mumbai': (19.0760, 72.8777), ...
bsd-3-clause
kenwang815/KodiPlugins
script.module.youtube.dl/lib/youtube_dl/extractor/clyp.py
89
1742
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( float_or_none, parse_iso8601, ) class ClypIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?clyp\.it/(?P<id>[a-z0-9]+)' _TEST = { 'url': 'https://clyp.it/ojz2wfah', 'md5': '1d4961036c412...
gpl-2.0
yashLadha/coala
coalib/parsing/LineParser.py
28
9973
import logging import re from coala_utils.string_processing.StringConverter import StringConverter from coala_utils.string_processing import (unescape, convert_to_raw, position_is_escaped, unescaped_rstrip) class LineParser: d...
agpl-3.0
girving/tensorflow
tensorflow/python/ops/batch_norm_benchmark.py
38
10762
# 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
iModels/mbuild
mbuild/tests/test_packing.py
2
13909
import os import numpy as np import pytest import mbuild as mb from mbuild import Box from mbuild.exceptions import MBuildError from mbuild.tests.base_test import BaseTest class TestPacking(BaseTest): def test_fill_box(self, h2o): filled = mb.fill_box(h2o, n_compounds=50, box=Box([2, 2, 2])) ass...
mit
vrv/tensorflow
tensorflow/contrib/ffmpeg/__init__.py
82
1251
# 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
vishwaprakashmishra/xmatrix
vumi/dispatchers/tests/utils.py
3
2173
from twisted.internet.defer import inlineCallbacks from vumi.tests.utils import VumiWorkerTestCase, PersistenceMixin # For backcompat from .helpers import DummyDispatcher DummyDispatcher # To keep pyflakes happy. class DispatcherTestCase(VumiWorkerTestCase, PersistenceMixin): """ This is a base class for ...
bsd-3-clause
retomerz/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/tests/__init__.py
231
1092
from django.contrib.auth.tests.auth_backends import (BackendTest, RowlevelBackendTest, AnonymousUserBackendTest, NoAnonymousUserBackendTest, NoBackendsTest, InActiveUserBackendTest, NoInActiveUserBackendTest) from django.contrib.auth.tests.basic import BasicTestCase from django.contrib.auth.tests.decorators imp...
apache-2.0
aleh-arol/tcollector
collectors/0/haproxy.py
7
3715
#!/usr/bin/env python # This file is part of tcollector. # Copyright (C) 2013 The tcollector Authors. # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or...
lgpl-3.0
jgeskens/django
django/conf/locale/fr/formats.py
118
1448
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATE...
bsd-3-clause
cjastram/silverbot
archives/lib/trader.py
1
8331
import sys from ib.ext.Contract import Contract from ib.ext.EWrapper import EWrapper from ib.ext.EClientSocket import EClientSocket from ib.ext.ExecutionFilter import ExecutionFilter def showmessage(message, mapping): try: del(mapping['self']) except (KeyError, ): pass items = mapping.ite...
agpl-3.0
seocam/django
django/contrib/postgres/forms/ranges.py
59
2762
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange from django import forms from django.core import exceptions from django.forms.widgets import MultiWidget from django.utils.translation import ugettext_lazy as _ __all__ = ['IntegerRangeField', 'FloatRangeField', 'DateTimeRangeField', 'DateRangeField...
bsd-3-clause
Nivl/django-pipeline
tests/tests/compiler.py
4
1182
from django.test import TestCase from pipeline.conf import settings from pipeline.compilers import Compiler, CompilerBase class DummyCompiler(CompilerBase): output_extension = 'js' def match_file(self, path): return path.endswith('.coffee') def compile_file(self, infile, outfile, outdated=False...
mit
40223149/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/highlight.py
617
2518
import keyword import _jsre as re from browser import html letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'_' digits = '0123456789' builtin_funcs = ("abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" + "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +...
gpl-3.0
jordanemedlock/psychtruths
temboo/core/Library/Facebook/Actions/Video/WantsToWatch/ReadWantsToWatch.py
5
5401
# -*- coding: utf-8 -*- ############################################################################### # # ReadWantsToWatch # Retrieves one or more video wants_to_watch actions. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ...
apache-2.0
resmo/ansible
lib/ansible/modules/network/junos/junos_logging.py
52
8820
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # 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', ...
gpl-3.0
EraYaN/CouchPotatoServer
libs/requests/api.py
206
4935
# -*- coding: utf-8 -*- """ requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def request(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. Retur...
gpl-3.0
HenriHeinonen/barcoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
blablack/ams-lv2
waflib/Node.py
18
25509
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2018 (ita) """ Node: filesystem structure #. Each file/folder is represented by exactly one node. #. Some potential class properties are stored on :py:class:`waflib.Build.BuildContext` : nodes to depend on, etc. Unused class members can increase the `.wa...
gpl-2.0
loop1024/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/json/tests/test_decode.py
35
2127
import decimal from StringIO import StringIO from collections import OrderedDict from json.tests import PyTest, CTest class TestDecode(object): def test_decimal(self): rval = self.loads('1.1', parse_float=decimal.Decimal) self.assertTrue(isinstance(rval, decimal.Decimal)) self.assertEqual(...
mit
kobejean/tensorflow
tensorflow/python/kernel_tests/matrix_band_part_op_test.py
27
5786
# 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
catapult-project/catapult-csm
third_party/apiclient/googleapiclient/discovery.py
25
38539
# Copyright 2014 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 ...
bsd-3-clause
j3parker/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mpl-2.0
40223134/w16b_test
static/Brython3.1.3-20150514-095342/Lib/xml/dom/__init__.py
873
4019
"""W3C Document Object Model implementation for Python. The Python mapping of the Document Object Model is documented in the Python Library Reference in the section on the xml.dom package. This package contains the following modules: minidom -- A simple implementation of the Level 1 DOM with namespace sup...
agpl-3.0
bmillham/DJDB
djdb.py
1
1111
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- from gi.repository import Gtk from os.path import dirname, realpath, join, expanduser import cPickle from gladeobjects import get_glade_objects, field_names from LibScan import LibScan # Hack to fix unicode issues in Python 2.7 import sys reload(sys) sys.setdefaultencoding...
gpl-2.0
mozilla/kitsune
kitsune/questions/tests/test_models.py
1
22191
# -*- coding: utf-8 -*- from datetime import datetime, timedelta from unittest import mock from actstream.models import Action, Follow from django.core.management import call_command from django.db.models import Q from nose.tools import eq_, ok_, raises from taggit.models import Tag import kitsune.sumo.models from ki...
bsd-3-clause
BaconPancakes/valor
lib/cffi/vengine_cpy.py
19
41325
# # DEPRECATED: implementation for ffi.verify() # import sys, imp from . import model from .error import VerificationError class VCPythonEngine(object): _class_key = 'x' _gen_python_module = True def __init__(self, verifier): self.verifier = verifier self.ffi = verifier.ffi self._...
gpl-3.0
ulrichard/electrum
gui/kivy/uix/dialogs/choice_dialog.py
2
1927
from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.uix.checkbox import CheckBox from kivy.uix.label import Label from kivy.uix.widget import Widget Builder.load_string(''' <ChoiceDialog@Popup> id: popup title: '' size...
gpl-3.0
w1kke/pylearn2
pylearn2/scripts/tutorials/tests/test_dbm.py
49
1067
""" This module tests dbm_demo/rbm.yaml """ import os from pylearn2.testing import skip from pylearn2.testing import no_debug_mode from pylearn2.config import yaml_parse @no_debug_mode def train_yaml(yaml_file): train = yaml_parse.load(yaml_file) train.main_loop() def train(yaml_file_path, save_path): ...
bsd-3-clause
tianyu0915/pythoner.net
pythoner/home/views.py
3
3552
#encoding:utf-8 """ pythoner.net Copyright (C) 2013 PYTHONER.ORG 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 3 of the License, or (at your option) any later version. Th...
gpl-3.0
dd00/commandergenius
project/jni/python/src/Tools/pybench/Imports.py
45
2947
from pybench import Test # First imports: import os import package.submodule class SecondImport(Test): version = 2.0 operations = 5 * 5 rounds = 40000 def test(self): for i in xrange(self.rounds): import os import os import os import os ...
lgpl-2.1
cmelange/ansible
lib/ansible/modules/database/vertica/vertica_role.py
37
8561
#!/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
hradec/gaffer
python/GafferAppleseedUI/AppleseedShaderBallUI.py
11
2742
########################################################################## # # Copyright (c) 2016, Image Engine Design 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: # # * Redistrib...
bsd-3-clause
JamesMura/sentry
src/sentry/south_migrations/0001_initial.py
36
11182
# encoding: 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 'GroupedMessage' db.create_table('sentry_groupedmessage', ( ('id', self.gf('sentry.db.m...
bsd-3-clause
dnlm92/chokoretto
temp/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
mit
openstack/networking-sfc
networking_sfc/tests/functional/services/sfc/agent/extensions/test_ovs_agent_sfc_extension.py
1
1138
# Copyright (c) 2016 Red Hat, 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
S2R2/viper
viper/modules/pymacho/MachOSourceVersionCommand.py
6
1633
# encoding: utf-8 """ Copyright 2013 Jérémie BOUTOILLE 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 3 of the License, or (at your option) any later version. This program is distri...
bsd-3-clause
IDEO-coLAB/vehicle-rec-microservice
ConnecttoBLE/ScanDevices.py
1
1362
# File : ScanDevices.py # Program uses the BLE microservice to scan the BLE devices and returns the Mac Address of the specified BLE Device # Author: Sooraj Bopanna #!usr/bin/env python #!/bin/bash import os import json import urllib2 import socket import ReadOBDSensorName def setup(): global BLEDeviceName,Devic...
mit
evanma92/routeh
flask/lib/python2.7/site-packages/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
bsd-3-clause
pombredanne/pyelftools
test/test_utils.py
2
2438
#------------------------------------------------------------------------------- # elftools tests # # Eli Bendersky (eliben@gmail.com) # This code is in the public domain #------------------------------------------------------------------------------- import unittest from random import randint from elftools.common.py3...
unlicense
rackerlabs/melange
melange/tests/__init__.py
1
3875
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
libclipunl/clipfiles
login.py
1
1960
# coding=utf-8 import Tkinter as tk import ttk import tkSimpleDialog # FIXME: Give alternate icon class LoginForm(tkSimpleDialog.Dialog): def __init__(self, parent, creds, status): self._creds = creds self._status = status tkSimpleDialog.Dialog.__init__(self, parent) def body(self, mas...
mit
savoirfairelinux/django
django/contrib/sites/models.py
9
3732
import string from contextlib import suppress from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_delete, pre_save from django.http.request import split_domain_port from django.utils.translation import gettext_lazy as _ SITE_CA...
bsd-3-clause
tedelhourani/ansible
lib/ansible/module_utils/facts/timeout.py
135
2215
# 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 distributed in the hope that ...
gpl-3.0
sinotradition/meridian
meridian/channels/gallbladder.py
1
2065
#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' from meridian.acupoints import tongziliao232 from meridian.acupoints import tinghui14 from meridian.acupoints import shangguan41 from meridian.acupoints import heyan24 from meridian.acupoints import xuanlu22 from meridian.acupoints import xuanli22 fr...
apache-2.0
mastizada/kuma
vendor/packages/ipython/IPython/kernel/tests/test_engineservice.py
7
2586
# encoding: utf-8 """This file contains unittests for the kernel.engineservice.py module. Things that should be tested: - Should the EngineService return Deferred objects? - Run the same tests that are run in shell.py. - Make sure that the Interface is really implemented. - The startService and stopService metho...
mpl-2.0
kisna72/django
tests/select_for_update/tests.py
203
9626
from __future__ import unicode_literals import threading import time from multiple_database.routers import TestRouter from django.conf import settings from django.db import connection, router, transaction from django.db.utils import DEFAULT_DB_ALIAS, ConnectionHandler, DatabaseError from django.test import ( Tra...
bsd-3-clause
imtapps/python-suds-0.4.IMT
suds/sax/parser.py
180
4461
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/PIL/ImageQt.py
26
4678
# # The Python Imaging Library. # $Id$ # # a simple Qt image interface. # # history: # 2006-06-03 fl: created # 2006-06-04 fl: inherit from QImage instead of wrapping it # 2006-06-05 fl: removed toimage helper; move string support to ImageQt # 2013-11-13 fl: add support for Qt5 (aurelien.ballier@cyclonit.com) # # Copyr...
mit
pombredanne/http-repo.gem5.org-gem5-
src/mem/slicc/util.py
83
3124
# Copyright (c) 2009 The Hewlett-Packard Development Company # 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...
bsd-3-clause
SeerLabs/new-csx-extractor
run_extraction.py
2
1500
from extraction.core import ExtractionRunner from extraction.runnables import Extractor, RunnableError, Filter, ExtractorResult import os import sys import csxextract.extractors.grobid as grobid import csxextract.extractors.pdfbox as pdfbox import csxextract.extractors.tei as tei import csxextract.extractors.parscit as...
apache-2.0
jannson/Similar
gistfile2.py
1
3594
import sys, os, os.path import logging import pprint import gensim from gensim import models, corpora, similarities from collections import defaultdict import json from scipy.cluster.hierarchy import dendrogram, linkage, fcluster, ward from sklearn.cluster.affinity_propagation_ import affinity_propagation from sklearn....
mit
mancoast/CPythonPyc_test
fail/342_test_platform.py
88
12413
from unittest import mock import os import platform import subprocess import sys import tempfile import unittest import warnings from test import support class PlatformTest(unittest.TestCase): def test_architecture(self): res = platform.architecture() @support.skip_unless_symlink def test_archite...
gpl-3.0
sysadmin75/ansible
lib/ansible/plugins/lookup/template.py
27
4601
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2012-17, 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 = """ lookup...
gpl-3.0
olgabrani/synnefo
snf-cyclades-app/synnefo/db/migrations/0085_nic_build_state.py
10
18323
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo...
gpl-3.0
giovaroma/bootstrap4
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
mit
MaxKellermann/xbmc
tools/EventClients/Clients/PS3BDRemote/ps3_remote.py
38
7006
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2013 Team XBMC # # 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 # (at your option) ...
gpl-2.0
twidi/satchmo
satchmo/apps/product/modules/downloadable/migrations/0001_split.py
5
19016
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): depends_on = ( ('product', '0010_add_discountable_categories'), ) needed_by = ( ('product', '0011_split_products'), ) def forwards(self, orm): db.rename_table(...
bsd-3-clause
sigma-random/asuswrt-merlin
release/src/router/samba36/lib/testtools/testtools/tests/test_helpers.py
20
3580
# Copyright (c) 2010 Jonathan M. Lange. See LICENSE for details. from testtools import TestCase from testtools.helpers import ( try_import, try_imports, ) from testtools.matchers import ( Equals, Is, ) class TestTryImport(TestCase): def test_doesnt_exist(self): # try_import('thin...
gpl-2.0