repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
MFoster/breeze
django/db/models/options.py
99
23148
from __future__ import unicode_literals import re from bisect import bisect from django.conf import settings from django.db.models.related import RelatedObject from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy ...
bsd-3-clause
rcocetta/kano-profile
kano_profile/apps.py
1
3777
#!/usr/bin/env python # apps.py # # Copyright (C) 2014, 2015 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 # import os from kano.utils import read_json, write_json, get_date_now, ensure_dir, \ chown_path, run_print_output_error from kano.logging import logge...
gpl-2.0
ThirdProject/android_external_chromium_org
tools/perf/measurements/endure.py
23
6579
# 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. import optparse import re import time from metrics import v8_object_stats from telemetry.page import page_measurement _V8_BYTES_COMMITTED = [ 'V8.MemoryN...
bsd-3-clause
wolfram74/numerical_methods_iserles_notes
venv/lib/python2.7/site-packages/sympy/combinatorics/group_constructs.py
25
2032
from __future__ import print_function, division from sympy.combinatorics.perm_groups import PermutationGroup from sympy.combinatorics.permutations import Permutation from sympy.utilities.iterables import uniq from sympy.core.compatibility import xrange _af_new = Permutation._af_new def DirectProduct(*groups): "...
mit
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/ctypes/test/test_init.py
113
1045
from ctypes import * import unittest class X(Structure): _fields_ = [("a", c_int), ("b", c_int)] new_was_called = False def __new__(cls): result = super(X, cls).__new__(cls) result.new_was_called = True return result def __init__(self): self.a = 9 ...
gpl-2.0
nicky-ji/edx-nicky
lms/djangoapps/bulk_email/migrations/0004_migrate_optout_user.py
182
6009
# -*- coding: utf-8 -*- from south.db import db from south.v2 import DataMigration from django.core.exceptions import ObjectDoesNotExist class Migration(DataMigration): def forwards(self, orm): # forwards data migration to copy over existing emails to associated ids if not db.dry_run: ...
agpl-3.0
ConPaaS-team/conpaas
conpaas-services/contrib/memcache.py
3
45957
#!/usr/bin/env python """ client module for memcached (memory cache daemon) Overview ======== See U{the MemCached homepage<http://www.danga.com/memcached>} for more about memcached. Usage summary ============= This should give you a feel for how this module operates:: import memcache mc = memcache.Client(...
bsd-3-clause
BT-ojossen/l10n-switzerland
l10n_ch_base_bank/tests/test_bank.py
2
5651
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
sbkro/alc
src/tests/unit/test_formatter.py
1
2802
# -*- coding:utf-8 -*- import calendar from mock import patch from datetime import datetime from alc.formatter import CalendarFormatter class TestDatetime: ''' Unit test for *CalendarFormatter.datetime()*. ''' def test_default(self): ''' :type: normal :case: *datetime_format...
bsd-3-clause
mF2C/COMPSs
tests/sources/python/1_decorator_mpi/src/modules/testMpiDecorator.py
1
4569
#!/usr/bin/python # -*- coding: utf-8 -*- """ PyCOMPSs Testbench Tasks ======================== """ # Imports import unittest import os from pycompss.api.task import task from pycompss.api.parameter import * from pycompss.api.api import compss_barrier, compss_open, compss_wait_on from pycompss.api.mpi import mpi fr...
apache-2.0
s34rching/python_classes
tests/test_contact_data.py
1
2053
import re import random def test_contact_data_from_home_page(app): r_index = random.randrange(len(app.contact.get_contact_list())) data_from_home_page = app.contact.get_contact_list()[r_index] data_from_edit_page = app.contact.get_contact_info_from_edit_page(r_index) assert data_from_home_page.firstna...
apache-2.0
AdmiralNemo/ansible-modules-extras
monitoring/logentries.py
22
4548
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Ivan Vanderbyl <ivan@app.io> # # 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 la...
gpl-3.0
ywcui1990/nupic
examples/opf/clients/hotgym/prediction/one_gym/nupic_output.py
17
6193
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
deeplook/bokeh
bokeh/charts/builder/timeseries_builder.py
26
6252
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the TimeSeries class which lets you build your TimeSeries charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------...
bsd-3-clause
IITBinterns13/edx-platform-dev
common/djangoapps/student/management/commands/pearson_import_conf_zip.py
10
5989
import csv from zipfile import ZipFile, is_zipfile from time import strptime, strftime from datetime import datetime from dogapi import dog_http_api from django.core.management.base import BaseCommand, CommandError from django.conf import settings from student.models import TestCenterUser, TestCenterRegistration fr...
agpl-3.0
msebire/intellij-community
python/lib/Lib/encodings/koi8_r.py
593
14035
""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
apache-2.0
Zkin/pf-kernel-updates
scripts/gdb/linux/cpus.py
997
3560
# # gdb helper commands and functions for Linux kernel debugging # # per-cpu tools # # Copyright (c) Siemens AG, 2011-2013 # # Authors: # Jan Kiszka <jan.kiszka@siemens.com> # # This work is licensed under the terms of the GNU GPL version 2. # import gdb from linux import tasks, utils MAX_CPUS = 4096 def get_cu...
gpl-2.0
eahneahn/free
lib/python2.7/site-packages/django/db/backends/dummy/base.py
114
2198
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
agpl-3.0
lmazuel/azure-sdk-for-python
azure-mgmt-cognitiveservices/setup.py
2
2834
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
mit
destijl/grr
grr/lib/authorization/groups.py
2
1243
#!/usr/bin/env python """Group authorization checking.""" import logging from grr.lib import config_lib from grr.lib import registry class GroupAccessManager(object): __metaclass__ = registry.MetaclassRegistry __abstract = True # pylint: disable=g-bad-name def AuthorizeGroup(self, group, subject): ra...
apache-2.0
LTLMoP/LTLMoP
src/lib/simulator/ode/ckbot/CKBotLib.py
8
4522
# CKBotLib.py # Takes word specifications and choose a gait # Run from ~/Desktop/ltlmop-google OR ~/Downloads/ltlmop-asl # python robots/CKBot/CKBotLib.py import sys, os class CKBotLib: def __init__(self): # Make a list of words that describe gaits #self.words = ["tall","low","fast","action gait","1D motion",...
gpl-3.0
t0mk/ansible
lib/ansible/utils/module_docs_fragments/avi.py
48
1616
# # Created on December 12, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Avi Version: 16.3.4 # # # 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...
gpl-3.0
ar7z1/ansible
lib/ansible/modules/network/panos/panos_dag_tags.py
10
7296
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
Timmenem/micropython
tests/misc/features.py
87
1952
# mad.py # Alf Clement 27-Mar-2014 # zero=0 three=3 print("1") print("2") print(three) print("{}".format(4)) five=25//5 print(int(five)) j=0 for i in range(4): j += i print(j) print(3+4) try: a=4//zero except: print(8) print("xxxxxxxxx".count("x")) def ten(): return 10 print(ten()) a=[] for i in range(13): a.appen...
mit
jonyroda97/redbot-amigosprovaveis
lib/matplotlib/backends/backend_nbagg.py
2
9384
"""Interactive figures in the IPython notebook""" # Note: There is a notebook in # lib/matplotlib/backends/web_backend/nbagg_uat.ipynb to help verify # that changes made maintain expected behaviour. import datetime from base64 import b64encode import json import io import os import six from uuid import uuid4 as uuid ...
gpl-3.0
kustodian/ansible
test/sanity/code-smell/release-names.py
63
1695
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) 2019, Ansible Project # # 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 ...
gpl-3.0
cogmission/nupic
examples/opf/experiments/spatial_classification/auto_generated/searchDef.py
34
2300
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
agpl-3.0
vdmann/cse-360-image-hosting-website
lib/python2.7/site-packages/django/shortcuts/__init__.py
116
5748
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.template import loader, RequestContext from django.http import HttpResponse, Http404 from django.http i...
mit
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/OpenGL/GL/NV/texture_shader.py
3
8361
'''OpenGL extension NV.texture_shader This module customises the behaviour of the OpenGL.raw.GL.NV.texture_shader to provide a more Python-friendly API Overview (from the spec) Standard OpenGL and the ARB_multitexture extension define a straightforward direct mechanism for mapping sets of texture coordinates t...
mit
frewsxcv/AutobahnPython
examples/asyncio/websocket/echo/client_coroutines_py2.py
5
2143
############################################################################### ## ## Copyright (C) 2013-2014 Tavendo GmbH ## ## 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 ## ## h...
apache-2.0
andymckay/django
tests/regressiontests/localflavor/cn/tests.py
33
4892
# Tests for contrib/localflavor/ CN Form Fields from django.contrib.localflavor.cn.forms import (CNProvinceSelect, CNPostCodeField, CNIDCardField, CNPhoneNumberField, CNCellNumberField) from django.test import SimpleTestCase class CNLocalFlavorTests(SimpleTestCase): def test_CNProvinceSelect(self): ...
bsd-3-clause
kyoungrok0517/linguist
samples/Python/tornado-httpserver.py
92
18852
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
mit
phbradley/tcr-dist
tcrdist/parse_cdr3.py
1
4891
import logging logger = logging.getLogger('parse_cdr3.py') from .all_genes import all_genes, gap_character def get_cdr3_and_j_match_counts( organism, ab, qseq, j_gene, min_min_j_matchlen = 3, extended_cdr3 = False ): #fasta = all_fasta[organism] jg = all_genes[organism][j_gene...
mit
3quarterstack/simple_blog
django/db/models/fields/files.py
111
15938
import datetime import os from django import forms from django.db.models.fields import Field from django.core.files.base import File from django.core.files.storage import default_storage from django.core.files.images import ImageFile from django.db.models import signals from django.utils.encoding import force_str, for...
mit
michael-dev2rights/ansible
lib/ansible/modules/cloud/amazon/s3_website.py
26
10810
#!/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
QISKit/qiskit-sdk-py
test/python/test_qasm_parser.py
1
2809
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
zxwing/ansible
lib/ansible/runner/lookup_plugins/redis_kv.py
176
2469
# (c) 2012, Jan-Piet Mens <jpmens(at)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 the License, or # (at your option) any later ver...
gpl-3.0
subutai/pycept
tests/unit/client_test.py
3
3542
import pycept import unittest from mock import patch, MagicMock import httpretty class ClientTestCase(unittest.TestCase): @httpretty.activate @patch('os.path.exists', return_value=False) @patch('os.makedirs') @patch('json.dump') def testTokenizeEmptyString(self, mockExists, mockMakedirs, mockDump): c...
mit
nitinitprof/odoo
addons/analytic/__init__.py
424
1072
# -*- 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...
agpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/python-dateutil-2.4.2/dateutil/relativedelta.py
104
18172
# -*- coding: utf-8 -*- import datetime import calendar from six import integer_types __all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"] class weekday(object): __slots__ = ["weekday", "n"] def __init__(self, weekday, n=None): self.weekday = weekday self.n = n def __c...
mit
Leoniela/nipype
nipype/interfaces/mipav/tests/test_auto_JistIntensityMp2rageMasking.py
9
1896
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.mipav.developer import JistIntensityMp2rageMasking def test_JistIntensityMp2rageMasking_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ...
bsd-3-clause
pblasquez/librenms
lib/influxdb-php/vendor/guzzlehttp/guzzle/docs/conf.py
46
2006
import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_d...
gpl-3.0
pyspeckit/pyspeckit
pyspeckit/spectrum/readers/alfalfa.py
8
2369
""" ALFAFA "source" .sav file """ from __future__ import print_function import idlsave try: import astropy.io.fits as pyfits except ImportError: import pyfits import pyspeckit import numpy as np def read_alfalfa_file(filename): """ Read the contents of a whole ALFALFA source file """ savfile = ...
mit
laszlocsomor/tensorflow
tensorflow/contrib/data/python/kernel_tests/concatenate_dataset_op_test.py
12
11402
# Copyright 2017 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
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_07_01/aio/operations/_public_ip_prefixes_operations.py
1
27147
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
DevangS/CoralNet
accounts/migrations/0004_create_user_called_alleviate.py
1
5492
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.conf import settings class Migration(DataMigration): # Create a dummy user called "Alleviate". # This is the user under which Alleviate-accepted annotations # will be...
bsd-2-clause
tuanvu216/udacity-course
intro_to_machine_learning/lesson/lesson_14_evaluation_metrics/evaluate_poi_identifier.py
1
2588
#!/usr/bin/python """ starter code for the evaluation mini-project start by copying your trained/tested POI identifier from that you built in the validation mini-project the second step toward building your POI identifier! start by loading/formatting the data """ import pickle import sys sys.p...
mit
jlachowski/clonedigger
clonedigger/clone_detection_algorithm.py
2
16192
from __future__ import print_function from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import range from builtins import * from past.utils import old_div # Copyright 2008...
gpl-3.0
ahaym/eden
modules/unit_tests/s3/benchmark.py
26
11407
# -*- coding: utf-8 -*- # # Core Benchmarks # # To run this script use: # python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3/benchmark.py # # Note: # # These tests represent the performance of specific server-side core # functions of Sahana Eden which are typically called millions of times # during ...
mit
jeanlinux/calibre
src/calibre/gui2/viewer/config.py
8
20731
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pygments-2.0.2/pygments/formatters/latex.py
72
17615
# -*- coding: utf-8 -*- """ pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division from pygments.formatter import Forma...
mit
kemalakyol48/python-for-android
python3-alpha/python3-src/Lib/unittest/test/test_discovery.py
785
13838
import os import re import sys import unittest class TestableTestProgram(unittest.TestProgram): module = '__main__' exit = True defaultTest = failfast = catchbreak = buffer = None verbosity = 1 progName = '' testRunner = testLoader = None def __init__(self): pass class TestDisc...
apache-2.0
chengjf/database-interface-doc-management
flask-demo/flask/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.py
478
16459
try: import http.client as httplib except ImportError: import httplib import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ) from .packages.six import string_type...
apache-2.0
adazey/Muzez
libs/youtube_dl/extractor/msn.py
17
4643
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( determine_ext, ExtractorError, int_or_none, unescapeHTML, ) class MSNIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?msn\.com/(?:[^/]+/)+...
gpl-3.0
yhoshino11/GuestBook
.venv/lib/python2.7/site-packages/pip/baseparser.py
149
9643
"""Base option parser setup""" from __future__ import absolute_import import sys import optparse import os import re import textwrap from distutils.util import strtobool from pip._vendor.six import string_types from pip._vendor.six.moves import configparser from pip.locations import ( legacy_config_file, config_b...
mit
werbk/task-7.22
tests_group/group_lib.py
3
3954
from tests_group.group_helper import Group def clean(group): return Group(id=group.id, group_name=group.group_name.strip()) class GroupBase: def __init__(self, app): self.app = app def open_group_page(self): wd = self.app.wd if not (wd.current_url.endswith('/group.php') and le...
apache-2.0
ukanga/SickRage
lib/github/InputGitAuthor.py
47
2633
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
evro/CouchPotatoServer
libs/xmpp/simplexml.py
198
22791
## simplexml.py based on Mattew Allum's xmlstream.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (...
gpl-3.0
kaedroho/django
tests/string_lookup/models.py
106
1232
from django.db import models class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def __str__(self): return "Foo %s" % self.name class Bar(models.Model): name = models.CharField(max_length=50) normal = models.ForeignKey(Foo...
bsd-3-clause
auready/django
django/db/models/aggregates.py
26
5000
""" Classes to represent the definitions of aggregate functions. """ from django.core.exceptions import FieldError from django.db.models.expressions import Func, Star from django.db.models.fields import DecimalField, FloatField, IntegerField __all__ = [ 'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', '...
bsd-3-clause
rsunder10/PopularityBased-SearchEngine
lib/python3.4/site-packages/django/db/models/fields/subclassing.py
44
2031
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the metaclass for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ import warnings from django.utils.deprecation imp...
mit
sammerry/ansible
v1/ansible/module_utils/splitter.py
372
8425
# (c) 2014 James Cammarata, <jcammarata@ansible.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 the License, or # (at your option) any late...
gpl-3.0
stshine/servo
tests/wpt/css-tests/tools/webdriver/webdriver/error.py
82
3570
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import collections class WebDriverException(Exception): http_status = None status_code = None class Element...
mpl-2.0
ArphonePei/PDFConverter
thirdparty/curl/tests/http_pipe.py
22
14355
#!/usr/bin/python # 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 required by a...
agpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/test/test_threading.py
8
34689
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose, cpython_only from test.script_helper import assert_python_ok import random import re import sys thread = test.test_support.import_module('thread') threading = test.test_support.import_module('threading') import...
gpl-3.0
Tehsmash/nova
nova/scheduler/weights/metrics.py
53
4448
# Copyright (c) 2011 OpenStack Foundation # 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 ...
apache-2.0
jeremiahmarks/sl4a
python/src/Lib/test/test_int.py
56
12905
import sys import unittest from test.test_support import run_unittest, have_unicode L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), ...
apache-2.0
Caylo/easybuild-framework
easybuild/toolchains/intel.py
2
1694
## # Copyright 2012-2016 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
undeath/joinmarket-clientserver
jmclient/test/test_psbt_wallet.py
2
28856
#! /usr/bin/env python '''Test of psbt creation, update, signing and finalizing using the functionality of the PSBT Wallet Mixin. Note that Joinmarket's PSBT code is a wrapper around bitcointx.core.psbt, and the basic test vectors for BIP174 are tested there, not here. ''' import copy import base64 from...
gpl-3.0
vipul-sharma20/oh-mainline
vendor/packages/whoosh/src/whoosh/filedb/multiproc.py
16
12210
# Copyright 2010 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the...
agpl-3.0
ThirdProject/android_external_chromium_org
chrome/test/functional/tracing/timeline_model.py
69
1823
# Copyright (c) 2012 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. import json import os class TimelineModel(object): """A proxy for about:tracing's TimelineModel class. Test authors should never need to know that...
bsd-3-clause
Big-B702/python-for-android
python-modules/twisted/twisted/web/html.py
57
1178
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """I hold HTML generation helpers. """ from twisted.python import log #t.w imports from twisted.web import resource import traceback, string from cStringIO import StringIO from microdom import escape def PRE(text): "Wrap <pre> ...
apache-2.0
40223229/2015cdb_g9
gear.py
204
19237
#@+leo-ver=5-thin #@+node:office.20150407074720.1: * @file gear.py #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:office.20150407074720.2: ** <<declarations>> (application) #@@language python import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 S...
gpl-2.0
krafczyk/spack
var/spack/repos/builtin/packages/py-qtconsole/package.py
4
2032
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
mitmedialab/MediaCloud-Web-Tools
server/util/request.py
1
3666
import logging import os from functools import wraps from flask import jsonify, request from mediacloud.error import MCException logger = logging.getLogger(__name__) def validate_params_exist(form, params): for param in params: if param not in form: raise ValueError('Missing required value f...
apache-2.0
GeoNode/geonode
geonode/layers/populate_layers_data.py
4
6742
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
CiscoSystems/tempest
tempest/api/object_storage/test_crossdomain.py
5
2167
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # Author: Joe H. Rahme <joe.hakim.rahme@enovance.com> # # 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...
apache-2.0
mattclay/ansible-modules-core
network/nxos/nxos_ntp_options.py
13
15517
#!/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
mancoast/CPythonPyc_test
cpython/252_test_hexoct.py
34
4922
"""Test correct treatment of hex/oct constants. This is complex because of changes due to PEP 237. """ import sys platform_long_is_32_bits = sys.maxint == 2147483647 import unittest from test import test_support import warnings warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning, ...
gpl-3.0
MoritzS/django
tests/staticfiles_tests/test_finders.py
29
3831
import os from django.conf import settings from django.contrib.staticfiles import finders, storage from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase, override_settings from .cases import StaticFilesTestCase from .settings import TEST_ROOT class TestFinders: """ B...
bsd-3-clause
iwschris/ezodf2
tests/test_pages.py
1
3894
#!/usr/bin/env python #coding:utf-8 # Purpose: test spreadpage body # Created: 29.01.2011 # Copyright (C) 2011, Manfred Moitzi # License: MIT from __future__ import unicode_literals, print_function, division __author__ = "mozman <mozman@gmx.at>" # Standard Library import unittest # trusted or separately t...
mit
cbrucks/Federated_Python-Swiftclient
swiftclient/contrib/federated/protocols/rax.py
1
2519
import urllib import urllib2 import json import getpass import BaseHTTPServer import os import webbrowser from swiftclient.contrib.federated import federated_exceptions, federated_utils import ssl ## Sends the authentication request to the IdP along # @param idpEndpoint The IdP address # @param idpRequest The authenti...
apache-2.0
NaturalHistoryMuseum/inselect
inselect/gui/views/boxes/box_item.py
1
8872
import sys from itertools import chain from PyQt5.QtCore import Qt, QRect, QRectF from PyQt5.QtGui import QPen from PyQt5.QtWidgets import QGraphicsItem, QGraphicsRectItem from inselect.lib.utils import debug_print from inselect.gui.colours import colour_scheme_choice from inselect.gui.utils import painter_state fr...
bsd-3-clause
dpwrussell/openmicroscopy
components/tools/OmeroWeb/omeroweb/urls.py
6
3485
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # # Copyright (c) 2008-2014 University of Dundee. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or...
gpl-2.0
dplorimer/osf
website/addons/github/utils.py
9
4025
import hmac import uuid import urllib import hashlib import httplib as http from github3.repos.branch import Branch from framework.exceptions import HTTPError from website.addons.base.exceptions import HookError from website.addons.github.api import GitHub MESSAGE_BASE = 'via the Open Science Framework' MESSAGES = {...
apache-2.0
joshowen/django-allauth
allauth/socialaccount/tests.py
3
22781
import json import random import warnings from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sites.models import Site from django.test...
mit
sebady/selenium
py/test/selenium/webdriver/firefox/__init__.py
57
1247
# Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google 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.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
kustodian/ansible-modules-core
packaging/os/apt.py
8
20940
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Flowroute LLC # Written by Matthew Williams <matthew@flowroute.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-3.0
openfun/edx-platform
lms/djangoapps/mobile_api/social_facebook/test_utils.py
104
6489
""" Test utils for Facebook functionality """ import httpretty import json from rest_framework.test import APITestCase from django.conf import settings from django.core.urlresolvers import reverse from social.apps.django_app.default.models import UserSocialAuth from student.models import CourseEnrollment from st...
agpl-3.0
sunu/oh-missions-oppia-beta
core/storage/base_model/gae_models_test.py
5
2820
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
SrNetoChan/Quantum-GIS
tests/src/python/test_qgsfloatingwidget.py
45
8058
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsFloatingWidget. .. note:: 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) any later version. """...
gpl-2.0
agrista/odoo-saas
addons/purchase_analytic_plans/__init__.py
441
1220
# -*- 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...
agpl-3.0
theflofly/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/masked_autoregressive.py
15
23796
# Copyright 2017 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
Oga-Jun/DECAF
decaf/roms/seabios/tools/checkstack.py
38
7820
#!/usr/bin/env python # Script that tries to find how much stack space each function in an # object is using. # # Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. # Usage: # objdump -m i386 -M i8086 -M suffix -d out/rom16.o | tools/che...
gpl-3.0
lodle/SoapServer
third_party/gtest-1.7.0/scripts/fuse_gtest_files.py
2577
8813
#!/usr/bin/env python # # Copyright 2009, 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...
lgpl-2.1
digiholic/universalSmashSystem
engine/subactions/control/conditional.py
2
4500
from engine.subaction import * class If(SubAction): subact_group = 'Control' fields = [NodeMap('variable','string','if>variable',''), NodeMap('source','string','if>variable|source','action'), NodeMap('function','string','if|function','=='), NodeMap('value','dyna...
gpl-3.0
ragupta-git/ImcSdk
imcsdk/mometa/huu/HuuFirmwareCatalogComponent.py
1
4134
"""This module contains the general information for HuuFirmwareCatalogComponent ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class HuuFirmwareCatalogComponentConsts: pass class HuuFirmwareCatalogComponent(ManagedObject...
apache-2.0
cyril51/Sick-Beard
lib/guessit/transfo/guess_weak_episodes_rexps.py
56
2126
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
xinjiguaike/edx-platform
common/djangoapps/util/db.py
109
2095
""" Utility functions related to databases. """ from functools import wraps import random from django.db import connection, transaction MYSQL_MAX_INT = (2 ** 31) - 1 def commit_on_success_with_read_committed(func): # pylint: disable=invalid-name """ Decorator which executes the decorated function inside a...
agpl-3.0
chrisjaquet/FreeCAD
src/Mod/Start/StartPage/ArchDesign.py
32
1805
#*************************************************************************** #* * #* Copyright (c) 2012 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1