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
jorik041/plaso
tests/parsers/chrome_preferences.py
3
2101
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Chrome Preferences file parser.""" import unittest # pylint: disable=unused-import from plaso.formatters import chrome_preferences as chrome_preferences_formatter from plaso.lib import timelib from plaso.parsers import chrome_preferences from tests.parsers i...
apache-2.0
-6,282,539,783,490,605,000
34.610169
79
0.712518
false
Orochimarufan/youtube-dl
youtube_dl/extractor/nowness.py
54
6024
# coding: utf-8 from __future__ import unicode_literals from .brightcove import ( BrightcoveLegacyIE, BrightcoveNewIE, ) from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, sanitized_Request, ) class NownessBaseIE(InfoExtractor): def _extract_ur...
unlicense
769,135,391,693,826,700
39.965986
119
0.535204
false
sileht/aodh
aodh/tests/api/v2/test_acl_scenarios.py
1
4386
# # Copyright 2012 New Dream Network, LLC (DreamHost) # Copyright 2015 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 # # Un...
apache-2.0
9,051,180,492,055,087,000
37.13913
76
0.51938
false
appneta/boto
tests/integration/cognito/identity/test_cognito_identity.py
112
2545
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
mit
-3,883,429,254,833,378,300
47.942308
80
0.727701
false
efortuna/AndroidSDKClone
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/idlelib/macosxSupport.py
51
6222
""" A number of function that enhance IDLE on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys import Tkinter from os import path _appbundle = None def runningAsOSXApp(): """ Returns True if Python is running from within an app on OSX. If so, assume that ...
apache-2.0
-2,084,891,873,755,058,700
34.554286
79
0.634201
false
pulsar-chem/Pulsar-Core
lib/systems/d-leucine.py
1
1231
import pulsar as psr def load_ref_system(): """ Returns d-leucine as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 1.6125 -0.7205 -0.4004 C 0.1080 -0.4462 -0.4641 C -0.2699 ...
bsd-3-clause
3,109,290,700,462,001,700
41.448276
65
0.39805
false
sillvan/laikaboss
laikaboss/modules/decode_base64.py
20
1160
# Copyright 2015 Lockheed Martin 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
apache-2.0
-7,828,749,846,821,871,000
39
127
0.712931
false
map222/spark
python/pyspark/mllib/clustering.py
59
36931
# # 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
5,311,107,780,188,030,000
34.005687
100
0.592348
false
Tao-Ma/incubator-hawq
tools/bin/gppylib/testold/testUtils.py
40
7004
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2010. All Rights Reserved. # # # THIS IMPORT MUST COME FIRST # import mainUtils FIRST to get python version check # from gppylib.mainUtils import * import os, sys, traceback gProgramName = os.path.split(sys.argv[0])[-1] from gppylib.commands.base import setExecuti...
apache-2.0
863,635,692,195,121,700
29.58952
134
0.650628
false
mmardini/django
tests/proxy_model_inheritance/tests.py
34
1921
from __future__ import absolute_import, unicode_literals import os from django.core.management import call_command from django.test import TestCase, TransactionTestCase from django.test.utils import override_system_checks, extend_sys_path from django.utils._os import upath from .models import (ConcreteModel, Concret...
bsd-3-clause
-3,156,065,193,074,376,000
39.87234
84
0.697033
false
LUTAN/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/kullback_leibler_test.py
27
4410
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-1,222,068,098,380,989,700
32.409091
80
0.690023
false
tlakshman26/cinder-https-changes
cinder/tests/unit/test_test.py
22
2735
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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...
apache-2.0
-7,990,432,161,386,189,000
33.620253
78
0.651188
false
uclaacm/ai-combat
AICombat/virtual/queuebot.py
1
4860
""" queuebot.py A pure utility virtualbot to be subclassed. The Queuebot provides a queue decorator to be used on get_action, allowing subclasses to define action sequences instead of juggling around action primitives. """ # Global imports from collections import deque # Local imports import real.definitions as d fr...
gpl-2.0
8,757,366,820,396,939,000
32.75
79
0.600823
false
0k/odoo
addons/marketing_campaign_crm_demo/__openerp__.py
52
1694
# -*- 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
7,912,990,340,016,421,000
37.5
87
0.59327
false
mSenyor/sl4a
python/src/Tools/msi/msi.py
30
58459
# Python MSI Generator # (C) 2003 Martin v. Loewis # See "FOO" in comments refers to MSDN sections with the title FOO. import msilib, schema, sequence, os, glob, time, re, shutil from msilib import Feature, CAB, Directory, Dialog, Binary, add_data import uisample from win32com.client import constants from distutils.spa...
apache-2.0
8,283,506,041,446,831,000
43.968462
196
0.58937
false
cyril51/Sick-Beard
lib/hachoir_metadata/image.py
90
10812
from lib.hachoir_metadata.metadata import (registerExtractor, Metadata, RootMetadata, MultipleMetadata) from lib.hachoir_parser.image import ( BmpFile, IcoFile, PcxFile, GifFile, PngFile, TiffFile, XcfFile, TargaFile, WMF_File, PsdFile) from lib.hachoir_parser.image.png import getBitsPerPixel as pngBitsPerP...
gpl-3.0
-551,240,089,937,298,560
35.160535
85
0.567888
false
spadae22/odoo
addons/mrp_operations/__init__.py
443
1091
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
-1,627,199,242,768,758,500
42.64
79
0.614115
false
zhlinh/leetcode
0284.Peeking Iterator/solution.py
1
2930
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-05-10 Last_modify: 2016-05-10 ****************************************** ''' ''' Given an Iterator class interface with met...
apache-2.0
1,608,131,948,590,291,200
28.3
82
0.609898
false
stewnorriss/LibCloud
libcloud/test/compute/test_ssh_client.py
17
11868
# -*- coding: utf-8 -*- # 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 "Li...
apache-2.0
3,145,985,062,654,945,000
35.968847
78
0.545884
false
bougui505/SOM
PCA.py
1
1348
#!/usr/bin/env python import numpy #import pylab def princomp(A,numpc=4,reconstruct=False,getEigenValues=True): # computing eigenvalues and eigenvectors of covariance matrix M = (A - numpy.atleast_2d(numpy.mean(A,axis=1)).T) # subtract the mean (along columns) # print 'A:%s'%A # print 'M:%s'%M # print 'cov:%s'%numpy...
gpl-2.0
-2,854,969,016,863,552,500
39.848485
115
0.727003
false
JackKelly/neuralnilm_prototype
scripts/e368.py
2
5841
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
mit
656,195,382,507,441,000
30.572973
86
0.592364
false
levkar/odoo
addons/hw_proxy/controllers/main.py
9
7344
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import commands import logging import time from threading import Lock from odoo import http from odoo.http import request _logger = logging.getLogger(__name__) # Those are the builtin raspberry pi USB modules, they ...
agpl-3.0
277,633,922,398,077,120
31.785714
93
0.563045
false
JWDebelius/American-Gut
tests/test_util.py
1
13782
#!/usr/bin/env python import os import pandas as pd from StringIO import StringIO from unittest import TestCase, main from numpy import array, nan from biom import Table from pandas.util.testing import assert_frame_equal from americangut.util import ( slice_mapping_file, parse_mapping_file, verify_subset, ...
bsd-3-clause
1,250,701,516,101,065,200
38.717579
79
0.427877
false
grantvk/aima-python
submissions/Fritz/myNN.py
13
4756
from sklearn import datasets from sklearn.neural_network import MLPClassifier import traceback from submissions.Fritz import medal_of_honor class DataFrame: data = [] feature_names = [] target = [] target_names = [] honordata = DataFrame() honordata.data = [] honortarget = [] class DataFrame2: da...
mit
3,103,999,463,779,415,000
21.224299
62
0.566022
false
sbarton272/AcousticBarcodes-Explorations
barcodes/dxfwrite/build/lib/dxfwrite/std.py
2
12517
#!/usr/bin/env python #coding:utf-8 # Purpose: standard data and definitions # module belongs to package: dxfwrite.py # Created: 09.02.2010 # Copyright (C) 2010, Manfred Moitzi # License: MIT License __author__ = "mozman <mozman@gmx.at>" from array import array from dxfwrite.htmlcolors import get_color_tuple_by_name...
mit
7,337,694,992,102,670,000
44.351449
86
0.477431
false
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.py
328
14177
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from codecs import register_error, xmlcharrefreplace_errors from .constants import voidElements, booleanAttributes, spaceCharacters from .constants import rcdataElements, entities, xmlEntities from . im...
bsd-3-clause
-3,481,803,404,525,276,700
41.446108
116
0.541017
false
miguelinux/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/C/PyUtility/setup.py
12
1265
## @file # package and install PyEfiCompressor extension # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of th...
gpl-2.0
-1,688,151,630,558,037,500
29.119048
85
0.627668
false
cselis86/edx-platform
common/djangoapps/student/tests/test_auto_auth.py
9
7557
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django_comment_common.models import ( Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_STUDENT) from django_comment_common.utils import seed_permissions_roles from student.models i...
agpl-3.0
3,445,876,699,064,746,000
38.359375
94
0.650523
false
cyanna/edx-platform
common/djangoapps/embargo/migrations/0005_add_courseaccessrulehistory.py
102
7906
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CourseAccessRuleHistory' db.create_table('embargo_courseaccessrulehistory', ( ('...
agpl-3.0
-135,785,200,974,386,500
68.359649
182
0.560207
false
chenjun0210/tensorflow
tensorflow/python/training/adagrad_test.py
81
12075
# 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,117,962,181,361,412,000
43.230769
80
0.612008
false
akretion/delivery-carrier
delivery_carrier_label_gls/report/__init__.py
5
1056
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) All Rights Reserved 2014 Akretion # @author David BEAL <david.beal@akretion.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
agpl-3.0
-8,621,012,728,665,239,000
43
79
0.614583
false
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/test/test_multifile.py
138
1702
from test import test_support mimetools = test_support.import_module('mimetools', deprecated=True) multifile = test_support.import_module('multifile', deprecated=True) import cStringIO msg = """Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_590453667==_" X-OriginalArrivalTime:...
mit
-8,052,766,747,504,507,000
24.402985
83
0.592244
false
andrewklau/openshift-tools
openshift/installer/vendored/openshift-ansible-3.4.12-1/playbooks/common/openshift-cluster/upgrades/library/openshift_upgrade_config.py
91
5294
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 """Ansible module for modifying OpenShift configs during an upgrade""" import os import yaml DOCUMENTATION = ''' --- module: openshift_upgrade_config short_description: OpenShift Upgrade Config author: Jason DeTiberus requirements: [ ]...
apache-2.0
-8,399,050,273,119,413,000
32.506329
100
0.630525
false
sankha93/selenium
py/selenium/webdriver/common/html5/application_cache.py
52
1430
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-5,760,559,416,338,789,000
28.791667
73
0.696503
false
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/conf/locale/__init__.py
82
12130
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
mit
-8,583,353,967,094,661,000
20.550909
80
0.381169
false
the-elven-archer/bind_manager
bind_manager_v3/modules/dns_tools.py
1
3907
#!/usr/bin/env python2 import dns.query import dns.zone import dns.rdtypes import dns.rdatatype import dns.rdataclass import dns.rdata import dns.update import dns.tsigkeyring import IPy import urllib from operator import itemgetter import time from .models import * from .main import * class dns_utils(): def __...
apache-2.0
-7,611,211,821,014,566,000
41.467391
105
0.446378
false
LIS/lis-tempest
tempest/api/identity/test_extension.py
12
1194
# Copyright 2014 NEC Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
5,740,937,399,714,182,000
37.516129
78
0.686767
false
baylee/django
tests/gis_tests/geoapp/test_feeds.py
49
4228
from __future__ import unicode_literals from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import ( TestCase, modify_settings, override_settings, skipUnlessDBFeature, ) from .models import City @modify_settings(INSTALLED_APPS={'append': 'd...
bsd-3-clause
-8,887,023,973,677,901,000
44.956522
103
0.639073
false
acozzette/fMBT
pythonshare/pythonshare/client.py
1
9648
# fMBT, free Model Based Testing tool # Copyright (c) 2013-2015, Intel Corporation. # # Author: antti.kervinen@intel.com # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software...
lgpl-2.1
4,969,981,804,421,104,000
34.470588
96
0.59971
false
openhatch/oh-mainline
vendor/packages/twisted/twisted/mail/test/pop3testserver.py
57
8173
#!/usr/bin/env python # -*- test-case-name: twisted.mail.test.test_pop3client -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.internet.protocol import Factory from twisted.protocols import basic from twisted.internet import reactor import sys, time USER = "test" PASS = "twist...
agpl-3.0
-2,265,666,328,662,812,700
25.028662
93
0.591093
false
shanglt/youtube-dl
youtube_dl/extractor/turbo.py
140
2386
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, xpath_text, ) class TurboIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?turbo\.fr/videos-voiture/(?P<id>[0-9]+)-' _API_URL =...
unlicense
2,266,875,326,361,617,200
34.61194
152
0.553227
false
lj1985730/vehicleCRM
crm/sqlite.py
1
1746
# coding=utf-8 import sqlite3 # noinspection PyUnresolvedReferences,SqlResolve class Database(object): """ 数据库操作对象 """ def __init__(self): self.conn = None ''' 提交 ''' def commit(self): self.conn.commit() ''' 关闭 ''' def close(self): self.conn.c...
apache-2.0
-1,204,090,200,560,444,400
19.1
59
0.496269
false
luci/luci-py
appengine/swarming/handlers_backend.py
2
15567
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Main entry point for Swarming backend handlers.""" import datetime import json import logging import webapp2 from google.appengine.api import...
apache-2.0
-4,932,910,699,899,570,000
32.191898
80
0.720627
false
0xkag/tornado
tornado/gen.py
36
28109
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler:: class Asy...
apache-2.0
7,601,210,502,000,315,000
35.743791
82
0.607243
false
8l/NetASM-python
netasm/examples/back_ends/soft_switch/mininet/linear_switch.py
3
2367
#!/usr/bin/python # ################################################################################ # ## # ## https://github.com/NetASM/NetASM-python # ## # ## File: # ## linear_switch.py # ## # ## Project: # ## NetASM: A Network Assembly Language for Programmable Dataplanes # ## # ## Author: # ## ...
gpl-2.0
-3,054,267,642,425,270,000
29.753247
110
0.631601
false
CiscoSystems/vespa
neutron/tests/unit/ml2/test_agent_scheduler.py
46
1360
# 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.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
797,552,823,428,170,000
36.777778
78
0.738235
false
with-git/tensorflow
tensorflow/contrib/tensor_forest/client/eval_metrics.py
52
5515
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-4,043,257,719,799,917,600
33.46875
80
0.682321
false
jac2130/BayesGame
pywebsocket-read-only/src/mod_pywebsocket/xhr_benchmark_handler.py
76
3946
# Copyright 2014 Google Inc. All rights reserved. # # Use of this source code is governed by a BSD-style # license that can be found in the COPYING file or at # https://developers.google.com/open-source/licenses/bsd from mod_pywebsocket import util class XHRBenchmarkHandler(object): def __init__(self, headers, ...
mit
-4,600,740,470,667,927,000
34.872727
77
0.569691
false
philanthropy-u/edx-platform
openedx/features/journals/views/learner_dashboard.py
4
2148
""" Journal Tab of Learner Dashboard views """ from datetime import datetime, time import logging from django.http import Http404 from edxmako.shortcuts import render_to_response from openedx.core.djangoapps.programs.models import ProgramsApiConfig from openedx.features.journals.api import ( fetch_journal_access,...
agpl-3.0
5,477,084,216,306,294,000
27.263158
103
0.666667
false
Amechi101/concepteur-market-app
venv/lib/python2.7/site-packages/PIL/ImagePalette.py
7
5792
# # The Python Imaging Library. # $Id$ # # image palette object # # History: # 1996-03-11 fl Rewritten. # 1997-01-03 fl Up and running. # 1997-08-23 fl Added load hack # 2001-04-16 fl Fixed randint shadow bug in random() # # Copyright (c) 1997-2001 by Secret Labs AB # Copyright (c) 1996-1997 by Fredrik Lundh # ...
mit
2,071,495,097,911,003,000
27.253659
76
0.549551
false
wuxianghou/phantomjs
src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_nc_test.py
277
3758
#!/usr/bin/env python # # Copyright 2007, 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...
bsd-3-clause
6,576,378,827,450,013,000
34.45283
79
0.699308
false
jadnohra/handle_file
lztex.py
1
18515
import os,sys import copy, json import re g_dbg = '-dbg' in sys.argv or False g_force_keep_indent = '-force_keep_indent' in sys.argv g_kill_indent = True g_enable_lzmath = False if '-no_lzmath' in sys.argv else True g_re1 = re.compile(r"(\\)([A-Z])\b") g_re1_subst = '\mathbb{\\2}' g_re2 = re.compile(r"(])([A-Z])\b") ...
unlicense
-6,545,656,344,312,695,000
40.328125
241
0.587848
false
bdfoster/blumate
blumate/components/sensor/forecast.py
1
9411
""" Support for Forecast.io weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.forecast/ """ import logging from datetime import timedelta from blumate.const import CONF_API_KEY, TEMP_CELSIUS from blumate.helpers.entity import Entity...
mit
-8,728,797,458,482,809,000
36.098814
79
0.559557
false
toshywoshy/ansible
test/units/modules/network/f5/test_bigip_trunk.py
22
4247
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0
5,762,719,258,150,774,000
29.120567
91
0.619732
false
kjw0106/boto
tests/unit/emr/test_connection.py
34
38189
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...
mit
9,210,500,263,727,003,000
37.036853
166
0.627458
false
rvalyi/geraldo
site/newsite/site-geraldo/django/template/defaultfilters.py
12
26148
"""Default variable filters.""" import re import random as random_module try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.3, 2.4 fallback. from django.template import Variable, Library from django.conf import settings from django.utils.translation impo...
lgpl-3.0
-7,951,094,756,144,083,000
29.440047
84
0.619856
false
dgarros/ansible
lib/ansible/modules/files/blockinfile.py
24
10652
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, 2015 YAEGASHI Takeshi <yaegashi@debian.org> # # 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 ...
gpl-3.0
4,131,859,882,835,718,700
30.892216
124
0.61059
false
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/pip/_vendor/urllib3/connection.py
7
15170
from __future__ import absolute_import import datetime import logging import os import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection from .packages.six.moves.http_client imp...
gpl-2.0
-3,492,647,580,436,915,000
32.861607
100
0.603494
false
yrchen/CommonRepo
commonrepo/users_api/views.py
1
2534
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
apache-2.0
248,587,561,603,506,800
31.487179
79
0.758485
false
MingdaZhou/gnuradio
gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
344
1871
#!/usr/bin/env python """ Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from xml.dom import minidom import os import sys import compound import indexsuper as supermod class DoxygenTypeSub(supermod.DoxygenType): def __init__(self, version=None, compound=None): supermod.DoxygenType.__init__(se...
gpl-3.0
-7,973,063,119,899,299,000
23.298701
77
0.647782
false
09zwcbupt/undergrad_thesis
ext/poxdesk/qx/tool/pylib/pyparse/pyparsing.py
8
153237
# module pyparsing.py # # Copyright (c) 2003-2010 Paul T. McGuire # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, cop...
gpl-3.0
48,624,897,203,446,740
39.421261
196
0.577654
false
darmaa/odoo
addons/hr_evaluation/report/__init__.py
441
1076
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
2,715,984,978,931,876,400
43.833333
78
0.61803
false
CSyllabus/webapp
backend/apps/csyllabusapi/views/tests/test_country.py
1
1963
from django.test import TestCase, Client from ...models import Country from django.core.exceptions import ObjectDoesNotExist import json from django.utils import timezone class CountryViewTestCase(TestCase): def test_post(self): country1 = Country.objects.create(name="Italy") c = Client() ...
mit
6,217,689,419,906,817,000
32.862069
93
0.579725
false
imply/chuu
ppapi/generators/idl_release.py
63
9668
#!/usr/bin/env python # 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. """ IDLRelease for PPAPI This file defines the behavior of the AST namespace which allows for resolving a symbol as one or more AS...
bsd-3-clause
-5,784,455,275,666,914,000
26.54416
78
0.672735
false
heke123/chromium-crosswalk
chrome/common/extensions/docs/server2/fake_fetchers.py
36
4590
# 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. # These are fake fetchers that are used for testing and the preview server. # They return canned responses for URLs. url_fetcher_fake.py uses the fake # ...
bsd-3-clause
5,932,316,556,011,573,000
29.397351
80
0.633115
false
zach-/roll20_britannia
image_processing/image_knit.py
1
1802
import json from PIL import Image, ImageTk from cv2 import imread, imwrite from numpy import zeros, unique from tkinter import Toplevel, Label from glob import glob import os from re import search def change_values(data): removex = data[0]["X"] removey = data[0]["Y"] for cell in data: cell["X"] = ...
mit
8,135,171,128,153,427,000
28.064516
77
0.527192
false
nesterione/scikit-learn
examples/ensemble/plot_random_forest_embedding.py
286
3531
""" ========================================================= Hashing feature transformation using Totally Random Trees ========================================================= RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representation, which might be beneficial for classificati...
bsd-3-clause
-6,507,203,299,573,897,000
32.628571
79
0.709997
false
pdellaert/ansible
test/lib/ansible_test/_internal/sanity/yamllint.py
14
3420
"""Sanity test using yamllint.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os from .. import types as t from ..sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SANITY_ROOT, ) from ..target import (...
gpl-3.0
341,576,080,365,326,000
25.929134
147
0.576901
false
paytokens-beta/paytokensd
lib/rpsresolve.py
1
6548
#! /usr/bin/python3 import binascii import struct from . import (util, config, exceptions, jetcoin, util, rps) # move random rps_match_id FORMAT = '>H16s32s32s' LENGTH = 2 + 16 + 32 + 32 ID = 81 def validate (db, source, move, random, rps_match_id): problems = [] rps_match = None if not isinstance(move...
mit
-8,893,628,784,314,526,000
37.733728
147
0.624198
false
mancoast/CPythonPyc_test
fail/321_threaded_import_hangers.py
57
1428
# This is a helper module for test_threaded_import. The test imports this # module, and this module tries to run various Python library functions in # their own thread, as a side effect of being imported. If the spawned # thread doesn't complete in TIMEOUT seconds, an "appeared to hang" message # is appended to the m...
gpl-3.0
-8,390,461,230,207,551,000
33
81
0.679972
false
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/openid/store/nonce.py
180
2843
__all__ = [ 'split', 'mkNonce', 'checkTimestamp', ] from openid import cryptutil from time import strptime, strftime, gmtime, time from calendar import timegm import string NONCE_CHARS = string.ascii_letters + string.digits # Keep nonces for five hours (allow five hours for the combination of # reque...
mit
5,846,635,125,210,840,000
28.010204
70
0.658108
false
todaychi/hue
desktop/core/ext-py/pycparser-2.14/examples/c-to-c.py
19
1578
#------------------------------------------------------------------------------ # pycparser: c-to-c.py # # Example of using pycparser.c_generator, serving as a simplistic translator # from C to AST and back to C. # # Copyright (C) 2008-2015, Eli Bendersky # License: BSD #------------------------------------------------...
apache-2.0
7,781,619,414,835,135,000
24.451613
79
0.542459
false
zstackorg/zstack-woodpecker
zstackwoodpecker/zstackwoodpecker/header/host.py
4
1304
import zstackwoodpecker.header.header as zstack_header CONNECTED = 'Connected' CONNECTING = 'Connecting' DISCONNECTED = 'Disconnected' ENABLED = 'Enabled' DISABLED = 'Disabled' PREMAINTENANCE = 'PreMaintenance' MAINTENANCE = 'Maintenance' class TestHost(zstack_header.ZstackObject): def __init__(self): self...
apache-2.0
5,679,643,656,064,340,000
23.148148
70
0.619632
false
peterlauri/django
django/contrib/admin/utils.py
14
19023
from __future__ import unicode_literals import datetime import decimal from collections import defaultdict from django.contrib.auth import get_permission_codename from django.core.exceptions import FieldDoesNotExist from django.db import models from django.db.models.constants import LOOKUP_SEP from django.db.models.d...
bsd-3-clause
2,394,298,465,463,930,400
34.097786
110
0.587237
false
konstantinoskostis/sqlalchemy-utils
sqlalchemy_utils/primitives/currency.py
5
2588
# -*- coding: utf-8 -*- import six from .. import i18n, ImproperlyConfigured from ..utils import str_coercible @str_coercible class Currency(object): """ Currency class wraps a 3-letter currency code. It provides various convenience properties and methods. :: from babel import Locale ...
bsd-3-clause
-7,865,761,566,241,043,000
22.962963
78
0.566461
false
DamourYouKnow/HAHA-NO-UR
main.py
1
2130
''' A discord bot for scouting in Love Live: School Idol Festival. ''' import sys from asyncio import get_event_loop from json import load from time import time from threading import Thread from commands import * from bot import HahaNoUR, get_session_manager from bot.logger import setup_logging from config import conf...
mit
1,117,899,858,481,930,000
24.662651
77
0.606573
false
indashnet/InDashNet.Open.UN2000
android/external/chromium_org/tools/site_compare/scrapers/ie/ie7.py
189
5669
#!/usr/bin/env python # Copyright (c) 2011 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. """Does scraping for all known versions of IE.""" import pywintypes import time import types from drivers import keyboard from dr...
apache-2.0
5,581,537,709,557,499,000
25.995238
79
0.665197
false
kelseyoo14/Wander
venv_2_7/lib/python2.7/site-packages/pandas/tests/test_categorical.py
9
162878
# -*- coding: utf-8 -*- # pylint: disable=E1101,E1103,W0232 from datetime import datetime from pandas.compat import range, lrange, u, PY3 import os import pickle import re from distutils.version import LooseVersion import numpy as np import pandas as pd from pandas import Categorical, Index, Series, DataFrame, Perio...
artistic-2.0
-8,708,013,545,450,238,000
41.042938
287
0.54885
false
aroche/django
django/db/backends/sqlite3/introspection.py
204
11332
import re from collections import namedtuple from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',)) def get_field_size(name)...
bsd-3-clause
6,925,916,050,943,244,000
40.357664
112
0.55683
false
cogmission/nupic
setup.py
2
6053
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
8,090,593,245,804,107,000
31.718919
91
0.662316
false
mattjj/pyhsmm-slds
pyslds/models.py
2
20741
from __future__ import division import numpy as np from functools import partial from builtins import zip from pybasicbayes.distributions import DiagonalRegression, Gaussian, Regression import pyhsmm from pyhsmm.util.general import list_split from pyslds.states import HMMSLDSStatesPython, HMMSLDSStatesEigen, HSMMSLD...
mit
-6,135,905,188,730,445,000
37.267528
114
0.593944
false
nihilus/diaphora
pygments/lexers/tcl.py
47
5398
# -*- coding: utf-8 -*- """ pygments.lexers.tcl ~~~~~~~~~~~~~~~~~~~ Lexers for Tcl and related languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import...
gpl-2.0
-6,790,748,791,974,640,000
36.227586
100
0.435346
false
ConnorGBrewster/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/constants.py
141
4619
from . import utils content_types = utils.invert_dict({"text/html": ["htm", "html"], "application/json": ["json"], "application/xhtml+xml": ["xht", "xhtm", "xhtml"], "application/xml": ["xml"], ...
mpl-2.0
-2,992,992,566,073,011,000
49.206522
85
0.512449
false
alexandernajafi/nifty_stuff
patrik/emacs.d/plugins/yasnippet/doc/compile-doc.py
21
3784
#!/usr/bin/python # Compile document to HTML use docutils. # ======================================== # Pygments syntax highlighting # ======================================== from pygments.formatters import HtmlFormatter # Set to True if you want inline CSS styles instead of classes INLINESTYLES = True from pygment...
bsd-2-clause
3,800,691,771,649,286,700
33.4
79
0.624736
false
mitsuhiko/sentry
src/sentry/models/authprovider.py
5
1606
from __future__ import absolute_import, print_function from bitfield import BitField from django.db import models from django.utils import timezone from jsonfield import JSONField from sentry.db.models import ( BoundedPositiveIntegerField, FlexibleForeignKey, Model, sane_repr ) class AuthProvider(Model): __...
bsd-3-clause
8,257,545,484,657,626,000
29.301887
88
0.688667
false
achang97/YouTunes
lib/python2.7/site-packages/gunicorn/reloader.py
13
3598
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import os import os.path import re import sys import time import threading class Reloader(threading.Thread): def __init__(self, extra_files=None, interval=1, callback=None): supe...
mit
8,327,128,300,346,942,000
28.252033
88
0.549194
false
ahmadRagheb/goldenHR
erpnext/patches/v5_0/recalculate_total_amount_in_jv.py
108
1062
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe from frappe.utils import money_in_words def execute(): company_currency = dict(frappe.db.sql("select name, default_currency from `tabCompany`")) bank_or_cash_accounts = frappe...
gpl-3.0
4,976,100,920,543,584,000
41.48
95
0.704331
false
minhphung171093/GreenERP_V8
openerp/addons/payment_authorize/models/authorize.py
201
6963
# -*- coding: utf-'8' "-*-" import hashlib import hmac import logging import time import urlparse from openerp import api, fields, models from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment_authorize.controllers.main import AuthorizeController from openerp.tools.floa...
agpl-3.0
-8,946,651,792,264,672,000
41.2
152
0.57705
false
jdowner/gist
tests/test_config.py
1
1307
import configparser import gist import pytest @pytest.fixture def config(): cfg = configparser.ConfigParser() cfg.add_section("gist") return cfg def test_get_value_from_command(): """ Ensure that values which start with ``!`` are treated as commands and return the string printed to stdout b...
mit
-2,999,181,374,152,996,000
31.675
88
0.703137
false
lesina/Hack70
src/content/migrations/0001_initial.py
1
1381
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-20 07:19 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 = [ ('course...
gpl-3.0
-6,876,256,917,491,472,000
36.324324
142
0.606083
false
toolforger/sympy
sympy/polys/domains/algebraicfield.py
93
4194
"""Implementation of :class:`AlgebraicField` class. """ from __future__ import print_function, division from sympy.polys.domains.field import Field from sympy.polys.domains.simpledomain import SimpleDomain from sympy.polys.domains.characteristiczero import CharacteristicZero from sympy.polys.polyclasses import ANP f...
bsd-3-clause
5,103,677,046,673,374,000
31.765625
95
0.598712
false
jamestwebber/scipy
scipy/fftpack/tests/test_real_transforms.py
2
24175
from __future__ import division, print_function, absolute_import from os.path import join, dirname import numpy as np from numpy.testing import assert_array_almost_equal, assert_equal import pytest from pytest import raises as assert_raises from scipy.fftpack.realtransforms import ( dct, idct, dst, idst, dctn, i...
bsd-3-clause
7,829,799,792,764,493,000
28.517705
86
0.552223
false
fkarb/xltable
docs/conf.py
3
7921
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # xltable documentation build configuration file, created by # sphinx-quickstart on Wed Apr 15 11:52:17 2015. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # auto...
mit
-1,454,405,201,276,858,600
31.068826
80
0.704583
false
yuchangfu/pythonfun
flaskenv/Lib/encodings/mac_farsi.py
593
15426
""" Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
gpl-3.0
-822,852,734,427,734,900
49.247557
120
0.568974
false
kmiddleton/dewarp_video
setupCV.py
1
1758
# -*- coding: utf-8 -*- def setupCV(cameraMatrixFile, distortionCoefsFile): """ Load camera matrix and distortion coefficients. Function to load the camera matrix and distortion coefficients from saved files and returning them in the proper format. Args: cameraMatrixFile (string): Path to...
cc0-1.0
2,042,244,417,448,009,500
37.217391
75
0.678612
false
richardcs/ansible
lib/ansible/plugins/lookup/nios.py
80
4057
# # Copyright 2018 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
3,535,728,768,616,708,600
33.675214
147
0.684249
false
whitzhu/fle-home
fle_site/apps/articles/migrations/0003_auto__add_field_tag_slug.py
10
8057
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Tag.slug' db.add_column('articles_tag', 'slug', self.gf('django.db.models.fields.CharField')(defau...
mit
6,217,352,641,795,369,000
71.585586
191
0.552687
false
kunalghosh/T-61.6050-Special-Course-in-Deep-Learning
exercises/utils/mlp.py
1
1926
import theano.tensor as T from logistic_reg import LogisticRegression from hiddenLayer import HiddenLayer class MLP(object): def __init__(self, rng, inpt, layers, scale=1): ''' len(layers) must be atleast 3 input -> hidden -> output but it can be more as well. ''' se...
mit
-808,134,100,188,311,700
39.978723
92
0.455867
false
rpmcpp/Audacity
lib-src/lv2/sord/waflib/Tools/python.py
61
13210
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys from waflib import Utils,Options,Errors,Logs from waflib.TaskGen import extension,before_method,after_method,feature from waflib.Configure import conf FRAG=''' #...
gpl-2.0
1,975,625,510,144,763,100
37.852941
220
0.69947
false
weimingtom/python-for-android
python3-alpha/python3-src/Lib/test/test_hashlib.py
47
14178
# Test hashlib module # # $Id$ # # Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) # Licensed to PSF under a Contributor Agreement. # import array import hashlib import itertools import sys try: import threading except ImportError: threading = None import unittest import warnings from test impor...
apache-2.0
-6,718,522,857,242,505,000
36.607427
85
0.623995
false