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
ppwwyyxx/tensorflow
tensorflow/examples/speech_commands/generate_streaming_test_wav.py
23
11074
# 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
-9,019,512,501,110,795,000
37.85614
105
0.667419
false
pothosware/gnuradio
gr-digital/python/digital/qa_clock_recovery_mm.py
45
5378
#!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your optio...
gpl-3.0
-1,078,142,984,001,026,200
29.384181
84
0.559316
false
TheTimmy/spack
var/spack/repos/builtin/packages/easybuild/package.py
3
1703
############################################################################## # Copyright (c) 2017, Kenneth Hoste # # This file is part of Spack. # Created by Kenneth Hoste, kenneth.hoste@gmail.com # # For details, see https://github.com/llnl/spack # Please also see the NOTICE and LICENSE files for our notice and the ...
lgpl-2.1
-8,301,545,125,183,858,000
43.815789
83
0.661773
false
apark263/tensorflow
tensorflow/python/training/session_manager_test.py
11
33665
# 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
8,843,576,877,582,383,000
40.256127
80
0.641943
false
jj0hns0n/geonode
scripts/cloud/demo_site.py
24
3716
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
2,890,165,075,286,033,400
36.535354
92
0.627826
false
tinloaf/home-assistant
tests/components/test_system_log.py
1
9023
"""Test system log component.""" import logging from unittest.mock import MagicMock, patch from homeassistant.core import callback from homeassistant.bootstrap import async_setup_component from homeassistant.components import system_log _LOGGER = logging.getLogger('test_logger') BASIC_CONFIG = { 'system_log': { ...
apache-2.0
-5,514,070,416,520,113,000
34.805556
74
0.647124
false
wraiden/spacewalk
client/rhel/rhn-client-tools/src/actions/hardware.py
3
1142
#!/usr/bin/python # Copyright (c) 1999--2016 Red Hat, Inc. Distributed under GPLv2. # # Author: Adrian Likins <alikins@redhat.com> # imports are a bit weird here to avoid name collions on "harware" import sys sys.path.append("/usr/share/rhn/") from up2date_client import hardware from up2date_client import up2dateA...
gpl-2.0
5,867,446,367,480,152,000
23.826087
68
0.645359
false
risicle/django
tests/managers_regress/models.py
245
3566
""" Various edge-cases for model managers. """ from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import force_text, python_2_unicode_compatible class OnlyFred(mo...
bsd-3-clause
5,720,068,105,682,584,000
22.932886
105
0.700224
false
bverburg/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/hdbits.py
45
4648
import re import json import traceback from couchpotato.core.helpers.variable import tryInt, getIdentifier from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider log = CPLog(__name__) class Base(TorrentProvider): urls = { 'test': 'http...
gpl-3.0
-8,348,464,893,871,556,000
35.598425
627
0.488167
false
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/contracts/testing/utils.py
3
1693
from ..interface import (ContractSyntaxError, describe_value, ContractNotRespected) from ..main import parse_contract_string, check_contracts def check_contracts_ok(contract, value): if isinstance(contract, str): contract = [contract] value = [value] context = check_co...
agpl-3.0
2,667,312,903,854,337,500
26.754098
71
0.570585
false
splav/servo
tests/wpt/web-platform-tests/webdriver/tests/element_click/interactability.py
20
3922
import pytest from tests.support.asserts import assert_error, assert_success from tests.support.inline import inline def element_click(session, element): return session.transport.send( "POST", "session/{session_id}/element/{element_id}/click".format( session_id=session.session_id, ...
mpl-2.0
-3,808,400,321,913,989,600
28.938931
92
0.63539
false
tedi3231/openerp
build/lib/openerp/addons/report_webkit/webkit_report.py
4
14795
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # Contributor(s) : Florent Xicluna (Wingo SA) # # WARNING: This program as such is intended...
agpl-3.0
2,747,064,016,605,099,500
42.772189
131
0.533018
false
yCanta/yCanta
regen_db.py
1
3115
#!/usr/bin/env python from webapp.model import Song, Songbook, hub try: # try c version for speed then fall back to python import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET import xml.parsers.expat import webapp.c_utilities as c from posixpath import * import turbogears impo...
unlicense
-4,722,866,939,589,505,000
28.11215
138
0.651364
false
Cinntax/home-assistant
homeassistant/components/opengarage/cover.py
1
5524
"""Platform for the opengarage.io cover component.""" import logging import requests import voluptuous as vol from homeassistant.components.cover import ( CoverDevice, DEVICE_CLASS_GARAGE, PLATFORM_SCHEMA, SUPPORT_OPEN, SUPPORT_CLOSE, ) from homeassistant.const import ( CONF_NAME, STATE_CL...
apache-2.0
-5,574,541,414,185,043,000
29.185792
87
0.59685
false
y12uc231/edx-platform
common/djangoapps/monitoring/signals.py
172
4584
""" Add receivers for django signals, and feed data into the monitoring system. If a model has a class attribute 'METRIC_TAGS' that is a list of strings, those fields will be retrieved from the model instance, and added as tags to the recorded metrics. """ from django.db.models.signals import post_save, post_delete,...
agpl-3.0
-2,647,746,199,598,295,000
32.955556
98
0.669503
false
gundalow/ansible-modules-extras
cloud/cloudstack/cs_instance.py
10
36881
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
6,173,070,347,577,890,000
34.666344
217
0.59077
false
alon/servo
tests/wpt/css-tests/css-text-3_dev/xhtml1print/support/generate-segment-break-transformation-rules-tests.py
324
4862
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests segment-break-transformation-rules-001 ~ 049 which cover all possible combinations of characters at two sides of segment breaks. More specifically, there are seven types of characters involve in these rules: 1. East Asian Full-width (F)...
mpl-2.0
-6,415,390,813,129,318,000
43.229358
123
0.605891
false
lausser/coshsh
tests/test_application_mysql.py
1
3116
import unittest import sys import os import logging sys.dont_write_bytecode = True sys.path.insert(0, os.path.abspath("..")) #sys.path.insert(0, os.path.abspath(os.path.join("..", "coshsh"))) import coshsh from coshsh.generator import Generator #from datasource import Datasource from coshsh.host import Host from cosh...
agpl-3.0
-629,217,532,276,216,300
38.443038
152
0.608472
false
danielvdao/facebookMacBot
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py
327
6557
# urllib3/_collections.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from collections import Mapping, MutableMapping try: from threading import RLock excep...
mit
-7,934,124,323,927,202,000
30.985366
92
0.60973
false
jwhui/openthread
tools/harness-automation/cases/leader_5_6_6.py
18
1877
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
7,508,945,234,717,609,000
40.711111
77
0.761854
false
drxaero/calibre
src/calibre/ebooks/metadata/sources/covers.py
13
5969
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import time f...
gpl-3.0
5,876,443,635,214,135,000
30.088542
110
0.577149
false
hongliang5623/sentry
src/sentry/api/endpoints/project_search_details.py
23
2463
from __future__ import absolute_import from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.project import ProjectEndpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.api.serializers import serialize from sentry.models import SavedSearch cl...
bsd-3-clause
-1,561,855,981,441,736,700
24.926316
75
0.587089
false
abhattad4/Digi-Menu
django/template/loader_tags.py
100
9868
from collections import defaultdict from django.template.base import ( Library, Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs, ) from django.utils import six from django.utils.safestring import mark_safe register = Library() BLOCK_CONTEXT_KEY = 'block_context' class ExtendsError(Exc...
bsd-3-clause
-5,648,067,205,941,862,000
36.953846
111
0.602858
false
JioCloud/tempest
tempest/api/image/v2/test_images.py
6
10418
# Copyright 2013 OpenStack Foundation # Copyright 2013 IBM Corp # 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/LICE...
apache-2.0
8,463,105,307,117,775,000
37.021898
78
0.612978
false
mlundblad/telepathy-gabble
tests/twisted/vcard/disconnect-during-pep.py
2
1199
""" Regression test for https://bugs.freedesktop.org/show_bug.cgi?id=31412 """ import dbus from servicetest import call_async, EventPattern, sync_dbus from gabbletest import (exec_test, make_result_iq, acknowledge_iq, disconnect_conn) import constants as cs def test(q, bus, conn, stream): event = q.expec...
lgpl-2.1
-604,697,615,475,491,800
31.405405
74
0.673061
false
indictranstech/fbd_erpnext
erpnext/accounts/report/financial_statements.py
1
7760
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, _dict from frappe.utils import (flt, getdate, get_first_day, get_last_day, add_months, add_days, formatdate) def g...
agpl-3.0
-7,527,998,118,984,529,000
29.551181
118
0.669974
false
bmotlaghFLT/FLT_PhantomJS
src/breakpad/src/tools/gyp/test/generator-output/gyptest-copies.py
151
1694
#!/usr/bin/env 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. """ Verifies file copies using an explicit build target of 'all'. """ import TestGyp test = TestGyp.TestGyp() test.writable(test.workpath...
bsd-3-clause
7,322,185,558,469,738,000
28.719298
78
0.688902
false
Shouqun/node-gn
tools/depot_tools/third_party/boto/pyami/scriptbase.py
90
1422
import os import sys from boto.utils import ShellCommand, get_ts import boto import boto.utils class ScriptBase: def __init__(self, config_file=None): self.instance_id = boto.config.get('Instance', 'instance-id', 'default') self.name = self.__class__.__name__ self.ts = get_ts() if ...
mit
-8,793,452,691,590,407,000
31.318182
109
0.559072
false
dlodato/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawClusters.py
41
5445
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
2,494,467,371,869,293,600
48.063063
173
0.599633
false
JennyChi/Script-helper
BAT/nonclustering/DC/size_simple_event.py
3
1771
## file_simple_event.py # Author: Chen-Ning (Jenny) Chi # Date: 2011 Sep ########################################################### ## The program will generate & input simple event. # Support files & directory. # Could specify the new file to create the specified size events. # Could specify how many events are ...
apache-2.0
-2,612,844,783,121,636,000
30.070175
129
0.600226
false
moritz-wundke/Concurrent
concurrent/core/transport/pyjsonrpc/http.py
1
8216
#!/usr/bin/env python # coding: utf-8 import sys import urllib2 import base64 import BaseHTTPServer import SocketServer import httplib import urllib import urlparse from StringIO import StringIO import gzip import rpcrequest import rpcresponse import rpcerror import rpclib from rpcjson import json def http_request(u...
mit
-3,441,411,038,702,147,000
25.418006
82
0.581548
false
angelman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/factory.py
118
5888
# Copyright (C) 2010 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 ...
bsd-3-clause
5,463,417,951,094,886,000
45
133
0.663723
false
pierky/ripe-atlas-tools
tests/commands/measure.py
1
34634
# -*- coding: UTF-8 -*- # Copyright (c) 2015 RIPE NCC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This progra...
gpl-3.0
-2,836,823,426,343,584,300
35.798087
100
0.445693
false
Prash88/my-wedding
node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
mit
3,570,014,633,721,116,700
27.78
73
0.640375
false
Liuqian0501/elements-of-programming-interview
09-binary-tree/9-1-Test if a binary tree is height-balanced/python/balanced_binary_tree.py
2
1774
from binary_tree_prototype import BinaryTreeNode import collections # @include def is_balanced_binary_tree(tree): BalancedStatusWithHeight = collections.namedtuple( 'BalancedStatusWithHeight', ('balanced', 'height')) # First value of the return value indicates if tree is balanced, and if # balanc...
mit
6,789,483,874,265,193,000
31.254545
75
0.66009
false
tomchristie/django
django/views/generic/dates.py
4
25236
import datetime from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import models from django.http import Http404 from django.utils import timezone from django.utils.functional import cached_property from django.utils.translation import gettext as _ from django.views...
bsd-3-clause
1,357,326,610,280,561,700
34.05
103
0.594151
false
alirizakeles/tendenci
tendenci/apps/directories/tests.py
1
1387
""" This file demonstrates two different styles of tests (one doctest and one unittest). These will both pass when you run "manage.py test". Replace these with more appropriate tests for your application. """ from django.test import TestCase, Client from django.contrib.auth.models import User from tendenci.apps.direc...
gpl-3.0
-722,451,136,352,159,500
28.510638
73
0.666907
false
jkibele/OpticalRS
OpticalRS/DepthEstimator.py
1
9986
# -*- coding: utf-8 -*- """ DepthEstimator ============== Code for handling required data and producing depth estimates from multispectral satellite imagery. KNN (Kibele and Shears, In Review) and linear methods (Lyzenga et al., 2006) are currently supported. References ---------- Kibele, J., Shears, N.T., In Press....
bsd-3-clause
-7,517,890,316,098,358,000
39.258065
109
0.597556
false
marcusramberg/dotfiles
link/hammerspoon/hs/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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 re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
1,351,469,147,559,058,700
29.524691
80
0.639838
false
liu21st/masterfirefoxos
masterfirefoxos/base/middleware.py
2
2023
from django.conf import settings from django.http import HttpResponseRedirect class NonExistentLocaleRedirectionMiddleware(object): """Redirect to the 'en' version of a page if translation does not exist. This middleware redirects requests to pages with locale other than 'en' to their 'en' version. The m...
mpl-2.0
-4,366,393,971,210,195,000
39.46
76
0.59911
false
mcltn/ansible-modules-extras
monitoring/nagios.py
39
36108
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file is largely copied from the Nagios module included in the # Func project. Original copyright follows: # # func-nagios - Schedule downtime and enables/disable notifications # Copyright 2011, Red Hat, Inc. # Tim Bielawa <tbielawa@redhat.com> # # This software may be ...
gpl-3.0
-1,178,139,650,947,743,500
34.056311
441
0.604991
false
xq262144/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/messages/tests/urls.py
119
2470
from django.conf.urls import patterns, url from django.contrib import messages from django.core.urlresolvers import reverse from django import forms from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext, Template from django.template.response import TemplateResponse from ...
apache-2.0
-2,582,673,930,275,093,500
32.835616
91
0.703239
false
ddboline/pylearn2
pylearn2/costs/tests/test_term_1_0_l1_penalty.py
33
2673
""" Test term_1_0_l1_penalty """ import numpy as np from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.models.mlp import MLP, Sigmoid from pylearn2.train import Train from pylearn2.training_algorithms.sgd import SGD, ExponentialDecay from pylearn2.termination_criteria import And, EpochCou...
bsd-3-clause
-6,457,076,522,960,942,000
33.269231
79
0.546577
false
TEAM-Gummy/platform_external_chromium_org
chrome/browser/extensions/PRESUBMIT.py
57
12404
# 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. """Chromium presubmit script for src/chrome/browser/extensions. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more det...
bsd-3-clause
5,994,708,311,195,304,000
39.937294
79
0.638584
false
xen0l/ansible
lib/ansible/plugins/netconf/default.py
79
2030
# # (c) 2017 Red Hat 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 d...
gpl-3.0
5,624,308,527,988,444,000
38.038462
118
0.649754
false
dhruvg/luigi
luigi/db_task_history.py
50
8720
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # 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,731,571,966,869,994,000
37.414097
127
0.644954
false
TechBK/horizon-dev
openstack_dashboard/dashboards/project/routers/views.py
36
8431
# Copyright 2012, Nachi Ueno, NTT MCL, Inc. # Copyright 2013, Big Switch Networks, 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...
apache-2.0
-3,362,432,892,930,063,400
39.339713
79
0.596608
false
softlayer/softlayer-python
SoftLayer/CLI/dedicatedhost/list.py
4
2313
"""List dedicated servers.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import columns as column_helper from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers COLUMNS = [ column_helper.Column('datacenter',...
mit
-7,528,834,387,916,019,000
32.042857
73
0.587116
false
gfyoung/numpy
numpy/lib/tests/test_packbits.py
17
12851
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import assert_array_equal, assert_equal, assert_raises def test_packbits(): # Copied from the docstring. a = [[[1, 0, 1], [0, 1, 0]], [[1, 1, 0], [0, 0, 1]]] for dt in '?bBhHiIlLqQ': ar...
bsd-3-clause
3,452,184,264,935,454,000
46.951493
88
0.372967
false
Eric89GXL/mne-python
mne/externals/tqdm/_tqdm/std.py
14
55471
""" Customisable progressbar decorator for iterators. Includes a default (x)range iterator printing to stderr. Usage: >>> from tqdm import trange[, tqdm] >>> for i in trange(10): #same as: for i in tqdm(xrange(10)) ... ... """ from __future__ import absolute_import, division # compatibility functions and uti...
bsd-3-clause
-5,063,074,868,960,030,000
36.890027
80
0.536046
false
mbauskar/omnitech-demo-erpnext
erpnext/setup/doctype/global_defaults/global_defaults.py
55
2227
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals """Global Defaults""" import frappe import frappe.defaults from frappe.utils import cint from frappe.custom.doctype.property_setter.property_setter impo...
agpl-3.0
8,889,649,739,319,591,000
34.349206
101
0.715312
false
quixoten/ansible
lib/ansible/plugins/inventory/aggregate.py
237
2266
# (c) 2012-2014, 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) an...
gpl-3.0
6,455,675,831,063,847,000
36.147541
79
0.654457
false
jmaas/cobbler
cobbler/items/item.py
1
18656
""" Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> This software may be freely redistributed under the terms of the GNU general public license. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundatio...
gpl-2.0
-5,257,253,946,318,414,000
38.609342
124
0.601576
false
inteos/IBAdmin
restore/models.py
1
1062
# -*- coding: UTF-8 -*- # # Copyright (c) 2015-2019 by Inteos Sp. z o.o. # All rights reserved. See LICENSE file for details. # from __future__ import unicode_literals from django.db import models """ class Permissions(models.Model): class Meta: managed = False permissions = ( ('rest...
agpl-3.0
-2,235,240,723,820,277,800
34.433333
65
0.548964
false
revpoint/prefs-n-perms
prefs_n_perms/sections.py
1
1192
from prefs_n_perms.client import db from prefs_n_perms.permissions import Permissions from prefs_n_perms.preferences import Preferences from prefs_n_perms.settings import preference_settings class Section(object): prefix = preference_settings.SECTIONS_PREFIX def __init__(self, name, **kwargs): self.n...
mit
-9,189,466,580,389,179,000
24.361702
54
0.641779
false
adrienbrault/home-assistant
tests/components/trace/test_utils.py
2
1169
"""Test trace helpers.""" from datetime import timedelta from homeassistant import core from homeassistant.components import trace from homeassistant.util import dt as dt_util def test_json_encoder(hass): """Test the Trace JSON Encoder.""" ha_json_enc = trace.utils.TraceJSONEncoder() state = core.State("...
mit
3,634,082,463,287,204,000
26.833333
78
0.627887
false
bfirsh/django-old
django/contrib/gis/db/models/sql/query.py
379
5314
from django.db import connections from django.db.models.query import sql from django.contrib.gis.db.models.fields import GeometryField from django.contrib.gis.db.models.sql import aggregates as gis_aggregates from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField from django.contri...
bsd-3-clause
-3,786,327,239,213,824,500
43.655462
97
0.637373
false
miipl-naveen/optibizz
addons/stock_picking_wave/wizard/picking_to_wave.py
382
1624
############################################################################## # # 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 Affero General Public L...
agpl-3.0
-2,498,065,670,355,011,000
46.794118
95
0.628695
false
keedio/hue
desktop/core/ext-py/python-openid-2.2.5/setup.py
56
1682
import sys import os from distutils.core import setup if 'sdist' in sys.argv: os.system('./admin/makedoc') version = '[library version:2.2.5]'[17:-1] setup( name='python-openid', version=version, description='OpenID support for servers and consumers.', long_description='''This is a set of Python...
apache-2.0
374,008,846,243,616,060
35.565217
82
0.650416
false
numerigraphe/stock-logistics-warehouse
__unported__/stock_available_immediately/__openerp__.py
5
1363
# -*- coding: utf-8 -*- # # # Author: Guewen Baconnier # Copyright 2010-2012 Camptocamp SA # Copyright (C) 2011 Akretion Sébastien BEAU <sebastien.beau@akretion.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as #...
agpl-3.0
7,649,733,926,563,730,000
33.05
77
0.675477
false
acquia/Diamond
src/collectors/onewire/onewire.py
53
2416
# coding=utf-8 """ The OneWireCollector collects data from 1-Wire Filesystem You can configure which sensors are read in two way: - add section [scan] with attributes and aliases, (collector will scan owfs to find attributes) or - add sections with format id:$SENSOR_ID See also: http://owfs.org/ Author: Tomas...
mit
8,140,003,941,477,633,000
24.702128
77
0.514073
false
LiaoPan/scikit-learn
sklearn/neighbors/tests/test_nearest_centroid.py
305
4121
""" Testing for the nearest centroid module. """ import numpy as np from scipy import sparse as sp from numpy.testing import assert_array_equal from numpy.testing import assert_equal from sklearn.neighbors import NearestCentroid from sklearn import datasets from sklearn.metrics.pairwise import pairwise_distances # t...
bsd-3-clause
-4,138,792,061,354,202,600
29.301471
72
0.645232
false
jpaalasm/pyglet
pyglet/font/freetype.py
26
13163
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
-7,581,732,745,991,547,000
34.866485
80
0.606853
false
HiSPARC/station-software
user/python/Lib/nntplib.py
92
21470
"""An NNTP client class based on RFC 977: Network News Transfer Protocol. Example: >>> from nntplib import NNTP >>> s = NNTP('news') >>> resp, count, first, last, name = s.group('comp.lang.python') >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last Group comp.lang.python has 51 articles, rang...
gpl-3.0
7,369,082,507,752,612,000
32.757862
80
0.555752
false
rwesterlund/pysteam
pysteam/tests/test_user.py
1
1232
#!/usr/bin/env python # encoding: utf-8 """ test_user.py Created by Scott on 2013-12-29. Copyright (c) 2013 Scott Rice. All rights reserved. """ import sys import os import mock import shutil import tempfile import unittest from pysteam import steam from pysteam import user class TestUser(unittest.TestCase): ...
mit
-4,519,453,434,119,878,700
30.615385
95
0.719156
false
dgouldin/django-socialite
socialite/apps/myspace/helper.py
1
1221
import oauth2 as oauth import urlparse from django.conf import settings from django.contrib.auth.models import User from django.core.cache import cache from django.utils import simplejson from socialite.apps.base.oauth import helper as oauth_helper from socialite.apps.base.oauth20.utils import get_mutable_query_dict ...
mit
-5,701,995,020,682,012,000
32.916667
107
0.732187
false
htwenhe/DJOA
env/Lib/site-packages/django/template/loader_tags.py
115
12330
import logging from collections import defaultdict from django.utils import six from django.utils.safestring import mark_safe from .base import ( Node, Template, TemplateSyntaxError, TextNode, Variable, token_kwargs, ) from .library import Library register = Library() BLOCK_CONTEXT_KEY = 'block_context' logger...
mit
5,265,148,879,168,746,000
37.895899
111
0.600243
false
jholloman/node-gyp
gyp/pylib/gyp/easy_xml.py
1049
4803
# Copyright (c) 2011 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 re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
-4,933,394,291,325,316,000
29.592357
80
0.638976
false
qrkourier/ansible
lib/ansible/modules/windows/win_pagefile.py
42
3966
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2017, Liran Nisanov <lirannis@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in the .ps1 # file of the same name ANSIBLE_METADATA = {'metadata_vers...
gpl-3.0
5,058,137,035,469,085,000
27.532374
158
0.684065
false
kidburglar/youtube-dl
youtube_dl/extractor/crooksandliars.py
64
2061
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( int_or_none, qualities, ) class CrooksAndLiarsIE(InfoExtractor): _VALID_URL = r'https?://embed\.crooksandliars\.com/(?:embed|v)/(?P<id>[A-Za-z0-9]+)' _TESTS = [{ 'url': 'https://embed.crooksandliar...
unlicense
-2,350,202,205,262,566,000
33.35
101
0.534207
false
auready/django
tests/db_functions/models.py
11
1699
""" Tests for built in Function expressions. """ from django.db import models class Author(models.Model): name = models.CharField(max_length=50) alias = models.CharField(max_length=50, null=True, blank=True) goes_by = models.CharField(max_length=50, null=True, blank=True) age = models.PositiveSmallInt...
bsd-3-clause
5,994,139,831,086,847,000
32.313725
75
0.701589
false
sonuyos/couchpotato
libs/suds/mx/typer.py
203
4116
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
-7,791,473,606,229,264,000
32.463415
83
0.582362
false
ubc/edx-platform
lms/djangoapps/shoppingcart/processors/__init__.py
215
2574
""" Public API for payment processor implementations. The specific implementation is determined at runtime using Django settings: CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use. CC_PROCESSOR: Dictionary of configuration options for specific processor implementations, ...
agpl-3.0
8,885,376,412,171,255,000
27.285714
103
0.688811
false
whitepyro/debian_server_setup
lib/MultipartPostHandler.py
62
3557
#!/usr/bin/python #### # 06/2010 Nic Wolfe <nic@wolfeden.ca> # 02/2006 Will Holcomb <wholcomb@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the Li...
gpl-3.0
8,045,421,697,428,503,000
38.966292
110
0.574642
false
MSeifert04/astropy
astropy/visualization/scripts/fits2bitmap.py
2
7795
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os from distutils.version import LooseVersion from astropy.visualization.mpl_normalize import simple_norm from astropy import log from astropy.io.fits import getdata def fits2bitmap(filename, ext=0, out_fn=None, stretch='linear', ...
bsd-3-clause
-900,642,009,899,625,700
43.798851
78
0.579987
false
neilLasrado/frappe
frappe/core/page/background_jobs/background_jobs.py
17
1197
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from rq import Queue, Worker from frappe.utils.background_jobs import get_redis_conn from frappe.utils import format_datetime, cint colors = { 'queued': 'orange',...
mit
-5,769,711,556,241,931,000
22.470588
68
0.642439
false
aricchen/openHR
openerp/addons/base_gengo/__init__.py
57
1104
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Openerp sa (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
8,628,804,786,005,157,000
41.461538
78
0.625906
false
Jet-Streaming/gyp
build/lib/gyp/MSVSUserFile.py
8
5241
# Copyright (c) 2012 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. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xm...
bsd-3-clause
-868,897,882,514,389,900
33.653061
79
0.577371
false
jessrosenfield/pants
src/python/pants/backend/core/tasks/target_filter_task_mixin.py
7
1504
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.c...
apache-2.0
-6,347,385,056,332,908,000
44.575758
99
0.705452
false
bigswitch/neutron
neutron/tests/unit/callbacks/test_manager.py
5
8124
# Copyright 2015 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
2,910,578,807,380,029,400
40.030303
79
0.642541
false
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/google/gcp_compute_interconnect_attachment.py
1
15372
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
4,422,826,079,063,840,000
34.501155
152
0.65294
false
alexlo03/ansible
contrib/inventory/brook.py
27
9611
#!/usr/bin/env python # Copyright 2016 Doalitic. # # 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 ve...
gpl-3.0
349,524,894,473,432,200
35.823755
116
0.635522
false
kingofsystem/django-allauth
allauth/socialaccount/providers/flickr/views.py
65
1666
import json from django.utils.http import urlencode from allauth.socialaccount.providers.oauth.client import OAuth from allauth.socialaccount.providers.oauth.views import ( OAuthAdapter, OAuthLoginView, OAuthCallbackView) from .provider import FlickrProvider class FlickrAPI(OAuth): api_url = 'https...
mit
-2,726,943,071,581,839,000
35.217391
76
0.62545
false
educreations/django-ormcache
ormcache/managers.py
1
2096
from django.db.models.signals import class_prepared, post_delete, post_save from django.utils.functional import cached_property from ormcache.queryset import CachedQuerySet class CachedManagerMixin(object): @cached_property def __cache_enabled(self): return getattr(self.model, "cache_enabled", False...
mit
2,617,330,432,595,628,000
33.360656
78
0.62166
false
wkrzemien/DIRAC
TransformationSystem/Agent/TransformationAgentsUtilities.py
7
3139
""" Utility Class for threaded agents (e.g. TransformationAgent) Mostly for logging """ import time from DIRAC import gLogger __RCSID__ = "$Id$" AGENT_NAME = '' class TransformationAgentsUtilities(object): """ logging utilities for threaded TS agents """ def __init__(self): """ c'tor """ sel...
gpl-3.0
8,808,716,867,639,009,000
36.369048
111
0.619624
false
MounirMesselmeni/django
tests/gis_tests/geos_tests/test_geos.py
5
46748
from __future__ import unicode_literals import ctypes import json import random import unittest from binascii import a2b_hex, b2a_hex from io import BytesIO from unittest import skipUnless from django.contrib.gis import gdal from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import ( HAS_GE...
bsd-3-clause
5,649,489,197,817,285,000
40.007018
115
0.576067
false
glennbarrett/sslstrip
sslstrip/URLMonitor.py
60
2839
# Copyright (c) 2004-2009 Moxie Marlinspike # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distri...
gpl-3.0
-3,410,322,072,738,421,000
31.632184
99
0.635435
false
Majed6/kodi-habitica
script.habitica/addon.py
1
6718
#! python3 # -*- coding: utf-8 -*- import os import xbmcaddon import xbmcgui import datetime import resources.lib.httplib2 as httplib2 import urllib import json addon = xbmcaddon.Addon() dialog = xbmcgui.Dialog() http = httplib2.Http() class Habitica(xbmcgui.Window): def __init__(self): self.background = xbmcgui.C...
gpl-3.0
2,130,908,879,276,223,700
39.926829
146
0.688915
false
mmottahedi/neuralnilm_prototype
scripts/e65.py
2
2721
from __future__ import print_function, division from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify from lasagne.objectives import crossentropy from lasagne.init import Uniform, Normal from lasagne.layers import LSTMLayer, Dens...
mit
1,810,273,935,312,879,400
25.417476
92
0.62624
false
aisipos/django
django/db/backends/mysql/features.py
28
2938
from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property from .base import Database try: import pytz except ImportError: pytz = None class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () update_can_self_select = False ...
bsd-3-clause
-4,873,980,332,232,086,000
36.666667
101
0.684139
false
hbohuang/kubernetes
cluster/juju/charms/trusty/kubernetes/hooks/kubernetes_installer.py
148
2518
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
-1,403,427,269,254,630,100
36.029412
77
0.611994
false
ganeshgore/myremolab
server/launch/sample_balanced2_concurrent_experiments/main_machine/lab_and_experiment1/experiment76/server_config.py
242
1525
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- weblab_xilinx_experiment_xilinx_device = 'FPGA' weblab_xilinx_experiment_port_number = 1 # This should be something like this: # import os as _os # xilinx_home = _os.getenv('XILINX_HOME') # if xilinx_home == None: # if _os.name == 'nt': # xilinx_home = r'C:...
bsd-2-clause
-6,626,965,432,853,780,000
32.911111
116
0.681967
false
nicoTrombon/DjangoPolls
env/Lib/site-packages/django/db/models/sql/aggregates.py
174
4843
""" Classes to represent the default SQL aggregate functions """ import copy import warnings from django.db.models.fields import FloatField, IntegerField from django.db.models.lookups import RegisterLookupMixin from django.utils.deprecation import RemovedInDjango110Warning from django.utils.functional import cached_pr...
bsd-3-clause
-7,427,335,065,539,340,000
30.044872
91
0.626884
false
nkcr/WebIndex
app/venv/lib/python3.5/site-packages/pip/_vendor/colorama/ansi.py
640
2524
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. ''' This module generates ANSI character codes to printing colors to terminals. See: http://en.wikipedia.org/wiki/ANSI_escape_code ''' CSI = '\033[' OSC = '\033]' BEL = '\007' def code_to_chars(code): return CSI + str(code) + 'm' def set...
mit
-3,663,186,921,418,530,000
23.745098
78
0.540412
false
alexlo03/ansible
lib/ansible/module_utils/oneview.py
23
18876
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
-8,950,572,623,155,557,000
36.676647
125
0.639807
false
mcalmer/spacewalk
client/tools/rhncfg/config_management/rhncfg_diff_revisions.py
10
2765
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-4,715,343,344,376,730,000
32.719512
75
0.60434
false
sebrandon1/neutron
neutron/conf/wsgi.py
9
1262
# 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
-5,643,900,964,155,852,000
33.108108
78
0.655309
false
zarboz/xbmc
lib/libUPnP/Neptune/Build/Tools/SCons/gcc-generic.py
21
1153
import os def generate(env, gcc_cross_prefix=None, gcc_strict=True, gcc_stop_on_warning=None): if gcc_stop_on_warning == None: gcc_stop_on_warning = env['stop_on_warning'] ### compiler flags if gcc_strict: env.AppendUnique(CCFLAGS = ['-pedantic', '-Wall', '-W', '-Wundef', '-Wno-long-long']) ...
gpl-2.0
-1,331,433,406,760,817,700
33.969697
95
0.575889
false
acourtney2015/boto
boto/iam/connection.py
75
62193
# Copyright (c) 2010-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, Inc. # # 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, includin...
mit
-765,098,532,683,176,400
36.87637
115
0.605309
false
hep-gc/glint-horizon
openstack_dashboard/dashboards/admin/hypervisors/tests.py
7
2096
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 #...
apache-2.0
-2,121,620,840,377,456,600
40.098039
78
0.701813
false