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
AhmadHamzeei/Amir-Accounting
amir/factor.py
1
1168
class factor: number = None # factor number bill_id = None trans_id = None dirty = False ## type of factor can be sell, buy facotr_type = "sell" def __init__(self, number): if(number): #get bill_id and trans_id and type from database ## set current factor deatils ...
gpl-3.0
-1,586,664,391,974,443,500
24.391304
95
0.617295
false
orlenko/bccf
src/mezzanine/blog/management/commands/import_tumblr.py
3
5052
from datetime import datetime from optparse import make_option from time import sleep from urllib import urlopen from django.core.management.base import CommandError from django.utils.html import strip_tags try: from json import loads except ImportError: # Python < 2.6 from django.utils.simplejson import lo...
unlicense
8,505,821,997,740,500,000
35.875912
79
0.554632
false
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/pip/_vendor/packaging/utils.py
62
1520
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import re from .version import InvalidVersion, Version _canonicalize_re...
gpl-2.0
5,971,269,549,867,061,000
25.666667
83
0.649342
false
elijah513/ice
python/test/Ice/inheritance/Server.py
3
1086
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
-1,855,314,748,383,883,300
26.15
89
0.615101
false
balloob/python-wink
src/pywink/test/devices/sensor_test.py
3
11909
import json import os import unittest from unittest.mock import MagicMock from pywink.api import get_devices_from_response_dict from pywink.devices import types as device_types from pywink.devices.piggy_bank import WinkPorkfolioBalanceSensor from pywink.devices.smoke_detector import WinkSmokeDetector, WinkCoDetector,...
mit
-1,015,123,002,657,742,600
41.99278
110
0.620539
false
peterm-itr/edx-platform
lms/djangoapps/courseware/tests/test_video_xml.py
13
3186
# -*- coding: utf-8 -*- # pylint: disable=protected-access """Test for Video Xmodule functional logic. These test data read from xml, not from mongo. We have a ModuleStoreTestCase class defined in common/lib/xmodule/xmodule/modulestore/tests/django_utils.py. You can search for usages of this in the cms and lms tests ...
agpl-3.0
4,742,308,571,731,830,000
34.797753
91
0.59887
false
mdublin/Brightcove-Dynamic-Ingest-App
ENV/lib/python2.7/site-packages/sqlalchemy/log.py
14
6796
# sqlalchemy/log.py # Copyright (C) 2006-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # Includes alterations by Vinay Sajip vinay_sajip@yahoo.co.uk # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Logging control and...
mit
8,981,492,393,119,932,000
30.174312
84
0.6392
false
munkiat/libcloud
libcloud/test/common/test_cloudstack.py
45
7303
# 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 use ...
apache-2.0
5,249,302,747,236,265,000
33.77619
80
0.56689
false
pgodd/KOS
doc/ksdomain.py
11
8805
# -*- coding: utf-8 -*- import re from docutils import nodes from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.roles import XRefRole from sphinx.locale import l_, _ from sphinx.domains import Domain, ObjType, Index from sphinx.directives import ObjectDescription from sphinx.util.nod...
gpl-3.0
-2,522,210,027,344,941,000
31.977528
77
0.540829
false
teonlamont/mne-python
mne/io/tests/test_raw.py
2
6009
# Generic tests that all raw classes should run from os import path as op import math import pytest import numpy as np from numpy.testing import (assert_allclose, assert_array_almost_equal, assert_equal, assert_array_equal) from mne import concatenate_raws, create_info from mne.datasets imp...
bsd-3-clause
9,165,223,854,405,684,000
37.767742
79
0.585622
false
palmhold/djinn
djinn/errors.py
2
3285
# -*- coding: utf-8 -*- # # Copyright(c) 2014 palmhold.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,301,697,924,143,356,400
28.330357
80
0.606088
false
apdavison/python-neo
neo/test/iotest/test_nsdfio.py
3
8778
""" Tests of neo.io.NSDFIO """ import numpy as np import quantities as pq from datetime import datetime import os import unittest from neo.io.nsdfio import HAVE_NSDF, NSDFIO from neo.test.iotest.common_io_test import BaseTestIO from neo.core import AnalogSignal, Segment, Block, ChannelIndex from neo.test.tools impor...
bsd-3-clause
-96,700,024,164,038,780
35.575
96
0.620529
false
bunjiboys/security_monkey
security_monkey/watchers/keypair.py
1
4346
# Copyright 2014 Netflix, 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...
apache-2.0
-7,403,455,337,478,664,000
40
119
0.556374
false
ZhangXinNan/tensorflow
tensorflow/python/training/slot_creator_test.py
45
5256
# 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
-3,246,445,751,443,079,700
39.122137
80
0.667428
false
ludwig-n/fchess
old_code.py
1
21297
# def comet(mvs, pcs, recdepth, maxrecdepth): # options = [] # curxp = xp_diff(mvs[0][0].color, pcs) # intro = '// ' + ('-' * (recdepth * 2)) + ' COMET: ' # if DEBUG_OUTPUT: # print(intro + '{} opts'.format(len(mvs))) # else: # print(' ' * recdepth + '*') # if len(mvs) ==...
gpl-3.0
4,026,633,267,642,389,500
42.372917
124
0.357562
false
HybridF5/jacket
jacket/compute/block_device.py
1
21039
# Copyright 2011 Isaku Yamahata <yamahata@valinux co jp> # 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
5,364,418,655,642,744,000
34.065
79
0.584153
false
shenlong3030/asv-django-guestbook
django/contrib/gis/utils/geoip.py
13
15172
""" This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R) C API (http://www.maxmind.com/app/c). This is an alternative to the GPL licensed Python GeoIP interface provided by MaxMind. GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts. For IP-based geoloca...
bsd-3-clause
-8,023,022,239,660,367,000
40.027701
117
0.610533
false
yanheven/keystone
keystone/i18n.py
22
1156
# Copyright 2014 IBM Corp. # # 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
-5,843,146,296,524,441,000
30.243243
75
0.745675
false
Smarsh/django
django/core/files/move.py
403
2931
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from django.core.files import locks try: from shutil import copystat except ImportError: import stat def copystat(src, dst): ...
bsd-3-clause
-4,432,999,123,547,349,000
32.306818
94
0.598431
false
sauloal/PiCastPy
sqlalchemy/engine/__init__.py
14
15527
# engine/__init__.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """SQL connections, SQL execution and high-level DB-API interface. The engine pack...
mit
-1,590,251,565,080,899,600
42.492997
103
0.691956
false
amboxer21/scrapy
scrapy/utils/signal.py
18
2931
"""Helper functions for working with signals""" import logging from twisted.internet.defer import maybeDeferred, DeferredList, Deferred from twisted.python.failure import Failure from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, \ getAllReceivers, disconnect from scrapy.xlib.pydispatch...
bsd-3-clause
-7,353,079,968,003,916,000
39.150685
89
0.641419
false
rghe/ansible
lib/ansible/modules/cloud/vmware/vmware_vm_facts.py
31
6619
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, 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 ...
gpl-3.0
982,819,304,979,674,900
31.767327
105
0.592688
false
AltSchool/django
tests/template_tests/filter_tests/test_addslashes.py
473
1202
from django.template.defaultfilters import addslashes from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class AddslashesTests(SimpleTestCase): @setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'}) ...
bsd-3-clause
3,258,233,290,053,482,500
35.424242
108
0.621464
false
crafty78/ansible
lib/ansible/plugins/action/service.py
16
3306
# (c) 2015, Ansible Inc, # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
gpl-3.0
-3,552,879,471,567,041,000
39.814815
152
0.608288
false
thinkopensolutions/tkobr-addons
unported/tko_partner_configuration_menus/__openerp__.py
2
1853
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
agpl-3.0
6,688,664,301,674,100,000
35.333333
120
0.589854
false
stonek4/iperfparser
parseperf.py
1
1894
import argparse import json from pprint import pprint def convertToM(number, btype): if (btype == 'KBytes' or btype == 'Kbits/sec'): return number/1000 elif (btype == 'Bytes' or btype == 'Bits/sec'): return number/1000000 else: return number def parseIPerf(file_name, json_data): ...
mit
6,743,573,093,690,095,000
28.138462
84
0.554382
false
Tejeshwarabm/Westwood
examples/wireless/wifi-ap.py
57
5871
# -*- Mode: Python; -*- # /* # * Copyright (c) 2005,2006,2007 INRIA # * Copyright (c) 2009 INESC Porto # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License version 2 as # * published by the Free Software Foundation; # * # * This p...
gpl-2.0
130,443,904,954,530,910
32.169492
116
0.661046
false
jeremycline/pulp
server/test/unit/server/db/model/test_repository.py
14
2436
import unittest import mock from pulp.server.db.model.repository import RepoContentUnit REPOSITORY = 'pulp.server.db.model.repository' class TestRepoContentUnit(unittest.TestCase): def setUp(self): self.unit = RepoContentUnit('repo1', 'unit1', 'rpm') def test_utc_in_iso8601(self): # make ...
gpl-2.0
104,189,373,670,150,700
37.666667
95
0.66913
false
tboyce021/home-assistant
tests/components/atag/__init__.py
9
2495
"""Tests for the Atag integration.""" from homeassistant.components.atag import DOMAIN from homeassistant.const import CONF_EMAIL, CONF_HOST, CONF_PORT, CONTENT_TYPE_JSON from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.test_util.aiohttp import AiohttpClientMocker USER...
apache-2.0
-8,192,295,288,540,823,000
28.352941
83
0.556713
false
ikmaak/Printrun
printrun/injectgcode.py
25
1922
# This file is part of the Printrun suite. # # Printrun 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. # # Printrun is distributed in ...
gpl-3.0
670,970,243,464,513,200
41.711111
103
0.704475
false
eugene1g/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/zipfileset_mock.py
167
2166
# Copyright (C) 2011 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 of conditions and the f...
bsd-3-clause
-1,988,864,178,194,965,200
41.470588
72
0.727147
false
alexander-ae/sistema-de-cotizacion
quoman/quotes/pdf.py
1
9706
import os from io import BytesIO from django.utils import timezone from django.template.loader import get_template from django.template import Context from django.core.mail import EmailMessage from django.conf import settings from reportlab.pdfgen import canvas from reportlab.platypus import Table from reportlab.lib.p...
gpl-3.0
6,467,304,017,844,745,000
35.307116
118
0.553435
false
stdweird/aquilon
lib/python2.6/aquilon/worker/commands/make_aquilon.py
2
1052
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2013 Contributor # # 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 t...
apache-2.0
8,036,266,087,011,021,000
36.571429
74
0.742395
false
seawaywen/vim-config
bundle/python-mode/pymode/libs2/rope/contrib/fixsyntax.py
17
6737
import rope.base.codeanalyze import rope.base.evaluate from rope.base import worder, exceptions, utils from rope.base.codeanalyze import ArrayLinesAdapter, LogicalLineFinder class FixSyntax(object): def __init__(self, pycore, code, resource, maxfixes=1): self.pycore = pycore self.code = code ...
apache-2.0
8,717,412,625,420,738,000
37.942197
81
0.55544
false
AutorestCI/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/models/metric_value.py
2
2022
# 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
-2,516,196,752,203,041,000
32.7
76
0.564293
false
Xarthisius/girder
plugins/mongo_search/plugin_tests/search_test.py
2
6228
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 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
2,157,119,850,354,370,800
31.778947
92
0.53404
false
mortada/tensorflow
tensorflow/contrib/keras/python/keras/datasets/reuters.py
15
4442
# 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
6,592,793,623,018,774,000
31.661765
80
0.635299
false
wido/cloudstack
test/integration/component/test_network_offering.py
6
67587
# 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
2,359,833,329,645,906,000
44.208696
128
0.437762
false
figment/falloutsnip
Vendor/IronPython/Lib/xml/dom/pulldom.py
322
11974
import xml.sax import xml.sax.handler import types try: _StringTypes = [types.StringType, types.UnicodeType] except AttributeError: _StringTypes = [types.StringType] START_ELEMENT = "START_ELEMENT" END_ELEMENT = "END_ELEMENT" COMMENT = "COMMENT" START_DOCUMENT = "START_DOCUMENT" END_DOCUMENT = "END_DOCUMENT" ...
gpl-3.0
6,973,500,957,505,363,000
33.11396
82
0.588191
false
simbha/mAngE-Gin
lib/Django 1.7/django/contrib/auth/context_processors.py
514
1938
# PermWrapper and PermLookupDict proxy the permissions system into objects that # the template system can understand. class PermLookupDict(object): def __init__(self, user, app_label): self.user, self.app_label = user, app_label def __repr__(self): return str(self.user.get_all_permissions()) ...
mit
-5,414,689,920,572,316,000
28.363636
79
0.608359
false
ikropotov/kops
vendor/k8s.io/kubernetes/hack/update_owners.py
40
7464
#!/usr/bin/env python # Copyright 2016 The Kubernetes 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
1,916,297,625,362,277,000
37.474227
120
0.620311
false
BlogomaticProject/Blogomatic
opt/blog-o-matic/usr/lib/python/Bio/Nexus/Nodes.py
1
5759
# Copyright 2005-2008 by Frank Kauff & Cymon J. Cox. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # # Nodes.py # # Provides functionality of a linked list. # Each node has one ...
gpl-2.0
-7,650,546,238,337,055,000
32.482558
114
0.578573
false
tinchoss/Python_Android
python/src/Lib/test/test_unittest.py
51
85098
"""Test script for unittest. By Collin Winter <collinw at gmail.com> Still need testing: TestCase.{assert,fail}* methods (some are tested implicitly) """ from test import test_support import unittest from unittest import TestCase import types ### Support code ####################################################...
apache-2.0
392,040,441,835,419,460
36.047453
91
0.619192
false
kcpawan/django
django/contrib/admin/views/main.py
327
16684
import sys from collections import OrderedDict from django.contrib.admin import FieldListFilter from django.contrib.admin.exceptions import ( DisallowedModelAdminLookup, DisallowedModelAdminToField, ) from django.contrib.admin.options import ( IS_POPUP_VAR, TO_FIELD_VAR, IncorrectLookupParameters, ) from djang...
bsd-3-clause
-4,259,337,331,166,140,000
41.561224
99
0.585291
false
yast/yast-python-bindings
examples/CheckBox3.py
1
1854
# encoding: utf-8 from yast import import_module import_module('UI') from yast import * class CheckBox3Client: def main(self): # Build dialog with one check box and buttons to set its state to # on, off or "don't care" (tri-state). UI.OpenDialog( VBox( CheckBox(Id("cb"), "Forma...
gpl-2.0
-2,700,459,688,835,351,000
27.090909
79
0.555556
false
lichuan261/wuand
XX-Net/python27/1.0/lib/dis.py
270
6499
"""Disassembler of Python byte code into mnemonics.""" import sys import types from opcode import * from opcode import __all__ as _opcodes_all __all__ = ["dis", "disassemble", "distb", "disco", "findlinestarts", "findlabels"] + _opcodes_all del _opcodes_all _have_code = (types.MethodType, types.FunctionT...
gpl-2.0
-6,307,960,867,180,962,000
28.013393
78
0.47792
false
michaelhkw/incubator-impala
tests/performance/query_executor.py
1
7409
# 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,721,566,679,812,413,000
31.495614
89
0.689702
false
alangwansui/mtl_ordercenter
openerp/addons/report_intrastat/report_intrastat.py
52
5691
# -*- 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
6,607,249,272,340,694,000
43.811024
174
0.555087
false
vadimtk/chrome4sdp
styleguide/c++/chromium-cpp/main.py
90
1649
#!/usr/bin/env python # # Copyright 2014 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 google.appengine.api import memcache from google.appengine.api import urlfetch import webapp2 import base64 """A simple appengi...
bsd-3-clause
5,211,564,629,334,780,000
31.98
75
0.644027
false
uclouvain/osis
education_group/ddd/service/read/get_mini_training_service.py
1
1686
# ############################################################################ # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core business i...
agpl-3.0
293,317,102,154,096,000
53.354839
93
0.705638
false
fernandog/Sick-Beard
lib/unidecode/x052.py
253
4654
data = ( 'Dao ', # 0x00 'Diao ', # 0x01 'Dao ', # 0x02 'Ren ', # 0x03 'Ren ', # 0x04 'Chuang ', # 0x05 'Fen ', # 0x06 'Qie ', # 0x07 'Yi ', # 0x08 'Ji ', # 0x09 'Kan ', # 0x0a 'Qian ', # 0x0b 'Cun ', # 0x0c 'Chu ', # 0x0d 'Wen ', # 0x0e 'Ji ', # 0x0f 'Dan ', # 0x10 'Xi...
gpl-3.0
7,022,685,240,678,568,000
17.03876
20
0.393425
false
foss-transportationmodeling/rettina-server
.env/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/tests/test_resources.py
62
24677
#!/usr/bin/python # -*- coding: utf-8 -*- # NOTE: the shebang and encoding lines are for ScriptHeaderTests; do not remove from unittest import TestCase, makeSuite; from pkg_resources import * from setuptools.command.easy_install import get_script_header, is_sh import os, pkg_resources, sys, StringIO, tempfile, shutil t...
apache-2.0
8,510,065,886,879,846,000
37.021572
94
0.552926
false
kiyoto/statsmodels
statsmodels/tsa/vector_ar/tests/test_svar.py
28
2034
""" Test SVAR estimation """ import statsmodels.api as sm from statsmodels.tsa.vector_ar.svar_model import SVAR from numpy.testing import assert_almost_equal, assert_equal, assert_allclose from .results import results_svar import numpy as np import numpy.testing as npt DECIMAL_6 = 6 DECIMAL_5 = 5 DECIMAL_4 = 4 class...
bsd-3-clause
-4,274,975,765,943,821,000
31.806452
76
0.613078
false
davipeterlini/routeflow_ha
pox/pox/lib/threadpool.py
26
2952
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
apache-2.0
2,634,766,650,063,631,000
25.836364
72
0.627371
false
sosey/ginga
ginga/mockw/ImageViewCanvasTypesMock.py
1
2800
# # ImageViewCanvasTypesMock.py -- drawing classes for ImageViewCanvas widget # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # # TODO: this line is for backward compati...
bsd-3-clause
-7,083,930,837,897,296,000
25.415094
76
0.603571
false
glovebx/odoo
addons/website_sale/models/product.py
262
10108
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
2,462,238,935,387,430,000
48.067961
186
0.619114
false
jkoelker/quark
quark/api/extensions/subnets_quark.py
2
1724
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 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-2.0
6,742,540,741,692,072,000
27.733333
78
0.641531
false
billwanjohi/ansible
lib/ansible/runner/connection_plugins/paramiko_ssh.py
13
13550
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
-1,842,554,650,926,866,700
38.73607
133
0.587601
false
kiyukuta/chainer
chainer/function.py
2
25375
import collections import traceback import weakref import six import chainer from chainer import configuration from chainer import cuda from chainer.utils import type_check from chainer import variable def no_backprop_mode(): """Make a context manager which disables back-propagation. In this context, Chain...
mit
-2,169,144,190,993,398,800
36.481536
79
0.627547
false
spaceone/pyjs
examples/libtest/ClassTest.py
6
50377
import sys from UnitTest import UnitTest, IN_BROWSER # syntax check # import a, b, c if True: import imports.circ1 from imports import exec_order, imports as IMPORTS from imports import exec_order as EXEC_ORDER import I18N from imports.classes import WithAttribute import imports.decors # must be in this form gl...
apache-2.0
9,022,950,932,178,744,000
32.2961
184
0.586458
false
D4rk4/Neural-Network-Trading-Bot
pyTrader/trading_floor.py
1
4891
import sys, time from file_check import * check_data_files() from print_trade_info import set_low_balance_msg, print_trade, reset_print_info from db_access import db_connect, db_exists, output_records_exist, output_init_record, get_last_output_record from balances import * from analyst import * from trader import * f...
mit
-6,007,698,097,752,149,000
42.669643
176
0.588223
false
centwave/jg82ksgvqkuan
django/contrib/gis/geos/prototypes/geom.py
311
4465
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, c_uint, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, PREPGEOM_PTR, GEOS_PREPARE from django.contrib.gis.geos.prototypes.errcheck import \ check_geom, check_minus_one, check_sized_string, check_string, check_zero from django.contrib.gis....
bsd-3-clause
3,393,611,786,477,534,700
36.521008
88
0.737514
false
kensho-technologies/graphql-compiler
graphql_compiler/tests/test_sqlalchemy_extensions.py
1
2928
# Copyright 2019-present Kensho Technologies, LLC. import unittest import sqlalchemy import sqlalchemy.dialects.mssql as mssql import sqlalchemy.dialects.postgresql as postgresql from ..compiler.sqlalchemy_extensions import print_sqlalchemy_query_string from .test_helpers import compare_sql, get_sqlalchemy_schema_inf...
apache-2.0
3,203,333,420,723,106,300
37.025974
95
0.608948
false
cwvh/maidfs
maidsim/selectionalgorithm.py
1
1591
from __future__ import division class SelectionAlgorithm: ''' Implements a selective compression algorithm. This algorithm determines whether a given file should be compressed or not. This class is designed as a base class; actual selection algorithms should be implemented as child classes. ...
bsd-2-clause
6,102,317,379,407,468,000
29.596154
79
0.710874
false
nekulin/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/security/security_enums.py
17
9461
import win32security, ntsecuritycon, winnt class Enum: def __init__(self, *const_names): """Accepts variable number of constant names that can be found in either win32security, ntsecuritycon, or winnt.""" for const_name in const_names: try: const_val=getattr(...
apache-2.0
-5,317,163,630,969,549,000
28.939873
127
0.659233
false
oso/pymcda
apps/learn-from-dataset.py
1
5147
import os, sys sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/../") import time import datetime from pymcda.electre_tri import MRSort from pymcda.generate import generate_categories_profiles from pymcda.pt_sorted import SortedPerformanceTable from pymcda.types import CriterionValue, CriteriaValues fr...
gpl-3.0
-8,795,354,359,320,967,000
32.640523
101
0.683311
false
akretion/stock-logistics-workflow
stock_route_sales_team/tests/test_sale_team_route.py
6
2813
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
1,421,870,303,995,236,600
38.619718
78
0.587629
false
leki75/ansible
lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py
71
14950
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
4,327,423,282,405,911,600
34.9375
207
0.608361
false
kvesteri/intervals
tests/interval/test_properties.py
1
3829
from datetime import date, datetime from decimal import Decimal from infinity import inf from pytest import mark from intervals import ( DateInterval, DateTimeInterval, DecimalInterval, FloatInterval, IntInterval ) class TestIntervalProperties(object): @mark.parametrize( ('interval',...
bsd-3-clause
-6,745,928,997,886,584,000
29.388889
60
0.495952
false
danielballan/filestore
filestore/file_writers.py
2
4154
from __future__ import (absolute_import, division, print_function, unicode_literals) from .handlers_base import HandlerBase import errno import six import logging import numpy as np import uuid import os import os.path as op import datetime import filestore.api as fsc logger = logging.getLogg...
bsd-3-clause
-3,262,063,835,125,397,000
28.253521
85
0.583534
false
cgcgbcbc/django-xadmin
xadmin/__init__.py
1
2296
from xadmin.sites import AdminSite, site VERSION = [0,4,4] class Settings(object): pass def autodiscover(): """ Auto-discover INSTALLED_APPS admin.py modules and fail silently when not present. This forces an import on them to register any admin bits they may want. """ from django.conf...
bsd-3-clause
-4,139,415,933,278,390,000
33.268657
78
0.635453
false
jianghuaw/nova
nova/objects/floating_ip.py
3
10691
# Copyright 2014 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 a...
apache-2.0
531,933,072,275,019,400
40.437984
79
0.611729
false
lawrence34/python-social-auth
social/backends/open_id.py
66
14306
import datetime from calendar import timegm from jwt import InvalidTokenError, decode as jwt_decode from openid.consumer.consumer import Consumer, SUCCESS, CANCEL, FAILURE from openid.consumer.discover import DiscoveryFailure from openid.extensions import sreg, ax, pape from social.utils import url_add_parameters fr...
bsd-3-clause
-382,409,563,224,280,770
38.519337
79
0.596533
false
hdinsight/hue
desktop/core/ext-py/Django-1.6.10/django/conf/locale/de/formats.py
118
1104
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DAT...
apache-2.0
-2,702,927,733,127,701,000
34.612903
77
0.605072
false
ndtran/l10n-switzerland
l10n_ch_account_statement_base_import/parser/g11_file_parser.py
1
8249
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Steve Ferry # # This program is free software: you can redistribute it and...
agpl-3.0
-6,230,455,243,707,692,000
32.944915
78
0.503213
false
holly/gistcli
lib/gistcli/argparser.py
1
6704
#!/usr/bin/env python # vim:fileencoding=utf-8 from argparse import ArgumentParser, FileType import time import warnings import os, sys, io import signal class ArgParser(object): def __init__(self, description, version): self.__description = description self.__version = version self....
mit
3,353,789,592,942,976,500
63.461538
217
0.654833
false
SUNET/eduid-idproofing-letter
src/idproofing_letter/app.py
1
1737
# -*- coding: utf-8 -*- from __future__ import absolute_import from flask import Flask from eduid_common.api.logging import init_logging from eduid_common.api.exceptions import init_exception_handlers from eduid_userdb import UserDB from eduid_userdb.proofing import LetterProofingStateDB from idproofing_letter.ekopos...
bsd-3-clause
-5,242,303,160,198,039,000
27.47541
83
0.70639
false
xin3liang/platform_external_chromium_org
third_party/protobuf/python/google/protobuf/internal/containers.py
224
10004
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
bsd-3-clause
6,145,333,621,792,047,000
36.189591
79
0.70122
false
malcolmpl/fleetpanel
JumpBridge.py
1
1343
#!/usr/bin/python # vim:sw=4:softtabstop=4:expandtab:set fileencoding=ISO8859-2 # # JumpBridge.py, part of the FleetPanel # # Copyright (c) 2008-2009 Pawe³ 'Reef' Polewicz # All rights reserved. # # This software is licensed as described in the file LICENSE, which # you should have received as part of this distribution...
mit
2,926,273,205,177,891,000
30.97619
114
0.638868
false
lisa-lab/pylearn2
doc/conf.py
2
6651
# -*- coding: utf-8 -*- # # pylearn2 documentation build configuration file # It is based on Theano documentation build # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module impo...
bsd-3-clause
8,295,227,984,766,826,000
30.822967
82
0.715682
false
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/_osx_support.py
16
19138
"""Shared OS X support functions.""" import os import re import sys __all__ = [ 'compiler_fixup', 'customize_config_vars', 'customize_compiler', 'get_platform_osx', ] # configuration variables that may contain universal build flags, # like "-arch" or "-isdkroot", that may need customization for # the...
apache-2.0
1,908,390,192,607,335,400
37.123506
80
0.612917
false
Djabbz/wakatime
wakatime/packages/tzlocal3/unix.py
11
3929
import os import re import pytz3 as pytz _cache_tz = None def _tz_from_env(tzenv): if tzenv[0] == ':': tzenv = tzenv[1:] # TZ specifies a file if os.path.exists(tzenv): with open(tzenv, 'rb') as tzfile: return pytz.tzfile.build_tzinfo('local', tzfile) # TZ specifies a zo...
bsd-3-clause
1,433,406,195,352,429,000
33.769912
89
0.596589
false
QuantConnect/Lean
Algorithm.Python/AddFutureOptionContractDataStreamingRegressionAlgorithm.py
3
4028
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Licen...
apache-2.0
-2,749,620,885,306,923,000
41.4
141
0.690665
false
Edraak/edraak-platform
lms/djangoapps/courseware/access_utils.py
13
3032
""" Simple utility functions for computing access. It allows us to share code between access.py and block transformers. """ from datetime import datetime, timedelta from logging import getLogger from django.conf import settings from pytz import UTC from courseware.access_response import AccessResponse, StartDateErro...
agpl-3.0
424,471,687,527,144,640
30.583333
107
0.697889
false
jbonofre/beam
sdks/python/apache_beam/internal/gcp/json_value_test.py
7
3701
# # 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 us...
apache-2.0
911,081,779,017,772,200
34.932039
76
0.732235
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/sites/models.py
82
3951
from __future__ import unicode_literals import string import warnings from django.core.exceptions import ImproperlyConfigured, ValidationError from django.db import models from django.db.models.signals import pre_delete, pre_save from django.utils.deprecation import RemovedInDjango19Warning from django.utils.encoding...
mit
2,361,877,200,388,488,000
30.608
80
0.643381
false
jsirois/pants
src/python/pants/core/goals/typecheck.py
1
6985
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from dataclasses import dataclass from typing import Any, Dict, Iterable, Optional, Tuple from pants.core.goals.style_request import StyleRequest from ...
apache-2.0
-6,475,198,788,146,782,000
33.04878
100
0.663181
false
DasIch/django
django/contrib/auth/hashers.py
66
17463
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from d...
bsd-3-clause
-4,107,704,391,264,429,600
32.777563
106
0.640783
false
CanalTP/navitia
source/jormungandr/jormungandr/scenarios/helper_classes/tests/__init__.py
3
1257
# coding=utf-8 # Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and...
agpl-3.0
8,624,440,456,743,450,000
42.344828
79
0.750199
false
moylop260/odoo-dev
addons/account/wizard/account_reconcile_partner_process.py
385
5775
# -*- 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
-6,495,954,017,105,307,000
55.617647
476
0.606926
false
itpcc/FPGA-IA-Journy-game
image2verilog-colorgroup.py
1
4467
#!/usr/bin/python # -*- coding: utf-8 -*- import os import Tkinter import tkFileDialog from PIL import Image import ImageDraw import PIL.ImageOps __DEFAULT_VAR_NAME__ = "var1" __IS_MARK_CENTER__ = False __INVERT_COLOR__ = False def main(): try: Tkinter.Tk().withdraw() # Close the root window in_p...
mit
906,560,923,251,348,500
36.508621
126
0.534811
false
liyitest/rr
openstack_dashboard/dashboards/admin/hypervisors/views.py
48
2811
# Copyright 2013 B1 Systems GmbH # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
2,973,141,039,619,827,700
35.506494
78
0.638563
false
stars2014/quick-ng
tools/cocos2d-console/toexec/build_console.py
6
7612
#!/usr/bin/python # ---------------------------------------------------------------------------- # build_console: Build cocos2d-console into executable binary file with PyInstaller # # Author: Bin Zhang # # License: MIT # ---------------------------------------------------------------------------- ''' Build cocos2d-con...
mit
344,842,534,512,521,000
32.831111
186
0.559511
false
Xeralux/tensorflow
tensorflow/contrib/nn/python/ops/alpha_dropout.py
17
3427
# 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
1,092,177,389,100,326,000
38.848837
103
0.654217
false
droark/bitcoin
test/functional/feature_bip68_sequence.py
2
18287
#!/usr/bin/env python3 # Copyright (c) 2014-2019 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 BIP68 implementation.""" import time from test_framework.blocktools import create_block, create_...
mit
1,109,395,572,228,011,500
44.49005
140
0.622956
false
frankyrumple/ope
admin_app/gluon/tests/test_template.py
7
6382
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Unit tests for gluon.template """ import unittest from fix_path import fix_sys_path fix_sys_path(__file__) import template from template import render class TestTemplate(unittest.TestCase): def testRun(self): self.assertEqual(render(content='{{for ...
mit
-6,805,760,191,392,247,000
44.262411
80
0.492792
false
xin3liang/platform_external_chromium_org
tools/telemetry/telemetry/unittest/progress_reporter_unittest.py
33
1548
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry.unittest import progress_reporter class TestFoo(unittest.TestCase): # Test method doesn't have test- prefix intentionally...
bsd-3-clause
-8,654,138,391,182,510,000
27.666667
72
0.700904
false
bbc/kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/SkyGrassBackground.py
12
2597
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
apache-2.0
-8,302,695,903,277,677,000
30.289157
135
0.649211
false
hynnet/openwrt-mt7620
staging_dir/host/lib/python2.7/cProfile.py
169
6515
#! /usr/bin/env python """Python interface for the 'lsprof' profiler. Compatible with the 'profile' module. """ __all__ = ["run", "runctx", "help", "Profile"] import _lsprof # ____________________________________________________________ # Simple interface def run(statement, filename=None, sort=-1): """Run s...
gpl-2.0
-9,211,661,086,502,263,000
31.738693
79
0.554413
false
hbwzhsh/scrapy
scrapy/link.py
56
1253
""" This module defines the Link object used in Link extractors. For actual link extractors implementation see scrapy.linkextractors, or its documentation in: docs/topics/link-extractors.rst """ import six class Link(object): """Link objects represent an extracted link by the LinkExtractor.""" __slots__ = [...
bsd-3-clause
8,881,319,564,704,283,000
33.805556
91
0.622506
false