repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
dogecoin/dogecoin
src/test/bitcoin-util-test.py
51
1534
#!/usr/bin/env python # Copyright 2014 BitPay Inc. # Copyright 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from __future__ import division,print_function,unicode_literals import os import bctest...
mit
6,198,340,018,903,460,000
33.088889
83
0.691656
false
danielfrg/s3contents
s3contents/genericfs.py
1
1876
""" Generic FileSystem class to be used by the Content Manager """ from s3contents.ipycompat import HasTraits class GenericFS(HasTraits): def ls(self, path=""): raise NotImplementedError( "Should be implemented by the file system abstraction" ) def isfile(self, path): rai...
apache-2.0
677,545,848,713,585,200
26.588235
71
0.6242
false
DevinDewitt/pyqt5
pyuic/uic/widget-plugins/qtdeclarative.py
2
1565
############################################################################# ## ## Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com> ## ## This file is part of PyQt5. ## ## This file may be used under the terms of the GNU General Public License ## version 3.0 as published by the Free Softw...
gpl-3.0
1,552,947,209,253,559,600
46.424242
79
0.669649
false
halfak/mwxml
mwxml/utilities/inflate.py
2
1818
r""" ``$ mwxml inflate -h`` :: Converts a stream of flat RevisionDocument JSON blobs into hierarchical JSON RevisionDocument JSON blobs. Usage: inflate (-h|--help) inflate [<input-file>...] [--threads=<num>] [--output=<path>] [--compress=<type>] [--verbose] [--debug] O...
mit
8,629,356,007,420,047,000
31.464286
80
0.557206
false
saleeh93/buck-cutom
third-party/py/twitter-commons/src/python/twitter/common/python/package.py
23
9291
import contextlib import os import tarfile import zipfile from .base import maybe_requirement from .common import safe_mkdtemp from .http.link import Link from .interpreter import PythonInterpreter from .pep425 import PEP425, PEP425Extras from .platforms import Platform from pkg_resources import ( EGG_NAME, p...
apache-2.0
9,171,705,022,739,710,000
32.064057
100
0.684211
false
gao-wei/qualitybots
src/appengine/common/useragent_parser_test.py
26
8267
#!/usr/bin/python2.4 # # 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...
apache-2.0
-422,641,603,072,157,700
52.681818
80
0.612556
false
terranodo/geonode
geonode/base/management/commands/fixsitename.py
22
1462
# -*- 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
-7,981,670,063,689,223,000
33.809524
73
0.635431
false
graysonc/vim
autoload/conque_term/conque_sole_communicator.py
30
5055
# FILE: autoload/conque_term/conque_sole_communicator.py # AUTHOR: Nico Raffo <nicoraffo@gmail.com> # WEBSITE: http://conque.googlecode.com # MODIFIED: 2011-09-02 # VERSION: 2.3, for Vim 7.0 # LICENSE: # Conque - Vim terminal/console emulator # Copyright (C) 2009-2011 Nico Raffo # # MIT License # # Permission i...
mit
-6,926,851,838,518,226,000
26.622951
117
0.565579
false
larsbutler/swift
swift/common/middleware/ratelimit.py
42
13190
# Copyright (c) 2010-2013 OpenStack Foundation # # 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 agree...
apache-2.0
-5,584,195,747,522,986,000
38.969697
79
0.574147
false
ErikTromm1/Erik
py/openage/convert/mediafile.py
46
10925
# media files conversion stuff from .colortable import ColorTable, PlayerColorTable from collections import defaultdict from . import dataformat from .drs import DRS from . import filelist from .hardcoded import termcolors import os import os.path import pickle from string import Template import subprocess from .textu...
gpl-3.0
7,577,660,532,622,985,000
36.286689
111
0.593776
false
thomdixon/elasticsearch-py
docs/conf.py
9
8459
# -*- coding: utf-8 -*- # # Elasticsearch documentation build configuration file, created by # sphinx-quickstart on Mon May 6 15:38:41 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. #...
apache-2.0
-4,458,923,984,586,905,000
31.519231
80
0.707156
false
danicampora/micropython
tests/micropython/viper_misc.py
37
2637
import micropython # viper function taking and returning ints @micropython.viper def viper_int(x:int, y:int) -> int: return x + y + 3 print(viper_int(1, 2)) # viper function taking and returning objects @micropython.viper def viper_object(x:object, y:object) -> object: return x + y print(viper_object(1, 2)) ...
mit
8,166,659,649,239,554,000
20.439024
57
0.677664
false
hchen1202/django-react
virtualenv/lib/python3.6/site-packages/django/contrib/sessions/backends/cached_db.py
118
2813
""" Cached, database-backed sessions. """ import logging from django.conf import settings from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import caches from django.core.exceptions import SuspiciousOperation from django.utils import timezone from django.utils.encoding imp...
mit
-8,355,653,014,335,284,000
33.728395
96
0.608247
false
krux/adspygoogle
examples/adspygoogle/dfp/v201204/create_teams.py
2
1659
#!/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 b...
apache-2.0
-4,514,310,480,909,120,500
27.603448
80
0.6956
false
monikasulik/django-oscar
tests/integration/address/form_tests.py
39
1320
from django.test import TestCase from oscar.apps.address import models, forms from oscar.core.compat import get_user_model from oscar.test.factories import UserFactory class TestUserAddressForm(TestCase): def setUp(self): self.user = UserFactory() self.country = models.Country.objects.create( ...
bsd-3-clause
6,207,614,630,818,314,000
34.675676
78
0.617424
false
dweinstein/finsky
finsky/protos/play_survey_pb2.py
2
8956
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: play_survey.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _r...
mit
-4,645,086,301,553,842,000
34.824
784
0.700759
false
evgchz/scikit-learn
doc/tutorial/text_analytics/solutions/exercise_01_language_train_model.py
254
2253
"""Build a language detector model The goal of this exercise is to train a linear classifier on text features that represent sequences of up to 3 consecutive characters so as to be recognize natural languages by using the frequencies of short character sequences as 'fingerprints'. """ # Author: Olivier Grisel <olivie...
bsd-3-clause
-8,716,717,958,102,103,000
31.185714
78
0.734132
false
wolfmanstout/dragonfly
dragonfly/actions/keyboard/_pynput.py
2
8733
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly 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 L...
lgpl-3.0
-2,057,399,541,129,497,600
30.989011
75
0.654758
false
blacktear23/django
django/conf/project_template/settings.py
150
5005
# Django settings for {{ project_name }} project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
bsd-3-clause
-5,349,375,471,665,250,000
33.517241
115
0.682118
false
ElijahCaine/GrindStone
grindstone/tests.py
1
6880
#!/usr/bin/env python """ File: test.py Package: grindstone Author: Elijah Caine Description: Test GrindStone lib functionality """ from lib import GrindStone import unittest import shutil import os class TestGrindStoneLibrary(unittest.TestCase): def setUp(self): # We're testing everything in a /tmp/*...
mit
3,310,106,132,467,607,000
31.606635
79
0.568314
false
Tuxemon/Tuxemon-Server
tuxemon_server/core/game/event/actions/core.py
3
9876
#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <shadowapex@gmail.com> # # This file is part of Tuxemon. # # Tuxemon 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, ...
gpl-3.0
4,310,644,759,492,586,500
25.983607
99
0.570474
false
jrief/django-filer
filer/models/clipboardmodels.py
22
1562
#-*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from django.conf import settings from filer.models import filemodels from filer.utils.compatibility import python_2_unicode_compatible @python_2_unicode_compatible class...
bsd-3-clause
7,575,553,333,584,889,000
34.5
136
0.642766
false
dongjoon-hyun/tensorflow
tensorflow/contrib/timeseries/python/timeseries/ar_model_test.py
25
15933
# 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
-765,913,845,294,597,500
42.652055
91
0.608988
false
AnonymFx/scripts
ios-to-android-strings.py
5
2531
#!/usr/bin/python import argparse import os import re def main(): # def arguments argparser = argparse.ArgumentParser() argparser.add_argument("input") argparser.add_argument("target") args = argparser.parse_args() # get input file if not os.path.isfile(args.input): raise Exceptio...
gpl-3.0
5,110,498,977,506,290,000
26.215054
104
0.560648
false
justasabc/kubernetes-ubuntu
ke/images/python/setting.py
1
1316
#/usr/bin/python # -*- coding:utf-8 -*- # base/apache/var/www/region_load/ # region related INTERNAL_ADDRESS = "0.0.0.0" EXTERNAL_HOSTNAME = "162.105.17.48" ALLOW_ALTERNATE_PORTS = False MAX_AGENTS = 100 MAX_PRIMS = 15000 GLOBAL_REGION_DATA2 = { "huyu": {"orig":(1000,1000), "startPort":9000, "wh":(2,2)}, "xwd": {"o...
apache-2.0
-9,204,379,930,543,503,000
28.244444
78
0.68465
false
BurntSushi/docopt
test_docopt.py
13
25889
from __future__ import with_statement from docopt import (docopt, DocoptExit, DocoptLanguageError, Option, Argument, Command, OptionsShortcut, Required, Optional, Either, OneOrMore, parse_argv, parse_pattern, parse_section, parse_defaults, ...
mit
-3,922,653,919,072,139,000
41.027597
79
0.493723
false
jchrismer/PiQuad
Calibration/adjusted_least_squars.py
1
4915
''' ===================================================================================== Python implementation of the ALS (Adujusted Least Square) ellipsoid fitting algorithm ===================================================================================== Sources: "Consistent least squares fitting of ellipsoids"...
gpl-3.0
9,196,110,637,525,861,000
30.670968
117
0.537177
false
lmazuel/azure-sdk-for-python
azure-mgmt-relay/azure/mgmt/relay/models/authorization_rule.py
2
1513
# 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 ...
mit
8,735,264,423,107,064,000
31.191489
76
0.557171
false
scorphus/scrapy
setup.py
15
1521
from os.path import dirname, join from setuptools import setup, find_packages with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f: version = f.read().decode('ascii').strip() setup( name='Scrapy', version=version, url='http://scrapy.org', description='A high-level Web Crawling and Web...
bsd-3-clause
-608,338,524,507,178,200
30.6875
79
0.595661
false
bmotlaghFLT/FLT_PhantomJS
src/qt/qtwebkit/Source/JavaScriptCore/KeywordLookupGenerator.py
117
11965
# Copyright (C) 2011 Apple Inc. All rights reserved. # Copyright (C) 2012 Sony Network Entertainment. 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 retai...
bsd-3-clause
5,558,830,763,025,435,000
37.596774
129
0.610698
false
google-code/android-scripting
python/gdata/samples/oauth/oauth_on_appengine/appengine_utilities/rotmodel.py
131
2149
""" Copyright (c) 2008, appengine-utilities project 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 ...
apache-2.0
-2,812,150,520,772,166,000
45.717391
79
0.751978
false
DazWorrall/ansible
lib/ansible/modules/network/avi/avi_api_session.py
27
8381
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # 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 publ...
gpl-3.0
4,412,631,351,815,438,000
32.658635
137
0.592173
false
architecture-building-systems/CityEnergyAnalyst
cea/technologies/thermal_network/simplified_thermal_network.py
2
29336
import math import time import geopandas as gpd import numpy as np import pandas as pd import wntr import cea.config import cea.inputlocator import cea.technologies.substation as substation from cea.constants import P_WATER_KGPERM3, FT_WATER_TO_PA, FT_TO_M, M_WATER_TO_PA, HEAT_CAPACITY_OF_WATER_JPERKGK, SHAPEFILE...
mit
-2,530,157,341,089,189,400
51.857658
172
0.644021
false
wgapl/moose
gui/utils/YamlData.py
34
1524
#!/usr/bin/python import sys, os, commands, time, re, copy try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportErro...
lgpl-2.1
9,173,088,631,956,272,000
27.222222
68
0.66601
false
0k/odoo
addons/stock_account/stock.py
6
13101
# -*- 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
4,692,838,510,907,675,000
42.380795
137
0.55866
false
sakuramilk/sc02c_kernel_gb
tools/perf/scripts/python/check-perf-trace.py
948
2501
# perf trace event handlers, generated by perf trace -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. Ba...
gpl-2.0
3,123,209,681,431,189,000
29.5
78
0.642543
false
daviddupont69/CouchPotatoServer
couchpotato/core/downloaders/base.py
3
6076
from base64 import b32decode, b16encode from couchpotato.core.event import addEvent from couchpotato.core.helpers.variable import mergeDicts from couchpotato.core.logger import CPLog from couchpotato.core.providers.base import Provider import random import re log = CPLog(__name__) class Downloader(Provider): pr...
gpl-3.0
-4,373,210,685,486,813,000
29.84264
139
0.602699
false
rolandwz/pymisc
ustrader/strategy/oneTrader.py
2
7496
# -*- coding: utf-8 -*- import datetime, time, csv, os import numpy as np from utils.db import SqliteDB from utils.rwlogging import log from utils.rwlogging import strategyLogger as logs from utils.rwlogging import balLogger as logb from trader import Trader from indicator import ma, macd, bolling, rsi, kdj from strate...
mit
787,866,101,869,439,000
33.389908
330
0.563501
false
quiqueporta/django-admin-dialog
django_admin_dialog/migrations/0001_initial.py
1
1234
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='DjangoAdminDialog', fields=[ ('id', models.Auto...
gpl-2.0
60,533,250,762,794,330
34.257143
114
0.547002
false
willu47/SALib
tests/test_cli_analyze.py
1
7726
import sys import subprocess from SALib.test_functions import Ishigami import numpy as np import re salib_cli = "./src/SALib/scripts/salib.py" ishigami_fp = "./src/SALib/test_functions/params/Ishigami.txt" if sys.version_info[0] == 2: subprocess.run = subprocess.call def test_delta(): cmd = "python {cli} sa...
mit
2,531,186,178,850,552,300
37.63
246
0.637587
false
yjxtogo/horizon
horizon/__init__.py
85
2217
# Copyright 2012 Nebula, 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 required by applicable law or agree...
apache-2.0
5,306,104,983,293,418,000
32.590909
79
0.701398
false
dneg/cortex
python/IECore/SWAReader.py
12
4885
########################################################################## # # Copyright (c) 2012, John Haddon. 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 sou...
bsd-3-clause
3,265,376,423,133,693,000
36.576923
127
0.695394
false
amith01994/intellij-community
python/lib/Lib/site-packages/django/contrib/flatpages/tests/csrf.py
94
3788
import os from django.conf import settings from django.contrib.auth.models import User from django.test import TestCase, Client class FlatpageCSRFTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.client = Client(enforce_csrf_checks=...
apache-2.0
-6,349,937,514,251,999,000
46.949367
118
0.678986
false
rghe/ansible
test/units/modules/network/f5/test_bigip_wait.py
10
3828
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks 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 import os import json import pytest import sys from nose.plugins.skip imp...
gpl-3.0
3,997,182,965,494,125,600
29.870968
91
0.649948
false
chafique-delli/OpenUpgrade
addons/website_twitter/controllers/main.py
76
1637
from openerp.addons.web import http from openerp.addons.web.http import request from openerp.tools.translate import _ import json class Twitter(http.Controller): @http.route(['/twitter_reload'], type='json', auth="user", website=True) def twitter_reload(self): return request.website.fetch_favorite_twe...
agpl-3.0
4,037,762,793,838,108,000
50.15625
101
0.602321
false
JKRP/geonode
geonode/groups/search_indexes.py
27
1292
import json from django.conf import settings from haystack import indexes from geonode.groups.models import GroupProfile class GroupIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) title = indexes.CharField(boost=2) # https://github.com/toastdriv...
gpl-3.0
-3,851,706,179,140,491,000
29.046512
97
0.655573
false
mclois/iteexe
twisted/test/test_pbfailure.py
16
6031
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. from twisted.trial import unittest from twisted.spread import pb, flavors, jelly from twisted.internet import reactor, defer from twisted.python import log, failure ## # test exceptions ## class PoopError(Exception): pass class FailEr...
gpl-2.0
4,263,671,094,017,759,000
28.70936
90
0.651965
false
Zyell/home-assistant
tests/components/binary_sensor/test_template.py
3
4085
"""The tests for the Template Binary sensor platform.""" import unittest from unittest import mock from homeassistant.const import EVENT_STATE_CHANGED from homeassistant.components.binary_sensor import template from homeassistant.exceptions import TemplateError from tests.common import get_test_home_assistant class...
mit
3,077,530,758,322,034,700
33.618644
77
0.531457
false
kingvuplus/xrd-alliance
lib/python/Screens/Downloads.py
1
23946
from Plugins.Plugin import PluginDescriptor from Components.Sources.List import List from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest from enigma import eTimer, quitMainloop, RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, gFont, getDesktop, ePicLoad fr...
gpl-2.0
4,043,404,555,849,252,000
35.117647
233
0.541844
false
colford/sirf_receiver_frontend
sirfcontrol/sirfui.py
1
7631
# -*- coding: utf-8 -*- """ Created on Fri Feb 24 15:59:29 2017 @author: CFord """ import sys, math, signal from PyQt4 import QtGui, QtCore from PyQt4.QtGui import * from PyQt4.QtCore import * from collections import deque from sirfcontrol.sirf import SirfMessageReader # Globals to begin with port = "COM7" baud = 38...
gpl-3.0
-88,010,808,461,296,160
33.224215
88
0.548683
false
pigeonflight/strider-plone
docker/appengine/lib/django-1.4/tests/modeltests/invalid_models/invalid_models/models.py
33
26337
#encoding=utf-8 """ 26. Invalid models This example exists purely to point out errors in models. """ from django.db import connection, models class FieldErrors(models.Model): charfield = models.CharField() charfield2 = models.CharField(max_length=-1) charfield3 = models.CharField(max_length="bad") d...
mit
-788,742,350,052,902,000
72.561453
214
0.772698
false
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/tests/unit/ec2/test_securitygroup.py
112
8556
#!/usr/bin/env python from tests.compat import unittest from tests.unit import AWSMockServiceTestCase from boto.ec2.connection import EC2Connection from boto.ec2.securitygroup import SecurityGroup DESCRIBE_SECURITY_GROUP = br"""<?xml version="1.0" encoding="UTF-8"?> <DescribeSecurityGroupsResponse xmlns="http://ec2...
mit
-56,021,392,731,348,904
39.549763
82
0.464002
false
south-coast-science/scs_core
tests/position/position_test.py
1
1174
#!/usr/bin/env python3 """ Created on 10 Feb 2021 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) Getting distance between two points based on latitude/longitude https://stackoverflow.com/questions/19412462/getting-distance-between-two-points-based-on-latitude-longitude """ from scs_core.position.positio...
mit
1,304,403,179,746,953,700
23.458333
118
0.63799
false
dbarbier/privot
python/test/t_FrankCopula_std.py
1
2700
#! /usr/bin/env python from openturns import * from math import * TESTPREAMBLE() RandomGenerator().SetSeed(0) try : # Instanciate one distribution object dim = 2 copula = FrankCopula(2.5) print "Copula " , repr(copula) print "Copula " , copula print "Mean " , repr(copula.getMean()) print ...
lgpl-3.0
3,293,267,492,674,573,300
32.75
81
0.673333
false
pyfa-org/eos
tests/mod_builder/etree/affectee_filter/test_affectee_dom_grp.py
1
5818
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publi...
lgpl-3.0
-8,746,083,152,078,974,000
44.811024
80
0.660364
false
bertrand-l/LearnML
learnml/datasets/load.py
1
6085
# -*- coding: utf-8 -*- """ Utilities to load datasets from the `dataset` package. """ # Author: bertrand-l # License: BSD from __future__ import absolute_import, division, print_function, unicode_literals import os import numpy as np from .dataset import DataSet __all__ = ('load_faithful', 'load_iris', 'load_women'...
bsd-3-clause
3,226,797,682,472,570,400
31.185185
82
0.534605
false
2ndQuadrant/ansible
test/units/modules/storage/netapp/test_na_ontap_cifs_server.py
38
8705
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit tests ONTAP Ansible module: na_ontap_cifs_server ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch from...
gpl-3.0
-2,640,345,137,026,583,600
38.38914
99
0.605514
false
Fusion-Rom/android_external_chromium_org
ppapi/generators/idl_log.py
137
1271
# 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. """ Error and information logging for IDL """ import sys class IDLLog(object): """Captures and routes logging output. Caputres logging output and...
bsd-3-clause
-8,400,726,117,185,671,000
22.537037
72
0.618411
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_complex.py
32
27808
import unittest from test import test_support from random import random from math import atan2, isnan, copysign INF = float("inf") NAN = float("nan") # These tests ensure that complex math does the right thing class ComplexTest(unittest.TestCase): def assertAlmostEqual(self, a, b): if isinstance(a, comp...
mit
1,771,935,263,131,212,300
41.390244
100
0.556818
false
sysadminmatmoz/OCB
addons/website_blog/tests/test_website_blog_flow.py
45
2781
# -*- coding: utf-8 -*- from openerp.addons.website_blog.tests.common import TestWebsiteBlogCommon class TestWebsiteBlogFlow(TestWebsiteBlogCommon): def test_website_blog_followers(self): """ Test the flow of followers and notifications for blogs. Intended flow : - people subscribe to ...
agpl-3.0
2,706,001,637,693,172,700
46.135593
155
0.647249
false
AnishShah/tensorflow
tensorflow/contrib/keras/api/keras/datasets/imdb/__init__.py
39
1036
# 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
-8,874,356,472,156,117,000
38.846154
80
0.718147
false
40223117cda/2015cdaw13
static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/locals.py
603
1141
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library is free software; you can redistribute it and/or ## modify it under the terms of the GNU Library General Public ## License as published by the Free Software Foundation; either ## version 2 of the License...
gpl-3.0
5,375,121,702,832,935,000
38.344828
80
0.695004
false
tsabi/Odoo-tsabi-fixes
addons/subscription/subscription.py
337
8906
# -*- 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
6,172,405,187,428,690,000
51.081871
196
0.607792
false
Novasoft-India/OperERP-AM-Motors
openerp/addons/account_asset/account_asset.py
14
29289
# -*- encoding: 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 G...
agpl-3.0
910,100,032,905,051,800
57.93159
256
0.605142
false
dset0x/invenio
invenio/modules/oauth2server/upgrades/oauth2server_2015_07_14_innodb.py
2
1644
# -*- 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
8,096,528,097,804,857,000
25.095238
74
0.681265
false
caot/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/tests/distapp/models.py
406
1832
from django.contrib.gis.db import models class SouthTexasCity(models.Model): "City model on projected coordinate system for South Texas." name = models.CharField(max_length=30) point = models.PointField(srid=32140) objects = models.GeoManager() def __unicode__(self): return self.name class SouthTe...
apache-2.0
-7,934,160,259,706,839,000
35.64
71
0.707424
false
xodus7/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/graph_io.py
39
37211
# 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
-2,017,438,871,528,949,000
41.189342
93
0.645347
false
davisagli/eye
eye/views.py
1
1372
import cgi import json import pprint from webob import Response from persistent import Persistent def as_json(context): """Return an object's representation as JSON""" info = { 'info': cgi.escape(pprint.pformat(context.context)), } return Response(content_type='application/json', body=json.dum...
mit
6,530,911,947,158,649,000
23.070175
75
0.571429
false
danilito19/django
tests/serializers/tests.py
118
30530
# -*- coding: utf-8 -*- from __future__ import unicode_literals import importlib import json import re import unittest from datetime import datetime from xml.dom import minidom from django.core import management, serializers from django.core.serializers.base import ProgressBar from django.db import connection, transa...
bsd-3-clause
6,000,386,514,764,262,000
35.345238
172
0.598624
false
protatremy/buildbot
worker/buildbot_worker/exceptions.py
9
1155
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-1,018,914,183,407,041,900
40.25
79
0.747186
false
slohse/ansible
test/units/modules/network/netscaler/test_netscaler_nitro_request.py
57
12941
# Copyright (c) 2017 Citrix Systems # # 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
-4,312,411,834,909,484,500
36.293948
126
0.573758
false
Jgarcia-IAS/SAT
openerp/addons-extra/odoo-pruebas/odoo-server/addons/hw_posbox_upgrade/__openerp__.py
313
1696
# -*- 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
3,332,517,930,144,285,000
35.085106
78
0.617335
false
NeblioTeam/neblio
test/functional/todo/p2p_unrequested_blocks.py
1
14460
#!/usr/bin/env python3 # Copyright (c) 2015-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test processing of unrequested blocks. Setup: two nodes, node0+node1, not connected to each other. Nod...
mit
1,170,253,134,158,632,700
43.767802
131
0.65249
false
celery/kombu
t/mocks.py
2
4712
from itertools import count from unittest.mock import Mock from case import ContextMock from kombu.transport import base from kombu.utils import json def PromiseMock(*args, **kwargs): m = Mock(*args, **kwargs) def on_throw(exc=None, *args, **kwargs): if exc: raise exc raise ...
bsd-3-clause
6,299,004,834,465,878,000
26.555556
77
0.590195
false
igniteflow/codebase-python-api-client
codebase/utils.py
1
2236
import sys from codebase import logger from codebase.client import CodeBaseAPI class CodeBaseAPIUtils(CodeBaseAPI): def bulk_update_ticket_statuses(self, current_status_name, target_status_name): """ Example usage to set all "Approved for Dev" tp "Deployed to Dev": STATUS_TRANSITIONS = ...
mit
6,410,588,830,195,811,000
32.373134
91
0.525492
false
labcodes/django
tests/forms_tests/widget_tests/base.py
83
1134
from django.forms.renderers import DjangoTemplates, Jinja2 from django.test import SimpleTestCase try: import jinja2 except ImportError: jinja2 = None class WidgetTest(SimpleTestCase): beatles = (('J', 'John'), ('P', 'Paul'), ('G', 'George'), ('R', 'Ringo')) @classmethod def setUpClass(cls): ...
bsd-3-clause
778,564,383,325,184,100
39.5
102
0.655203
false
seize-the-dave/XlsxWriter
xlsxwriter/test/worksheet/test_cond_format13.py
8
4541
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet class TestAss...
bsd-2-clause
-8,862,496,255,839,959,000
33.142857
171
0.348381
false
PrestonMonteWest/compmart
account/forms.py
1
5138
import datetime import re from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from django.forms.widgets import Widget, Select from django.utils import six from django.utils.dates import MONTHS from django.utils.safestring import mark_safe from .mod...
apache-2.0
8,255,708,337,630,137,000
28.699422
83
0.572207
false
asm-products/movie-database-service
ani/lib/python2.7/site-packages/Crypto/SelfTest/Util/test_Counter.py
117
7095
# -*- coding: utf-8 -*- # # SelfTest/Util/test_Counter: Self-test for the Crypto.Util.Counter module # # Written in 2009 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent t...
agpl-3.0
-3,081,169,812,717,205,000
42
108
0.622692
false
xuweiliang/Codelibrary
nova/virt/xenapi/volumeops.py
17
9667
# Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2013 OpenStack Foundation # # 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...
apache-2.0
-1,683,959,749,907,447,600
41.399123
79
0.578152
false
puzan/ansible
lib/ansible/modules/cloud/google/gce_img.py
25
6737
#!/usr/bin/python # Copyright 2015 Google Inc. All Rights Reserved. # # 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 o...
gpl-3.0
-1,007,985,178,850,651,000
27.914163
100
0.650141
false
abhattad4/Digi-Menu
tests/many_to_many/tests.py
58
19011
from __future__ import unicode_literals from django.db import transaction from django.test import TestCase from django.utils import six from .models import Article, Publication class ManyToManyTests(TestCase): def setUp(self): # Create a couple of Publications. self.p1 = Publication.objects.cre...
bsd-3-clause
1,661,466,705,176,403,500
44.589928
113
0.573037
false
Smart-Torvy/torvy-home-assistant
homeassistant/components/notify/ecobee.py
6
1245
""" Support for ecobee Send Message service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.ecobee/ """ import logging import voluptuous as vol from homeassistant.components import ecobee from homeassistant.components.notify import ( BaseNot...
mit
-5,551,236,426,636,110,000
27.953488
74
0.734137
false
brain-tec/l10n-switzerland
l10n_ch_bank/models/bank.py
2
1706
# Copyright 2014 Olivier Jossen brain-tec AG # Copyright 2014-2015 Guewen Baconnier (Camptocamp SA) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields class ResBank(models.Model): """ Inherit res.bank class in order to add swiss specific fields Fields from the ori...
agpl-3.0
3,153,002,572,328,001,000
40.609756
95
0.640094
false
htzy/bigfour
common/lib/calc/calc/tests/test_calc.py
190
20806
""" Unit tests for calc.py """ import unittest import numpy import calc from pyparsing import ParseException # numpy's default behavior when it evaluates a function outside its domain # is to raise a warning (not an exception) which is then printed to STDOUT. # To prevent this from polluting the output of the tests, ...
agpl-3.0
-4,298,447,446,879,415,000
36.087344
91
0.534077
false
mcgachey/edx-platform
common/lib/xmodule/xmodule/modulestore/store_utilities.py
124
4490
import re import logging from collections import namedtuple import uuid def _prefix_only_url_replace_regex(pattern): """ Match urls in quotes pulling out the fields from pattern """ return re.compile(ur""" (?x) # flags=re.VERBOSE (?P<quote>\\?['"]) # the op...
agpl-3.0
-9,148,368,426,878,271,000
43.455446
135
0.659911
false
chrwi/ardupilot
Tools/LogAnalyzer/DataflashLog.py
83
27803
# # Code to abstract the parsing of APM Dataflash log files, currently only used by the LogAnalyzer # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # from __future__ import print_function import collections import os import numpy import bisect import sys import ctypes class Format(object): ...
gpl-3.0
7,254,802,924,795,259,000
42.0387
212
0.552171
false
infobloxopen/infoblox-netmri
infoblox_netmri/api/broker/v2_6_0/attribute_doc_broker.py
17
45632
from ..broker import Broker class AttributeDocBroker(Broker): controller = "attribute_docs" def show(self, **kwargs): """Shows the details for the specified attribute doc. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``requi...
apache-2.0
-5,109,352,448,690,528,000
52.246208
600
0.591274
false
spyder-ide/conda-manager
conda_manager/widgets/search.py
2
2652
# -*- coding:utf-8 -*- # # Copyright © 2015 The Spyder Development Team # Copyright © 2014 Gonzalo Peña-Castellanos (@goanpeca) # # Licensed under the terms of the MIT License """ """ # Standard library imports from __future__ import (absolute_import, division, print_function, unicode_literal...
mit
-1,333,985,350,111,639,300
30.535714
75
0.611174
false
aldryn/aldryn-blog
aldryn_blog/search_indexes.py
1
1338
# -*- coding: utf-8 -*- from django.db.models import Q from django.template import RequestContext from aldryn_search.utils import get_index_base, strip_tags from .conf import settings from .models import Post class BlogIndex(get_index_base()): haystack_use_for_indexing = settings.ALDRYN_BLOG_SEARCH INDEX_T...
bsd-3-clause
-8,641,224,025,138,494,000
29.409091
93
0.656951
false
hforge/itools
itools/database/backends/patchs.py
1
5600
# -*- coding: UTF-8 -*- # Copyright (C) 2020 Sylvain Taverne <sylvain@agicia.com> # # 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 lat...
gpl-3.0
-6,861,649,027,077,709,000
36.837838
107
0.577857
false
se4u/pylearn2
pylearn2/scripts/papers/maxout/svhn_preprocessing.py
55
2006
import os import logging import shutil from theano import config from pylearn2.datasets import preprocessing from pylearn2.datasets.svhn import SVHN from pylearn2.utils.string_utils import preprocess orig_path = preprocess('${PYLEARN2_DATA_PATH}/SVHN/format2') try: local_path = preprocess('${SVHN_LOCAL_PATH}') exc...
bsd-3-clause
-3,476,672,913,912,795,000
33
104
0.717846
false
AcalephStorage/ansible-modules-extras
network/f5/bigip_monitor_http.py
8
16585
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, serge van Ginderachter <serge@vanginderachter.be> # based on Matt Hite's bigip_pool module # (c) 2013, Matt Hite <mhite@hotmail.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...
gpl-3.0
-7,183,306,935,871,236,000
33.195876
158
0.580826
false
asm-products/movie-database-service
ani/lib/python2.7/site-packages/pip/commands/uninstall.py
395
2203
from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.basecommand import Command from pip.exceptions import InstallationError class UninstallCommand(Command): """ Uninstall packages. pip is able to uninstall most installed packages. Known exceptions are: - Pure distutil...
agpl-3.0
-5,089,071,828,487,694,000
36.338983
86
0.605084
false
eaplatanios/tensorflow
tensorflow/python/ops/rnn.py
3
62251
# 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
-2,085,073,340,155,275,000
40.307896
80
0.661965
false
nvoron23/brython
src/Lib/pyre.py
115
15252
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
bsd-3-clause
4,427,554,224,070,944,000
40.110512
79
0.638933
false
sirrice/scorpion
scorpion/sigmod/overlap.py
1
5112
import math import pdb import numpy as np import Orange from Orange.feature import Type as OType class OverlapPenalty(object): def __init__(self, domain, cdists, ddists, granularity=100): """ Args: domain: Orange.Domain object """ self.domain = domain self.cdists = cdists self.ddists ...
mit
-1,934,942,845,345,573,000
25.764398
72
0.617175
false
nunogt/tempest
tempest/api/object_storage/test_object_temp_url_negative.py
15
3914
# Copyright (C) 2013 eNovance SAS <licensing@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.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
-7,107,210,520,589,180,000
35.240741
78
0.617271
false
YingHsuan/termite_data_server
web2py/anyserver.py
19
12802
#!/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) This file is based, although a rewrite, on MIT-licensed code from the Bottle web framework. """ import os ...
bsd-3-clause
5,665,798,449,404,080,000
34.561111
118
0.589673
false
UTSA-ICS/keystone-kerberos
keystone/common/cache/backends/noop.py
30
1426
# Copyright 2013 Metacloud # # 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, s...
apache-2.0
2,900,959,249,968,139,300
28.102041
78
0.697055
false