repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
OpenAgInitiative/gro-api
gro_api/actuators/migrations/0008_auto_20150812_1550.py
1
1250
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('actuators', '0007_auto_20150812_1520'), ] operations = [ migrations.AlterField( model_name='actuatoreffect', ...
gpl-2.0
-4,914,615,802,447,475,000
31.051282
144
0.5896
false
4.448399
false
false
false
LumaPictures/rez
src/rez/resolved_context.py
1
63181
from rez import __version__, module_root_path from rez.package_repository import package_repository_manager from rez.solver import SolverCallbackReturn from rez.resolver import Resolver, ResolverStatus from rez.system import system from rez.config import config from rez.util import shlex_join, dedup from rez.utils.sour...
lgpl-3.0
-8,348,680,213,081,125,000
37.619193
89
0.572767
false
4.397035
true
false
false
matthewjwoodruff/language-of-choice
article/nodsl.py
1
3949
""" nodsl.py Attempt to express the language of choice without overloading operators. I understand why the article did it, and I'm impressed that it works so well, but it's hard to follow what's happening. Too much magic for me. I think partly it's because the article conflates variables and choices. A variable's ...
gpl-3.0
1,861,754,821,942,455,800
25.863946
83
0.593062
false
3.401378
false
false
false
ASMlover/study
compiler/eLisp2/eLisp/number.py
1
2219
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright (c) 2015 ASMlover. 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 copyrig...
bsd-2-clause
8,802,085,610,972,698,000
32.119403
70
0.684993
false
4.034545
false
false
false
lizardsystem/lizard-kpi
setup.py
1
1150
from setuptools import setup version = '0.5.dev0' long_description = '\n\n'.join([ open('README.rst').read(), open('TODO.rst').read(), open('CREDITS.rst').read(), open('CHANGES.rst').read(), ]) install_requires = [ 'Django', 'django-extensions', 'django-nose', 'lizard-ui', 'pk...
gpl-3.0
-1,418,867,999,999,005,700
24.555556
78
0.58
false
3.650794
false
false
false
NCI-GDC/gdcdatamodel
migrations/update_legacy_states.py
1
6311
#!/usr/bin/env python """gdcdatamodel.migrations.update_legacy_states ---------------------------------- File nodes from legacy projects were given a `state` that represents what is now `file_state`. This script transforms the old `state` into `file_state` and set's the `state` according the the following table: | ...
apache-2.0
7,030,365,817,418,758,000
25.078512
79
0.575978
false
3.794949
false
false
false
fahadsultan/CausalRelations
FeaturesExtractor.py
1
14860
from bs4 import BeautifulSoup import os import pandas as pd import sys import traceback from sklearn.feature_extraction.text import CountVectorizer class FeaturesExtractor: def __init__(self): self.FEATURE_NAMES = ['e1_token_id', 'e1_number','e1_sentence','e1_token','e1_aspect', 'e1_class','e1_event_id'...
apache-2.0
3,989,359,469,246,249,500
43.624625
538
0.421467
false
4.423936
false
false
false
hotsyk/uapython2
event/migrations/0001_initial.py
1
2895
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='City', fields=[ ('id', models.AutoField(verbose...
bsd-3-clause
5,386,760,394,031,964,000
37.092105
114
0.516408
false
4.495342
false
false
false
dutradda/myreco
myreco/engine_strategies/filters/factory.py
1
4207
# MIT License # Copyright (c) 2016 Diogo Dutra <dutradda@gmail.com> # 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, co...
mit
-5,812,263,325,621,395,000
40.245098
98
0.550986
false
4.721661
false
false
false
hyperhq/nova-hyper
novahyper/virt/hyper/hostinfo.py
1
2080
# Copyright (c) 2013 dotCloud, Inc. # Copyright (c) 2015 HyperHQ 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/license...
apache-2.0
7,434,647,035,159,597,000
24.679012
78
0.603365
false
3.484087
false
false
false
sony/nnabla
python/benchmark/function/test_logical.py
1
2622
# Copyright 2017,2018,2019,2020,2021 Sony 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...
apache-2.0
6,322,361,230,130,387,000
33.5
90
0.635774
false
3.616552
true
false
false
JamesClough/dagology
dagology/generators/random_dag.py
1
1482
""" Random DAG model, as in Karrer & Newman, 2009, Phys Rev E """ # Copyright (C) 2016 by # James Clough <james.clough91@gmail.com> # All rights reserved. # BSD license. __author__ = "\n".join(["James Clough (james.clough91@gmail.com)"]) import networkx as nx import numpy as np from random import randran...
mit
-711,647,949,574,725,400
27.5
73
0.609312
false
3.869452
false
false
false
SonicFrog/jdrpoly
main/migrations/0004_comitymember_mainpagesection_news.py
1
2798
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-02-24 11:48 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ...
gpl-2.0
1,634,196,145,750,455,800
42.71875
143
0.556469
false
4.176119
false
false
false
MaxTyutyunnikov/lino
obsolete/src/lino/adamo/datatypes.py
1
11685
## Copyright 2003-2007 Luc Saffre ## This file is part of the Lino project. ## Lino 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 versio...
gpl-3.0
-7,101,941,256,306,729,000
24.681319
73
0.55798
false
3.62438
false
false
false
nju-websoft/JAPE
code/attr2vec_func.py
1
2786
import math import collections import random import numpy as np import tensorflow as tf import itertools import time def sum_rows(x): """Returns a vector summing up each row of the matrix x.""" cols = tf.shape(x)[1] ones_shape = tf.stack([cols, 1]) ones = tf.ones(ones_shape, x.dtype) return tf.res...
mit
4,553,009,698,414,285,000
34.717949
119
0.604451
false
3.397561
false
false
false
andrew-lundgren/gwpy
gwpy/plotter/frequencyseries.py
1
11434
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2013) # # This file is part of GWpy. # # GWpy 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 ...
gpl-3.0
-6,821,686,522,418,402,000
35.069401
80
0.546091
false
4.135262
false
false
false
isudox/leetcode-solution
python-algorithm/leetcode/flip_binary_tree_to_match_preorder_traversal.py
1
2107
# -*- coding: utf-8 -*- """971. Flip Binary Tree To Match Preorder Traversal https://leetcode.com/problems/flip-binary-tree-to-match-preorder-traversal/ Given a binary tree with N nodes, each node has a different value from {1, ..., N}. A node in this binary tree can be flipped by swapping the left child and the right...
mit
-1,886,637,052,181,223,000
28.676056
80
0.58187
false
3.547138
false
false
false
cloudmesh/vagrant
setup.py
1
3460
#!/usr/bin/env python # ----------------------------------------------------------------------- # # Copyright 2008-2010, Gregor von Laszewski # # Copyright 2010-2013, Indiana University # # # # Licensed under the Apache License, Version 2.0 (the "License"); ...
apache-2.0
4,580,480,080,358,300,700
36.608696
88
0.573988
false
4.407643
false
false
false
Alignak-monitoring/alignak-checks-example
version.py
1
1285
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Checks pack for EXAMPLE """ # Package name __pkg_name__ = u"alignak_checks_EXAMPLE" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - directory where to store...
agpl-3.0
1,924,157,300,005,393,700
31.125
95
0.670817
false
3.320413
false
false
false
splotz90/urh
src/urh/models/ProtocolLabelListModel.py
1
4134
from PyQt5.QtCore import QAbstractListModel, pyqtSignal, Qt, QModelIndex, QMimeData from PyQt5.QtGui import QFont from urh import constants from urh.signalprocessing.FieldType import FieldType from urh.signalprocessing.MessageType import MessageType from urh.signalprocessing.ProtocoLabel import ProtocolLabel from urh....
gpl-3.0
-1,866,661,335,700,646,400
36.243243
113
0.643445
false
3.918483
false
false
false
eciis/web
backend/test/model_test/invite_institution_test.py
1
5437
# -*- coding: utf-8 -*- from ..test_base import TestBase from models import Invite from models import Institution from models import InviteInstitution from models import User from custom_exceptions import FieldException from mock import patch class InviteInstitutionTest(TestBase): """Test invite model.""" ...
gpl-3.0
3,515,197,406,887,376,000
34.305195
101
0.640611
false
3.807423
true
false
false
karinemiras/evoman_framework
evoman/player.py
1
12662
################################ # EvoMan FrameWork - V1.0 2016 # # Author: Karine Miras # # karine.smiras@gmail.com # ################################ import sys import numpy import struct import binascii import Base from Base.SpriteConstants import * from Base.SpriteDefinition import * from sensors imp...
cc0-1.0
2,649,441,619,843,990,500
35.074074
192
0.525746
false
4.231952
false
false
false
VarunRaval48/SignCode
java.sign/TestScripts/Valid/python/iterateChangeParameterPython.py
1
3261
# **************************************************************************** # Copyright (c) 2015 UT-Battelle, LLC. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available a...
gpl-3.0
5,838,214,338,211,463,000
38.780488
90
0.767863
false
2.387262
false
false
false
jenshnielsen/hemelb
Tools/setuptool/HemeLbSetupTool/View/VectorCtrl.py
1
2871
# # Copyright (C) University College London, 2007-2012, all rights reserved. # # This file is part of HemeLB and is provided to you under the terms of # the GNU LGPL. Please see LICENSE in the top level directory for full # details. # import wx # from wx.lib.masked import NumCtrl, EVT_NUM from HemeLbSetupTool.Bind...
lgpl-3.0
-1,803,520,995,720,174,000
32
98
0.604667
false
3.858871
false
false
false
achanda/refstack
refstack/tools/tempest_subunit_test_result.py
1
7924
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 # # ...
apache-2.0
-8,004,023,840,272,725,000
38.422886
78
0.614967
false
4.280929
true
false
false
davidfokkema/artist
demo/demo_histogram_fit.py
1
1160
import numpy as np import scipy.optimize import scipy.stats from artist import Plot def main(): # Draw random numbers from the normal distribution np.random.seed(1) N = np.random.normal(size=2000) # define bin edges edge = 5 bin_width = .1 bins = np.arange(-edge, edge + .5 * bin_width, b...
gpl-3.0
6,107,514,388,074,478,000
22.673469
70
0.612931
false
3.276836
false
false
false
orbingol/NURBS-Python
geomdl/exchange.py
1
33428
""" .. module:: exchange :platform: Unix, Windows :synopsis: Provides CAD exchange and interoperability functions .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ import os import struct import json from io import StringIO from . import compatibility, operations, elements, linalg from . import _ex...
mit
1,979,683,606,880,411,600
35.06041
119
0.638447
false
3.73122
false
false
false
brokendata/bigmler
bigmler/train_reader.py
1
11880
# -*- coding: utf-8 -*- # # Copyright 2013-2015 BigML # # 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
4,185,642,118,313,162,000
36.358491
79
0.555724
false
4.606437
false
false
false
edgarcosta/endomorphisms
endomorphisms/Representations.py
1
1456
""" * Representation functions * * Copyright (C) 2016-2017 * Edgar Costa (edgarcosta@math.dartmouth.edu) * Davide Lombardo (davide.lombardo@math.u-psud.fr) * Jeroen Sijsling (jeroen.sijsling@uni-ulm.de) * * See LICENSE.txt for license details. """ from sage.all import...
gpl-2.0
1,946,836,060,677,192,400
32.860465
86
0.62294
false
3.008264
false
false
false
kgullikson88/LasCampanas-MIKE
ConvertToExtensions.py
1
2043
import FittingUtilities from astropy.io import fits as pyfits import sys import os import numpy import matplotlib.pyplot as plt import HelperFunctions left_trim = 8 right_trim = 0 bad_regions = {} if __name__ == "__main__": fileList = [] for arg in sys.argv[1:]: fileList.append(arg) for fname in fileL...
gpl-3.0
8,868,885,856,817,803,000
31.428571
105
0.604014
false
3.721311
false
false
false
Arvedui/i3pystatus
i3pystatus/mail/maildir.py
1
1360
import os from i3pystatus.mail import Backend class MaildirMail(Backend): """ Checks for local mail in Maildir """ settings = ( "directory", ) required = ("directory",) directory = "" def init(self): self.directory = os.path.expanduser(self.directory) @property ...
mit
-4,569,347,419,518,561,000
29.222222
90
0.611029
false
4.047619
false
false
false
Statoil/libecl
python/ecl/grid/ecl_region.py
1
41631
# Copyright (C) 2011 Equinor ASA, Norway. # # The file 'ecl_region.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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
-2,768,528,232,218,818,000
38.01687
134
0.587567
false
3.638755
false
false
false
mjames-upc/python-awips
dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/discrete/DiscreteKey.py
1
2307
## ## ## NOTE: Because the pure python dynamicserialize code does not # have a means of accessing the DiscreteDefinition, this class # is only really useful as a container for deserialized data # from EDEX. I would not recommend trying to use it for anything # else. SUBKEY_SEPARATOR = '^' AUXDATA_SEPARATOR = ':'...
bsd-3-clause
2,756,679,888,910,306,000
24.921348
85
0.581274
false
3.851419
false
false
false
pubs/pubs
pubs/commands/export_cmd.py
1
1748
from __future__ import unicode_literals import argparse from .. import repo from ..uis import get_ui from .. import endecoder from ..utils import resolve_citekey_list from ..endecoder import BIBFIELD_ORDER from ..completion import CiteKeyCompletion, CommaSeparatedListCompletion class CommaSeparatedList(argparse.Act...
lgpl-3.0
-1,259,626,932,651,064,800
28.133333
91
0.66762
false
3.626556
false
false
false
sidnarayanan/BAdNet
train/gen/adv/models/particles/v4_Adam_trunc7_limit100/trainer.py
1
2034
#!/usr/bin/env python2.7 from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--nepoch',type=int,default=20) parser.add_argument('--version',type=int,default=4) parser.add_argument('--trunc',type=int,default=7) parser.add_argument('--limit',type=int,default=100) parser.add_argument('--adv...
mit
-7,653,248,862,955,114,000
29.818182
132
0.602262
false
3.063253
false
true
false
google-aai/tf-serving-k8s-tutorial
client/resnet_client.py
1
5117
#!/usr/bin/env python2.7 # # Copyright 2018 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 la...
apache-2.0
-162,718,467,718,734,300
32.012903
78
0.683017
false
3.726875
false
false
false
ustunb/risk-slim
riskslim/bound_tightening.py
1
6773
import numpy as np def chained_updates(bounds, C_0_nnz, new_objval_at_feasible = None, new_objval_at_relaxation = None, MAX_CHAIN_COUNT = 20): new_bounds = dict(bounds) # update objval_min using new_value (only done once) if new_objval_at_relaxation is not None: if new_bounds['objval_min'] < new...
bsd-3-clause
-6,996,975,109,408,880,000
42.416667
130
0.591761
false
3.148768
false
false
false
anthonyserious/okdataset
okdataset/profiler.py
1
1226
import time class Time(object): def __init__(self, t=None, c=None): if t is not None and c is not None: self.time = t self.cpu = c else: self.time = time.time() self.cpu = time.clock() def __add__(self, t): return Time( self.t...
mit
-2,381,361,044,137,555,500
20.892857
73
0.492659
false
3.584795
false
false
false
alessandrothea/gardener
tree/manyJetsHiggsVar.py
1
7690
from tree.gardening import TreeCloner import optparse import sys import ROOT import numpy import re import os.path import math from math import * from array import array; # # # \ | | | | | _) # |\/ | _` | __ \ | | | _ \ __| | | | _` | ...
gpl-2.0
-2,007,795,501,905,367,800
32.290043
228
0.46827
false
2.826167
false
false
false
factly/election-results-2017
goa/goa/spiders/results_spider.py
1
2491
import scrapy from scrapy import Request class CWACResultsSpider(scrapy.Spider): name = "cw-all-candidates" def start_requests(self): for i in range(40): if self.endpoint == 'archive': yield Request('https://web.archive.org/web/20160823114553/http://eciresults.ni...
mit
-1,441,801,575,931,974,400
48.82
165
0.58049
false
3.370771
false
false
false
chickenzord/dotenvy
src/dotenvy/parser.py
1
2349
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import bytes from future import standard_library standard_library.install_aliases() from sys import version_info from string import Template from .exception...
mit
-5,616,391,606,090,050,000
23.726316
79
0.604938
false
3.64186
false
false
false
ministryofjustice/cla_backend
cla_backend/apps/knowledgebase/management/commands/builddata.py
1
1649
"""" usage- ./manage.py builddata load_knowledgebase_csv ~/Documents/Scratch/knowledgebase.csv Creates derived dataset of constants used by JS frontend. Data is sourced from cla_common. you can then load the fixture with- ./manage.py loaddata cla_backend/apps/knowledgebase/fixtures/kb_from_spreadsheet.json """ from ...
mit
2,654,605,644,263,438,300
32.653061
94
0.627653
false
3.569264
false
false
false
CompPhysics/ThesisProjects
doc/MSc/msc_students/former/AudunHansen/Audun/Pythonscripts/CCD_matrix_implementation_class_mkII.py
1
40959
from numpy import * from time import * from matplotlib.pyplot import * from scipy.sparse import csr_matrix, coo_matrix class electronbasis(): def __init__(self, N, rs, Nparticles): self.rs = rs self.states = [] self.nstates = 0 self.nparticles = Nparticles Nm = in...
cc0-1.0
-4,270,726,599,347,849,700
39.542596
147
0.487121
false
2.858868
false
false
false
foauth/oauth-proxy
setuser.py
1
1376
import getpass import os import sys from werkzeug.datastructures import MultiDict import models import forms # Make sure the database gets installed properly models.db.create_all() values = MultiDict() form = forms.SetUser(values) values['email'] = sys.argv[1] if len(sys.argv) > 1 else raw_input('%s: ' % form.emai...
bsd-3-clause
-4,924,099,926,810,548,000
26.52
97
0.704942
false
3.0783
false
false
false
cloudbase/coriolis
coriolis/osmorphing/osdetect/oracle.py
1
1061
# Copyright 2020 Cloudbase Solutions Srl # All Rights Reserved. import re from coriolis import constants from coriolis.osmorphing.osdetect import base ORACLE_DISTRO_IDENTIFIER = "Oracle Linux" class OracleOSDetectTools(base.BaseLinuxOSDetectTools): def detect_os(self): info = {} oracle_releas...
agpl-3.0
-3,441,065,869,275,441,700
32.15625
70
0.526861
false
4.278226
false
false
false
gensmusic/test
l/python/test/json-to-object/json-to-object.py
1
1287
#!/usr/bin/python #coding:utf-8 j = '{"action": "print", "method": "onData", "data": {"key1" : 1, "key2":"value2"} }' import json class Payload(object): def __init__(self, j): self.__dict__ = json.loads(j) p = Payload(j) print '-' * 30 print dir(p) print '-' * 30 print p.action print p.method print p.dat...
gpl-2.0
-2,800,019,684,156,221,000
21.508772
111
0.554949
false
2.929224
false
false
false
intfrr/SoCo
soco/data_structures.py
1
38123
# -*- coding: utf-8 -*- # pylint: disable=star-args, too-many-arguments, fixme """ This module contains classes for handling DIDL-Lite metadata. This is the XML schema used by Sonos for carrying metadata representing many items such as tracks, playlists, composers, albums etc. """ # It tries to follow the class h...
mit
8,021,834,686,697,248,000
35.48134
81
0.572069
false
4.151476
false
false
false
yeyanchao/calibre
src/calibre/gui2/library/views.py
1
39819
#!/usr/bin/env python # 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 os, itertools, operator from functools import partial from future_builtins import map from collections import Ordere...
gpl-3.0
4,215,792,900,672,243,700
38.230542
105
0.555815
false
4.030671
false
false
false
dradux/tracker
web/migrations/versions/95ecf01d9cb4_add_test_result_status_items.py
1
1277
"""add test_result_status items Revision ID: 95ecf01d9cb4 Revises: ea71f73f5460 Create Date: 2017-03-29 19:41:26.581925 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '95ecf01d9cb4' down_revision = 'ea71f73f5460' branch_labels = None depends_on = None def up...
gpl-3.0
2,511,160,009,906,113,000
33.513514
135
0.680501
false
3.607345
true
false
false
noemu/script.example-master
default.py
1
7991
# https://docs.python.org/2.7/ import os import sys import urllib import urlparse # http://mirrors.kodi.tv/docs/python-docs/ import xbmcaddon import xbmcgui import xbmcplugin # http://docs.python-requests.org/en/latest/ import requests from threading import Thread import time class PlayerWindow(xbmcgui.WindowXML): ...
gpl-2.0
-3,525,701,916,214,955,000
27.641577
137
0.568014
false
3.867861
false
false
false
Endika/manufacture
mrp_operations_time_control/models/operation_time.py
1
2588
# -*- coding: utf-8 -*- # © 2015 Avanzosc # © 2015 Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import api, models, fields class MrpProductionWorkcenterLine(models.Model): _inherit = 'mrp.production.workcenter.line' operation_time_lines = fields.One2many( ...
agpl-3.0
-6,874,118,255,651,219,000
33.48
79
0.643852
false
3.668085
false
false
false
rikima/spark
python/pyspark/context.py
1
45234
# # 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
-2,844,523,567,311,684,600
41.713881
99
0.611376
false
4.332344
true
false
false
etienne-gauvin/music-player-core
examples/demo-console-player.py
1
3812
#!/usr/bin/env python # MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2012, Albert Zeyer, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. import sys, os, random, fnmatch # Our parent path might contain a ...
bsd-2-clause
4,915,947,774,121,647,000
24.245033
101
0.658447
false
2.647222
false
false
false
tmct/adventOfCode2016
problems/11/State.py
1
8576
number_of_levels = 4 from itertools import cycle, islice, combinations def roundrobin(*iterables): "roundrobin('ABC', 'D', 'EF') --> A D E B F C" # Recipe credited to George Sakkis pending = len(iterables) nexts = cycle(iter(it).__next__ for it in iterables) while pending: try: ...
mit
1,454,731,120,773,989,400
39.074766
114
0.596082
false
3.59129
false
false
false
mfxox/ILCC
ILCC/utility.py
1
31390
# coding=utf-8 ''' Created on 3/20/2017 8:58 57PM Wang Weimin @author: wangwm ''' import os from pcd_corners_est import exact_full_marker_data import numpy as np from pcd_corners_est import generate_grid_coords import matplotlib.pyplot as plt import matplotlib import vtk import config from ast import literal_eval as m...
bsd-2-clause
-3,670,802,329,565,017,000
37.468137
136
0.599618
false
3.110076
false
false
false
melipelo/ejemplo
app.py
1
3030
#!/usr/bin/env python # coding=utf-8 import requests import urllib2 import json import os from flask import Flask from flask import request from flask import make_response from bs4 import BeautifulSoup # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webh...
apache-2.0
5,939,019,461,058,861,000
30.237113
185
0.642244
false
3.026973
false
false
false
petewarden/tensorflow
tensorflow/python/keras/saving/saved_model/save_impl.py
1
28457
# Copyright 2018 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
-5,671,393,154,205,207,000
38.688982
111
0.697965
false
3.977775
false
false
false
DavideCanton/Python3
docs/docs.py
1
1567
__author__ = 'davide' import pathlib import string import math from collections import defaultdict def compute_inverse(fdt, docs, terms): ft = defaultdict(int) for t in terms: for d in docs: ft[t] += fdt[t, d] return ft def index(): terms = set() docs = [] fdt = default...
gpl-3.0
-8,411,056,482,351,363,000
24.290323
74
0.498405
false
3.060547
false
false
false
lahwaacz/tvnamer
tests/test_anime_filenames.py
1
1102
#!/usr/bin/env python """Tests anime filename output """ from functional_runner import run_tvnamer, verify_out_data from nose.plugins.attrib import attr @attr("functional") def test_group(): """Anime filename [#100] """ out_data = run_tvnamer( with_files = ['[Some Group] Scrubs - 01 [A1B2C3].avi...
unlicense
3,900,368,123,542,362,600
23.488889
112
0.608893
false
2.930851
false
false
false
zookeepr/zookeepr
zk/model/ceiling.py
1
3694
"""The application's model objects""" import sqlalchemy as sa from meta import Base from pylons.controllers.util import abort from beaker.cache import CacheManager from role import Role from person_role_map import person_role_map from meta import Session import datetime import random class Ceiling(Base): """S...
gpl-2.0
-5,095,891,693,858,206,000
29.783333
170
0.61072
false
3.74645
false
false
false
ContinuumIO/dask
dask/array/utils.py
2
11059
import difflib import functools import math import numbers import os import warnings import numpy as np from tlz import frequencies, concat from .core import Array from ..highlevelgraph import HighLevelGraph from ..utils import has_keyword, ignoring, is_arraylike try: AxisError = np.AxisError except AttributeErr...
bsd-3-clause
7,372,364,514,582,665,000
29.465565
87
0.5694
false
3.652246
false
false
false
twwd/MoodleDownloader
downloader.py
1
9854
#!/usr/bin/env python3 import argparse import importlib import os import re import sqlite3 from datetime import datetime from urllib.parse import urljoin import requests import yaml def load_plugin_class(plugin_class_str): """ dynamically load a class from a string """ class_data = plugin_class_str.s...
mit
195,151,069,313,467,550
37.643137
146
0.531561
false
4.530575
true
false
false
eliben/code-for-blog
2017/continuations-trampolines/tracing.py
1
1493
# Tracing of function calls. Use @TraceCalls() as a decorator on functions. # # Eli Bendersky [http://eli.thegreenplace.net] # This code is in the public domain. import sys from functools import wraps class TraceCalls(object): """ Use as a decorator on functions that should be traced. Several functions ca...
unlicense
7,345,459,679,741,440,000
33.72093
75
0.58004
false
3.888021
false
false
false
wdbm/shijian
shijian_examples_clocks.py
1
5541
#!/usr/bin/env python """ ################################################################################ # # # shijian_examples_clocks # # ...
gpl-3.0
-61,446,250,638,534,950
43.328
80
0.484931
false
4.556743
false
false
false
tstapler/Access-Plus-Schedule-Parser
web/ScheduleViewer/migrations/0001_initial.py
1
2389
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Course', fields=[ ('id', models.AutoField(auto_...
mit
3,464,933,900,472,990,700
39.491525
183
0.52951
false
4.335753
false
false
false
cumc-dbmi/pmi_sprint_reporter
webapi.py
1
2220
""" Utilities to configure WebAPI (backend for Atlas) to work with the database(s) loaded by reporter and achilles. This module makes the following assumptions: * WebAPI section of settings is valid * The WebAPI database (referred to by `settings.webapi_conn_str`) already contains the application tables """ from sq...
mit
1,704,027,627,111,090,700
36
111
0.703604
false
3.231441
false
false
false
Yelp/pgctl
pgctl/fuser.py
1
2200
#!/usr/bin/env python2.7 """\ usage: pgctl-fuser [-d] file [file ...] Shows the pids (of the current user) that have this file opened. This is useful for finding which processes hold a file lock (flock). This has the same behavior as `lsof -t file`, but is *much* faster. """ from __future__ import absolute_import from...
mit
-5,979,769,641,141,754,000
25.506024
97
0.581818
false
4.104478
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/ea-utils/package.py
1
2144
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
620,051,369,482,476,400
41.039216
82
0.67444
false
4.022514
false
false
false
MehdiSfr/tensor-flow
tensorflow/python/training/input.py
1
24193
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-4,704,024,588,663,581,000
42.201786
80
0.69144
false
3.794385
false
false
false
rsenk330/Flask-Cake
flask_cake/tests/test_cake.py
1
1572
import pytest try: from unittest import mock # Python 3 except ImportError: import mock @pytest.fixture def app(tmpdir): from flask import Flask root_path = tmpdir.ensure("test-proj", dir=True) tmpdir.ensure("test-proj/static/coffee", dir=True) p = tmpdir.join("test-proj/static/coffee", "C...
bsd-2-clause
9,065,584,534,477,928,000
26.103448
103
0.670483
false
3.188641
true
false
false
OpenTrons/opentrons_sdk
api/tests/opentrons/calibration/tip_length/test_tip_length_calibration.py
1
1461
import pytest from typing import List, Tuple from opentrons.calibration.tip_length import state_machine valid_transitions: List[Tuple[str, str, str]] = [ ('loadLabware', 'sessionStarted', 'labwareLoaded'), ('moveToMeasureNozzleOffset', 'labwareLoaded', 'measuringNozzleOffset'), ('jog', 'measuringNozzleOffset',...
apache-2.0
4,413,712,137,367,218,000
44.65625
75
0.740589
false
3.503597
false
false
false
jackliusr/scrapy-crawlers
crawlers/crawlers/spiders/lq7m.py
1
2098
import scrapy from selenium import webdriver from scrapy.http import JsonRequest, Request from scrapy import Selector import time import json class Lq7mSpider(scrapy.Spider): name = 'lq7m' start_urls = ['http://lq.7m.com.cn/list/3/2.shtml'] custom_settings = { 'DATABASEPIPELINE_ENABLED': True, ...
apache-2.0
6,463,469,120,809,064,000
36.464286
111
0.531935
false
3.629758
false
false
false
ColdenCullen/d2dl
enki2/enkilib/python/parser.py
1
5204
# # Copyright (c) 2008 Eric Anderton # # 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, # ...
mit
5,033,403,532,751,314,000
32.939597
123
0.511337
false
4.831941
false
false
false
benagricola/exabgp
lib/exabgp/bgp/message/update/nlri/qualifier/etag.py
1
1397
# encoding: utf-8 """ etag.py Created by Thomas Mangin on 2014-06-26. Copyright (c) 2014-2015 Orange. All rights reserved. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ # TODO: take into account E-VPN specs that specify the role of the first bit of ESI # (since draft-ietf-l2vpn-evpn-05) from struct ...
bsd-3-clause
3,194,523,706,247,964,000
21.174603
83
0.67287
false
3.097561
false
false
false
kimberlythegeek/axe-selenium-python
axe_selenium_python/tests/conftest.py
1
1081
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from datetime import datetime import pytest from py.xml import html @pytest.mark.optionalhook def pytest_html_results...
mpl-2.0
-323,944,129,504,433,200
33.870968
73
0.719704
false
3.68942
true
false
false
ayepezv/GAD_ERP
openerp/report/render/rml2pdf/trml2pdf.py
1
45686
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import sys import copy import reportlab import re from reportlab.pdfgen import canvas from reportlab import platypus import utils import color import os import logging import traceback from lxml import etree import base...
gpl-3.0
-7,056,118,041,523,852,000
41.777154
238
0.545506
false
3.868089
false
false
false
MediaKraken/MediaKraken_Deployment
source/test_asyncpg_json.py
1
1574
import asyncio import datetime import json import asyncpg ### # fully working for DICT of row along with auto json decode/encode ### async def main(): conn = await asyncpg.connect(user='postgres', password='metaman', database='postgres', ...
gpl-3.0
375,246,508,988,305,300
33.217391
87
0.52986
false
4.025575
true
false
false
ToontownUprising/src
toontown/nametag/Nametag2d.py
1
10929
from direct.task.Task import Task import math from panda3d.core import PGButton, VBase4, DepthWriteAttrib, Point3 from toontown.chat.ChatBalloon import ChatBalloon from toontown.margins import MarginGlobals from toontown.margins.MarginVisible import MarginVisible from toontown.nametag import NametagGlobals from toonto...
mit
4,598,167,220,696,883,700
33.805732
94
0.620093
false
3.836083
false
false
false
tommyogden/maxwellbloch
setup.py
1
2118
"""MaxwellBloch MaxwellBloch is a Python package for solving the coupled Maxwell-Bloch equations describing the nonlinear propagation of near-resonant light through thermal atomic vapours. """ import os import textwrap from setuptools import setup, find_packages import subprocess DESCRIPTION = "A Python package f...
mit
-6,282,543,788,265,770,000
29.695652
80
0.660057
false
3.438312
false
false
false
percival-detector/odin-data
tools/python/odin_data/meta_listener_adapter.py
1
7328
import logging from tornado import escape from odin.adapters.adapter import ApiAdapterResponse, \ request_types, response_types from odin_data.odin_data_adapter import OdinDataAdapter class MetaListenerAdapter(OdinDataAdapter): """An OdinControl adapter for a MetaListener""" def __init__(self, **kwarg...
apache-2.0
4,103,719,632,012,855,000
37.978723
99
0.593068
false
4.531849
true
false
false
Kronuz/pyXapiand
xapiand/search.py
1
11782
from __future__ import unicode_literals, absolute_import import base64 import logging import xapian from . import json from .core import get_slot, get_prefix, expand_terms, find_terms, DOCUMENT_CUSTOM_TERM_PREFIX from .serialise import normalize, serialise_value from .exceptions import XapianError MAX_DOCS = 10000 ...
gpl-2.0
5,752,482,212,671,406,000
36.28481
121
0.496605
false
4.341194
false
false
false
luigiberrettini/Kiln-to-GitHub
kiln_repo_list.py
1
1422
import requests from anvil import Anvil def main(): requests.packages.urllib3.disable_warnings() in_file = open("./kiln_base_url.txt", "r") base_url = in_file.read().replace('\n', '') in_file.close() anvil = Anvil(base_url, False) anvil.create_session_by_prompting() repo_indices = set() ...
mit
3,321,808,101,163,100,700
33.682927
93
0.489451
false
3.693506
false
false
false
AlexandreDecan/multiwords
rims.py
1
1223
#!/usr/bin/python """ Module that provides several functions to handle (un)rimmed words. """ import words def rims_of(word): """ Return the rims for the given word. A rim is a (nonempty) word u such that w = u.s = p.u' for some s,p,u' such that |u'| = |u|, and u' and u agree on every position except ...
apache-2.0
-7,824,436,984,240,739,000
29.575
78
0.609975
false
3.184896
false
false
false
xiaohan2012/snpp
tests/test_signed_graph.py
1
1749
""" For the utilities """ import contexts as ctx import numpy as np from scipy.sparse import csr_matrix, isspmatrix_csr from snpp.utils.signed_graph import symmetric_stat, \ fill_diagonal, \ make_symmetric, \ matrix2graph def test_symmetric_stat(Q1_d): c_sym, c_consis = symmetric_stat(Q1_d) asser...
mit
6,050,825,672,574,178,000
27.672131
86
0.532876
false
2.91015
false
false
false
sandeez/lino-book_locator
locate/locate/lib/books/models.py
1
4811
from lino.api import dd from django.db import models class Floor(dd.Model): number = models.IntegerField('Number', null=False) def __unicode__(self): return 'Floor: {0}'.format(self.number) class Meta: verbose_name = 'Floor' verbose_name_plural = 'Floors' class Room(dd.Model): ...
bsd-2-clause
1,497,361,167,193,368,000
27.467456
104
0.561214
false
3.709329
false
false
false
ryos36/polyphony-tutorial
Life/life_one.py
1
2840
import polyphony from polyphony import module, pure from polyphony import testbench from polyphony.io import Port from polyphony.typing import bit, uint3, uint4, List from polyphony.timing import clksleep, clkfence, wait_rising, wait_falling @module class life: def __init__(self): self.i_bit4 = Port(uin...
mit
7,964,215,205,951,401,000
21.362205
74
0.415493
false
2.619926
false
false
false
itucsdb1621/itucsdb1621
tags.py
1
2795
import psycopg2 from flask import Flask from flask import render_template, request from flask import Blueprint, current_app,session,redirect, url_for #declaring sub app with blueprint tags_app = Blueprint('tags_app', __name__) @tags_app.route('/add_tag/<photo_id>/', methods=["POST"]) def add_tag(photo_id): # a po...
gpl-3.0
-8,171,542,644,453,910,000
41.348485
179
0.647227
false
3.489388
false
false
false
changhoonhahn/centralMS
centralms/tests/test_sfrs.py
1
1027
''' Test functions for handling star formation rates ''' import numpy as np from scipy.integrate import odeint import sfrs as SFR def IntegrationTest(): ''' Simple test the integration ''' logsfr = lambda mstar, t: np.log10(t**2) for tt in np.arange(1., 11., 1.): M_int = SFR.integ...
mit
-3,111,330,352,351,419,400
19.54
76
0.555015
false
2.860724
false
false
false
robosafe/mc-vs-bdi
models/pta_models/table/legible_full/extract.py
1
8357
#!/usr/bin/env python # This script translates and separates the traces computed with UPPAAL model checking and the tracer tool (libutap). The traces are originally in a *.xtr file format. The specified automata transitions are separated from the global traces (the human, the setting of gaze, pressure and location), an...
gpl-3.0
51,145,047,482,889,110
34.261603
463
0.630848
false
2.881724
false
false
false
akshayka/bft2f
bft2f.py
1
3641
#!/usr/bin/python import sys import os from mininet.topo import Topo from mininet.node import CPULimitedHost from mininet.link import TCLink from mininet.net import Mininet from mininet.log import lg, info from mininet.util import dumpNodeConnections from mininet.cli import CLI from mininet.util import pmonitor from s...
gpl-2.0
563,290,887,564,789,900
32.1
193
0.61192
false
2.999176
false
false
false
alexanderAustin/PythonGame
test.py
1
2259
# This was built from the tutorial https://www.raywenderlich.com/24252/beginning-game-programming-for-teens-with-python import pygame, math, random from pygame.locals import * import pyganim # 2 - Initialize the game pygame.init() width, height = 640, 480 screen=pygame.display.set_mode((width, height)) pygame.display...
apache-2.0
5,823,003,622,661,369,000
29.958904
119
0.678619
false
3.086066
false
false
false
michel-slm/0install
tests/testescaping.py
1
2832
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import basetest from basetest import BaseTest import sys, os, re import unittest sys.path.insert(0, '..') from zeroinstall.injector import model from zeroinstall.support import escaping safe = re.compile('^[-.a-zA-Z0-9_]*$') class ...
lgpl-2.1
-8,598,118,403,903,593,000
31.906977
123
0.674205
false
3.049569
true
false
false
hodgestar/graas
graas/cli.py
1
1213
""" Command for launching GRaaS. """ import sys import click from twisted.internet import reactor from twisted.python import log from twisted.web.server import Site from .api import GraasApi from .devserver import GraasServerFactory @click.command("graas") @click.version_option() @click.option( '--host', '-h'...
bsd-3-clause
7,179,159,240,244,600,000
24.808511
69
0.658697
false
3.296196
false
false
false
infobloxopen/infoblox-client
infoblox_client/object_manager.py
1
21402
# Copyright 2015 Infoblox 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
-3,936,074,170,078,028,300
43.40249
79
0.48944
false
4.5721
true
false
false
IvIePhisto/ECoXiPy
ecoxipy/pyxom/_document.py
1
17879
# -*- coding: utf-8 -*- import collections from xml.sax.xmlreader import AttributesImpl from ecoxipy import _python2, _unicode from ecoxipy import _helpers from ._common import XMLNode, ContainerNode, _string_repr from ._content_nodes import Text from .indexing import (IndexDescriptor, ElementByUniqueAttributeValueIn...
mit
-2,128,559,108,914,202,400
37.534483
86
0.606578
false
4.264011
false
false
false
status-im/status-react
test/appium/tests/conftest.py
1
13196
import requests import pytest import re from _pytest.runner import runtestprotocol from http.client import RemoteDisconnected from support.device_stats_db import DeviceStatsDB from support.test_rerun import should_rerun_test from tests import test_suite_data, appium_container from datetime import datetime from os impor...
mpl-2.0
520,488,454,995,145,340
40.2375
138
0.554032
false
4.266408
true
false
false
Yangqing/caffe2
caffe2/python/layers/fc.py
1
3042
# Copyright (c) 2016-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
-1,604,963,854,280,311,300
40.108108
80
0.589415
false
4.184319
false
false
false
janpipek/boadata
boadata/gui/qt/views/histogram_view.py
1
1199
from .view import View from ..backends.matplotlib import MatplotlibBackend from boadata import unwrap import seaborn as sns # @View.register_view class HistogramView(View): def accepts(cls, data_object): return True def create_widget(self, parent=None, xcol=None, bins=50, **kwargs): if xcol i...
mit
-1,467,702,614,424,234,500
30.578947
88
0.57548
false
3.611446
false
false
false
mycointest/owncoin
share/seeds/generate-seeds.py
1
4297
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
mit
6,910,685,491,095,861,000
30.82963
98
0.575983
false
3.175905
false
false
false
fhqgfss/MoHa
moha/posthf/ci/configuration.py
1
1441
import numpy as np import copy import itertools from moha.system.basis import SlaterDeterminant,NElectronBasisSet class Configuration(object): """ """ def __init__(self): """ """ pass @classmethod def truncated(cls,hfwavefunction,excitation_level): """ excit...
mit
-5,836,256,464,177,644,000
32.511628
75
0.485774
false
4.225806
false
false
false