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
iModels/foyer
foyer/tests/utils.py
1
3192
import glob from os.path import join, split, abspath import urllib.parse as parseurl import numpy as np def atomtype(structure, forcefield, **kwargs): """Compare known atomtypes to those generated by foyer. Parameters ---------- structure : parmed.Structure A parmed structure with `atom.type`...
mit
-5,376,610,217,032,805,000
29.692308
92
0.605263
false
carsongee/edx-platform
lms/djangoapps/shoppingcart/urls.py
12
1078
from django.conf.urls import patterns, url from django.conf import settings urlpatterns = patterns('shoppingcart.views', # nopep8 url(r'^postpay_callback/$', 'postpay_callback'), # Both the ~accept and ~reject callback pages are handled here url(r'^receipt/(?P<ordernum>[0-9]*)/$', 'show_receipt'), url(r'...
agpl-3.0
2,950,699,554,577,574,400
40.461538
117
0.641002
false
knossos-project/PythonQt
examples/NicePyConsole/module_completion.py
3
4932
# -*- coding: utf-8 -*- """ provide completions for modules 'import', copied code with some modifications from IPython!""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- from __future__ import pr...
lgpl-2.1
-2,445,425,459,961,235,000
27.674419
84
0.550081
false
tiagocoutinho/bliss
tests/continuous_scan/test_p201.py
1
2719
""" Continuous acquisition test using icepap motor and P201 card """ import os import sys import time import logging import argparse import gevent from bliss.config import static try: import bliss except ImportError: __this_dir = os.path.dirname(__file__) __juyo_dir = os.path.realpath(os.path.join(__thi...
lgpl-3.0
5,842,952,628,930,979,000
31.759036
87
0.613461
false
schmidtfederico/PRinde
core/modules/data_updater/sync.py
1
5697
from pymongo.errors import BulkWriteError from core.lib.jobs.base import BaseJob from core.lib.jobs.monitor import ProgressMonitor, JOB_STATUS_WAITING, JOB_STATUS_RUNNING __author__ = 'Federico Schmidt' class YieldDatabaseSync(BaseJob): def __init__(self, system_config): super(YieldDatabaseSync, self)._...
gpl-2.0
7,426,628,131,308,822,000
48.112069
113
0.54713
false
cjluo/money-monkey
email_sender.py
1
1506
import os import smtplib import logging from email.mime.text import MIMEText from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart class EmailSender: def __init__(self, address): self._address = address def send_email(self, title, image_pairs, delete=True): fro...
mit
-1,089,241,163,424,332,400
28.529412
76
0.563081
false
anthonyalmarza/trex
tests/test_scan.py
1
1942
from trex.redis import Connection from twisted.internet.defer import inlineCallbacks from twisted.trial import unittest from .mixins import RedisVersionCheckMixin, REDIS_HOST, REDIS_PORT class TestScan(unittest.TestCase, RedisVersionCheckMixin): KEYS = ['_scan_test_' + str(v).zfill(4) for v in range(100)] S...
mit
-1,663,686,892,160,437,500
31.915254
77
0.625644
false
ericfrederich/graphviz
tests/test_dot.py
2
3365
# test_dot.py import unittest2 as unittest from graphviz.dot import Graph, Digraph class TestDot(unittest.TestCase): def test_repr_svg(self): self.assertRegexpMatches(Graph('spam')._repr_svg_(), r'(?s)^<\?xml .+</svg>\s*$') def test_attr(self): with self.assertRaises(ValueError...
mit
-3,727,539,746,753,796,000
21.284768
79
0.532838
false
teeple/pns_server
work/install/Python-2.7.4/Demo/tkinter/guido/paint.py
42
1898
""""Paint program by Dave Michell. Subject: tkinter "paint" example From: Dave Mitchell <davem@magnet.com> To: python-list@cwi.nl Date: Fri, 23 Jan 1998 12:18:05 -0500 (EST) Not too long ago (last week maybe?) someone posted a request for an example of a paint program using Tkinter. Try as I might I can't seem to f...
gpl-2.0
9,145,878,009,647,141,000
30.633333
78
0.596944
false
JioCloud/nova
nova/api/openstack/compute/contrib/floating_ip_dns.py
24
9936
# Copyright 2011 Andrew Bogott for the Wikimedia 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 requi...
apache-2.0
2,142,448,356,065,491,700
35.395604
78
0.585648
false
user-none/calibre
src/calibre/library/server/browse.py
13
40620
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import operator, os, json, re, time from binascii import hexlify, unhexlify from collections import OrderedDict import ch...
gpl-3.0
-7,050,573,765,135,154,000
40.280488
139
0.488602
false
emschorsch/scrapy
scrapy/settings/default_settings.py
2
7437
""" This module contains the default values for all settings used by Scrapy. For more information about these settings you can read the settings documentation in docs/topics/settings.rst Scrapy developers, if you add a setting here remember to: * add it in alphabetical order * group similar settings without leaving...
bsd-3-clause
-2,283,552,007,354,715,000
29.231707
95
0.751244
false
C00kiie/Youtube-Mp3-telegram-bot
youtube_dl/extractor/crackle.py
23
4916
# coding: utf-8 from __future__ import unicode_literals, division from .common import InfoExtractor from ..utils import int_or_none class CrackleIE(InfoExtractor): _GEO_COUNTRIES = ['US'] _VALID_URL = r'(?:crackle:|https?://(?:(?:www|m)\.)?crackle\.com/(?:playlist/\d+/|(?:[^/]+/)+))(?P<id>\d+)' _TEST = {...
mit
6,306,601,350,509,899,000
33.851064
212
0.452584
false
PFWhite/qipr_approver
qipr_approver/approver/workflows/user_crud.py
1
6581
from approver.models import Person, Speciality, Expertise, QI_Interest, Suffix, Address, Organization, ClinicalArea, Self_Classification from approver.constants import SESSION_VARS, ADDRESS_TYPE from approver.utils import extract_tags, update_tags, true_false_to_bool, extract_model from django.contrib.auth.models impo...
apache-2.0
378,675,038,706,688,800
37.261628
136
0.645647
false
alexvanboxel/airflow
airflow/hooks/S3_hook.py
10
17040
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
-5,699,005,850,409,829,000
39.094118
82
0.569073
false
mlperf/training_results_v0.6
Fujitsu/benchmarks/resnet/implementations/mxnet/python/mxnet/context.py
4
9068
# 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
-4,114,525,253,454,067,000
28.346278
97
0.606308
false
1tush/reviewboard
reviewboard/webapi/tests/mixins_review.py
1
8138
from __future__ import unicode_literals from reviewboard.webapi.tests.mixins import test_template from reviewboard.webapi.tests.mixins_extra_data import (ExtraDataItemMixin, ExtraDataListMixin) class ReviewListMixin(ExtraDataListMixin): @test_template d...
mit
-4,623,619,825,217,934,000
36.675926
79
0.577906
false
alexm92/sentry
src/sentry/plugins/sentry_mail/activity/release.py
2
2095
from __future__ import absolute_import from sentry import features from sentry.db.models.query import in_iexact from sentry.models import GroupSubscriptionReason, Release, ReleaseCommit, User from .base import ActivityEmail class ReleaseActivityEmail(ActivityEmail): def __init__(self, activity): super(R...
bsd-3-clause
-3,922,186,275,890,436,600
29.362319
79
0.577566
false
notestaff/cosi
tests/make_cosi_tests.py
1
3662
#!/usr/bin/env python # # Script: make_cosi_tests.py # # Generate the scripts to call cosi test cases. # import sys, os, stat, logging def SystemSucceed( cmd, dbg = False, exitCodesOk = ( 0, ) ): """Run a shell command, and raise a fatal error if the command fails.""" logging.info( 'Running command ' + cmd ...
gpl-3.0
5,908,847,216,820,035,000
41.091954
196
0.53905
false
ZHAW-INES/rioxo-uClinux-dist
user/python/python-2.4.4/Lib/bsddb/test/test_thread.py
11
15508
"""TestCases for multi-threaded access to a DB. """ import os import sys import time import errno import shutil import tempfile from pprint import pprint from random import random try: True, False except NameError: True = 1 False = 0 DASH = '-' try: from threading import Thread, currentThread ha...
gpl-2.0
8,036,978,964,572,095,000
30.016
88
0.501161
false
saurabh1e/FlaskStructure
manager.py
3
1152
import os from flask_migrate import Migrate, MigrateCommand import urllib.parse as up from flask_script import Manager from flask import url_for from src import api, db, ma, create_app, configs, bp, security, admin config = os.environ.get('PYTH_SRVR') config = configs.get(config, 'default') extensions = [api, db, ...
mit
3,009,530,823,375,237,600
22.04
81
0.625
false
schocco/mds-web
apps/trails/gis_math.py
1
5200
from bisect import bisect from django.contrib.gis.geos.point import Point import math def haversine(origin, destination): ''' :param origin: start position :param destination: end position :return: length in meters .. See:: http://www.movable-type.co.uk/scripts/gis-faq-5.1.html '''...
mit
8,821,322,964,885,942,000
36.15
107
0.572885
false
themrmax/scikit-learn
sklearn/preprocessing/data.py
2
68159
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Andreas Mueller <amueller@ais.uni-bonn.de> # Eric Martin <eric@ericmart.in> # Giorgio Patrini <giorgio.patrini@anu.edu.au> # Lic...
bsd-3-clause
3,821,227,525,569,790,500
34.835436
84
0.591118
false
bstaint/pr0bescan
libs/DNS/Lib.py
2
23853
# -*- encoding: utf-8 -*- """ $Id: Lib.py,v 1.11.2.11 2011/11/23 17:07:14 customdesigned Exp $ This file is part of the pydns project. Homepage: http://pydns.sourceforge.net This code is covered by the standard Python License. See LICENSE for details. Library code. Largely this is packers and unpackers for vari...
gpl-2.0
1,438,570,080,887,518,500
31.321138
82
0.550623
false
SamuelMarks/crow
amalgamate/merge_all.py
6
1290
"""Merges all the header files.""" from glob import glob from os import path as pt import re from collections import defaultdict import sys header_path = "../include" if len(sys.argv) > 1: header_path = sys.argv[1] OUTPUT = 'crow_all.h' re_depends = re.compile('^#include "(.*)"', re.MULTILINE) headers = [x.rsplit...
bsd-3-clause
-9,064,107,557,558,154,000
22.888889
75
0.627907
false
varunarya10/nova_test_latest
nova/network/linux_net.py
12
76610
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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...
apache-2.0
-827,402,703,517,651,200
38.007128
79
0.539394
false
exa-analytics/atomic
exatomic/core/tests/test_basis.py
2
5093
# -*- coding: utf-8 -*- # Copyright (c) 2015-2020, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 import numpy as np import pandas as pd from unittest import TestCase from exatomic.core.basis import BasisSet class TestBasisSet(TestCase): def setUp(self): adict = {co...
apache-2.0
894,215,249,751,153,900
45.724771
85
0.445906
false
tierney/mustached-bear
toolchain/mac_x86_pnacl/newlib/bin/pydir/pnacl-dis.py
2
2746
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # # IMPORTANT NOTE: If you make local mods to this file, you must run: # % pnacl/build.sh driver # in order for them to take eff...
bsd-3-clause
-3,004,215,988,635,176,400
30.930233
79
0.616169
false
a4fr/FelfeliDict
v0.1/felfeliDict.py
1
1961
#! python3 from bottle import Bottle, run, app, template, route, get, post, request, static_file import felfeliDict_lib as felfeliDict import time import os app = '/dict' #Dictionary DataBase start = time.time() f_dict = felfeliDict.load_db() print('* DataBase loaded in', format(time.time()-start, '.2f')) ######...
gpl-2.0
-3,933,762,045,450,733,600
23.822785
88
0.579296
false
enthought/traitsgui
enthought/pyface/ui/null/action/tool_bar_manager.py
1
2973
#------------------------------------------------------------------------------ # Copyright (c) 2005, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions describe...
bsd-3-clause
-5,176,776,958,236,423,000
36.1625
79
0.532795
false
sethkontny/blaze
blaze/io/sql/constructors.py
3
1743
""" SQL array constructors. """ from __future__ import absolute_import, division, print_function from ... import Array from .datadescriptor import SQL_DDesc from datashape import dshape, Record, DataShape, coretypes class TableSelection(object): """ Table and column name Attributes ========== ...
bsd-3-clause
-1,251,931,157,297,576,400
20
76
0.621343
false
sergio-incaser/odoo
openerp/addons/base/ir/ir_ui_view.py
7
51880
# -*- coding: 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 GNU...
agpl-3.0
4,882,319,257,160,424,000
44.628848
155
0.54653
false
glemaitre/protoclass
doc/source/conf.py
1
9511
# -*- coding: utf-8 -*- # # protoclass documentation build configuration file, created by # sphinx-quickstart on Mon Apr 4 13:55:31 2016. # # 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 # autogenerated file. # ...
gpl-2.0
-4,905,088,611,089,797,000
31.35034
79
0.707602
false
OpenKore/OpenKore
src/scons-local-3.0.1/scons-local-3.0.1/SCons/Tool/ar.py
5
2227
"""SCons.Tool.ar Tool-specific initialization for ar (library archive). There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is hereby granted, fr...
gpl-2.0
-7,688,123,544,123,417,000
34.349206
114
0.719353
false
eklitzke/spitfire
spitfire/compiler/walker.py
1
4304
class TreeWalkError(Exception): pass def print_tree(root): print TreeVisitor(root).get_text() # perform an in-order traversal of the AST and call the generate methods class TreeVisitor(object): def __init__(self, root): self.root = root def walk(self, node=None): if node is None: node = se...
bsd-3-clause
730,874,781,039,876,200
26.240506
72
0.713987
false
envoyproxy/envoy-wasm
tools/protodoc/protodoc.py
1
24954
# protoc plugin to map from FileDescriptorProtos to Envoy doc style RST. # See https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto # for the underlying protos mentioned in this file. See # https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html for Sphinx RST syntax. fro...
apache-2.0
-3,480,274,841,590,263,000
36.581325
122
0.703575
false
psas/reaction-control
controller_scripts/MPU_6050_roll_V3.py
1
3633
import mraa import time import sys import numpy as np #important values: A_GAIN = 0.932 # [deg/LSB] G_GAIN = 1.466 # [deg/s/LSB] DT = 0.002 # [s/loop] loop period A = 0.98 # complementary filter constant KP = 1.8 # proportional controller gain [LSB/deg/loop] KD = 0.4 # derivat...
gpl-3.0
-2,088,870,879,097,940,500
26.522727
80
0.466832
false
addition-it-solutions/project-all
addons/crm/wizard/__init__.py
8
1102
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,529,893,088,458,077,000
43.08
78
0.626134
false
mlperf/training_results_v0.6
NVIDIA/benchmarks/ssd/implementations/pytorch/nhwc/mnist_nhwc.py
5
5689
# Copyright (c) 2018, NVIDIA 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 by applic...
apache-2.0
-3,352,556,964,942,353,400
41.774436
95
0.603094
false
BellScurry/gem5-fault-injection
src/arch/x86/isa/insts/simd64/floating_point/compare/compare_and_write_minimum_or_maximum.py
91
2158
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
-7,545,165,371,231,788,000
51.634146
72
0.793327
false
m4rx9/rna-pdb-tools
rna_tools/tools/webserver-engine/cleanup.py
2
4553
#!/usr/bin/python """ Remove jobs from VM. MAILS_TO_KEEP_DATA set up to keep the data. REAL_REMOVE RNA models for: 260c8ff6-f24e-4eff-9760-1831407fc770/ (1kh6 revised without restraints) RNA models for: f3c68edc-99c2-4950-9efd-0486812f15ae (3l0u ss + rst) RNA models for: 4371aff4-cea1-4deb-88ce-fbb9dc6ae5a4 (tetraloop...
mit
8,560,003,576,654,588,000
33.492424
154
0.567977
false
drewandersonnz/openshift-tools
ansible/roles/lib_openshift_3.2/build/ansible/oc_secret.py
13
4319
# pylint: skip-file # pylint: disable=too-many-branches def main(): ''' ansible oc module for secrets ''' module = AnsibleModule( argument_spec=dict( kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'), state=dict(default='present', type='str', ...
apache-2.0
-660,355,043,803,292,000
33.007874
94
0.567029
false
scripnichenko/nova
nova/tests/unit/virt/xenapi/test_vmops.py
12
64857
# Copyright 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 requ...
apache-2.0
-187,607,245,181,147,360
44.545646
79
0.586922
false
cloudant/python-cloudant
src/cloudant/view.py
1
14295
#!/usr/bin/env python # Copyright (C) 2015, 2019 IBM. 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 requir...
apache-2.0
-4,179,084,407,348,044,000
35.937984
81
0.624344
false
nightjean/Deep-Learning
tensorflow/contrib/rnn/python/tools/checkpoint_convert.py
5
10153
# 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
-504,070,315,371,197,400
40.105263
80
0.671723
false
spodkowinski/cassandra-dtest
tools/data.py
2
7104
import time from cassandra import ConsistencyLevel from cassandra.concurrent import execute_concurrent_with_args from cassandra.query import SimpleStatement from nose.tools import assert_equal, assert_true import assertions from dtest import debug, create_cf, DtestTimeoutError from tools.funcutils import get_rate_lim...
apache-2.0
1,160,953,948,285,309,700
41.54491
181
0.653857
false
edx/edx-platform
lms/djangoapps/instructor/tests/views/test_instructor_dashboard.py
2
28290
""" Unit tests for instructor_dashboard.py. """ import datetime import re from unittest.mock import patch import ddt from django.conf import settings from django.contrib.sites.models import Site from django.test.utils import override_settings from django.urls import reverse from edx_toggles.toggles.testutils import o...
agpl-3.0
232,834,636,607,615,360
40.725664
118
0.62743
false
geekosphere/zgeist
zg/objects/item/model.py
1
1165
""" Item Model """ from __future__ import division, print_function, absolute_import, unicode_literals from sqlalchemy import Table, ForeignKey, Column, Integer, String, Text from sqlalchemy.orm import relationship from zg.database import Base, UTCDateTime from zg.objects.tag.model import TagModel TaggingModel = Table...
agpl-3.0
-5,373,538,348,094,051,000
24.888889
82
0.660086
false
danmergens/mi-instrument
mi/dataset/parser/test/test_fdchp_a_dcl.py
5
6846
""" @package mi.dataset.parser.test @file mi/dataset/parser/test/test_fdchp_a_dcl.py @author Emily Hahn @brief Parser test for the fdchp series a instrument through a DCL """ import os from nose.plugins.attrib import attr from mi.core.exceptions import UnexpectedDataException, SampleException from mi.dataset.driver.fd...
bsd-2-clause
6,473,076,581,250,910,000
42.056604
106
0.663015
false
lym/allura-git
ForgeTracker/forgetracker/tests/test_app.py
2
3100
# 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 (t...
apache-2.0
-6,845,210,833,465,340,000
40.891892
96
0.654839
false
eunchong/build
third_party/sqlalchemy_0_7_1/sqlalchemy/orm/dynamic.py
8
11427
# orm/dynamic.py # Copyright (C) 2005-2011 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 """Dynamic collection API. Dynamic collections act like Query() objects for read opera...
bsd-3-clause
7,028,947,768,777,470,000
35.507987
84
0.602783
false
h2oai/h2o-3
h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_gaussian.py
3
6514
#!/usr/bin/env python # -*- encoding: utf-8 -*- from __future__ import print_function import h2o import sys sys.path.insert(1,"../../../") # allow us to run this standalone from h2o.estimators.random_forest import H2ORandomForestEstimator from h2o.estimators.gbm import H2OGradientBoostingEstimator from h2o.estimato...
apache-2.0
1,637,608,106,587,428,600
42.139073
148
0.603623
false
tthtlc/volatility
volatility/plugins/mac/mount.py
45
1762
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your o...
gpl-2.0
-4,060,370,142,997,711,000
34.24
89
0.659478
false
watonyweng/nova
nova/tests/functional/v3/test_networks_associate.py
3
3375
# Copyright 2012 Nebula, Inc. # 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...
apache-2.0
2,519,083,785,427,579,400
39.178571
78
0.623407
false
alanudg/SmartCheckIn
app/models/Lugar.py
2
1549
from app.config import db_sql as db from app.utils.key_utils import generate_key from geoalchemy2.types import Geometry class Lugar(db.Model): id = db.Column(db.Integer, primary_key=True) nombre = db.Column(db.String(20), nullable=False, unique=True) asignacion_automatica = db.Column(db.Boolean, nullable=...
mit
6,522,296,970,790,014,000
35.880952
77
0.613299
false
google/skia
tools/skpbench/_hardware_pixel.py
12
3172
# Copyright 2017 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from _hardware import Expectation from _hardware_android import HardwareAndroid CPU_CLOCK_RATE = 1670400 GPU_CLOCK_RATE = 315000000 class HardwarePixel(HardwareAndroid): def __init__...
bsd-3-clause
4,039,787,392,599,664,600
34.244444
119
0.640921
false
NaohiroTamura/ironic
ironic/tests/unit/objects/test_fields.py
6
5020
# Copyright 2015 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
-2,773,689,864,405,893,000
35.642336
78
0.625896
false
yaroslav-tarasov/avango
avango-skelanim/python/__init__.py
3
1696
# -*- Mode:Python -*- ########################################################################## # # # This file is part of AVANGO. # # ...
lgpl-3.0
-359,051,954,670,236,900
59.571429
74
0.40625
false
aquamatt/Peloton
src/peloton/utils/tests/testConfig.py
1
3102
# $Id: testConfig.py 106 2008-04-04 10:47:50Z mp $ # # Copyright (c) 2007-2008 ReThought Limited and Peloton Contributors # All Rights Reserved # See LICENSE for details """ Test the peloton.utils.config code """ from unittest import TestCase from peloton.utils.config import findTemplateTargetsFor from peloton.utils.c...
bsd-3-clause
444,120,789,223,818,200
36.385542
80
0.610574
false
ArcherSys/ArcherSys
Lib/lib2to3/fixes/fix_nonzero.py
1
1931
<<<<<<< HEAD <<<<<<< HEAD """Fixer for __nonzero__ -> __bool__ methods.""" # Author: Collin Winter # Local imports from .. import fixer_base from ..fixer_util import Name, syms class FixNonzero(fixer_base.BaseFix): BM_compatible = True PATTERN = """ classdef< 'class' any+ ':' suite< any* ...
mit
4,875,776,425,556,398,000
26.985507
63
0.517866
false
mKeRix/home-assistant
homeassistant/components/trafikverket_train/sensor.py
19
6918
"""Train information for departures and delays, provided by Trafikverket.""" from datetime import date, datetime, timedelta import logging from pytrafikverket import TrafikverketTrain import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_API_K...
mit
-4,189,729,032,214,131,700
32.746341
86
0.600752
false
meteorcloudy/tensorflow
tensorflow/contrib/autograph/operators/control_flow_test.py
14
3204
# 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
8,365,276,159,819,342,000
31.363636
80
0.634207
false
minorua/QGIS
tests/src/python/test_processing_alg_decorator.py
23
5963
# -*- coding: utf-8 -*- """QGIS Unit tests for the @alg processing algorithm. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later ...
gpl-2.0
-2,386,405,209,042,353,000
31.232432
81
0.650176
false
jean/python-docx
docx/section.py
12
5424
# encoding: utf-8 """ The |Section| object and related proxy classes. """ from __future__ import absolute_import, print_function, unicode_literals from collections import Sequence class Sections(Sequence): """ Sequence of |Section| objects corresponding to the sections in the document. Supports ``len()...
mit
-9,065,056,653,536,695,000
28.318919
78
0.620391
false
misty-/addons
plugin.video.nratv/default.py
1
4223
import os import sys import xbmc,xbmcaddon import xbmcplugin import xbmcgui import plugintools addon01 = xbmcaddon.Addon('plugin.video.nratv') addonname = addon01.getAddonInfo('name') addon_id = 'plugin.video.nratv' from addon.common.addon import Addon addon = Addon(addon_id, sys.argv) icon = addon01.getAddonInfo('ic...
gpl-3.0
-2,627,433,504,491,137,000
30.522388
129
0.649065
false
jamesyli/solum
solum/tests/common/test_trace_data.py
2
2892
# Copyright 2014 - Rackspace # # 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,...
apache-2.0
7,002,892,351,298,845,000
36.076923
76
0.593015
false
enableiot/iotkit-samples
api/python/iotkit_client.py
2
12878
#!/usr/bin/env python # Copyright (c) 2015, Intel Corporation # # 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 condition...
bsd-2-clause
-6,109,433,356,895,974,000
35.797143
111
0.645364
false
messagebird/python-rest-api
messagebird/base_list.py
1
1174
from messagebird.base import Base class Links(Base): def __init__(self): self.first = None self.previous = None self.next = None self.last = None class BaseList(Base): def __init__(self, item_type): """When setting items, they are instantiated as objects of type ite...
bsd-2-clause
3,953,238,563,114,596,400
22.48
85
0.560477
false
bioothod/zbuilder
zbuilder.py
1
7249
#!/usr/bin/python import argparse import docker import json import logging import os import shutil import sys logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO) class zbuilder(): def __init__(self, config): js = json.load(config) self.docker_files = [] ...
apache-2.0
5,666,204,978,273,247,000
37.973118
110
0.497448
false
hippysurfer/scout-records
subs_report.py
1
10965
# coding: utf-8 """Online Scout Manager Interface - generate report from subs. Usage: subs_report.py [-d] [-u] [--term=<term>] [--email=<address>] <apiid> <token> <outdir> subs_report.py (-h | --help) subs_report.py --version Options: <outdir> Output directory for vcard files. -d,--debug ...
gpl-2.0
5,661,807,540,519,932,000
32.842593
113
0.560876
false
mirror/vbox
src/VBox/ValidationKit/tests/shutdown/tdGuestOsShutdown1.py
2
12973
#!/usr/bin/env python # -*- coding: utf-8 -*- """ VMM Guest OS boot tests. """ __copyright__ = \ """ Copyright (C) 2010-2014 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it ...
gpl-2.0
2,482,712,481,723,269,600
35.338936
126
0.57003
false
SDSG-Invenio/invenio
invenio/base/scripts/demosite.py
6
5190
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
-8,919,417,447,294,634,000
36.883212
89
0.574566
false
muricoca/crab
setup.py
10
2537
#!/usr/bin/env python import os descr = """Crab is a flexible, fast recommender engine for Python. The engine aims to provide a rich set of components from which you can construct a customized recommender system from a set of algorithms.""" DISTNAME = 'scikits.crab' DESCRIPTION = 'A recommender engine for Python...
bsd-3-clause
4,826,715,628,353,942,000
32.826667
98
0.597556
false
laurentb/weboob
modules/binck/browser.py
1
9712
# -*- coding: utf-8 -*- # Copyright(C) 2016 Edouard Lambert # # This file is part of a weboob module. # # This weboob module 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 3 of the...
lgpl-3.0
-8,604,345,800,985,341,000
40.823276
115
0.610945
false
cryptobanana/sdnctrlsim
plot/plot_defaults.py
2
1263
from matplotlib import rc, rcParams DEF_AXIS_LEFT = 0.15 DEF_AXIS_RIGHT = 0.95 DEF_AXIS_BOTTOM = 0.1 DEF_AXIS_TOP = 0.95 DEF_AXIS_WIDTH = DEF_AXIS_RIGHT - DEF_AXIS_LEFT DEF_AXIS_HEIGHT = DEF_AXIS_TOP - DEF_AXIS_BOTTOM # add_axes takes [left, bottom, width, height] DEF_AXES = [DEF_AXIS_LEFT, DEF_AXIS_BOTTOM, DEF_AXIS...
bsd-3-clause
1,908,442,648,773,870,000
28.372093
76
0.693587
false
bukun/maplet
extor/model/ext_category_model.py
2
1423
# -*- coding:utf-8 -*- ''' Model for Posts. ''' from torcms.model.core_tab import TabPost,TabTag from torcms.model.core_tab import TabPost2Tag from torcms.model.abc_model import Mabc from torcms.model.category_model import MCategory class MExtCategory(Mabc): ''' Model for Posts. ''' def __init__(s...
mit
-8,194,644,219,696,702,000
19.411765
108
0.534968
false
TheCodingMonkeys/checkin-at-fmi
checkinatfmi_project/lends/models.py
1
1143
from datetime import datetime from django.db import models import checkinatfmi.translations_bg as translate from identifications.models import Book from identifications.models import Cardowner class LendRequest(models.Model): WAITING = 'W' FOR_LEND = 'L' RETURNED = 'R' DELAYED = 'D' CANCELED = ...
agpl-3.0
1,781,926,424,923,768,600
29.891892
118
0.692038
false
jodal/pyspotify
tests/test_utils.py
3
15680
# encoding: utf-8 from __future__ import unicode_literals import unittest import spotify from spotify import utils import tests from tests import mock class EventEmitterTest(unittest.TestCase): def test_listener_receives_event_args(self): listener_mock = mock.Mock() emitter = utils.EventEmitte...
apache-2.0
-4,640,322,048,668,185,000
32.099576
77
0.62216
false
jfelectron/python-driver
cassandra/murmur3.py
15
2387
from six.moves import range import struct def body_and_tail(data): l = len(data) nblocks = l // 16 tail = l % 16 if nblocks: return struct.unpack_from('qq' * nblocks, data), struct.unpack_from('b' * tail, data, -tail), l else: return tuple(), struct.unpack_from('b' * tail, data, -t...
apache-2.0
-2,561,335,672,573,787,600
20.123894
103
0.518224
false
teonlamont/mne-python
examples/inverse/plot_mixed_source_space_inverse.py
5
5418
""" ======================================================================= Compute MNE inverse solution on evoked data in a mixed source space ======================================================================= Create a mixed source space and compute MNE inverse solution on evoked dataset. """ # Author: Annalisa ...
bsd-3-clause
-7,522,093,241,928,322,000
35.608108
79
0.622001
false
Carson-Shook/bpm
dlanimotes.py
4
3755
#!/usr/bin/env python3 # -*- coding: utf8 -*- ################################################################################ ## ## This file is part of BetterPonymotes. ## Copyright (c) 2012-2015 Typhos. ## ## This program is free software: you can redistribute it and/or modify it ## under the terms of the GNU Affero...
agpl-3.0
-4,976,498,514,931,275,000
33.136364
96
0.616511
false
cedrick-f/pySequence
src/rapport.py
1
86883
#!/usr/bin/env python # -*- coding: utf-8 -*- ##This file is part of pySequence ############################################################################# ############################################################################# ## ## ## ...
gpl-3.0
2,687,847,378,589,196,000
38.374489
143
0.542851
false
qbuat/rootpy
rootpy/utils/extras.py
1
3415
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import from urllib2 import urlopen import xml.dom.minidom as minidom from itertools import chain, izip from .. import log; log = log[__name__] from . import quickroot as QROOT __all_...
gpl-3.0
3,772,350,570,441,238,000
24.485075
102
0.54817
false
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/test/test_StringIO.py
1
4641
# Tests StringIO and cStringIO import unittest import StringIO import cStringIO import types from test import test_support class TestGenericStringIO(unittest.TestCase): # use a class variable MODULE to define which module is being tested # Line of data to test as string _line = 'abcdefghijk...
mit
64,293,950,995,065,250
29.787671
74
0.588882
false
translate/terminator
project/terminator_comments_app/models.py
1
4026
# -*- coding: UTF-8 -*- # # Copyright 2011, 2013 Leandro Regueiro # # This file is part of Terminator. # # Terminator 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 yo...
gpl-3.0
-5,319,126,717,350,898,000
46.364706
144
0.622951
false
googleapis/googleapis-gen
google/cloud/domains/v1beta1/domains-v1beta1-py/google/cloud/domains_v1beta1/services/domains/transports/__init__.py
2
1131
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-404,207,965,977,427,400
33.272727
78
0.76481
false
Zac-HD/home-assistant
homeassistant/components/binary_sensor/homematic.py
2
2130
""" Support for Homematic binary sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/binary_sensor.homematic/ """ import logging from homeassistant.const import STATE_UNKNOWN from homeassistant.components.binary_sensor import BinarySensorDevice from ...
apache-2.0
808,940,468,253,477,100
29.428571
79
0.652582
false
tmap/MashPI
old_mashpi.py
1
3801
#!/usr/bin/env python # -*- coding: utf-8 -*- # mashpi 2014-08-13 # it should works import RPi.GPIO as GPIO import time import os import sys import glob import re from threading import Timer # Define thermometer specs os.system('modprobe w1-gpio') os.system('modprobe w1-therm') base_dir = '/sys/bus/w1/devices/' devic...
gpl-3.0
4,749,828,075,881,721,000
21.358824
96
0.653512
false
yrobla/nova
nova/tests/test_api.py
9
23344
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 compli...
apache-2.0
-3,937,147,327,687,546,400
36.957724
79
0.578093
false
Donkyhotay/MoonPy
zope/app/interface/__init__.py
1
4380
############################################################################## # # Copyright (c) 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
gpl-3.0
-8,777,955,528,858,111,000
30.285714
78
0.634247
false
icereval/raven-python
raven/contrib/celery/__init__.py
3
2299
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~ >>> class CeleryClient(CeleryMixin, Client): >>> def send_encoded(self, *args, **kwargs): >>> "Errors through celery" >>> self.send_raw.delay(*args, **kwargs) >>> @task(routing_key='sentry') >>> def send_raw(*args, **kwargs): >>> return super(clien...
bsd-3-clause
8,558,829,466,970,187,000
32.318841
76
0.621575
false
piMoll/SEILAPLAN
lib/reportlab/graphics/renderPS.py
1
38053
#Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details #history https://hg.reportlab.com/hg-public/reportlab/log/tip/src/reportlab/graphics/renderPS.py __version__='3.3.0' __doc__="""Render drawing objects in Postscript""" from reportlab.pdfbase.pdfmetrics import getFont, stringWidth, unicode2...
gpl-2.0
4,931,666,620,803,069,000
38.108941
118
0.574225
false
jeanlinux/calibre
src/calibre/ebooks/oeb/iterator/spine.py
14
5674
#!/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) from future_builtins import map __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'res...
gpl-3.0
5,830,317,173,059,512,000
37.080537
101
0.571907
false
qhm123/the10000
v2ex/templatetags/filters.py
2
6336
import re import logging from django import template from datetime import timedelta import urllib, hashlib register = template.Library() def timezone(value, offset): if offset > 12: offset = 12 - offset return value + timedelta(hours=offset) register.filter(timezone) # auto convert img.ly/abcd links ...
bsd-3-clause
2,040,978,807,477,734,100
40.149351
529
0.576862
false
John-Hart/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/readonlyproperty.py
2
4268
# 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
-6,717,718,069,507,566,000
34.865546
84
0.635192
false
abougouffa/alfanous
interfaces/smart_phones/alfanousS60/ensymble.py
4
86334
#!/usr/bin/env python #[SQUEEZE] this is an embedded package import imp s="requires python 2.5.2 or bytecode compatible" if imp.get_magic()!='\xb3\xf2\r\n':raise RuntimeError,s try:import zlib except:raise RuntimeError,"requires zlib" import base64,marshal s=base64.decodestring(""" eNqFVW1v1EYQnl373ny5KwIkkigI...
agpl-3.0
-2,104,151,386,635,089,200
75.429596
76
0.943452
false
andrewromanenco/pyjvm
pyjvm/utils.py
1
2811
# PyJVM (pyjvm.org) Java Virtual Machine implemented in pure Python # Copyright (C) 2014 Andrew Romanenco (andrew@romanenco.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
gpl-3.0
3,142,101,564,049,662,500
29.89011
71
0.610459
false
HomeRad/TorCleaner
wc/proxy/HttpProxyClient.py
1
7708
# -*- coding: iso-8859-1 -*- # Copyright (C) 2005-2009 Bastian Kleineidam """ Internal http client. """ import urlparse from . import Headers, ClientServerMatchmaker from .decoder import UnchunkStream from .. import log, LOG_PROXY, filter as webfilter, url as urlutil from ..http import parse_http_response from ..http.h...
gpl-2.0
-2,078,656,444,847,312,400
34.520737
78
0.554359
false
olapaola/olapaola-android-scripting
python/src/Demo/turtle/tdemo_planet_and_moon.py
32
2835
#!/usr/bin/python """ turtle-example-suite: tdemo_planets_and_moon.py Gravitational system simulation using the approximation method from Feynman-lectures, p.9-8, using turtlegraphics. Example: heavy central body, light planet, very light moon! Planet has a circular orbit, moon a stable orbit around th...
apache-2.0
-7,343,327,556,414,829,000
24.088496
66
0.571781
false
gbitzes/root
tutorials/pyroot/gui_ex.py
37
1870
## \file ## \ingroup tutorial_pyroot ## A Simple GUI Example ## ## \macro_code ## ## \author Wim Lavrijsen import os, sys, ROOT def pygaus( x, par ): import math if (par[2] != 0.0): arg1 = (x[0]-par[1])/par[2] arg2 = (0.01*0.39894228)/par[2] arg3 = par[0]/(1+par[3]) gauss = arg3*arg2*ma...
lgpl-2.1
6,683,356,999,407,638,000
27.769231
79
0.622995
false