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
iarroyof/distributionalSemanticStabilityThesis
mklObj.py
2
55729
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys __author__ = 'Ignacio Arroyo-Fernandez' from modshogun import * from tools.load import LoadMatrix from sklearn.metrics import r2_score import random from math import sqrt import numpy from os import getcwd from sys import stderr from pdb import set_trace as...
gpl-2.0
4,751,117,838,187,217,000
49.478261
203
0.637938
false
dharmabumstead/ansible
lib/ansible/modules/clustering/k8s/k8s_raw.py
18
4093
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Chris Houseknecht <@chouseknecht> # 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
5,013,787,274,289,695,000
24.110429
105
0.658441
false
EnTeQuAk/django-allauth
allauth/socialaccount/providers/facebook/south_migrations/0003_tosocialaccount.py
82
8978
# encoding: utf-8 from south.v2 import DataMigration class Migration(DataMigration): depends_on = (('socialaccount', '0002_genericmodels'),) def forwards(self, orm): # Migrate FB apps app_id_to_sapp = {} for app in orm.FacebookApp.objects.all(): sapp = orm['socialaccount.S...
mit
3,415,711,191,397,401,000
63.589928
182
0.537202
false
asimonov-im/boinc
sched/assimilator.py
28
10954
#!/usr/bin/env python ''' Generic Assimilator framework ''' import os, re, signal, sys, time, hashlib import boinc_path_config from Boinc import database, boinc_db, boinc_project_path, configxml, sched_messages # Peter Norvig's Abstract base class hack def abstract(): """ This function is not necessary, but p...
gpl-3.0
-4,082,752,531,128,119,000
35.635452
91
0.566642
false
ligaturee/ansible-modules-extras
cloud/centurylink/clc_server.py
49
50314
#!/usr/bin/python # # Copyright (c) 2015 CenturyLink # # 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 la...
gpl-3.0
-3,804,365,891,682,560,000
35.645302
120
0.566979
false
jyotikamboj/container
django/contrib/gis/db/backends/postgis/creation.py
87
3505
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation class PostGISCreation(DatabaseCreation): geom_index_type = 'GIST' geom_index_ops = 'GIST_GEOMETRY_OPS' geom_index_ops_nd = 'GIST_GEOMETRY_OPS_ND' def sql_indexes_for_field(self, model, f, style): "Return any spatial ...
mit
-1,945,298,335,484,753,000
47.680556
86
0.489872
false
pli3/enigma2-pli
lib/python/Plugins/Extensions/DVDPlayer/plugin.py
9
3144
import os from Components.config import config from Tools.Directories import pathExists, fileExists from Plugins.Plugin import PluginDescriptor from Components.Harddisk import harddiskmanager detected_DVD = None def main(session, **kwargs): from Screens import DVD session.open(DVD.DVDPlayer) def play(session, **kw...
gpl-2.0
2,518,299,830,168,845,000
31.75
137
0.708969
false
mandeepdhami/horizon
openstack_dashboard/dashboards/admin/metering/views.py
51
6870
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
-1,383,926,962,966,380,000
38.482759
78
0.527802
false
robertodr/autocmake
autocmake/generate.py
5
8504
def gen_cmake_command(config): """ Generate CMake command. """ from autocmake.extract import extract_list s = [] s.append("\n\ndef gen_cmake_command(options, arguments):") s.append(' """') s.append(" Generate CMake command based on options and arguments.") s.append(' """') ...
bsd-3-clause
3,656,157,017,505,442,300
37.306306
153
0.632643
false
devanlai/pyOCD
pyOCD/target/target_kinetis.py
5
6593
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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,981,168,604,314,440,000
38.244048
159
0.61535
false
okuta/chainer
chainer/types.py
4
2270
import numbers import typing as tp # NOQA import typing_extensions as tpe # NOQA try: from typing import TYPE_CHECKING # NOQA except ImportError: # typing.TYPE_CHECKING doesn't exist before Python 3.5.2 TYPE_CHECKING = False # import chainer modules only for type checkers to avoid circular import if TY...
mit
7,340,583,681,865,399,000
23.148936
87
0.68326
false
jlmadurga/django-oscar
src/oscar/apps/dashboard/users/views.py
19
8320
from django.conf import settings from django.contrib import messages from django.core.urlresolvers import reverse from django.db.models import Q from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ from django.views.generic import ( DeleteView, DetailView, FormView, ListView...
bsd-3-clause
-8,218,051,795,522,424,000
35.017316
78
0.617308
false
sfstpala/Victory-Chat
cherrypy/test/test_auth_digest.py
42
4553
# This file is part of CherryPy <http://www.cherrypy.org/> # -*- coding: utf-8 -*- # vim:ts=4:sw=4:expandtab:fileencoding=utf-8 import cherrypy from cherrypy.lib import auth_digest from cherrypy.test import helper class DigestAuthTest(helper.CPWebCase): def setup_server(): class Root: def i...
isc
-3,314,657,154,382,807,600
38.591304
167
0.576323
false
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/features/wikibase/util.py
3
1550
class DictDiff: """ Represents the difference between two dictionaries """ __slots__ = ('added', 'removed', 'intersection', 'changed', 'unchanged') def __init__(self, added, removed, intersection, changed, unchanged): self.added = added """ `set` ( `mixed` ) : Keys that were...
mit
-3,626,847,046,564,687,400
25.271186
76
0.514194
false
dibenede/NFD-ICN2014
ICN2014-apps/consumer.py
2
4500
# -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ # # Copyright (c) 2013-2014 Regents of the University of California. # Copyright (c) 2014 Susmit Shannigrahi, Steve DiBenedetto # # This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions). # # ndn-cxx library is free software...
gpl-3.0
-2,621,243,482,082,429,000
32.58209
197
0.650889
false
Eric89GXL/scipy
scipy/optimize/tests/test_lsq_common.py
11
8749
from __future__ import division, absolute_import, print_function from numpy.testing import assert_, assert_allclose, assert_equal from pytest import raises as assert_raises import numpy as np from scipy.sparse.linalg import LinearOperator from scipy.optimize._lsq.common import ( step_size_to_bound, find_active_co...
bsd-3-clause
-5,684,958,390,232,676,000
30.814545
78
0.530461
false
sumedh123/debatify
venv/lib/python2.7/site-packages/pip/utils/build.py
899
1312
from __future__ import absolute_import import os.path import tempfile from pip.utils import rmtree class BuildDirectory(object): def __init__(self, name=None, delete=None): # If we were not given an explicit directory, and we were not given an # explicit delete option, then we'll default to del...
mit
-3,734,610,804,674,756,600
30.238095
79
0.602134
false
joshuaspence/ThesisCode
MATLAB/Lib/matlab_bgl-4.0.1/libmbgl/boost1.36/libs/python/pyste/src/Pyste/exporterutils.py
54
3331
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) ''' Various helpers for interface files. ''' from settings import * from policies impor...
gpl-3.0
72,976,796,314,474,020
37.287356
79
0.567397
false
houlixin/BBB-TISDK
linux-devkit/sysroots/i686-arago-linux/usr/lib/python2.7/encodings/hex_codec.py
528
2309
""" Python 'hex_codec' Codec - 2-digit hex content transfer encoding Unlike most of the other codecs which target Unicode, this codec will return Python string objects for both encode and decode. Written by Marc-Andre Lemburg (mal@lemburg.com). """ import codecs, binascii ### Codec APIs def hex_encode(...
gpl-2.0
7,160,427,932,226,569,000
28.227848
68
0.686444
false
V11/volcano
server/sqlmap/thirdparty/chardet/euckrprober.py
236
1672
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
-1,712,874,008,233,023,500
39.780488
69
0.718301
false
coffenbacher/askbot-devel
askbot/importers/stackexchange/models.py
21
14019
from django.db import models class Badge(models.Model): id = models.IntegerField(primary_key=True) class_type = models.IntegerField(null=True) name = models.CharField(max_length=50, null=True) description = models.TextField(null=True) single = models.NullBooleanField(null=True) secret = models.N...
gpl-3.0
-1,488,731,204,014,411,500
50.922222
124
0.733576
false
davidwaroquiers/abiflows
abiflows/fireworks/utils/custodian_utils.py
2
3730
import abc from custodian.custodian import ErrorHandler, Validator #TODO: do we stick to custodian's ErrorHandler/Validator inheritance ?? class SRCErrorHandler(ErrorHandler): HANDLER_PRIORITIES = {'PRIORITY_FIRST': 0, 'PRIORITY_VERY_HIGH': 1, 'PRIORITY_HIGH':...
gpl-2.0
1,931,065,653,369,522,000
29.57377
71
0.589276
false
oinopion/django
tests/utils_tests/test_module_loading.py
281
9516
import imp import os import sys import unittest from importlib import import_module from zipimport import zipimporter from django.test import SimpleTestCase, modify_settings from django.test.utils import extend_sys_path from django.utils import six from django.utils._os import upath from django.utils.module_loading im...
bsd-3-clause
236,576,731,916,279,170
38.983193
112
0.655633
false
brian-l/django-1.4.10
tests/regressiontests/admin_views/admin.py
18
19542
# -*- coding: utf-8 -*- from __future__ import absolute_import import tempfile import os from django import forms from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.core.files.storage import FileSystemStorage from django.core.mail import EmailMessage from django.conf.u...
bsd-3-clause
-3,797,134,043,349,487,600
29.064615
93
0.685703
false
yannrouillard/weboob
modules/arte/video.py
2
1250
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Christophe Benz # # 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 yo...
agpl-3.0
4,965,366,698,261,835,000
30.25
84
0.6896
false
ncoghlan/prototype
integration-tests/features/steps/cockpit_demo.py
2
14754
"""Steps to test the demonstration Cockpit plugin""" from behave import given, when, then from hamcrest import ( assert_that, equal_to, greater_than, greater_than_or_equal_to ) @given("Cockpit is installed on the testing host") def check_cockpit_is_installed(context): """Checks for the `cockpit-bridge` command...
lgpl-2.1
4,128,819,085,334,917,000
42.522124
99
0.634675
false
ulikoehler/UliEngineering
UliEngineering/Electronics/MOSFET.py
1
1960
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Utility to calculate MOSFETs """ import numpy as np from UliEngineering.EngineerIO import normalize_numeric from UliEngineering.Units import Unit __all__ = ["mosfet_gate_charge_losses", "mosfet_gate_charge_loss_per_cycle"] def mosfet_gate_charge_losses(total_gate_cha...
apache-2.0
2,482,209,518,004,200,000
35.296296
109
0.701531
false
yuchangfu/pythonfun
flaskenv/Lib/site-packages/pip/commands/show.py
344
2767
import os from pip.basecommand import Command from pip.log import logger from pip._vendor import pkg_resources class ShowCommand(Command): """Show information about one or more installed packages.""" name = 'show' usage = """ %prog [options] <package> ...""" summary = 'Show information about in...
gpl-3.0
5,698,749,515,757,753,000
33.5875
75
0.568486
false
zpincus/celltool
celltool/utility/image.py
1
1424
# Copyright 2007 Zachary Pincus # This file is part of CellTool. # # CellTool is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. """Tools to read and write numpy arrays from and to image files. """ ...
gpl-2.0
3,721,460,240,594,580,000
36.473684
129
0.702247
false
AlphaStaxLLC/tornado
tornado/test/testing_test.py
144
7361
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import gen, ioloop from tornado.log import app_log from tornado.testing import AsyncTestCase, gen_test, ExpectLog from tornado.test.util import unittest import contextlib import os import traceback @...
apache-2.0
-3,858,222,051,311,614,000
30.728448
83
0.599511
false
AlperSaltabas/OR_Tools_Google_API
examples/python/alldifferent_except_0.py
32
3637
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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 applicable ...
apache-2.0
3,366,076,094,530,906,600
28.569106
74
0.681056
false
cschnei3/forseti-security
tests/inventory/pipelines/test_data/fake_buckets.py
3
4791
# Copyright 2017 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 required by applicable law or agreed to in writing, s...
apache-2.0
2,028,861,380,523,940,400
42.554545
367
0.583594
false
alexgibson/bedrock
lib/fluent_migrations/firefox/set-as-default/landing.py
6
6217
from __future__ import absolute_import import fluent.syntax.ast as FTL from fluent.migrate.helpers import transforms_from from fluent.migrate.helpers import VARIABLE_REFERENCE, TERM_REFERENCE from fluent.migrate import REPLACE, COPY whatsnew_73 = "firefox/whatsnew_73.lang" def migrate(ctx): """Migrate bedrock/fir...
mpl-2.0
-2,111,450,246,619,000,000
48.688
188
0.518757
false
PriceChild/ansible
contrib/inventory/zone.py
57
1489
#!/usr/bin/env python # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # # 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 # ...
gpl-3.0
182,314,048,696,642,080
33.627907
83
0.687038
false
FujitsuEnablingSoftwareTechnologyGmbH/tempest
tempest/api/orchestration/stacks/test_templates.py
4
2155
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
5,518,884,974,646,020,000
32.671875
78
0.668213
false
Mirantis/tempest
tempest/openstack/common/fixture/lockutils.py
15
1890
# Copyright 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 req...
apache-2.0
1,651,202,735,555,117,300
36.058824
79
0.680423
false
SKA-ScienceDataProcessor/algorithm-reference-library
workflows/serial/imaging/imaging_serial.py
1
21976
"""Manages the imaging context. This take a string and returns a dictionary containing: * Predict function * Invert function * image_iterator function * vis_iterator function """ __all__ = ['predict_list_serial_workflow', 'invert_list_serial_workflow', 'residual_list_serial_workflow', 'restore_list_ser...
apache-2.0
-4,444,415,177,807,086,600
41.180422
118
0.623225
false
anthill-platform/anthill-exec
anthill/exec/options.py
1
1753
from anthill.common.options import define # Main define("host", default="http://localhost:9507", help="Public hostname of this service", type=str) define("listen", default="port:9507", help="Socket to listen. Could be a port number (port:N), or a unix domain socket (unix:PATH)", ...
mit
-7,595,907,881,905,282,000
21.189873
101
0.601825
false
TeslaProject/external_chromium_org
build/android/pylib/instrumentation/test_result.py
110
1183
# 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. from pylib.base import base_test_result class InstrumentationTestResult(base_test_result.BaseTestResult): """Result information for a single instrume...
bsd-3-clause
-8,748,805,147,472,209,000
33.794118
78
0.677937
false
domijin/Pset
assignment1/q2_sigmoid.py
1
1346
import numpy as np def sigmoid(x): """ Compute the sigmoid function for the input here. """ x = 1./(1 + np.exp(-x)) return x def sigmoid_grad(f): """ Compute the gradient for the sigmoid function here. Note that for this implementation, the input f should be the sigmoid f...
mit
-2,472,550,393,974,548,500
23.925926
66
0.586924
false
google/llvm-propeller
lldb/test/API/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
4
3374
""" Test watchpoint condition API. """ from __future__ import print_function import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class WatchpointConditionAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) NO_DEBUG_INFO_...
apache-2.0
7,726,554,952,393,700,000
34.515789
79
0.622407
false
jfantom/incubator-airflow
tests/contrib/hooks/test_spark_sql_hook.py
16
3922
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-7,843,620,243,679,064,000
34.017857
152
0.596379
false
newemailjdm/scipy
scipy/integrate/tests/test_quadpack.py
19
12363
from __future__ import division, print_function, absolute_import import sys import math import numpy as np from numpy import sqrt, cos, sin, arctan, exp, log, pi, Inf from numpy.testing import (assert_, TestCase, run_module_suite, dec, assert_allclose, assert_array_less, assert_almost_equal) from scipy.integra...
bsd-3-clause
-4,132,021,473,130,172,000
32.686649
86
0.5201
false
blueskycoco/rt-thread
bsp/stm32/stm32f103-onenet-nbiot/rtconfig.py
14
4024
import os # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute...
gpl-2.0
-3,277,084,581,247,337,000
25.649007
152
0.561382
false
CodeRiderz/rojak
rojak-analyzer/show_data_stats.py
4
2488
import csv from collections import Counter import re from bs4 import BeautifulSoup csv_file = open('data_detikcom_labelled_740.csv') csv_reader = csv.DictReader(csv_file) words = [] docs = [] label_counter = {} unique_label_counter = {} for row in csv_reader: title = row['title'].strip().lower() raw_content ...
bsd-3-clause
-6,003,033,714,906,896,000
26.955056
63
0.602492
false
cpe/VAMDC-VALD
nodes/tipbase/node/queryfunc.py
2
9280
# -*- coding: utf-8 -*- # # This module (which must have the name queryfunc.py) is responsible # for converting incoming queries to a database query understood by # this particular node's database schema. # # This module must contain a function setupResults, taking a sql object # as its only argument. # # library im...
gpl-3.0
-1,581,240,502,995,056,000
31.110727
125
0.675539
false
JamesClough/networkx
examples/drawing/giant_component.py
15
2287
#!/usr/bin/env python """ This example illustrates the sudden appearance of a giant connected component in a binomial random graph. Requires pygraphviz and matplotlib to draw. """ # Copyright (C) 2006-2016 # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov>...
bsd-3-clause
7,517,144,974,051,697,000
27.949367
77
0.589856
false
yamahata/neutron
neutron/plugins/vmware/api_client/request.py
7
12120
# Copyright 2012 VMware, 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
5,499,473,022,401,385,000
41.229965
79
0.529455
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/django/utils/translation/trans_null.py
467
1408
# These are versions of the functions in django.utils.translation.trans_real # that don't actually do anything. This is purely for performance, so that # settings.USE_I18N = False can use this module rather than trans_real.py. from django.conf import settings from django.utils.encoding import force_text def ngettext...
bsd-3-clause
-5,247,082,747,347,013,000
23.701754
77
0.721591
false
pombreda/syzygy
third_party/numpy/files/numpy/distutils/fcompiler/g95.py
94
1313
# http://g95.sourceforge.net/ from numpy.distutils.fcompiler import FCompiler compilers = ['G95FCompiler'] class G95FCompiler(FCompiler): compiler_type = 'g95' description = 'G95 Fortran Compiler' # version_pattern = r'G95 \((GCC (?P<gccversion>[\d.]+)|.*?) \(g95!\) (?P<version>.*)\).*' # $ g95 --ver...
apache-2.0
-6,992,905,948,343,536,000
28.840909
105
0.530845
false
centricular/cerbero
cerbero/commands/build.py
1
3560
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # 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; eit...
lgpl-2.1
-5,947,529,026,135,603,000
39
84
0.597753
false
alangwansui/mtl_ordercenter
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py
384
8450
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
8,974,592,544,217,426,000
43.473684
168
0.606509
false
agile-geoscience/seisplot
notice.py
1
1873
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Notices during runtime. :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ class Notice(object): """ Helper class to make printout more readable. """ styles = {'HEADER': '\033[95m', 'INFO': '\033[94m', # blue '...
apache-2.0
-8,828,764,164,858,055,000
24.57971
75
0.471388
false
ptdtan/Ragout
lib/networkx/exception.py
41
1660
# -*- coding: utf-8 -*- """ ********** Exceptions ********** Base exceptions and errors for NetworkX. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg...
gpl-3.0
-693,232,099,482,927,400
32.16
153
0.73462
false
IRI-Research/django
django/core/management/commands/inspectdb.py
6
11091
from __future__ import unicode_literals from collections import OrderedDict import keyword import re from optparse import make_option from django.core.management.base import NoArgsCommand, CommandError from django.db import connections, DEFAULT_DB_ALIAS class Command(NoArgsCommand): help = "Introspects the data...
bsd-3-clause
1,390,244,335,107,470,600
44.085366
114
0.52475
false
virtualelephant/openstack-heat-bde-plugin
scripts/createRestAPI.py
1
2262
#!/usr/bin/python # Testing module for REST API code in BDE # # Chris Mutchler - chris@virtualelephant.com # http://www.VirtualElephant.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...
apache-2.0
-1,452,937,556,992,857,600
26.925926
109
0.729001
false
jcfr/girder
tests/cases/access_test.py
1
5001
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2014 Kitware 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 cop...
apache-2.0
-1,472,799,096,683,289,000
31.686275
80
0.589282
false
jimsimon/sky_engine
third_party/jinja2/tests.py
638
3444
# -*- coding: utf-8 -*- """ jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re from jinja2.runtime import Undefined from jinja2._compat import text_type, string_types, mappi...
bsd-3-clause
8,530,965,320,924,734,000
22.114094
73
0.594077
false
chirilo/kitsune
kitsune/upload/tests/test_models.py
17
1259
from django.contrib.contenttypes.models import ContentType from django.core.files import File from nose.tools import eq_ from kitsune.questions.tests import question from kitsune.sumo.tests import TestCase from kitsune.upload.models import ImageAttachment from kitsune.upload.tasks import generate_thumbnail from kitsu...
bsd-3-clause
4,742,437,298,624,371,000
33.972222
76
0.698967
false
darisandi/geonode
geonode/social/signals.py
2
9849
######################################################################### # # Copyright (C) 2012 OpenPlans # # 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 #...
gpl-3.0
-2,680,490,337,925,870,000
42.197368
117
0.652249
false
0x0all/scikit-learn
sklearn/manifold/tests/test_t_sne.py
10
9541
import sys from sklearn.externals.six.moves import cStringIO as StringIO import numpy as np import scipy.sparse as sp from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_equal from sklearn.utils.testing import assert_less from sklearn.utils.testing import assert_raises_regexp ...
bsd-3-clause
-45,300,304,403,392,630
35.003774
79
0.626873
false
Johnetordoff/osf.io
osf_tests/test_search_views.py
6
15204
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import pytest from nose.tools import * # noqa: F403 from osf_tests import factories from tests.base import OsfTestCase from website.util import api_url_for from website.views import find_bookmark_collection @...
apache-2.0
6,924,549,850,251,762,000
44.25
152
0.545251
false
colonelnugget/pychess
testing/eval.py
21
2202
import unittest from pychess.Utils.const import * from pychess.Utils.lutils.LBoard import LBoard from pychess.Utils.lutils.leval import evaluateComplete from pychess.Utils.lutils import leval class EvalTestCase(unittest.TestCase): def setUp (self): self.board = LBoard(NORMALCHESS) self.boar...
gpl-3.0
-2,355,220,881,972,958,700
35.7
84
0.599001
false
Farkal/kivy
kivy/core/image/img_tex.py
54
1548
''' Tex: Compressed texture ''' __all__ = ('ImageLoaderTex', ) import json from struct import unpack from kivy.logger import Logger from kivy.core.image import ImageLoaderBase, ImageData, ImageLoader class ImageLoaderTex(ImageLoaderBase): @staticmethod def extensions(): return ('tex', ) def lo...
mit
2,618,830,294,913,861,000
26.157895
71
0.537468
false
saisai/phantomjs
src/breakpad/src/tools/gyp/pylib/gyp/generator/xcode.py
137
50429
#!/usr/bin/python # Copyright (c) 2009 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import posixpath import re import shutil import subprocess imp...
bsd-3-clause
8,718,310,460,114,508,000
43.470018
80
0.655377
false
tcoxon/association
google.py
1
1780
import json, time from math import log from urllib import quote_plus import urllib2 _COUNT_URL = 'https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=' _AUTOCOMPLETE_URL = 'http://suggestqueries.google.com/complete/search?client=chrome&q=' _GOOGLE_ENCODING = 'latin-1' _last_query_time = 0.0 _QUERY_DELAY =...
bsd-3-clause
-5,526,467,623,473,082,000
24.797101
87
0.600562
false
dellax/django-files-widget
topnotchdev/files_widget/settings.py
1
1103
from django.conf import settings FILES_DIR = getattr(settings, 'FILES_WIDGET_FILES_DIR', 'uploads/files_widget/') OLD_VALUE_STR = getattr(settings, 'FILES_WIDGET_OLD_VALUE_STR', 'old_%s_value') DELETED_VALUE_STR = getattr(settings, 'FILES_WIDGET_DELETED_VALUE_STR', 'deleted_%s_value') MOVED_VALUE_STR = getattr(setting...
mit
-1,448,785,252,150,470,700
67.9375
133
0.74252
false
ladybug-analysis-tools/honeybee
honeybee/radiance/command/gendaymtx.py
1
4200
# coding=utf-8 from _commandbase import RadianceCommand from ..parameters.gendaymtx import GendaymtxParameters import os class Gendaymtx(RadianceCommand): u""" gendaymtx - Generate an annual Perez sky matrix from a weather tape. Attributes: output_name: An optional name for output file name. If ...
gpl-3.0
-5,121,866,229,592,809,000
37.53211
84
0.640714
false
postlund/home-assistant
homeassistant/components/cloudflare/__init__.py
13
2256
"""Update the IP addresses of your Cloudflare DNS records.""" from datetime import timedelta import logging from pycfdns import CloudflareUpdater import voluptuous as vol from homeassistant.const import CONF_API_KEY, CONF_EMAIL, CONF_ZONE import homeassistant.helpers.config_validation as cv from homeassistant.helpers...
apache-2.0
4,991,089,331,319,314,000
29.486486
81
0.670213
false
PGower/Unsync
unsync_timetabler/unsync_timetabler/ptf9/student_timetable_import.py
1
1359
"""Timetabler PTF9 import functions.""" import unsync import petl @unsync.command() @unsync.option('--input-file', '-i', type=unsync.Path(exists=True, dir_okay=False, readable=True, resolve_path=True), help='Timetabler PTF9 file to extract data from.', required=True) @unsync.option('--destination', '-d', required=Tru...
apache-2.0
7,594,038,102,366,328,000
60.772727
183
0.632082
false
shacker/django
tests/m2o_recursive/tests.py
71
1678
from django.test import TestCase from .models import Category, Person class ManyToOneRecursiveTests(TestCase): def setUp(self): self.r = Category(id=None, name='Root category', parent=None) self.r.save() self.c = Category(id=None, name='Child category', parent=self.r) self.c.save...
bsd-3-clause
-5,077,420,167,380,638,000
39.926829
90
0.626937
false
sadleader/odoo
addons/stock_account/wizard/__init__.py
351
1105
# -*- 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
-5,294,511,935,478,762,000
43.2
78
0.628054
false
Mistobaan/tensorflow
tensorflow/python/util/compat.py
58
3499
# 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
-30,710,797,128,740,944
25.915385
80
0.678765
false
leppa/home-assistant
homeassistant/components/sql/sensor.py
5
4817
"""Sensor from an SQL Query.""" import datetime import decimal import logging import sqlalchemy from sqlalchemy.orm import scoped_session, sessionmaker import voluptuous as vol from homeassistant.components.recorder import CONF_DB_URL, DEFAULT_DB_FILE, DEFAULT_URL from homeassistant.components.sensor import PLATFORM_...
apache-2.0
-1,592,087,942,554,482,200
30.077419
88
0.607224
false
huggingface/transformers
src/transformers/models/vit/convert_vit_timm_to_pytorch.py
2
9959
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # 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,603,102,298,172,927,000
39.64898
117
0.641731
false
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/lunch/tests/test_lunch.py
345
5045
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-6,484,639,792,362,439,000
53.847826
161
0.646977
false
rwl/muntjac
muntjac/data/validatable.py
1
2850
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ """Interface for validatable objects.""" class IValidatable(object): """Interface for validatable objects. Defines methods to verify if the object's value is valid or not, and to add, remove and list registered validators of the object. @author: Vaadin Ltd. ...
apache-2.0
6,367,159,937,781,479,000
31.022472
79
0.652982
false
gkumar7/AlGDock
AlGDock/BindingPMF.py
2
149901
#!/usr/bin/env python import os # Miscellaneous operating system interfaces from os.path import join import cPickle as pickle import gzip import copy import time import numpy as np import MMTK import MMTK.Units from MMTK.ParticleProperties import Configuration from MMTK.ForceFields import ForceField import Scientif...
mit
-5,246,218,502,270,748,000
38.179561
188
0.579549
false
imsuwj/noambox
model.py
1
1420
''' Provide the Data Model ''' import time class Config(object): def __init__(self): self.play = Playing() self.use_netease_source = False self.scroll_lryic = False self.enable_rpc = False class Playing(object): def __init__(self): self.title = '' self.singer...
mit
-8,553,047,898,957,027,000
19
46
0.492958
false
GageGaskins/osf.io
website/exceptions.py
7
1484
from website.tokens.exceptions import TokenError class OSFError(Exception): """Base class for exceptions raised by the Osf application""" pass class NodeError(OSFError): """Raised when an action cannot be performed on a Node model""" pass class NodeStateError(NodeError): """Raised when the Node...
apache-2.0
-4,835,112,011,316,159,000
33.511628
95
0.733154
false
pinpong/android_kernel_htc_m7-gpe
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
6,643,414,628,909,160,000
29.227273
70
0.654887
false
bitifirefly/edx-platform
lms/djangoapps/instructor/management/tests/test_openended_commands.py
106
8584
"""Test the openended_post management command.""" from datetime import datetime import json from mock import patch from pytz import UTC from django.conf import settings from opaque_keys.edx.locations import Location import capa.xqueue_interface as xqueue_interface from courseware.courses import get_course_with_acces...
agpl-3.0
-1,270,103,840,815,903,700
43.708333
159
0.683947
false
LifeDJIK/S.H.I.V.A.
containers/shiva/hazelcast/protocol/codec/client_add_membership_listener_codec.py
2
2425
from hazelcast.serialization.bits import * from hazelcast.protocol.client_message import ClientMessage from hazelcast.protocol.custom_codec import * from hazelcast.util import ImmutableLazyDataList from hazelcast.protocol.codec.client_message_type import * from hazelcast.protocol.event_response_const import * REQUEST_...
mit
-4,796,273,323,283,124,000
40.101695
146
0.718763
false
sysadmin75/ansible
test/support/integration/plugins/modules/postgresql_user.py
51
34084
#!/usr/bin/python # -*- coding: utf-8 -*- # 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': [...
gpl-3.0
4,800,152,462,706,088,000
35.768069
132
0.625601
false
turian/batchtrain
hyperparameters.py
1
5497
from locals import * from collections import OrderedDict import itertools import sklearn.linear_model import sklearn.svm import sklearn.ensemble import sklearn.neighbors import sklearn.semi_supervised import sklearn.naive_bayes # Code from http://rosettacode.org/wiki/Power_set#Python def list_powerset2(lst): ret...
bsd-3-clause
1,493,276,168,849,015,300
31.916168
81
0.525741
false
GeotrekCE/Geotrek-admin
mapentity/decorators.py
2
5841
from functools import wraps from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_control from django.views.decorators.http import last_modified as cache_last_modified from django.utils.translation import gettext_lazy as _ from django.core.exceptions import PermissionDeni...
bsd-2-clause
2,031,066,341,462,398,000
37.176471
95
0.587913
false
ybellavance/python-for-android
python3-alpha/python3-src/Lib/test/test_keywordonlyarg.py
49
6367
#!/usr/bin/env python3 """Unit tests for the keyword only argument specified in PEP 3102.""" __author__ = "Jiwon Seo" __email__ = "seojiwon at gmail dot com" import unittest from test.support import run_unittest def posonly_sum(pos_arg1, *arg, **kwarg): return pos_arg1 + sum(arg) + sum(kwarg.values()) def keywo...
apache-2.0
-8,380,046,481,938,432,000
36.674556
79
0.571384
false
joelpinheiro/safebox-smartcard-auth
Server/veserver/lib/python2.7/site-packages/cherrypy/lib/covercp.py
58
11592
"""Code-coverage tools for CherryPy. To use this module, or the coverage tools in the test suite, you need to download 'coverage.py', either Gareth Rees' `original implementation <http://www.garethrees.org/2001/12/04/python-coverage/>`_ or Ned Batchelder's `enhanced version: <http://www.nedbatchelder.com/code/modules/...
gpl-2.0
-7,136,922,001,951,756,000
28.953488
78
0.532781
false
evandavid/dodolipet
yowsup/layers/axolotl/store/sqlite/litesessionstore.py
53
2155
from axolotl.state.sessionstore import SessionStore from axolotl.state.sessionrecord import SessionRecord class LiteSessionStore(SessionStore): def __init__(self, dbConn): """ :type dbConn: Connection """ self.dbConn = dbConn dbConn.execute("CREATE TABLE IF NOT EXISTS session...
gpl-3.0
4,390,099,787,692,329,000
36.807018
106
0.633875
false
thelastpickle/python-driver
tests/integration/cqlengine/columns/test_static_column.py
3
3323
# Copyright DataStax, 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 agreed to in writing, softwa...
apache-2.0
1,413,245,784,554,717,700
34.351064
102
0.694252
false
lifemapper/core
LmCompute/plugins/multi/calculate/calculate.py
1
9421
"""Module containing functions to calculate PAM statistics Todo: Convert to use Matrix instead of numpy matrices """ import numpy as np from LmCommon.common.lmconstants import PamStatKeys, PhyloTreeKeys from LmCompute.plugins.multi.calculate import ot_phylo from lmpy import Matrix # ...............................
gpl-3.0
-1,875,603,392,488,939,300
38.091286
79
0.54697
false
awamper/draobpilc
draobpilc/widgets/items_view.py
1
13650
#!/usr/bin/env python3 # Copyright 2015 Ivan awamper@gmail.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 2 of # the License, or (at your option) any later version. # # Th...
gpl-3.0
4,281,217,289,881,190,400
31.193396
84
0.575458
false
gseismic/vnpy
vn.ctp/vnctptd/test/tdtest.py
96
4886
# encoding: UTF-8 import sys from time import sleep from PyQt4 import QtGui from vnctptd import * #---------------------------------------------------------------------- def print_dict(d): """按照键值打印一个字典""" for key,value in d.items(): print key + ':' + str(value) #------------------...
mit
2,553,848,454,266,774,000
25.785276
75
0.398305
false
blckshrk/Weboob
modules/gazelle/backend.py
1
2167
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # 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...
agpl-3.0
1,774,429,611,830,835,700
36.362069
97
0.675127
false
rcfduarte/nmsat
projects/examples/scripts/single_neuron_dcinput.py
1
7658
__author__ = 'duarte' from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict from modules.input_architect import EncodingLayer from modules.net_architect import Network from modules.io import set_storage_locations from modules.signals import iterate_obj_list from modules.analysis import sin...
gpl-2.0
-5,565,511,787,339,509,000
55.308824
120
0.422434
false
huguesv/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_internal/utils/glibc.py
5
3282
from __future__ import absolute_import import ctypes import re import warnings from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional, Tuple def glibc_version_string(): # type: () -> Optional[str] "Returns glibc version string, or None if not using ...
apache-2.0
1,302,323,980,895,768,600
34.290323
78
0.668495
false
tiborsimko/zenodo
zenodo/modules/search_ui/__init__.py
8
1063
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015 CERN. # # Zenodo 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 v...
gpl-2.0
3,035,887,296,235,631,600
38.37037
76
0.754468
false
nttks/edx-platform
common/test/utils.py
61
3533
""" General testing utilities. """ import sys from contextlib import contextmanager from django.dispatch import Signal from markupsafe import escape from mock import Mock, patch @contextmanager def nostderr(): """ ContextManager to suppress stderr messages http://stackoverflow.com/a/1810086/882918 """...
agpl-3.0
-419,557,261,592,425,700
31.412844
101
0.628078
false
django-json-api/django-rest-framework-json-api
example/api/resources/identity.py
2
2016
from django.contrib.auth import models as auth_models from django.utils import encoding from rest_framework import generics, parsers, renderers, serializers, viewsets from rest_framework.decorators import action from rest_framework.response import Response from rest_framework_json_api import utils from example.api.se...
bsd-2-clause
7,188,859,757,888,468,000
31
79
0.68006
false
jcoady9/python-for-android
python3-alpha/python3-src/Lib/base64.py
51
14091
#! /usr/bin/env python3 """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struct import binascii _...
apache-2.0
-2,095,566,623,580,467,200
33.536765
80
0.60159
false