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
guiccbr/autonomous-fuzzy-quadcopter
python/py_quad_control/controller/sparc.py
1
17796
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 # ------------------------ Imports ----------------------------------# from __future__ import division # Force real division import numpy as np # Numpy Arrays import math # Square root # ------------------------ Classes ---------------------------------# clas...
mit
6,382,856,539,554,038,000
38.284768
119
0.600079
false
3.778344
false
false
false
rtts/qqq
user_profile/views.py
1
3338
from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404, render_to_response from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.template.loader import get_template from django.template import Context, RequestCont...
gpl-3.0
1,092,736,102,146,066,000
29.623853
111
0.713901
false
3.684327
false
false
false
shady831213/myBlog
myBlog/articles/permission.py
1
1112
from rest_framework import permissions #adminorreadonly class ArticlePermission(permissions.BasePermission): def has_permission(self, request, view): return ( request.method in permissions.SAFE_METHODS or request.user and request.user.is_staff ) def has_object_permissio...
mit
2,163,750,632,873,102,600
37.37931
109
0.652878
false
4.412698
false
false
false
Exesium/python_training
fixture/session.py
1
1504
# -*- coding: utf-8 -*- class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("pass").click() wd.find_element_by_id("LoginForm").click() wd.find_elem...
gpl-3.0
6,056,223,281,163,196,000
30.333333
76
0.569149
false
3.364653
false
false
false
padajuan/ansible-module-etcd
library/etcd.py
1
9055
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, Juan Manuel Parrilla <jparrill@redhat.com> # # 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 opt...
mit
-4,966,589,647,599,316,000
27.564669
105
0.631695
false
3.841748
false
false
false
meeb/txcloudfiles
examples/account_set_temp_key.py
1
2390
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright 2012 Joe Harris 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
9,021,300,464,980,471,000
28.506173
96
0.673222
false
3.811802
false
false
false
googleads/google-ads-python
google/ads/googleads/v8/errors/types/partial_failure_error.py
1
1168
# -*- 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
-6,045,782,478,356,995,000
29.736842
74
0.708048
false
4.069686
false
false
false
sequana/sequana
sequana/modules_report/bwa_bam_to_fastq.py
1
3230
# coding: utf-8 # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed under the ...
bsd-3-clause
6,454,543,908,194,447,000
30.666667
81
0.586378
false
3.573009
false
false
false
ramondiez/machine-learning
ex2/plotDecisionBoundary.py
1
1679
''' Created on 20 feb. 2017 @author: fara ''' import numpy as np from matplotlib import pyplot as plt from mapFeature import mapFeature from show import show def plotDecisionBoundary(ax,theta, X, y): ''' %PLOTDECISIONBOUNDARY Plots the data points X and y into a new figure with %the decision boundary def...
gpl-3.0
-6,819,960,103,957,050,000
29
102
0.564622
false
3.542194
false
false
false
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/NFR4XBoot/ubi_reader/ubi/block/sort.py
5
2187
def list_by_list(blist, slist): slist_blocks = [] for block in blist: if block in slist: slist_blocks.append(block) return slist_blocks def by_image_seq(blocks, image_seq): seq_blocks = [] for block in blocks: if blocks[block].ec_hdr.image_seq == image_...
gpl-2.0
8,051,677,869,966,243,000
23.752941
70
0.54321
false
3.417188
false
false
false
skosukhin/spack
var/spack/repos/builtin/packages/gmake/package.py
1
2179
############################################################################## # 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
6,446,346,152,501,126,000
37.22807
91
0.65397
false
3.843034
false
false
false
carlshan/ml_workflow
datascience_tools/modeling/workflow_model_setup.py
1
2346
from workflow_diagnostics import get_diagnostics_dict from workflow_util import upload_to_s3 from sklearn import preprocessing import cPickle as pickle import pandas as pd import os def run_model(training, testing, features, outcome, clf, clf_name, normalize=True, verbose=True): # NOTE: You should set the clf se...
mit
-8,404,296,448,362,090,000
37.459016
103
0.665388
false
3.682889
true
false
false
akretion/odoo
odoo/tools/image.py
10
15192
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import base64 import codecs import io from PIL import Image from PIL import ImageEnhance from random import randrange # Preload PIL with the minimal subset of image formats we need from odoo.tools import pycompat Image...
agpl-3.0
2,528,655,349,134,123,500
44.214286
132
0.634742
false
3.748335
false
false
false
jjdmol/LOFAR
SAS/ResourceAssignment/ResourceAssignmentEstimator/resource_estimators/base_resource_estimator.py
1
3118
# base_resource_estimator.py # # Copyright (C) 2016 # ASTRON (Netherlands Institute for Radio Astronomy) # P.O.Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it # and/or modify it under the terms of the GNU G...
gpl-3.0
7,776,506,931,752,656,000
40.026316
119
0.679602
false
3.977041
false
false
false
midokura/python-midonetclient
src/midonetclient/tenant.py
1
2329
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Midokura PTE LTD. # 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/LICENS...
apache-2.0
-1,329,265,309,934,497,500
32.753623
77
0.674109
false
3.811784
false
false
false
pudo-attic/ted-xml
parse.py
1
6683
import os from lxml import etree from pprint import pprint from forms.parseutil import ted_documents, Extractor from collections import defaultdict from common import engine, documents_table, contracts_table, cpvs_table, references_table def select_form(form, lang): lang = lang.split()[0] children = form.getch...
mit
4,463,501,169,465,063,000
46.397163
105
0.638635
false
3.128745
false
false
false
gregmuellegger/django-superform
django_superform/forms.py
1
13772
""" This is awesome. And needs more documentation. To bring some light in the big number of classes in this file: First there are: * ``SuperForm`` * ``SuperModelForm`` They are the forms that you probably want to use in your own code. They are direct base classes of ``django.forms.Form`` and ``django.forms.ModelFor...
bsd-3-clause
3,049,697,306,495,678,000
33.865823
79
0.636364
false
4.285003
false
false
false
openjck/kuma
kuma/wiki/models.py
1
71106
import hashlib import json import sys import traceback from datetime import datetime, timedelta from functools import wraps import newrelic.agent import waffle from constance import config from django.conf import settings from django.core.exceptions import ValidationError from django.db import models from django.db.mo...
mpl-2.0
-1,674,403,241,280,517,600
37.414911
100
0.59919
false
4.338377
false
false
false
ahknight/fig-django
app/test_app/settings.py
1
2113
""" Django settings for test_app project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
bsd-3-clause
2,028,688,857,110,303,200
23.569767
71
0.716517
false
3.281056
false
false
false
dashmoment/moxa_ai_training
CNN_HW_solution/model_zoo.py
1
4589
import tensorflow as tf import netfactory as nf import numpy as np class model_zoo: def __init__(self, inputs, dropout, is_training, model_ticket): self.model_ticket = model_ticket self.inputs = inputs self.dropout = dropout self.is_training = is_training ...
mit
1,189,355,182,992,824,300
34.859375
143
0.460885
false
3.384218
false
false
false
collectiveacuity/labPack
tests/test_events_meetup.py
1
10267
__author__ = 'rcj1492' __created__ = '2016.12' __license__ = 'MIT' from labpack.events.meetup import * if __name__ == '__main__': # import dependencies & configs from pprint import pprint from time import time from labpack.records.settings import load_settings from labpack.handlers.reques...
mit
1,395,610,115,595,362,000
43.438053
110
0.598812
false
3.278097
true
false
false
MazamaScience/ispaq
ispaq/pressureCorrelation_metrics.py
1
6526
""" ISPAQ Business Logic for Simple Metrics. :copyright: Mazama Science :license: GNU Lesser General Public License, Version 3 (http://www.gnu.org/copyleft/lesser.html) """ from __future__ import (absolute_import, division, print_function) import math import numpy as np import pandas as pd from obspy im...
gpl-3.0
7,286,951,401,950,999,000
37.163743
138
0.564818
false
4.519391
false
false
false
dodger487/MIST
data/magnetak_ml.py
1
23641
""" Copyright 2014 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 agreed to in...
apache-2.0
1,774,346,763,933,319,000
37.378247
113
0.646419
false
3.323166
false
false
false
alkaitz/general-programming
water_level/water_level.py
1
1035
''' Created on Aug 1, 2017 @author: alkaitz ''' ''' An integer array defines the height of a 2D set of columns. After it rains enough amount of water, how much water will be contained in the valleys formed by these mountains? Ex: [3 2 3] X X X W X X X X -> X X X -> 1 X X X X X X ''' d...
mit
4,423,365,319,701,444,600
26.263158
102
0.533333
false
3.194444
false
false
false
jonfoster/pyxb1
examples/ndfd/showreq.py
1
1914
import pyxb.utils.domutils import xml.dom import xml.dom.minidom import pyxb.namespace # Structure #import DWML #print 'Validating DWML' #DWML.Namespace.validateSchema() #print 'Validated DWML: types %s' % ("\n".join(DWML.Namespace.typeDefinitions().keys()),) xmls = open('NDFDgen.xml').read() dom = xml.dom.minidom.pa...
apache-2.0
-6,638,820,040,696,046,000
25.583333
89
0.718913
false
2.958269
false
false
false
huazhisong/graduate_text
src/rnn/utils.py
1
4176
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys import time import csv import collections import cPickle as pickle import numpy as np import pandas as pd import tensorflow as tf from tensorflow.contrib import learn class TextLoader(object): def __init__(self, utils_dir, data_path, b...
agpl-3.0
323,030,258,419,681,400
31.95122
101
0.559148
false
3.590714
false
false
false
USGSDenverPychron/pychron
launchers/pydiode.py
1
1078
# =============================================================================== # Copyright 2014 Jake Ross # # 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/licens...
apache-2.0
-2,949,165,895,291,454,000
43.916667
81
0.519481
false
5.084906
false
false
false
pymedusa/SickRage
medusa/show/coming_episodes.py
1
7304
# coding=utf-8 # This file is part of Medusa. # # Medusa 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. # # Medusa is distributed in t...
gpl-3.0
-8,968,734,022,603,750,000
35.52
120
0.583242
false
3.846235
false
false
false
okffi/decisions
web/decisions/subscriptions/models.py
1
4698
from __future__ import unicode_literals import os import base64 from datetime import timedelta from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.timezone import now from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields i...
bsd-3-clause
-2,500,066,219,397,966,300
28.923567
76
0.649638
false
4.124671
false
false
false
rowinggolfer/openmolar2
src/lib_openmolar/client/qt4/dialogs/save_discard_cancel_dialog.py
1
3474
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ## ## ...
gpl-3.0
-4,159,314,006,897,088,500
39.882353
79
0.519862
false
4.700947
false
false
false
amdegroot/ssd.pytorch
layers/box_utils.py
1
9435
# -*- coding: utf-8 -*- import torch def point_form(boxes): """ Convert prior_boxes to (xmin, ymin, xmax, ymax) representation for comparison to point form ground truth data. Args: boxes: (tensor) center-size default boxes from priorbox layers. Return: boxes: (tensor) Converted xmin, y...
mit
5,635,319,637,972,045,000
38.443515
80
0.594463
false
3.229531
false
false
false
opendatatrentino/ckan-api-client
ckan_api_client/tests/unit/test_utils_diff.py
1
1092
from ckan_api_client.tests.utils.diff import diff_mappings, diff_sequences def test_diff_dicts(): dct1 = { 'one': 'VAL-1', 'two': 'VAL-2', 'three': 'VAL-3', 'four': 'VAL-4', 'five': 'VAL-5', } dct2 = { 'three': 'VAL-3', 'four': 'VAL-4-2', 'fi...
bsd-2-clause
2,361,998,526,642,072,000
26.3
74
0.508242
false
3.041783
false
false
false
hyperreal/GanjaBot
magnet_utils.py
1
4242
# # This file is part of Magnet2. # Copyright (c) 2011 Grom PE # # Magnet2 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
-5,035,402,395,565,944,000
34.057851
813
0.635078
false
2.991537
false
false
false
map0logo/hmm_tagging
bigram_tagging.py
1
10176
""" Implementation of bigram part-of speech (POS) tagger based on first-order hidden Markov models from scratch. """ from __future__ import division from __future__ import unicode_literals import numpy as np import pandas as pd import codecs POS_UNIVERSAL = ('VERB', 'NOUN', 'PRON', 'ADJ', 'ADV', 'ADP', ...
gpl-2.0
-3,219,382,188,687,192,000
30.214724
86
0.592571
false
3.085506
false
false
false
alvinwan/tex2py
setup.py
1
1510
import sys from setuptools import setup from setuptools.command.test import test as TestCommand install_requires = ['TexSoup==0.1.4', 'pptree==2.0'] tests_require = ['pytest', 'pytest-cov==2.5.1', 'coverage == 3.7.1', 'coveralls == 1.1'] # hack install_requires = install_requires + tests_require class PyTest(TestComm...
bsd-2-clause
-4,880,245,095,279,423,000
29.816327
88
0.635762
false
3.61244
true
false
false
pepetreshere/odoo
addons/website/models/website_visitor.py
2
15826
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta import uuid import pytz from odoo import fields, models, api, _ from odoo.addons.base.models.res_partner import _tz_get from odoo.exceptions import UserError from odoo.tools.misc...
agpl-3.0
-45,463,958,355,934,510
48.611285
185
0.623784
false
4.012677
false
false
false
marco-mariotti/selenoprofiles
libraries/networkx/algorithms/flow/mincost.py
1
26221
# -*- coding: utf-8 -*- """ Minimum cost flow algorithms on directed connected graphs. """ __author__ = """Loïc Séguin-C. <loicseguin@gmail.com>""" # Copyright (C) 2010 Loïc Séguin-C. <loicseguin@gmail.com> # All rights reserved. # BSD license. __all__ = ['network_simplex', 'min_cost_flow_cost', ...
gpl-2.0
4,067,730,387,553,061,400
35.821629
104
0.56265
false
3.754404
false
false
false
DavidPowell/OpenModes
openmodes/helpers.py
1
6055
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # OpenModes - An eigenmode solver for open electromagnetic resonantors # Copyright (C) 2013 David Powell # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Gen...
gpl-3.0
-6,340,580,178,052,489,000
30.536458
103
0.61635
false
4.172984
false
false
false
drewcsillag/skunkweb
pylibs/skunkdoc/scanners/common.py
1
1465
# # Copyright (C) 2001 Andrew T. Csillag <drew_csillag@geocities.com> # # You may distribute under the terms of either the GNU General # Public License or the SkunkWeb License, as specified in the # README file. # import sys import string import ParseSkunkDoc def doDocString(s): """**if <cod...
gpl-2.0
-243,526,687,297,408,400
30.847826
78
0.526962
false
3.367816
false
false
false
rave-engine/rave
modules/opengl/core3/texture.py
1
3655
from OpenGL import GL import numpy import ctypes from . import shaders class Texture: __slots__ = ('width', 'height', 'data', 'texture') def __init__(self, width, height, data): self.width = width self.height = height self.data = data self.texture = GL.glGenTextures(1) ...
bsd-2-clause
4,593,637,646,586,049,500
33.158879
166
0.59617
false
2.889328
false
false
false
puolival/multipy
multipy/scripts/analyze_data.py
1
1952
# -*- encoding: utf-8 -*- """Script for analyzing data from the simulated primary and follow-up experiments.""" # Allow importing modules from parent directory. import sys sys.path.append('..') from fdr import lsu, tst, qvalue from fwer import bonferroni, sidak, hochberg, holm_bonferroni from permutation import tfr_p...
bsd-3-clause
-2,987,823,949,373,830,000
30.483871
73
0.656762
false
3.148387
false
false
false
aESeguridad/GERE
venv/lib/python2.7/site-packages/weasyprint/layout/markers.py
1
2049
# coding: utf-8 """ weasyprint.layout.markers ------------------------- Layout for list markers (for ``display: list-item``). :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals ...
gpl-3.0
6,302,328,897,577,311,000
36.181818
78
0.627384
false
4.025591
false
false
false
am0d/bit
bit/utils.py
1
1479
# Utility functions for various actions import os import sys import time import shutil import hashlib from bit.instance import bit from bit.cprint import error, warning def hash(file_name): try: with open(file_name, 'rb') as hashable: algo = hashlib.new(bit.options.hash_type) algo...
bsd-3-clause
7,232,347,731,415,690,000
28.58
82
0.615957
false
3.633907
false
false
false
Schibum/naclports
lib/naclports/pkg_info.py
1
3150
# Copyright 2014 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. import shlex import string from naclports.error import PkgFormatError VALID_KEYS = ['NAME', 'VERSION', 'URL', 'ARCHIVE_ROOT', 'LICENSE', 'DEPENDS', ...
bsd-3-clause
-8,466,547,247,953,835,000
35.627907
78
0.578413
false
3.972257
false
false
false
Azure/azure-sdk-for-python
sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2017_10_01/operations/_operations.py
1
4791
# 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 may ...
mit
7,840,496,075,989,891,000
42.954128
133
0.643498
false
4.633462
false
false
false
romain-fontugne/RTTanalysis
dpgmm.py
1
8500
import numpy as np import glob import dpcluster as dpc import pandas as pd import os import sys try: import matplotlib.pylab as plt import matplotlib as mpl except Exception, e: sys.stderr.write("Matplotlib is not available!") def loadData(filename, format="rttEstimate"): """Load a csv file in me...
gpl-2.0
-7,810,559,939,886,170,000
31.319392
118
0.601765
false
3.521127
true
false
false
WuShichao/computational-physics
2/figure_2_2/figure_2_2.py
1
1143
# -*- coding: utf-8 -*- """ Created on Sun Jan 10 15:52:36 2016 P23 figure2.2的源程序 @author: nightwing """ import matplotlib.pyplot as plt DENSITY = 1.29 #空气密度(kg/m3) C = 1.0 #阻力系数 A = 0.33 #截面积(m2) M = 70.0 #人车质量(kg) v1 = 4.0 #(无阻力)速度(m/s) v2 = 4.0 #(有阻力)速度(m/s) P = 400.0 #功率(w) t =...
gpl-3.0
-5,247,181,144,916,056,000
22.8
59
0.560463
false
1.828846
false
false
false
owen-chen/wireless-testing-platform
wtp/DeviceUtils.py
1
3223
# -*- coding: utf-8 -*- ''' Created on May 21, 2015 @author: chenchen ''' import os from CommonLib import callCommand class DeviceUtils: processlock = '/sdcard/processlock.pid' """ 根据手机序列号获取手机产品型号 """ @staticmethod def getProductBySerial(serial): return callCommand("adb -s %s shell getp...
gpl-2.0
-2,518,703,167,617,819,000
34.949367
159
0.63156
false
2.896939
false
false
false
antoinedube/django-spine-news-display
Server/RadioCanada/infrastructure.py
1
1266
from django.utils import timezone from urllib.request import urlopen import xml.etree.ElementTree as et import json from RadioCanada.models import NewsItem class Downloader: def __init__(self): pass def fetch(self): f = urlopen('http://rss.radio-canada.ca/fils/nouvelles/nouvelles.xml') ...
gpl-3.0
1,697,606,006,735,934,000
26.521739
78
0.548973
false
4.234114
false
false
false
weltliteratur/vossanto
theof/graph.py
1
3086
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # Reads source-modifier pairs and outputs a graphviz .dot file. # # Usage: # # Author: rja # # Changes: # 2018-08-17 (rja) # - initial version import fileinput import math import random from collections import Counter def filter_graph(sources, modifiers, edges): fi...
gpl-3.0
2,003,152,647,947,842,300
29.254902
148
0.579391
false
3.772616
false
false
false
dmitriy0611/django
django/db/migrations/executor.py
1
10302
from __future__ import unicode_literals from django.apps.registry import apps as global_apps from django.db import migrations from .loader import MigrationLoader from .recorder import MigrationRecorder from .state import ProjectState class MigrationExecutor(object): """ End-to-end migration execution - load...
bsd-3-clause
917,353,421,160,323,000
46.256881
115
0.599981
false
4.767237
false
false
false
psychopy/versions
psychopy/core.py
1
5931
#!/usr/bin/env python # -*- coding: utf-8 -*- """Basic functions, including timing, rush (imported), quit """ # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import abs...
gpl-3.0
8,450,671,426,704,044,000
34.303571
79
0.669364
false
4.206383
false
false
false
ianblenke/awsebcli
ebcli/bundled/botocore/utils.py
1
18227
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
apache-2.0
4,503,787,993,518,301,700
33.390566
82
0.600208
false
4.281654
false
false
false
jepler/linuxcnc-mirror
tests/tool-info/random-no-startup-tool/test-ui.py
1
8177
#!/usr/bin/env python import linuxcnc import hal import math import time import sys import subprocess import os import signal import glob import re def wait_for_linuxcnc_startup(status, timeout=10.0): """Poll the Status buffer waiting for it to look initialized, rather than just allocated (all-zero). Retu...
lgpl-2.1
-7,770,383,162,234,791,000
30.817121
159
0.660756
false
2.841209
true
false
false
fluo-io/fluo-deploy
lib/tests/ec2/test_config.py
1
6124
# # 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
-129,113,717,068,885,630
35.452381
74
0.595526
false
3.199582
false
false
false
jabesq/home-assistant
homeassistant/components/amcrest/camera.py
1
17637
"""Support for Amcrest IP cameras.""" import asyncio from datetime import timedelta import logging from urllib3.exceptions import HTTPError from amcrest import AmcrestError import voluptuous as vol from homeassistant.components.camera import ( Camera, CAMERA_SERVICE_SCHEMA, SUPPORT_ON_OFF, SUPPORT_STREAM) from ho...
apache-2.0
6,563,436,508,412,655,000
35.515528
79
0.594829
false
3.952712
false
false
false
IskyN/submeter-bill-generator
get_submeter_data.py
1
6582
from sys import stdout from os import makedirs from os.path import exists, abspath from requests import Session from datetime import datetime, timedelta from getpass import getpass periods_path = abspath(__file__ + "/../periods.txt") site_url = "http://meterdata.submetersolutions.com" login_url = "/login.php" file_ur...
apache-2.0
4,653,421,852,300,319,000
36.827586
93
0.558037
false
3.855888
false
false
false
Glottotopia/aagd
moin/local/moin/MoinMoin/macro/_tests/test_Hits.py
1
3829
# -*- coding: iso-8859-1 -*- """ MoinMoin - MoinMoin.macro Hits tested @copyright: 2007-2008 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ import os from MoinMoin import caching, macro from MoinMoin.logfile import eventlog from MoinMoin.PageEditor import PageEditor from ...
mit
7,299,168,824,747,804,000
43.047059
104
0.64116
false
3.51607
true
false
false
briennakh/BIOF509
Wk02/genetic_algorithm_optimizer.py
1
5552
"""Module to calculate best path between multiple points, using genetic algorithm Functions: new_path -- path altering function that creates a new path distance -- cost function that calculates distance as the cost of a path select_best -- function that selects the best paths in a population recombine -- path altering...
mit
957,501,307,047,593,300
42.359375
115
0.698018
false
4.176072
false
false
false
amkahn/event-extraction
extract_events.py
1
12233
#!/usr/bin/python # Written by Andrea Kahn # Last updated Aug. 29, 2014 ''' This script takes as input: 1) A path to a file containing patients' clinic notes, each line having the format: MRN [tab] date [tab] description [tab] note (one note per line; date must be in format YYYY-MM-DD, YYYY-MM, or YYYY) 2) A path to...
mit
6,596,118,473,499,229,000
45.340909
422
0.622578
false
3.960181
false
false
false
evfredericksen/gmapsbounds
gmapsbounds/reader.py
1
6819
from gmapsbounds import utils from gmapsbounds import constants from gmapsbounds import llpx from gmapsbounds import polygon def get_nodes(rgb_image): nodes = [] width, height = rgb_image.size do_not_check = set() menu_borders = utils.get_menu_borders(rgb_image) for x in range(width): for y...
mit
9,046,952,827,354,978,000
37.971429
101
0.555947
false
3.775748
true
false
false
arunchandramouli/fanofpython
code/features/datatypes/lists1.py
1
3368
''' Aim :: To demonstrate the use of a list Define a simple list , add values to it and iterate and print it A list consists of comma seperated values which could be of any type which is reprsented as [,,,,] .. all values are enclosed between '[' and ']' ** A list object is a mutable datatype which means it...
gpl-3.0
158,409,647,628,030,750
19.542683
149
0.663005
false
2.967401
false
false
false
IntersectAustralia/dc2c
mecat/rifcs/publishservice.py
1
2428
from tardis.tardis_portal.publish.publishservice import PublishService PARTY_RIFCS_FILENAME = "MyTARDIS-party-%s.xml" COLLECTION_RIFCS_FILENAME = "MyTARDIS-%s-dataset-%s.xml" class PartyPublishService(PublishService): def get_template(self, type): return self.provider.get_template(type=type) ...
gpl-3.0
-6,296,705,034,827,789,000
43.163636
107
0.601318
false
3.829653
false
false
false
CSIS/proccer
src/proccer/t/test_periodic.py
1
1030
from __future__ import with_statement from datetime import datetime, timedelta from mock import patch from proccer.database import Job from proccer.periodic import main from proccer.t.testing import setup_module def test_periodic(): still_bad_job = Job.create(session, 'foo', 'bar', 'baz') still_bad_job.last_...
mit
-5,977,464,837,307,305,000
33.333333
79
0.683495
false
3.130699
false
false
false
houqp/floyd-cli
floyd/cli/experiment.py
1
11976
import click from tabulate import tabulate from time import sleep import webbrowser import sys from shutil import copyfile import os import floyd from floyd.cli.utils import ( get_module_task_instance_id, normalize_job_name, get_namespace_from_name ) from floyd.client.experiment import ExperimentClient fro...
apache-2.0
-4,036,297,198,941,373,000
35.181269
150
0.632933
false
3.904793
true
false
false
arthurdejong/python-stdnum
stdnum/eu/vat.py
1
5505
# vat.py - functions for handling European VAT numbers # coding: utf-8 # # Copyright (C) 2012-2021 Arthur de Jong # Copyright (C) 2015 Lionel Elie Mamane # # 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 Soft...
lgpl-2.1
-3,631,167,909,865,830,000
35.946309
87
0.695186
false
3.767967
false
false
false
tinloaf/home-assistant
homeassistant/components/homekit_controller/__init__.py
1
10546
""" Support for Homekit device discovery. For more details about this component, please refer to the documentation at https://home-assistant.io/components/homekit_controller/ """ import json import logging import os from homeassistant.components.discovery import SERVICE_HOMEKIT from homeassistant.helpers import disco...
apache-2.0
554,708,964,111,326,800
34.870748
78
0.591125
false
4.22516
true
false
false
williamroot/opps
opps/channels/admin.py
1
3732
# -*- coding: utf-8 -*- from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from mptt.admin import MPTTModelAdmin from .models import Channel from .forms import ChannelAdminForm from opps.core.admin import PublishableAdmin from opps.core.admin import apply_opps_rules from opps.cor...
mit
-3,664,716,400,936,687,000
34.542857
79
0.556002
false
3.871369
false
false
false
ptrsxu/snippetpy
ds/ringbuffer.py
1
1268
#!/usr/bin/env python # -*- coding: utf-8 -*- """from python cookbook 2nd edition.""" class RingBuffer(object): """ a ringbuffer not filled """ def __init__(self, size_max): self.max = size_max self.data = [] class __Full(object): """ a ringbuffer filled """ def append(se...
mit
683,121,483,345,865,500
22.924528
63
0.518927
false
3.390374
false
false
false
TheProjecter/jxtl
test/test.py
1
1738
# # $Id$ # # Description # Runs the same tests, but does it by using the Python language bindings. # The Python bindings need to be be built and installed to run this. # # Copyright 2010 Dan Rinehimer # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
-1,674,219,676,627,167,200
30.6
75
0.659379
false
3.361702
true
false
false
FourthLion/pydatasentry
pydatasentry/capture.py
1
1585
#!/usr/bin/env python import uuid import inspect import json import os, sys import copy from .config import get_config from .helpers import dumper, merge from .process import summarize_run def capture_input(args, kwargs, metadata): """ Capture the function parameters for the functions that have been ins...
mit
5,243,514,757,579,922,000
23.384615
81
0.536278
false
4.106218
false
false
false
mrakitin/sirepo
sirepo/srdb.py
1
1714
# -*- coding: utf-8 -*- u"""db configuration :copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkconfig from pykern import pkinspect from pykern import pki...
apache-2.0
8,552,786,995,130,998,000
29.070175
75
0.63769
false
3.380671
true
false
false
StichtingOpenGeo/transitpubsub
src/zmq_network.py
1
1444
from consts import ZMQ_SERVER_NETWORK, ZMQ_PUBSUB_KV17 from network import network from helpers import serialize import zmq import sys # Initialize the cached network sys.stderr.write('Caching networkgraph...') net = network() sys.stderr.write('Done!\n') # Initialize a zeromq context context = zmq.Context() # Set up...
agpl-3.0
4,215,510,292,400,556,500
30.391304
130
0.693906
false
3.187638
false
false
false
maxalbert/colormap-selector
mapping_3d_to_2d_test.py
1
1798
import numpy as np from cross_section import Plane from mapping_3d_to_2d import * def test_initialise_mapping_3d_to_2d_simple(): """ Check that for a plane orthogonal to the x-axis the transformation simply drops the constant x-coordinate. """ plane1 = Plane([50, 0, 0], n=[1, 0, 0]) f1 = Mappi...
mit
6,102,046,278,074,886,000
33.576923
82
0.585095
false
2.840442
false
false
false
bram85/topydo
test/test_view.py
1
1542
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org> # # 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,...
gpl-3.0
3,500,970,238,699,097,000
35.714286
71
0.723735
false
3.552995
true
false
false
thoreg/suds
suds/client.py
1
25571
# 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 b...
lgpl-3.0
7,985,433,385,657,277,000
31.95232
82
0.573032
false
4.135695
false
false
false
liamcurry/py3kwarn
py3kwarn2to3/pgen2/pgen.py
1
13781
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports from __future__ import print_function from . import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filenam...
mit
-1,833,032,193,287,119,000
34.702073
78
0.495682
false
4.140925
false
false
false
JNU-Include/CNN
Test/lab-11-4-mnist_cnn_ensemble2.py
1
2134
# Lab 11 MNIST and Deep learning CNN import tensorflow as tf from lib.ensemble.ensemble_core import EnsembleCore from lib.ensemble.mnist_core import MnistCore from lib.ensemble.cnn_core import CNNCore class MyCNN (CNNCore): def init_network(self): self.set_placeholder(784, 10, 28, 28) self.DO = tf...
mit
3,337,229,261,010,518,000
26.358974
73
0.628397
false
2.7289
false
false
false
compas-dev/compas
src/compas_rhino/objects/inspectors/meshinspector.py
1
3026
from __future__ import print_function from __future__ import absolute_import from __future__ import division from System.Collections.Generic import List from System.Drawing.Color import FromArgb from Rhino.Geometry import Point3d from Rhino.Geometry import Line from compas_rhino.conduits import BaseConduit from compa...
mit
1,955,176,110,724,072,700
33
127
0.618638
false
3.69475
false
false
false
mysociety/pombola
pombola/core/kenya_import_scripts/import_contacts_from_tuples.py
1
1646
#!/usr/bin/env python import os import sys # Horrible boilerplate - there must be a better way :) sys.path.append( os.path.abspath( os.path.dirname(__file__) + '../../..' ) ) from pombola.core import models from django.contrib.contenttypes.models import ContentType import mp_contacts phone_kind ...
agpl-3.0
-652,200,642,074,956,900
22.514286
82
0.565006
false
3.749431
false
false
false
linuxscout/tashaphyne
tashaphyne/stemming.py
1
47427
# -*- coding: UTF-8 -*- """ Arabic Light Stemmer A class which provides a configurable stemmer and segmentor for arabic text. Features: ========= - Arabic word Light Stemming. - Root Extraction. - Word Segmentation - Word normalization - Default Arabic Affixes list. - An customizable Light ste...
gpl-3.0
-4,222,205,376,867,603,500
34.792945
136
0.546386
false
3.685274
false
false
false
fpsw/Servo
servo/forms/devices.py
1
2204
# -*- coding: utf-8 -*- from django import forms from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from servo.models import Tag, Device, Customer from servo.forms import DatepickerInput, AutocompleteCharField product_lines = [(k, x['name']) for k, x in Device.PRODU...
bsd-2-clause
-8,518,432,263,230,593,000
28.783784
81
0.632033
false
4.066421
false
false
false
kevinselwyn/pokestop
api.py
1
5080
#!/usr/bin/python # coding=utf-8 """Pokéstop API""" import sys import argparse import json from pokestop import Pokestop from flask import Flask, jsonify from flask_restful import Api, reqparse, Resource #----------------------------------------------------------------# # Constants HOSTNAME = '0.0.0.0' PORT ...
gpl-3.0
4,443,108,776,689,280,500
23.394231
110
0.493102
false
4.085346
false
false
false
Jamonek/Robinhood
docs/conf.py
1
2026
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- projec...
mit
3,453,407,910,459,892,000
31.15873
78
0.671273
false
3.881226
true
false
false
nke001/attention-lvcsr
libs/Theano/theano/sandbox/cuda/cula.py
1
3988
import pkg_resources import theano from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda import GpuOp from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable try: from theano.sandbox.cuda import cuda_ndarray dimshuffle = cuda_ndarray.cuda_ndarray.dimshuffle except ImportErro...
mit
737,977,525,252,001,200
27.898551
77
0.515547
false
3.890732
false
false
false
tkln/HelvarNet
http_gateway.py
1
1266
#!/usr/bin/python3 import http.server import socketserver import helvar helvarNet = helvar.HelvarNet('10.254.1.2', 50000) leds = [helvar.LedUnit(helvarNet, '1.2.1.1'), helvar.LedUnit(helvarNet, '1.2.1.2'), helvar.LedUnit(helvarNet, '1.2.1.3'), helvar.LedUnit(helvarNet, '1.2.1.4'), ...
mit
3,007,065,090,095,122,400
28.44186
63
0.578989
false
2.992908
false
false
false
levilucio/SyVOLT
UMLRT2Kiltera_MM/Properties/from_thesis/HMM1_then1_ConnectedLHS.py
1
2650
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HMM1_then1_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HMM1_then1_ConnectedLHS. """ #...
mit
8,863,518,393,962,690,000
42.442623
125
0.47434
false
5.206287
false
false
false
digris/openbroadcast.org
website/apps/alibrary/models/artistmodels.py
1
13676
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging import os import uuid import arating import tagging from alibrary.models import MigrationMixin, Relation, Profession from alibrary.util.slug import unique_slugify from alibrary.util.storage import get_dir_for_object, OverwriteStorage from ...
gpl-3.0
-6,412,760,050,981,160,000
29.663677
92
0.602369
false
3.862186
false
false
false
heLomaN/NetCrawler
nga_hot.py
1
1579
#!/usr/bin/env python # coding=utf-8 import requests as rq import random as rd import sys reload(sys) sys.setdefaultencoding('utf-8') headers = { 'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) Apple...
apache-2.0
-929,872,826,803,928,700
25.762712
126
0.670044
false
2.451863
false
true
false
lynchnf/maneki-neko-web
socialmedia/tests.py
1
1601
from django.test import TestCase from cms.api import add_plugin from cms.models import Placeholder from socialmedia.cms_plugins import SocialLinkPlugin from socialmedia.models import ICON_CHOICES class SocialLinkPluginTest(TestCase): def test_plugin_context(self): placeholder = Placeholder.objects.creat...
mit
-7,077,663,203,663,897,000
38.073171
160
0.613991
false
3.589686
true
false
false
smartdong/PythonPractise
Chapter 04/BombCatcher.py
1
1793
import sys, random, time, pygame from pygame.locals import * def print_text(font, x, y, text, color=(255,255,255)): imgText = font.render(text, True, color) screen.blit(imgText, (x,y)) pygame.init() screen = pygame.display.set_mode((600,500)) pygame.display.set_caption("Bomb Catching Game") font1 = pygame.font.Font...
mit
-304,384,762,807,505,800
20.105882
68
0.625767
false
2.362319
false
false
false
PHLF/rasa_nlu
_pytest/test_sanity.py
1
2984
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import import importlib import pkgutil from collections import defaultdict import pytest from multiprocessing import Queue, Process from six import PY2 def import_submodules(...
apache-2.0
-1,151,380,040,605,416,700
32.155556
111
0.656836
false
4.132964
false
false
false
eduardoklosowski/ergo-notes
ergonotes/migrations/0001_initial.py
1
1776
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
agpl-3.0
-3,621,076,773,664,285,700
45.684211
216
0.56708
false
4.031818
false
false
false
asimshankar/tensorflow
tensorflow/python/keras/integration_test.py
1
13458
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-2,980,240,026,002,302,500
40.409231
80
0.588572
false
3.700302
true
false
false
g2p/SimpleTAL
examples/elementtree-example/basic-example.py
1
2377
#!/usr/bin/python """ Example TAL program Copyright (c) 2009 Colin Stewart (http://www.owlfish.com/) 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 ...
bsd-3-clause
628,443,351,640,474,600
37.967213
75
0.766933
false
4.214539
false
false
false
techtonik/warehouse
tests/accounts/test_db.py
1
1989
# Copyright 2013 Donald Stufft # # 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, so...
apache-2.0
6,569,239,910,698,849,000
27.414286
74
0.641528
false
3.697026
true
false
false
CiscoSystems/nova
nova/tests/test_notifications.py
1
13358
# Copyright (c) 2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-8,300,314,221,059,833,000
40.484472
78
0.64613
false
3.756468
true
false
false
DataDog/integrations-extras
storm/tests/conftest.py
1
1254
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import os import socket import pytest from datadog_checks.dev import docker_run, get_here, run_command from datadog_checks.dev.conditions import WaitFor from .common import HOST, INSTANCE def wait_for_thrift()...
bsd-3-clause
-365,325,387,029,298,400
35.882353
110
0.69059
false
3.593123
false
false
false
Suwmlee/XX-Net
Python3/lib/socket.py
1
27859
# Wrapper module for _socket, providing some additional facilities # implemented in Python. """\ This module provides socket operations and some related functions. On Unix, it supports IP (Internet Protocol) and Unix domain sockets. On other systems, it only supports IP. Functions specific for a socket are avai...
bsd-2-clause
-947,895,180,707,628,000
35.800543
95
0.56786
false
4.417156
false
false
false
Heappl/scripts
context.py
1
3041
#!/usr/bin/python3 def parse_commandline_options(): from optparse import OptionParser parser = OptionParser() parser.add_option("-s", "--stack", action='store_true', dest="stack", help="produces stack trace for each running component") parser.add_option("-l", "--last_line", type='int', dest="line"...
gpl-2.0
6,712,782,048,356,157,000
32.788889
130
0.585334
false
3.611639
false
false
false