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
taylorhxu/neurosynth
neurosynth/analysis/reduce.py
1
5689
""" Dimensionality reduction methods""" import numpy as np from neurosynth.base.dataset import Dataset from neurosynth.base import imageutils import logging logger = logging.getLogger('neurosynth.cluster') def average_within_regions(dataset, regions, threshold=None, remove_zero=True): """ Aggregates over all vo...
mit
-2,123,809,506,534,848,000
39.06338
79
0.642819
false
biocore/qiime
qiime/parse.py
6
32670
#!/usr/bin/env python # file parse.py: parsers for map file, distance matrix file, env file __author__ = "Rob Knight" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Rob Knight", "Daniel McDonald", "Greg Caporaso", "Justin Kuczynski", "Cathy Lozupone", "Jens Reeder", "...
gpl-2.0
-6,065,542,379,703,306,000
33.281217
95
0.575084
false
bameda/python-taiga
tests/test_milestones.py
4
3121
import datetime from taiga.requestmaker import RequestMaker from taiga.models import UserStory, Milestones from taiga import TaigaAPI import unittest from mock import patch from .tools import create_mock_json from .tools import MockResponse class TestMilestones(unittest.TestCase): @patch('taiga.requestmaker.Reque...
mit
-2,315,816,010,210,566,000
47.765625
103
0.624479
false
deepsrijit1105/edx-platform
lms/djangoapps/dashboard/git_import.py
27
11784
""" Provides a function for importing a git repository into the lms instance when using a mongo modulestore """ import os import re import StringIO import subprocess import logging from django.conf import settings from django.core import management from django.core.management.base import CommandError from django.util...
agpl-3.0
-2,640,303,271,180,701,000
33.156522
99
0.631704
false
Xetlin/Lua
Bindings/Scripts/create_lua_library/create_lua_library.py
10
41567
import sys import CppHeaderParser import os import errno import re from zipfile import * import fnmatch import re def mkdir_p(path): # Same effect as mkdir -p, create dir and all necessary parent dirs try: os.makedirs(path) except OSError as e: if e.errno == errno.EEXIST: # Dir already exists; not really an erro...
mit
-3,718,816,339,603,664,400
47.559579
524
0.593596
false
Ledoux/ShareYourSystem
Pythonlogy/draft/Simulaters/Brianer/draft/03_ExampleDoc.py
2
1598
#ImportModules import ShareYourSystem as SYS #Definition MyBrianer=SYS.BrianerClass( ).set( '-Populations', [ ( 'ManagingBeforeSetVariable', { 'NeurongroupingBrianKwargVariablesDict': { 'model': ''' dv/dt = (ge+gi-(v+49*mV))/(20*ms) : volt dge/dt = -ge/(5*ms) : volt ...
mit
1,122,958,059,654,174,000
15.821053
63
0.500626
false
agriggio/pysmt
pysmt/solvers/eager.py
2
3297
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 ...
apache-2.0
-1,543,510,063,000,445,000
35.633333
77
0.622081
false
pymedusa/SickRage
ext/tmdbsimple/tv.py
1
20917
# -*- coding: utf-8 -*- """ tmdbsimple.tv ~~~~~~~~~~~~~ This module implements the TV, TV Seasons, TV Episodes, and Networks functionality of tmdbsimple. Created by Celia Oakley on 2013-10-31. :copyright: (c) 2013-2020 by Celia Oakley :license: GPLv3, see LICENSE for more details """ from .base import TMDB class T...
gpl-3.0
5,543,613,008,889,226,000
29.053161
79
0.57011
false
garyfeng/pybrain
pybrain/rl/environments/mazes/tasks/pomdp.py
31
1465
__author__ = 'Tom Schaul, tom@idsia.ch' from scipy import ndarray from pybrain.rl.environments import EpisodicTask from pybrain.utilities import Named, drawIndex class POMDPTask(EpisodicTask, Named): """ Partially observable episodic MDP (with discrete actions) Has actions that can be performed, and observa...
bsd-3-clause
-9,210,264,471,081,991,000
26.660377
97
0.649829
false
ESOedX/edx-platform
lms/djangoapps/support/views/index.py
1
1900
""" Index view for the support app. """ from __future__ import absolute_import from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from edxmako.shortcuts import render_to_response from support.decorators import require_support_permission SUPPORT_INDEX_URLS = [ { "...
agpl-3.0
-4,170,745,403,023,848,000
30.666667
79
0.619474
false
HaebinShin/tensorflow
tensorflow/python/kernel_tests/scatter_ops_test.py
8
6156
# 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
-4,363,985,112,631,941,000
36.766871
80
0.624919
false
dcbaker/alot
alot/completion.py
1
22592
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import abc import argparse import glob import logging import os import re from . import crypto from . import commands from .buffers im...
gpl-3.0
-4,172,301,833,210,416,600
39.560144
79
0.530409
false
saurabh6790/frappe
frappe/model/mapper.py
2
7813
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe import _ from frappe.utils import cstr from frappe.model import default_fields, table_fields from six import string_types @frappe.whitelist() def ...
mit
4,925,199,684,571,421,000
33.267544
159
0.707539
false
amaozhao/basecms
cms/models/titlemodels.py
16
5249
# -*- coding: utf-8 -*- from datetime import timedelta from cms.constants import PUBLISHER_STATE_DIRTY from cms.utils.compat.dj import python_2_unicode_compatible from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from cms.models.managers import TitleM...
mit
-4,258,440,278,298,718,000
38.171642
115
0.623357
false
elahejalalpour/ELRyu
ryu/lib/stringify.py
8
12829
#!/usr/bin/env python # # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # 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...
apache-2.0
-6,690,845,110,445,938,000
30.833747
79
0.536987
false
missionpinball/mpf
mpf/commands/__init__.py
1
6303
"""MPF CLI commands.""" import argparse from importlib import import_module import os import sys from pkg_resources import iter_entry_points import mpf.core from mpf._version import version EXAMPLES_FOLDER = 'examples' CONFIG_FOLDER = 'config' class MpfCommandLineParser: """Base class for cli commands.""" ...
mit
-4,022,040,592,751,938,600
34.610169
115
0.579724
false
liesbethvanherpe/NeuroM
neurom/check/tests/test_neuron_checks.py
1
10546
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
bsd-3-clause
6,472,826,863,199,616,000
30.57485
86
0.5934
false
joshblum/django-with-audit
django/contrib/gis/geos/prototypes/io.py
92
8468
import threading from ctypes import byref, c_char_p, c_int, c_char, c_size_t, Structure, POINTER from django.contrib.gis.geos.base import GEOSBase from django.contrib.gis.geos.libgeos import GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string, check_sized_string from django.contrib...
bsd-3-clause
-1,062,297,409,962,977,000
33.991736
117
0.702527
false
scottpurdy/nupic.core
bindings/py/src/nupic/bindings/tools/cyclical_serialization_perf.py
7
4260
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2017, 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
8,285,896,536,346,109,000
32.809524
82
0.702817
false
schollz/extract_recipe
get_freebase_num/probeFreebase.py
1
1456
import json import urllib import sqlite3 as lite from unidecode import unidecode ''' last_ndb_no = '10909' start = False con = lite.connect('db') with con: cur = con.cursor() cur.execute('select ndb_no,shrt_desc from food_des') rows = cur.fetchall() for row in rows: ndb_no = row[0] print ndb_n...
apache-2.0
-4,355,018,759,415,273,000
28.714286
85
0.594093
false
aprefontaine/TMScheduler
tests/regressiontests/builtin_server/tests.py
14
1716
from unittest import TestCase from StringIO import StringIO from django.core.servers.basehttp import ServerHandler # # Tests for #9659: wsgi.file_wrapper in the builtin server. # We need to mock a couple of of handlers and keep track of what # gets called when using a couple kinds of WSGI apps. # class DummyHandler(o...
bsd-3-clause
-6,528,496,780,133,795,000
32.647059
83
0.661422
false
Melowkid/Talos
talos.py
1
44447
import subprocess from sets import Set import sys, os from proofTree import proofTree from outputParser import toSNotation sys.path.append(os.path.join(os.path.dirname(__file__), '../', 'DCEC_Library')) from DCEC_Library.DCECContainer import DCECContainer class spassContainer(): directory = os.path.dirname(__file...
gpl-2.0
-5,851,352,938,676,213,000
95.205628
914
0.695503
false
Aaron1992/flask
tests/test_instance_config.py
4
4365
# -*- coding: utf-8 -*- """ tests.test_instance ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2014 by the Flask Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os import sys import pytest import flask from flask._compat import PY2 def test_explicit_instance_paths(mo...
bsd-3-clause
-1,997,328,578,266,624,000
31.574627
75
0.629095
false
openstack/nova
nova/tests/unit/console/test_websocketproxy.py
2
29864
# 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 agreed to in...
apache-2.0
-5,748,044,044,201,525,000
38.450462
79
0.59108
false
jeffrey4l/nova
nova/openstack/common/report/models/conf.py
25
2380
# Copyright 2013 Red Hat, 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 agre...
apache-2.0
5,943,051,504,569,638,000
35.060606
81
0.62479
false
saurabh6790/test-med-lib
webnotes/boot.py
22
3990
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals """ bootstrap client session """ import webnotes import webnotes.defaults import webnotes.model.doc import webnotes.widgets.page import json import webnotes.webutils def get...
mit
-4,090,132,981,585,524,700
28.124088
100
0.696241
false
zentralopensource/zentral
zentral/utils/model_extras.py
1
1378
from collections import namedtuple RelatedObjects = namedtuple('RelatedObjects', ["name", "concrete", "to_name", "to_model", "objects", "objects_count"]) def find_all_related_objects(obj): for field in obj._meta.get_fields(): if not field.is_relation: continue ...
apache-2.0
-7,573,938,446,816,355,000
32.609756
100
0.515239
false
openmaraude/APITaxi
APITaxi2/tests/test_customers.py
1
2277
from APITaxi_models2.unittest.factories import CustomerFactory class TestEditCustomers: def test_invalid(self, anonymous, operateur, moteur): # Login required resp = anonymous.client.put('/customers/xxx', json={}) assert resp.status_code == 401 # Permission denied resp = o...
agpl-3.0
-8,230,134,203,105,731,000
35.142857
76
0.542819
false
cpennington/edx-platform
openedx/core/djangoapps/schedules/management/commands/tests/upsell_base.py
4
4091
""" Base file for testing schedules with upsell """ import datetime import itertools from collections import namedtuple import ddt from edx_ace.message import Message from edx_ace.utils.date import serialize from freezegun import freeze_time from mock import PropertyMock, patch from lms.djangoapps.courseware.models...
agpl-3.0
7,502,069,423,782,273,000
39.107843
115
0.657052
false
svartalf/python-opus
opus/decoder.py
4
1853
"""High-level interface to a opus.api.decoder functions""" from opus.api import decoder, ctl class Decoder(object): def __init__(self, fs, channels): """ Parameters: fs : sampling rate channels : number of channels """ self._fs = fs self._channels...
bsd-3-clause
8,219,980,433,603,259,000
30.40678
114
0.642742
false
TrackMaven/celery-once
tests/unit/test_helpers.py
6
2496
# -*- coding: utf-8 -*- from celery_once.helpers import queue_once_key, kwargs_to_list, force_string import pytest import six def test_force_string_1(): assert force_string('a') == 'a' def test_force_string_2(): assert force_string(u'a') == 'a' def test_force_string_3(): assert force_string('é') == '...
bsd-2-clause
2,580,298,836,659,329,000
25.287234
77
0.551599
false
GuardianRG/CuckooSploit
web/web/settings.py
6
5410
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import sys import os # Cuckoo path. CUCKOO_PATH = os.path.join(os.getcwd(), "..") sys.path.append(CUCKOO_PATH) from lib.cuckoo.common.config import C...
gpl-3.0
3,050,867,723,040,912,400
29.393258
85
0.697043
false
nicozhang/pyspider
tests/test_webdav.py
1
4204
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<roy@binux.me> # http://binux.me # Created on 2015-06-03 21:15 import os import six import time import shutil import inspect import unittest2 as unittest from six import BytesIO from pyspider import...
apache-2.0
8,990,342,809,478,623,000
34.327731
103
0.618459
false
Tayamarn/socorro
webapp-django/crashstats/crashstats/tests/test_utils.py
1
21058
import copy import datetime from cStringIO import StringIO from unittest import TestCase import json from django.http import HttpResponse from django.test.client import RequestFactory from crashstats.crashstats import utils class TestUtils(TestCase): def test_daterange(self): format = '%Y-%m-%d' ...
mpl-2.0
7,613,279,318,265,646,000
35.369603
92
0.440783
false
youfoh/webkit-efl
Tools/Scripts/webkitpy/performance_tests/perftestsrunner.py
1
11902
#!/usr/bin/env python # Copyright (C) 2012 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
-2,935,279,222,566,545,400
44.083333
135
0.621492
false
digitalocean/netbox
netbox/ipam/migrations/0016_unicode_literals.py
2
6052
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-24 15:34 import django.core.validators from django.db import migrations, models import django.db.models.deletion import ipam.fields class Migration(migrations.Migration): dependencies = [ ('ipam', '0015_global_vlans'), ] operations = ...
apache-2.0
-8,732,237,285,541,431,000
45.198473
249
0.598976
false
jualvarez/charlex
01-Inicial/charlexapi/charlas/migrations/0001_initial.py
3
4278
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-14 02:07 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
gpl-3.0
7,809,415,429,739,944,000
42.181818
133
0.566082
false
govarguz/espressopp
src/interaction/SmoothSquareWell.py
1
7137
# Copyright (C) 2017,2018 # Max Planck Institute for Polymer Research # # This file is part of ESPResSo++. # # ESPResSo++ 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 Licen...
gpl-3.0
-1,389,504,287,348,196,400
46.264901
192
0.697632
false
ttm/gmaneLegacy
tests/taggerTrain.py
1
4092
import nltk as k, pickle tagger=k.data.load('taggers/maxent_treebank_pos_tagger/english.pickle') # levou muito tempo, retornou: # tagger.evaluate(k.corpus.brown.tagged_sents()) # 0.5952331741865255 # pq as tags não são as mesmas? # Receita do Brill na própria classe do nltk from nltk.tbl.template import Template fro...
unlicense
-2,526,869,134,886,263,000
40.30303
122
0.691612
false
GHubgenius/Hammer
lib/mysql_class.py
3
1634
#!/usr/bin/python2.7 #coding:utf-8 ''' ''' import MySQLdb class MySQLHelper: '''MySQLdb 简单封装类''' def __init__(self,host,user,password,charset="utf8"): self.host=host self.user=user self.password=password self.charset=charset try: self.conn=MySQLdb.connect(host=self.host,user=self.user,passwd=self.passw...
gpl-2.0
-432,467,914,759,953,660
21.260274
84
0.638547
false
bpsmith/tia
tia/analysis/model/port.py
1
13375
from collections import OrderedDict import pandas as pd from tia.analysis.model.interface import CostCalculator, EodMarketData, PositionColumns as PC from tia.analysis.model.pos import Positions from tia.analysis.model.ret import RoiiRetCalculator from tia.analysis.model.txn import Txns from tia.analysis.util import ...
bsd-3-clause
-2,618,324,272,540,386,300
36.464986
120
0.566355
false
DenisCarriere/geocoder
geocoder/ottawa.py
1
2767
#!/usr/bin/python # coding: utf8 from __future__ import absolute_import import logging import re from geocoder.base import OneResult, MultipleResultsQuery class OttawaResult(OneResult): @property def lat(self): return self.raw.get('location', {}).get('y') @property def lng(self): ...
mit
4,576,178,556,643,008,000
26.949495
108
0.617636
false
rosspalmer/Caelum
caelum/stellar_system_model/planet_generator.py
1
4702
from planet_model import Planet import math as mt import random as rn M_jupiter = 2e27 # kg R_jupiter = 71492 # km M_earth = 6e24 # kg R_earth = 6378 # km def generate_planet(star_properties, planet_type, au): parameters = {'gas_giant': {'atmosphere': {'H': 0.9, 'He': 0.1}, ...
apache-2.0
4,304,546,259,769,949,700
33.07971
74
0.417695
false
medspx/QGIS
tests/src/python/test_qgslayoutpolygon.py
3
10772
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutItemPolygon. .. 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
-3,450,841,726,710,574,600
32.768025
93
0.624768
false
ecoal95/servo
tests/wpt/web-platform-tests/network-error-logging/support/lock.py
19
1713
# This file implements a shared lock that lets us ensure that the test cases in # this directory run serially. Each test case obtains this lock as its first # step, and releases it as its last. (The nel_test helper function in # nel.sub.js automates this process.) Because the lock needs to be shared # across all of ...
mpl-2.0
-4,616,994,438,030,963,000
34.6875
79
0.689434
false
twschiller/open-synthesis
openach/migrations/0030_auto_20161008_1249.py
1
1238
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-08 12:49 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("openach", "0029_auto_20161004_0323"), ] operations = [ migrations.AddField(...
gpl-3.0
-3,468,381,997,329,084,400
30.74359
100
0.551696
false
mitmproxy/mitmproxy
mitmproxy/contentviews/xml_html.py
2
7375
import io import re import textwrap from typing import Iterable, Optional from mitmproxy.contentviews import base from mitmproxy.utils import sliding_window, strutils """ A custom XML/HTML prettifier. Compared to other prettifiers, its main features are: - Implemented in pure Python. - Modifies whitespace only. - Wo...
mit
-7,197,868,616,178,917,000
29.475207
138
0.565966
false
hitdong/pyvision
src/pyvision/analysis/face.py
3
8265
# PyVision License # # Copyright (c) 2006-2008 David S. Bolme # 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, thi...
bsd-3-clause
-5,918,786,291,849,613,000
33.016461
100
0.538778
false
LighthouseHPC/lighthouse
sandbox/lily/django_orthg/dojango/bin/dojobuild.py
13
1261
#!/usr/bin/env python # This is the alternate dojo build command so it can be used # with older versions of django (mainly because of AppEngine, it uses version 0.96) import os import sys from optparse import OptionParser def setup_environ(): # we assume, that dojango is installed within your django's project dir ...
mit
876,172,679,731,151,500
39.709677
83
0.693101
false
illicitonion/givabit
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_0_96/django/db/models/loading.py
32
4520
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured import sys import os __all__ = ('get_apps', 'get_app', 'get_models', 'get_model', 'register_models') _app_list = [] # Cache of installed apps. ...
apache-2.0
-2,887,615,205,250,518,000
37.965517
139
0.620133
false
scorphus/politicos
tests/unit/models/test_legislator.py
1
3646
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Marcelo Jorge Vieira <metal@alucinados.com> # # 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 (at...
agpl-3.0
-8,097,954,450,932,880,000
39.511111
79
0.673066
false
novaspirit/eloipool
agplcompliance.py
6
3204
# Eloipool - Python Bitcoin pool server # Copyright (C) 2012-2014 Luke Dashjr <luke-jr+eloipool@utopios.org> # # 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 # L...
agpl-3.0
-5,041,123,365,346,520,000
36.255814
174
0.633895
false
nive/nive
nive/extensions/tests/test_persistence.py
1
1531
# -*-coding:utf-8 -*- import unittest from nive.extensions.persistence import * from nive.definitions import Conf from nive.helper import FormatConfTestFailure from nive.tests import db_app from nive.tests import __local class Persistence(unittest.TestCase): def setUp(self): self.app = db...
gpl-3.0
-624,896,616,748,852,700
23.190476
83
0.617859
false
deter-project/magi
scripts/magi_generate_group_aal.py
1
2763
#!/usr/bin/env python import sys import yaml import subprocess import re # great, now i've got two problems. import time from os.path import basename from collections import defaultdict from optparse import OptionParser if __name__ == '__main__': script_name = basename(sys.argv[0]) usage = 'Usage:...
gpl-2.0
-8,532,282,157,791,943,000
38.471429
104
0.593558
false
foxmask/django-th
th_evernote/tests.py
1
6939
# coding: utf-8 from django.conf import settings from django.core.cache import caches from django_th.tests.test_main import MainTest from evernote.api.client import EvernoteClient from th_evernote.models import Evernote from th_evernote.forms import EvernoteProviderForm, EvernoteConsumerForm from th_evernote.my_ever...
bsd-3-clause
5,888,162,812,482,918,000
32.684466
78
0.601095
false
asmacdo/pulp-automation
tests/general_tests/test_02_repo_applicability.py
2
1154
import json, unittest from tests import pulp_test from pulp_auto.repo import RepoAppl from pulp_auto.task import Task def setUpModule(): pass class RepoApplicabilty(pulp_test.PulpTest): def test_01_repo_content_applicability(self): response = RepoAppl.applicability(self.pulp, data={ ...
gpl-2.0
5,235,372,818,075,275,000
38.793103
118
0.525997
false
vkosuri/ChatterBot
tests/storage/test_sql_adapter.py
2
15201
from unittest import TestCase from chatterbot.conversation import Statement from chatterbot.storage.sql_storage import SQLStorageAdapter class SQLStorageAdapterTestCase(TestCase): @classmethod def setUpClass(cls): """ Instantiate the adapter before any tests in the test case run. """ ...
bsd-3-clause
6,196,846,224,603,339,000
31.550321
82
0.616144
false
RincewindWizzard/gruppenkasse-gtk
src/stores.py
1
2859
#!/usr/bin/python3 # -*- encoding: utf-8 -*- from gi.repository import Gtk, GObject #class ListStoreFilter(Gtk.ListStore): # def __init__(self, filter_func=None, modify_func=None, *args): class SQLStore(Gtk.ListStore): """ Fills a Gtk.ListStore with data from a SQL query everytime you call update """ ...
lgpl-3.0
-7,831,182,648,781,740,000
29.414894
198
0.551242
false
yannrouillard/weboob
modules/poivy/browser.py
2
2888
# -*- coding: utf-8 -*- # Copyright(C) 2013 Fourcot Florent # # This file is part of weboob. # # weboob 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 # (at your o...
agpl-3.0
6,548,889,652,903,258,000
30.391304
92
0.618767
false
pmghalvorsen/gramps_branch
gramps/gen/filters/rules/family/_memberbase.py
3
1917
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
871,916,708,985,938,700
33.854545
79
0.719875
false
Princu7/open-event-orga-server
app/models/speaker.py
7
5370
from app.helpers.versioning import clean_up_string, clean_html from app.models import db from app.helpers.helpers import ensure_social_link class Speaker(db.Model): """Speaker model class""" __tablename__ = 'speaker' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, nullable=Fal...
gpl-3.0
-6,421,023,573,535,674,000
35.040268
132
0.571508
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/key_vault_and_key_reference_py3.py
1
1500
# 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
-3,852,129,576,539,465,000
35.585366
82
0.600667
false
yordan-desta/QgisIns
python/plugins/processing/core/AlgorithmProvider.py
1
4825
# -*- coding: utf-8 -*- """ *************************************************************************** AlgorithmProvider.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
7,054,145,103,071,834,000
36.403101
77
0.573264
false
mozillazg/python-pinyin
pypinyin/style/finals.py
1
2173
# -*- coding: utf-8 -*- """韵母相关拼音风格: Style.FINALS Style.FINALS_TONE Style.FINALS_TONE2 Style.FINALS_TONE3 """ from __future__ import unicode_literals from pypinyin.constants import Style from pypinyin.style import register from pypinyin.style._constants import RE_TONE3 from pypinyin.standard import convert_finals fro...
mit
-2,118,293,914,438,749,700
26.90411
62
0.64163
false
tulsawebdevs/django-multi-gtfs
multigtfs/tests/test_service.py
2
3051
# # Copyright 2012-2014 John Whitlock # # 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 writ...
apache-2.0
2,180,882,623,893,636,900
36.207317
74
0.689282
false
boundlessgeo/QGIS
tests/src/python/test_qgsvalidityresultswidget.py
6
3113
# -*- coding: utf-8 -*- """QGIS Unit tests for validity results widget .. 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
6,473,184,253,258,920,000
44.779412
130
0.698362
false
dmlc/tvm
python/tvm/relay/data_dep_optimization/simplify_fc_transpose.py
4
1982
# 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 u...
apache-2.0
-7,829,170,379,208,612,000
32.033333
72
0.659435
false
lepture/oauthlib
tests/oauth1/rfc5849/test_signatures.py
2
13424
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals try: from urllib import quote except ImportError: from urllib.parse import quote from oauthlib.oauth1.rfc5849.signature import collect_parameters from oauthlib.oauth1.rfc5849.signature import construct_base_string from oauthlib.o...
bsd-3-clause
5,968,855,021,790,440,000
45.449827
79
0.623585
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/win32com/client/build.py
1
23871
"""Contains knowledge to build a COM object definition. This module is used by both the @dynamic@ and @makepy@ modules to build all knowledge of a COM object. This module contains classes which contain the actual knowledge of the object. This include parameter and return type information, the COM dispid and CLS...
epl-1.0
213,108,093,031,669,860
36.254808
159
0.660718
false
deepmind/surface-distance
surface_distance_test.py
1
14199
# Copyright 2018 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 ...
apache-2.0
645,911,862,099,925,400
37.479675
80
0.613423
false
osmanbaskaya/mapping-impact
run/pw-score-perp-calc.py
1
1989
#! /usr/bin/python # -*- coding: utf-8 -*- __author__ = "Osman Baskaya" """ This module calculates F1-Score and sense perplexity of each pseudoword for a given classifier """ import sys import os from tempfile import NamedTemporaryFile from collections import defaultdict as dd from multiprocessing import Pool from su...
mit
-196,228,552,919,871,800
25.52
84
0.655103
false
yajiedesign/mxnet
tests/python/unittest/test_subgraph_op.py
2
25902
# 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 u...
apache-2.0
-501,251,097,016,007,550
46.789668
106
0.643464
false
gem/oq-hazardlib
openquake/hazardlib/calc/__init__.py
1
1180
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2017 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
-4,664,859,067,582,426,000
42.703704
74
0.772034
false
lukas-krecan/tensorflow
tensorflow/python/platform/gfile.py
11
1205
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
7,308,468,893,456,987,000
40.551724
80
0.719502
false
marcosfede/algorithms
adventofcode/2018/7/p2.py
1
1255
import heapq from collections import defaultdict import re nodes = set() edges = defaultdict(set) with open('input') as f: for line in f: regex = r'Step (.) must be finished before step (.) can begin\.' match = re.match(regex, line) src, dest = match.group(1), match.group(2) nodes....
gpl-3.0
7,448,622,851,404,552,000
24.1
72
0.590438
false
githubmlai/numpy
numpy/core/setup.py
8
41303
from __future__ import division, print_function import imp import os import sys import pickle import copy import warnings from os.path import join from numpy.distutils import log from distutils.dep_util import newer from distutils.sysconfig import get_config_var from numpy.build_utils.apple_accelerate import uses_acce...
bsd-3-clause
5,261,013,120,446,992,000
41.188968
97
0.530058
false
simone-campagna/daikon
zirkon/toolbox/dictutils.py
2
3770
# -*- coding: utf-8 -*- # # Copyright 2013 Simone Campagna # # 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...
apache-2.0
-7,304,431,097,113,996,000
28.685039
81
0.593103
false
lcostantino/healing-os
healing/api/app.py
1
2032
# -*- coding: utf-8 -*- # # Copyright 2014 - Intel # # 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 app...
apache-2.0
-5,739,785,142,211,357,000
27.222222
77
0.649606
false
xiaom-GitHub/openthread
tests/scripts/thread-cert/Cert_6_5_01_ChildResetSynchronize.py
4
3434
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
bsd-3-clause
-3,673,567,928,461,065,000
35.147368
78
0.662784
false
onitake/ansible
lib/ansible/modules/network/f5/bigip_log_publisher.py
5
12922
#!/usr/bin/python # -*- 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-7,343,084,928,863,469,000
29.121212
92
0.602925
false
openstack/cinder
cinder/api/schemas/groups.py
3
4956
# Copyright (C) 2018 NTT DATA # 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 ...
apache-2.0
-7,871,887,999,568,972,000
27.647399
78
0.503228
false
indevgr/django
tests/forms_tests/field_tests/test_integerfield.py
4
5979
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.forms import IntegerField, Textarea, ValidationError from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class IntegerFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_integerfield_1(self): ...
bsd-3-clause
-4,634,796,334,554,950,000
42.948529
110
0.623222
false
jonathan-beard/edx-platform
cms/djangoapps/contentstore/features/component.py
14
6644
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # Lettuce formats proposed definitions for unimplemented steps with the # argument name "step" instead of "_step" and pylint does not like that. # pylint: disable=unused-argument from lettuce import world, step from nose.tools import assert_tr...
agpl-3.0
5,621,973,888,502,696,000
36.536723
103
0.653371
false
WatanabeYasumasa/edx-platform
common/djangoapps/terrain/stubs/http.py
19
8353
""" Stub implementation of an HTTP service. """ from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import urlparse import threading import json from functools import wraps from lazy import lazy from logging import getLogger LOGGER = getLogger(__name__) def require_params(method, *required_keys): """ ...
agpl-3.0
758,772,310,948,993,500
30.052045
110
0.565066
false
tensorflow/models
official/vision/detection/utils/object_detection/shape_utils.py
1
3608
# Copyright 2021 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
5,864,020,762,902,091,000
32.719626
79
0.709812
false
edgedb/edgedb
edb/errors/base.py
1
5179
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-present MagicStack Inc. and the EdgeDB authors. # # 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...
apache-2.0
4,119,359,837,803,341,000
29.28655
79
0.630044
false
jorsea/odoo-addons
product_template_search_by_ean13/__openerp__.py
8
1460
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
-2,418,287,399,865,728,000
36.435897
78
0.576712
false
hperala/kontuwikibot
pywikibot/families/wikibooks_family.py
1
7380
# -*- coding: utf-8 -*- """Family module for Wikibooks.""" from __future__ import unicode_literals from pywikibot import family __version__ = '$Id: 389c4f09d94b853d26a91486d518694d3d1ca38e $' # The Wikimedia family that is known as Wikibooks class Family(family.WikimediaFamily): """Family class for Wikibooks....
mit
-2,413,153,517,792,425,500
48.530201
157
0.626965
false
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/volumes/paths/path155.py
1
1061
import zstackwoodpecker.test_state as ts_header TestAction = ts_header.TestAction def path(): return dict(initial_formation="template2", path_list=[[TestAction.create_volume, "volume1", "=scsi"], \ [TestAction.attach_volume, "vm1", "volume1"], \ [TestAction.detach_volume, "volume1"], \ [TestAction.reboot_vm, ...
apache-2.0
2,246,609,339,134,716,000
47.227273
74
0.686145
false
thopiekar/Cura
cura/Settings/PerObjectContainerStack.py
1
3365
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Any, Optional from UM.Application import Application from UM.Decorators import override from UM.Settings.Interfaces import PropertyEvaluationContext from UM.Settings.SettingInstance import InstanceState ...
lgpl-3.0
-3,890,242,072,327,734,000
44.472973
119
0.671322
false
LinuxChristian/home-assistant
tests/components/lock/test_demo.py
22
1480
"""The tests for the Demo lock platform.""" import unittest from homeassistant.setup import setup_component from homeassistant.components import lock from tests.common import get_test_home_assistant FRONT = 'lock.front_door' KITCHEN = 'lock.kitchen_door' class TestLockDemo(unittest.TestCase): """Test the demo...
apache-2.0
-5,968,172,991,669,416,000
28.6
65
0.629054
false
sorenh/cc
vendor/Twisted-10.0.0/doc/core/examples/dbcred.py
3
6879
#!/usr/bin/env python # Copyright (c) 2001-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Simple example of a db checker: define a L{ICredentialsChecker} implementation that deals with a database backend to authenticate a user. """ from twisted.cred import error from twisted.cred.credentials import...
apache-2.0
-7,243,590,942,366,937,000
37.430168
79
0.615933
false
mancoast/CPythonPyc_test
cpython/223_test_math.py
5
6022
# Python test set -- math module # XXXX Should not do tests around zero only from test_support import * seps='1e-05' eps = eval(seps) print 'math module, testing with eps', seps import math def testit(name, value, expected): if abs(value-expected) > eps: raise TestFailed, '%s returned %f, expected %f'%\ ...
gpl-3.0
-3,319,627,338,319,984,000
29.882051
86
0.611425
false
MattNolanLab/ei-attractor
grid_cell_model/simulations/simulation_demo/default_params.py
2
6183
# # default_params.py # # Default neuron and network parameters # # Copyright (C) 2012 Lukas Solanka <l.solanka@sms.ed.ac.uk> # # 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 F...
gpl-3.0
-8,143,654,244,704,845,000
41.9375
100
0.336568
false
jhseu/tensorflow
tensorflow/compiler/aot/tests/make_test_graphs.py
1
7775
# Lint as: python2, python3 # 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 # ...
apache-2.0
4,341,346,972,946,254,000
33.709821
80
0.683344
false
openaid-IATI/OIPA
OIPA/api/transaction/tests/test_transaction_aggregation.py
2
6552
from decimal import Decimal from django.test import TestCase from rest_framework.test import APIClient from iati.factory import iati_factory from iati.transaction import factories as transaction_factory class TransactionAggregationTestCase(TestCase): def setUp(self): """ set up 2 activities. th...
agpl-3.0
-4,018,049,694,509,657,600
35
79
0.609432
false
edofic/ggrc-core
test/integration/ggrc/services/test_custom_attributes.py
6
11395
# Copyright (C) 2016 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests for PUT and POST requests for objects with custom attributes These tests include: - Creating an object with custom attributes (POST request). - Editing existing custom attributes on an object. - Ad...
apache-2.0
3,621,041,103,040,772,000
32.125
78
0.537253
false
RamezIssac/django-datatable-view
ra_datatableview/views.py
1
26039
import simplejson as json import re import operator import logging try: from functools import reduce except ImportError: pass from django.views.generic.list import ListView, MultipleObjectMixin from django.http import HttpResponse, HttpResponseBadRequest from django.core.exceptions import ObjectDoesNotExist fr...
apache-2.0
446,043,822,910,801,660
39.685938
231
0.568148
false
saintbird/django-cms
cms/test_utils/fixtures/navextenders.py
46
1057
# -*- coding: utf-8 -*- from __future__ import with_statement from cms.api import create_page from cms.models.pagemodel import Page class NavextendersFixture(object): def create_fixtures(self): """ Tree from fixture: page1 page2 page3 pa...
bsd-3-clause
1,900,532,495,443,964,700
35.448276
96
0.566698
false
BurntSushi/nflfan
nflfan/provider.py
1
24616
from __future__ import absolute_import, division, print_function from collections import namedtuple import json import os import re import sys import time import requests from bs4 import BeautifulSoup import nfldb import nflfan.config __pdoc__ = {} _user_agent = 'Mozilla/5.0 (X11; Linux x86_64)' # _user_agent = ...
unlicense
1,224,262,221,576,702,000
33.188889
121
0.56252
false