repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
stuartarchibald/numba
numba/np/unsafe/ndarray.py
7
2705
""" This file provides internal compiler utilities that support certain special operations with numpy. """ from numba.core import types, typing from numba.core.cgutils import unpack_tuple from numba.core.extending import intrinsic from numba.core.imputils import impl_ret_new_ref from numba.core.errors import RequireLit...
bsd-2-clause
8,952,773,959,271,370,000
32.8125
78
0.674677
false
3.751734
false
false
false
kunovg/EcoBici
ecobici.py
1
2059
import time import requests class EcobiciManager(): def __init__(self, client_secret, client_id): self.client_secret = client_secret self.client_id = client_id self.access_token = None self.expires_in = None self.refresh_token = None self.token_type = None se...
mit
-458,629,859,646,878,200
41.895833
196
0.629917
false
3.386513
false
false
false
DiCarloLab-Delft/PycQED_py3
pycqed/instrument_drivers/physical_instruments/american_magnetics/AMI430.py
1
24409
import collections import logging import time from functools import partial import numpy as np from qcodes import Instrument, IPInstrument from qcodes.math.field_vector import FieldVector from qcodes.utils.validators import Numbers, Anything log = logging.getLogger(__name__) class AMI430(IPInstrument): """ ...
mit
-247,127,317,100,002,240
34.375362
118
0.523946
false
4.116189
false
false
false
ethanrowe/python-data-packager
data_packager/__init__.py
1
12734
import os import pkg_resources import re import warnings REQ_PATTERN = re.compile('\bdata_packager\b') DEFAULT_ASSETS_SUBDIRECTORY = 'assets' INSTALL_REQUIREMENTS = ['data_packager'] class _Manager(object): def __init__(self, package, path): self.package = package self.path = path def relativ...
mit
8,237,471,563,180,493,000
37.125749
100
0.636171
false
4.394065
false
false
false
jfemiani/facade-segmentation
scripts/i12-eval/eval_lamma.py
1
2198
import os import re import numpy as np import skimage.io from PIL import Image from pyfacades.util.metrics import Metrics, viz_pixel_labels # Lama's results are provided as text files with the bounding boxes and confidences on each line LAMA_RESULTS_PATH = '/home/shared/Projects/Facades/data/lama_results/boxes' # O...
mit
-8,725,530,855,391,087,000
36.254237
103
0.688808
false
2.986413
false
false
false
rajaram1990/Nifty50Cards
server.py
1
4235
import cherrypy import os import redis import GetNSEStockPrice.get_stock as get_stock from cherrypy.process.plugins import Monitor import datetime import simplejson as json from collections import OrderedDict REDIS_OBJ = redis.Redis(host='10.193.124.239', port=6379, db=0) SCRIPS = REDIS_OBJ.get('scrips').split(',') c...
mit
-3,004,424,043,158,914,000
35.826087
105
0.536954
false
3.69869
false
false
false
michael-weinstein/ExACto
ExACto0.3.py
1
31402
#!/usr/bin/env python3 ''' Exome aggregation consortium annotation tool, Version 0.3 This program is designed to use the ExAC VCF data from the broad institute (downloadable from the link below). ftp://ftp.broadinstitute.org/pub/ExAC_release You will first need to run the library generation function using the commandli...
gpl-2.0
8,380,955,358,039,069,000
55.786618
439
0.570091
false
4.723526
false
false
false
mdhurst1/RoBoCoP_CRN
plotting_functions/Process_Linear_Chains.py
1
17392
# -*- coding: utf-8 -*- """ Created on Mon Mar 30 09:42:30 2015 Script to plot the results of linear change in erosion rate for CRN coasts chain MCMC simulations Martin Hurst, April 2014 @author: mhurst """ #IMPORT MODULES import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker ######...
gpl-3.0
-6,728,814,702,778,516,000
31.691729
185
0.675828
false
2.459624
false
false
false
tensorflow/lucid
lucid/optvis/overrides/__init__.py
1
1651
"""Override gradient implementations easily. Example usages: Fully default overrides ``` from lucid.optvis import overrides #... with overrides.standard_overrides(): T = render.import_model(model, param_t, param_t) #...use imported graph ``` Specific subsets of overrides ``` from lucid.optvis import ...
apache-2.0
584,805,439,254,591,600
26.516667
89
0.74682
false
3.468487
false
false
false
Alzon/senlin
senlin/drivers/openstack/lbaas.py
1
12679
# 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 # distributed unde...
apache-2.0
4,851,613,830,040,755,000
38.375776
78
0.527565
false
4.306726
false
false
false
kastrulya/InformationSecurityLabs
app/user_service.py
1
1743
from DAO import file_user_DAO_impl from DAO import mysql_user_DAO_impl from user import User __author__ = 'bubble' # user_store = file_user_DAO_impl.FileUserDAO() # user_store.start_connection() user_store = mysql_user_DAO_impl.MySQLUserDAO('admin', 'admin') def authorize(username="", password=""): users = us...
mit
7,665,477,856,956,514,000
25.409091
73
0.644865
false
3.748387
false
false
false
gfacciol/pvflip
glsvg/svg_pattern.py
1
1926
import OpenGL.GL as gl from .glutils import ViewportAs from glsvg import render_target from .svg_parser_utils import * from .svg_constants import * from .svg_path import SVGRenderableElement class SVGPattern(SVGRenderableElement): def __init__(self, svg, element, parent): SVGRenderableElement.__init__(...
agpl-3.0
-1,178,924,251,894,033,200
32.206897
118
0.575805
false
3.199336
false
false
false
noinil/euler_pysolution
python_solutions/p077_Prime_summations.py
1
1064
#!/usr/bin/env python3 import sympy def main(): prime_list = [] def is_prime(i): if i in prime_list: return True if len(sympy.primefactors(i)) == 1 and sympy.primefactors(i)[0] == i: prime_list.append(i) return True else: return False ...
gpl-2.0
-921,493,350,974,800,900
22.644444
77
0.400376
false
3.388535
false
false
false
xiaohe10/ThuCloudDisk
ThuCloudDisk/web/accountviews.py
2
3772
# This Python file uses the following encoding: utf-8 from django import forms from django.shortcuts import redirect from django.contrib.auth import authenticate from django.contrib.auth import login as auth_login,logout as auth_logout from web.models import MyUser from web.models import userBucket from ThuCloudDisk i...
apache-2.0
2,185,080,233,055,497,200
31.347826
102
0.629839
false
4.119601
false
false
false
diegocepedaw/oncall
src/oncall/api/v0/team.py
1
9662
# Copyright (c) LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license. # See LICENSE in the project root for license information. import uuid import time from urllib.parse import unquote from falcon import HTTPNotFound, HTTPBadRequest, HTTPError from ujson import dumps as json_dumps from ....
bsd-2-clause
-6,926,573,760,296,564,000
33.880866
159
0.527013
false
3.976132
false
false
false
kylejusticemagnuson/pyti
tests/sample_data.py
1
6286
class SampleData(object): def __init__(self): self.sample_volume = [1519202, 1935211, 2105682, 3287669, 1366749, 2537978, 1542199, 1868252, 1104452, 1332885, 1061692, 1166605, 1336585, 1347697, 1029834, 1038696, 1047872, 1006612, 1250938, 1818671, 1383119, 1010333, 1346189, 1386681, ...
mit
7,542,367,927,027,801,000
63.142857
79
0.5902
false
1.919976
false
false
false
jbornschein/draw
plot-kl.py
4
1711
#!/usr/bin/env python from __future__ import division, print_function import logging import argparse import numpy as np import pylab import matplotlib as mpl import cPickle as pickle from pandas import DataFrame from mpl_toolkits.mplot3d import Axes3D from blocks.main_loop import MainLoop from blocks.log.log impo...
mit
-9,205,754,836,000,925,000
23.797101
83
0.63647
false
3.151013
false
false
false
kmpf/uap
include/subcommands/render.py
1
27684
#!/usr/bin/env python # encoding: utf-8 import sys import copy import glob import logging import os import re import socket import io import subprocess import textwrap import yaml import pipeline import misc import process_pool from uaperrors import UAPError ''' This script uses graphviz to produce graphs that displa...
gpl-3.0
185,782,842,008,980,260
39.17852
95
0.453238
false
3.90782
false
false
false
inclement/kivy
kivy/uix/behaviors/button.py
18
6290
''' Button Behavior =============== The :class:`~kivy.uix.behaviors.button.ButtonBehavior` `mixin <https://en.wikipedia.org/wiki/Mixin>`_ class provides :class:`~kivy.uix.button.Button` behavior. You can combine this class with other widgets, such as an :class:`~kivy.uix.image.Image`, to provide alternative buttons th...
mit
6,915,083,310,421,695,000
29.240385
79
0.615103
false
3.993651
false
false
false
further-reading/Dicecord
code/vampireInventory.py
1
13970
# Chronicles of Darkness Vampire Inventory Sheet UI created for use in conjunction with Dicecord. # Copyright (C) 2017 Roy Healy import sip import math import stats from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import basicUI import player import sys class Invent...
gpl-3.0
-7,930,639,151,292,782,000
34.666667
114
0.581389
false
3.964245
false
false
false
Kalimaha/pact-test
pact_test/models/service_provider_test.py
1
2325
from pact_test.either import * from pact_test.constants import * class ServiceProviderTest(object): service_consumer = None has_pact_with = None @property def decorated_methods(self): for attr in dir(self): obj = getattr(self, attr) check = ( ca...
mit
8,757,752,162,023,163,000
27.353659
94
0.606452
false
3.954082
false
false
false
CTSRD-SOAAP/chromium-42.0.2311.135
third_party/trace-viewer/trace_viewer/build/benchmarks.py
6
1936
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import cProfile, pstats, StringIO import inspect import optparse import sys from trace_viewer import trace_viewer_project class Bench(object): def Set...
bsd-3-clause
5,048,566,468,007,365,000
24.813333
81
0.668905
false
3.45098
false
false
false
rmcgibbo/scipy
scipy/sparse/sputils.py
26
12917
""" Utility functions for sparse matrix module """ from __future__ import division, print_function, absolute_import __all__ = ['upcast','getdtype','isscalarlike','isintlike', 'isshape','issequence','isdense','ismatrix'] import warnings import numpy as np from scipy._lib._version import NumpyVersion # k...
bsd-3-clause
-8,949,182,244,853,308,000
29.976019
93
0.544089
false
3.907139
false
false
false
dvro/ml
mlcin/utils/keel.py
1
1423
import numpy as np def load_keel_dataset(dataset, fold, kind, prefix, module, fold_count=5): if kind not in ['tra', 'tst']: print 'ERROR: kind must be in [\'tra\', \'tst\']' return np.asarray([]), np.asarray([]) if module not in ['imbalanced', 'regular10']: print 'ERROR: module must b...
gpl-3.0
5,694,610,361,971,572,000
30.622222
74
0.51019
false
3.204955
false
false
false
pjuu/pjuu
tests/__init__.py
1
1713
# -*- coding: utf8 -*- """All Pjuu's unit/functional tests. :license: AGPL v3, see LICENSE for more details :copyright: 2014-2021 Joe Doherty """ # Stdlib imports import unittest # 3rd party imports from flask import current_app as app # Pjuu imports from pjuu import create_app, mongo as m, redis as r from pjuu.li...
agpl-3.0
7,320,815,346,594,177,000
22.465753
66
0.602452
false
3.840807
true
false
false
peap/alexa-astro
app/location.py
1
2121
import warnings from contextlib import closing from decimal import Decimal from flask import g import wikipedia from wikipedia.exceptions import DisambiguationError, PageError FIVE_PLACES = Decimal(10) ** -5 class CityNotFound(Exception): pass class CityNotSpecificEnough(Exception): pass def add_coordin...
mit
-3,730,329,487,910,856,000
28.458333
79
0.66148
false
3.7875
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/models/_models.py
1
422493
# 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
4,807,769,653,343,623,000
43.887272
901
0.663124
false
3.888118
true
false
false
tyagow/FacebookBot
src/bot/utils.py
1
2176
import json import re import requests from django.conf import settings from django.contrib.auth.models import User from src.accounts.models import Profile def read_user_details(fbid): user_details_url = "https://graph.facebook.com/v2.8/{}?access_token={}".format( fbid, settings.FACEBOOK_BOT_ACCE...
mit
-7,457,150,421,390,839,000
30.478261
109
0.653315
false
3.28593
false
false
false
martinhbramwell/GData_OpenERP_Data_Pump
models/ResCountryState.py
2
2196
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2013-03-19 @author: Martin H. Bramwell ''' from OErpModel import OErpModel OPENERP_MODULE_NAME = 'res.country.state' class ResCountryState(OErpModel): def __init__(self): super(ResCountryState, self).__init__() self.methods = { ...
agpl-3.0
-2,336,707,520,841,843,000
30.371429
113
0.571494
false
3.541935
false
false
false
materialsproject/custodian
custodian/nwchem/tests/test_handlers.py
1
1116
# coding: utf-8 from __future__ import unicode_literals, division """ TODO: Change the module doc. """ __author__ = "shyuepingong" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyuep@gmail.com" __status__ = "Beta" __date__ = "6/18/13" import unittest import os import shutil import glob from...
mit
5,202,155,036,249,255,000
22.744681
92
0.603047
false
2.748768
true
false
false
uclouvain/OSIS-Louvain
base/business/learning_units/achievement.py
2
1981
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
agpl-3.0
-2,152,200,874,589,981,000
43
97
0.660101
false
3.88998
false
false
false
kezilu/pextant
pextant/solvers/test_astarSEXTANT.py
2
1146
from astarMesh import ExplorerCost from pextant.EnvironmentalModel import GDALMesh from pextant.mesh.triangularmesh import TriPolyMesh from pextant.explorers import Astronaut from pextant.settings import AMES_DEM from pextant.mesh.MeshVisualizer import TriExpandViz from pextant.solvers.astar import aStarSearch from pex...
mit
-5,177,813,109,521,427,000
43.076923
77
0.812391
false
2.953608
false
true
false
EuroPython/epcon
tests/common_tools.py
1
6476
import http.client from datetime import date from urllib.parse import urlparse from cms.api import create_page from wsgiref.simple_server import make_server from django.conf import settings from django.core import mail from django.core.cache import cache from django.utils import timezone from assopy.models import Va...
bsd-2-clause
182,028,061,934,231,650
27.659292
98
0.657968
false
3.721839
false
false
false
fedora-infra/fedmsg
fedmsg/commands/trigger.py
7
5399
# This file is part of fedmsg. # Copyright (C) 2012 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. #...
lgpl-2.1
5,624,041,737,479,764,000
33.388535
80
0.549546
false
4.506678
true
false
false
camptocamp/mapproxy
mapproxy/test/unit/test_file_lock_load.py
6
1510
# This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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...
apache-2.0
-7,837,234,356,798,612,000
29.816327
74
0.682119
false
3.463303
false
false
false
SecondLiners/GO2
sendgrid/helpers/inbound/parse.py
3
3267
"""Parse data received from the SendGrid Inbound Parse webhook""" import base64 import email import mimetypes from six import iteritems from werkzeug.utils import secure_filename class Parse(object): def __init__(self, config, request): self._keys = config.keys self._request = request req...
gpl-3.0
5,075,583,852,293,130,000
31.67
130
0.579737
false
4.49381
false
false
false
patriczek/faf
src/pyfaf/actions/cleanup_packages.py
1
4032
# Copyright (C) 2016 ABRT Team # Copyright (C) 2016 Red Hat, Inc. # # This file is part of faf. # # faf 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) ...
gpl-3.0
-196,460,882,945,235,200
39.727273
80
0.619048
false
3.976331
false
false
false
Zephyrrus/ubb
YEAR 1/SEM1/FP/LAB/l6-l9/Controller/CommandController.py
1
3220
from Domain.Command import Command from Domain.Exceptions import InvalidCommandError from Utils import isInt class CommandController: commands = {} def __init__(self, studentCatalogController): self._studentCatalogController = studentCatalogController pass @staticmethod def addComman...
mit
500,981,276,063,189,570
39.25
140
0.586646
false
5.304778
false
false
false
Captain-Coder/tribler
Tribler/community/search/community.py
1
33610
""" Peer to peer search functionality and discovering new torrents. Author(s): Niels Zeilemaker """ from binascii import hexlify from random import shuffle from time import time from traceback import print_exc from twisted.internet.task import LoopingCall from Tribler.Core.CacheDB.sqlitecachedb import bin2str from Tr...
lgpl-3.0
6,588,257,795,146,055,000
44.542005
377
0.606694
false
4.015532
false
false
false
rs2/bokeh
bokeh/events.py
2
14547
''' Represent granular events that can be used to trigger callbacks. Bokeh documents and applications are capable of supporting various kinds of interactions. These are often associated with events, such as mouse or touch events, interactive downsampling mode activation, widget or tool events, and others. The classes ...
bsd-3-clause
4,487,428,915,801,680,400
32.673611
123
0.638001
false
3.961601
false
false
false
CountZer0/PipelineConstructionSet
python/maya/site-packages/pymel-1.0.5/extras/completion/py/pymel/all.py
3
2863
import pymel.core.modeling as modeling import pymel.internal.factories as factories import pymel.core.context as context import pymel.core.uitypes as ui import pymel.core.uitypes as uitypes from . import tools from . import core import maya.cmds as cmds import pymel.core.rendering as rendering import pymel as _pymel im...
bsd-3-clause
-440,677,085,993,410,560
27.346535
69
0.793573
false
3.624051
false
false
false
whiteclover/white
white/flash.py
4
1280
#!/usr/bin/env python # 2015 Copyright (C) White # # 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, version 2 of the License. # # This program is distributed in the hope that it will be useful, #...
gpl-2.0
9,078,375,787,033,354,000
30.219512
71
0.649219
false
4.129032
false
false
false
f4nt/mls-api
mls_api/models/team.py
1
1033
from django.db import models from mls_api.models.base import BaseModel class Team(BaseModel): ''' Soccer teams ''' name = models.CharField(max_length=128) slug = models.SlugField(unique=True) games = models.ManyToManyField('Game', through='GameTeam') def __unicode__(self): return u'%s' %...
bsd-2-clause
-806,369,380,958,834,600
24.825
72
0.624395
false
3.729242
false
false
false
sdepold/pHash
bindings/python/test/test_mhimage.py
3
4045
#!/usr/bin/python -OO # -*- coding: iso-8859-15 -*- # # # pHash, the open source perceptual hash library # Copyright (C) 2009 Aetilius, Inc. # All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-3.0
-3,935,429,322,503,889,400
24.28125
96
0.626947
false
3.034509
false
false
false
jmhsi/justin_tinker
data_science/courses/temp/layer_optimizer.py
1
1413
from .imports import * from .torch_imports import * from .core import * def opt_params(parm, lr, wd): return {'params': chain_params(parm), 'lr':lr, 'weight_decay':wd} class LayerOptimizer(): def __init__(self, opt_fn, layer_groups, lrs, wds=None): if not isinstance(layer_groups, (list,tuple)): layer_...
apache-2.0
2,210,702,873,780,521,200
32.642857
82
0.619958
false
2.749027
false
false
false
PawarPawan/h2o-v3
h2o-py/tests/testdir_misc/pyunit_frame_as_list2.py
3
1036
import sys sys.path.insert(1, "../../") import h2o def expr_as_list(ip,port): iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv")) # multiple rows and columns res = 2 - iris res = h2o.as_list(res, use_pandas=False) assert abs(float(res[4][0]) - -2.6) < 1e-10 and a...
apache-2.0
8,147,956,406,090,144,000
31.375
95
0.578185
false
2.454976
false
false
false
openstack/dragonflow
dragonflow/db/models/l3.py
1
2392
# 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 # d...
apache-2.0
3,410,816,278,397,442,600
34.701493
78
0.713211
false
3.629742
false
false
false
davidlmorton/spikepy
spikepy/builtins/visualizations/traces.py
1
5137
# Copyright (C) 2012 David Morton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distribut...
gpl-3.0
3,468,023,804,678,802,400
40.096
122
0.614756
false
3.589797
false
false
false
MAPC/myschoolcommute
survey/load_shp.py
1
2053
import os from django.contrib.gis.utils import LayerMapping from models import School, District, Street district_mapping = { 'districtid': 'districtid', 'distname': 'distname', 'slug': 'slug', 'startgrade': 'startgrade', 'endgrade': 'endgrade', 'distcode4': 'distcode4', 'distcode8': 'distco...
gpl-3.0
4,355,607,120,843,282,000
27.527778
107
0.625426
false
3.064179
false
false
false
kamilkloch/pdr-dfki
python/couch.py
1
6254
import couchdb from gps import Converter import Image, copy from images2gif import writeGif import os, inspect import ImageDraw import webbrowser from bs4 import BeautifulSoup import threading from datetime import datetime from dateutil.relativedelta import relativedelta def sync(end, start, delta, drawPath): im =...
mit
3,985,429,589,202,327,000
42.734266
231
0.500799
false
3.387866
false
false
false
rpwagner/tiled-display
flapp/test/test3D.py
1
1525
import sys, os sys.path = [os.path.join(os.getcwd(), "..", "..") ] + sys.path from flapp.app import App from flapp.glRenderer3D import glRenderer3D from OpenGL.GL import * from OpenGL.GLU import * from OpenGL import GLUT class glInitObj: def draw(self): glEnable(GL_DEPTH_TEST) class ScreenClearer: d...
apache-2.0
8,477,712,987,066,694,000
21.761194
62
0.613115
false
3.351648
false
false
false
chrislit/abydos
abydos/compression/_rle.py
1
3527
# Copyright 2014-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
-6,303,578,419,611,074,000
23.838028
73
0.525376
false
3.780279
false
false
false
StudyBlue/sblibs
sblibs/main.py
1
1409
#!/usr/bin/env python import argparse import logging import httplib from settings import * from version import __version__ def main(): """ Main Loop """ parser = argparse.ArgumentParser() parser.add_argument( '-v', '--verbose', action='store_true', default=False, help='Increase log verbo...
bsd-2-clause
1,389,723,253,765,816,800
28.375
69
0.646558
false
4.168639
false
false
false
fixbugs/py-fixbugs-tools
test/autocr/slove.py
1
5896
#!/usr/bin/env python #coding=utf8 import sys import time import copy import hashlib import json levelStr = 'level=13&x=7&y=8&map=00000000000000100000000000010001010000010000100100100001' endGameStr = '' def levelInfoGet(levelString): levelStringInfoList = levelString.split('&') nowLevelInfo = levelStrin...
gpl-3.0
4,921,701,958,613,374,000
26.680751
97
0.526119
false
3.264673
false
false
false
james-nichols/dtrw
dtrw_reactions_paper/Example_2_cable_equation.py
1
2829
#!/usr/local/bin/python3 # Libraries are in parent directory import sys sys.path.append('../') import numpy as np import time from dtrw import * from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import animation from matplotlib import cm class DTRW_diffusive_two_way(DTRW_diffus...
gpl-2.0
7,276,418,702,189,804,000
31.147727
193
0.59597
false
2.609779
false
false
false
duedil-ltd/mesos-docker-containerizer
containerizer/docker.py
1
1178
import os import json import subprocess import logging from subprocess import PIPE logger = logging.getLogger(__name__) def invoke_docker(command, arguments=[], stdout=None, stderr=None): """ Invoke the docker command line tool. This function returns a tuple that contains (stdout, stderr, return_code) ...
mit
6,050,872,447,783,286,000
24.608696
77
0.679966
false
4.090278
false
false
false
dchaplinsky/pep.org.ua
pepdb/cms_pages/migrations/0007_auto_20151025_0021.py
1
2335
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('cms_pages', '0006_auto_20151024_2019'), ] operations = [ migrations.AddField( ...
mit
5,637,296,913,732,979,000
41.454545
166
0.621842
false
3.270308
false
false
false
7sDream/zhihu-oauth
zhihu_oauth/zhcls/message.py
1
1407
# coding=utf-8 from __future__ import unicode_literals from .base import Base from .other import other_obj from .normal import normal_attr from .utils import int_id __all__ = ['Message'] class Message(Base): @int_id def __init__(self, mid, cache, session): super(Message, self).__init__(mid, cache, ...
mit
-6,738,061,253,821,813,000
18.833333
77
0.543163
false
3.256219
false
false
false
dgchurchill/nanowaspjs
src/z80/gen_disassembler_dicts.py
1
2136
import re import os from collections import namedtuple, OrderedDict Opcode = namedtuple('Opcode', 'byte, mnemonic, operand') def parse_line(l): parts = l.split(None, 1) byte = int(parts[0], 16) if len(parts) == 1: return Opcode(byte, 'fallthrough', '') format = parts[1] operand_match = re.search('[a-z]+',...
gpl-3.0
1,573,148,375,502,062,600
24.129412
81
0.631086
false
2.898236
false
false
false
kormakurAtli-tskoli/git_tskoli
for/gitverkefni.py
1
1678
#Kormákur Atli Unnþórsson #1.2.2017 #Gitverkefni #Valmynd valmynd = 0 while valmynd != 4: print("*---------- VALMYND ----------*") print("1 = Summa og margföldun") print("2 = Nafn") print("3 = Hástafir og lágstafir") print("4 = Hætta") print(" ") # Notandi slær inn valmöguleikann sem hann v...
mit
6,782,178,315,195,041,000
31.92
128
0.560753
false
2.913274
false
false
false
openqt/algorithms
projecteuler/ac/old/pe057_square_root_convergents.py
1
1235
#!/usr/bin/env python # coding=utf-8 """ Square root convergents Problem 57 It is possible to show that the square root of two can be expressed as an infinite continued fraction. √ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + ... ))) = 1.414213... By expanding this for the first four iterations, we get: 1 + 1/2 = 3/2 = 1.5...
gpl-3.0
-389,770,825,653,340,600
23.66
76
0.579886
false
2.992718
false
false
false
elegans-io/cold-start-recommender
csrec/recommender.py
1
11524
import pandas as pd import numpy as np from time import time import logging from csrec.tools.singleton import Singleton from csrec import factory_dal class Recommender(Singleton): """ Cold Start Recommender """ def __init__(self, dal_name='mem', dal_params={}, max_rating=5, log_level=logging.INFO): ...
gpl-2.0
3,942,279,133,162,012,000
49.104348
119
0.573412
false
3.854181
false
false
false
tino/django-grunted-assets
grunted_assets/templatetags/grunted_assets.py
1
3583
import os import re from django import template from django.conf import settings from django.contrib.staticfiles import finders from django.contrib.staticfiles.templatetags.staticfiles import static register = template.Library() DEFAULT_HTML_TAGS = { '.css': '<link rel="stylesheet" href="{}">', '.js': '<scri...
mit
-8,755,993,389,859,591,000
36.715789
81
0.581915
false
4.044018
false
false
false
sony/nnabla
python/src/nnabla/backward_function/interpolate.py
1
2509
# Copyright 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 or agreed...
apache-2.0
-2,261,908,843,617,264,600
38.203125
98
0.675169
false
3.9081
false
false
false
xica/hieratic
tests/test_collection_item.py
1
3947
from pytest import raises, fixture from time import mktime from datetime import datetime from hieratic import Resource from hieratic.item import ItemResource from hieratic.collection import CollectionResource from hieratic.index import SimpleIndex @fixture def UserResource(User): @ItemResource.define(User) ...
mit
815,090,181,708,777,000
25.139073
91
0.677983
false
4.056526
false
false
false
optimamodel/Optima
tests/testmodalities.py
1
17946
""" Test script for service modalities Details: Three different programs are targeting testing rates for F 15-49. This script demonstrates the effect of these programs under different interaction assumptions. It can also be used as a test script, to ensure that the calculations are being done correctly. Version: 2016...
lgpl-3.0
-8,167,342,342,997,178,000
46.228947
144
0.529644
false
3.527123
true
false
false
compas-dev/compas
src/compas_rhino/artists/_primitiveartist.py
1
1476
from __future__ import print_function from __future__ import absolute_import from __future__ import division import compas_rhino from ._artist import Artist __all__ = ["PrimitiveArtist"] class PrimitiveArtist(Artist): """Base class for artists for geometry primitives. Parameters ---------- primiti...
mit
-3,429,153,567,030,174,700
25.836364
62
0.634146
false
4.445783
false
false
false
Tocknicsu/nctuoj
backend/test/api/user/signup.py
1
8442
#!/usr/bin/env python3 import sys import requests import json import unittest import datetime from util import TestCase import common import config class TestApiUserSignup(TestCase): url = "%s/api/users/signup/"%(config.base_url,) def test_account(self): data = { 'email': config.user_test_...
mit
4,882,614,986,476,931,000
32.105882
123
0.50616
false
3.943017
true
false
false
szopu/django-rest-registration
rest_registration/api/serializers.py
1
7461
from django.contrib.auth import get_user_model from django.contrib.auth.password_validation import validate_password from rest_framework import serializers from rest_framework.exceptions import ValidationError from rest_registration.settings import registration_settings from rest_registration.utils.users import ( ...
mit
3,856,224,021,097,021,000
34.36019
115
0.649645
false
3.896084
false
false
false
microsoft/O-CNN
pytorch/projects/config.py
1
5285
import os import sys import shutil import argparse from yacs.config import CfgNode as CN _C = CN() # SOLVER related parameters _C.SOLVER = CN() _C.SOLVER.gpu = (0,) # The gpu ids _C.SOLVER.logdir = 'logs' # Directory where to write event logs _C.SOLVER.ckpt = '' # Res...
mit
-8,109,676,060,608,464,000
38.440299
84
0.604163
false
3.319724
true
false
false
DavidMellul/Projets
python/backtracking-sudoku/SudokuSolver.py
1
7491
''' M322 - Modélisation mathématique Travail dirigé par : Oliver PANTZ SudokuSolver.py - Un programme permettant de résoudre un sudoku par backtracking évolué, et de trouver toutes ses solutions. Auteurs : Loïs LONG, David MELLUL (et Abdoullah REZGUI) ''' #Utilisation de random pour mélanger les tableau...
mit
748,107,963,320,949,200
38.358696
145
0.714382
false
2.566886
false
false
false
ijat/Hotspot-PUTRA-Auto-login
PyInstaller-3.2/setup.py
1
6748
#! /usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2005-2016, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, ...
gpl-3.0
-3,051,754,085,776,156,700
32.572139
89
0.622258
false
4.193909
false
false
false
pombreda/iris-panel
iris/core/migrations/0004_remove_redundant_packs.py
7
15985
# -*- coding: utf-8 -*- # This file is part of IRIS: Infrastructure and Release Information System # # Copyright (C) 2013-2015 Intel Corporation # # IRIS is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # version 2.0 as published by the Free Software Foundat...
gpl-2.0
-8,878,759,284,707,510,000
67.900862
195
0.542821
false
3.628007
false
false
false
planaspa/Data-Mining
src/mapGraph.py
1
1452
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import sqlite3 """ This script generates a map with the geo location of the tweeters iformation gathered in our database. """ def loadData(conn): c = conn.cursor() print ("Reading from the database...") # We select all the tweets w...
mit
6,375,189,771,227,093,000
26.396226
70
0.654959
false
3.63
false
false
false
EvaBr/LVRSAT
dpll_ena_cista_pojavitev.py
1
5773
#implementacija DPLL brez (oz. z le eno) ciste pojavitve from boolean import * from cnf import * def dodaj(el, vred, slov): #Dela na CNF obliki, tj el je tipa Til/Lit, ne pa Spr/Neg. vred=T ali F, slovar={Spr("x"):T(),...} """ Pomozna funkcija, ki v slovarju vrednosti spremenljivk pripise po...
bsd-3-clause
-3,726,903,553,438,544,400
44.101563
157
0.444136
false
3.492438
false
false
false
polyaxon/polyaxon
core/tests/test_streams/test_artifacts_endpoints.py
1
2626
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
apache-2.0
657,175,664,798,178,600
38.19403
84
0.685834
false
3.719547
true
false
false
DEKHTIARJonathan/BilletterieUTC
badgingServer/Install/swigwin-3.0.7/Tools/obs-buildlogs.py
4
1117
#!/usr/bin/env python import os import subprocess import argparse import glob def remove_old_files(): files = glob.glob("*.log") for file in files: os.remove(file) def download(): repos = subprocess.Popen(['osc', 'repositories'], stdout=subprocess.PIPE) for line in repos.stdout: command = ['osc', 'bu...
apache-2.0
-2,801,348,440,133,401,600
31.852941
279
0.694718
false
3.812287
false
false
false
leonardcapillon/Flappy-Georges-Project
flappybird.py
1
15517
#! /usr/bin/env python3 """Flappy Bird, implemented using Pygame.""" import math import os from random import randint from collections import deque import sys, pygame, pyaudio, wave, audioop, math import pygame from pygame.locals import * """Audio prefs""" pygame.mixer.quit() # stops unwanted audio output on some co...
mit
-8,771,294,931,312,586,000
34.671264
86
0.61481
false
3.701574
false
false
false
ageorge/beets-bandcamp
setup.py
2
1119
from setuptools import setup setup( name='beets-bandcamp', version='0.1.4', description='Plugin for beets (http://beets.io) to use bandcamp as an autotagger source.', long_description=open('README.rst').read(), author='Ariel George', author_email='unarbolito@gmail.com', url='https://github....
mit
-1,462,102,179,319,302,000
30.083333
94
0.5916
false
3.552381
false
false
false
Daanvdk/is_valid
is_valid/is_with.py
1
1485
from .base import Predicate from .is_fixed import is_fixed from .to_pred import to_pred def to_func(value): if callable(value): return value def function(*args, **kwargs): return value return function def dict_to_func(context): context = { key: to_func(value) for ke...
mit
-6,470,562,208,733,671,000
23.75
73
0.569697
false
4.057377
false
false
false
victorywang80/Maintenance
saltstack/src/salt/modules/puppet.py
1
5937
# -*- coding: utf-8 -*- ''' Execute puppet routines ''' # Import salt libs import salt.utils def __virtual__(): ''' Only load if puppet is installed ''' if salt.utils.which('facter'): return 'puppet' return False def _check_puppet(): ''' Checks if puppet is installed ''' ...
apache-2.0
-6,262,073,637,189,654,000
27.004717
111
0.584976
false
3.942231
false
false
false
bigbrozer/monitoring.nagios
monitoring/nagios/plugin/secureshell.py
1
3521
# -*- coding: utf-8 -*- # Copyright (C) Vincent BESANCON <besancon.vincent@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...
mit
-1,083,917,222,572,238,600
43.0125
79
0.571713
false
4.938289
false
false
false
inspirehep/refextract
refextract/references/kbs.py
1
23328
# -*- coding: utf-8 -*- # # This file is part of refextract. # Copyright (C) 2013, 2015, 2016, 2017, 2018 CERN. # # refextract 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,...
gpl-2.0
4,838,409,437,108,367,000
39.641115
118
0.599709
false
4.136904
false
false
false
liorvh/golismero
tools/theHarvester/lib/graphs.py
9
28558
""" +-------------------------------------------------------------------+ | H T M L - G R A P H S (v4.8) | | | | Copyright Gerd Tentler www.gerd-tentler.de/tools | | Created: Sep. 17, 2002 ...
gpl-2.0
-6,549,902,497,065,745,000
51.690037
182
0.493837
false
3.788538
false
false
false
AlmostBetterNetwork/pinecast
pinecast/urls.py
3
1977
from django.conf import settings from django.conf.urls import include, url from django.contrib import admin from django.contrib.auth import logout from django.http import HttpResponse from django.shortcuts import redirect from django.views.i18n import JavaScriptCatalog import analytics.urls import assets.urls import d...
apache-2.0
2,487,575,772,242,942,500
30.887097
96
0.68083
false
3.702247
false
false
false
storyandstructure/django-nomnom
nomnom/actions.py
1
3242
import csv from django.http import HttpResponse def export_as_csv(modeladmin, request, queryset, export_type): """ Generic csv export admin action. based on http://djangosnippets.org/snippets/1697/ """ opts = modeladmin._meta field_names = set([field.name for field in opts.fields]) fields =...
mit
7,715,055,819,858,070,000
38.536585
111
0.598088
false
3.929697
false
false
false
dbc/gxref
setup.py
1
1031
#!/usr/bin/env python from setuptools import setup,Command,os from setuptools.command import sdist # Disable setup's overly-eager file finding. sdist.finders[:] def read(filename): return open(os.path.join(os.path.dirname(__file__), filename)).read() class veryclean(Command): description = 'Delete any non-s...
gpl-3.0
-5,114,264,740,900,383,000
25.435897
74
0.617847
false
3.413907
false
false
false
anthony-kolesov/kts46
pylib/kts46/model/Car.py
1
12912
# Copyright 2010-2011 Anthony Kolesov # # 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 w...
apache-2.0
-4,048,470,710,508,764,000
39.731861
125
0.61772
false
4.27833
false
false
false
Som-Energia/somenergia-generationkwh
generationkwh/investmentstate.py
1
22788
# -*- coding: utf-8 -*- '''State tracker for investments''' from yamlns import namespace as ns from . import investmentmodel as gkwh from .isodates import isodate from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from decimal import Decimal from decorator import decorator def f...
agpl-3.0
8,345,367,840,061,256,000
31.321023
93
0.535466
false
4.172749
false
false
false
zyzyis/monetdb
sql/test/Skyserver/Tests/Skyserver_v6.SQL.py
1
3549
import os, sys try: from MonetDBtesting import process except ImportError: import process def main(): user = 'skyserver' passwd = 'skyserver' dir = os.getenv('TSTSRCDIR') sys.stdout.write('Create User\n') sys.stderr.write('Create User\n') clt = process.client('sql', args = [os.path.join...
mpl-2.0
-6,209,569,096,766,204,000
50.434783
182
0.668921
false
3.054217
false
false
false
OpenAcademy-OpenStack/nova-scheduler
nova/tests/virt/xenapi/test_xenapi.py
1
169938
# Copyright (c) 2010 Citrix Systems, 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 applicab...
apache-2.0
4,143,222,511,453,504,000
41.273134
79
0.563052
false
3.885363
true
false
false
KenjiroAI/SynThai
metric.py
1
3224
""" Custom Metric """ from collections import OrderedDict import numpy as np from sklearn import metrics import constant def custom_metric(y_true, y_pred, gen_cm=False): """Calculate score with custom metric""" # Sample size and length sample_size = y_true.shape[0] length = y_true.shape[1] # F...
mit
-8,267,052,794,252,075,000
33.297872
85
0.534739
false
3.946144
false
false
false
SiLab-Bonn/Scarce
scarce/deprecated/python_files/FEM2.py
1
2190
import fipy import pygmsh as pg import meshio as mio def generate(resolution): geom = pg.Geometry() # Two readout pillars circle = geom.add_circle(x0=[10., 0.0, 0.0], radius=5, lcar=resolution/2., ...
mit
5,229,293,497,002,300,000
32.21875
101
0.496347
false
3.72449
false
false
false
nawawi/poedit
deps/boost/tools/build/src/util/set.py
15
1388
# (C) Copyright David Abrahams 2001. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, and with no claim as to its suitability for any purpose. from b2.util...
mit
2,454,000,742,943,172,000
27.916667
92
0.633285
false
3.71123
false
false
false
McIntyre-Lab/papers
fear_sem_sd_2015/scripts/dspr_gene_ggm_graph_network_neighborhoods.py
1
7120
#!/usr/bin/env python import os import logging import numpy as np import networkx as nx import matplotlib.pyplot as plt import pickle def setLogger(fname,loglevel): """ Function to handle error logging """ logging.basicConfig(filename=fname, filemode='w', level=loglevel, format='%(asctime)s - %(levelname)s - ...
lgpl-3.0
7,216,464,661,682,735,000
40.156069
163
0.643539
false
3.561781
false
false
false
deekshadangwal/PyRTL
pyrtl/transform.py
1
5321
import copy from .core import PostSynthBlock, set_working_block, LogicNet, working_block from .wire import Const, Input, Output, WireVector, Register from .helperfuncs import get_block def net_transform(transform_func, block=None): """ :param transform_func: Function signature: func(orig_net (logicne...
bsd-3-clause
-8,553,953,917,518,723,000
34.711409
96
0.618493
false
3.382708
false
false
false
who-emro/meerkat_api
meerkat_api/common.py
2
1589
""" common.py Shared functions for meerkat_api. """ from flask import abort, current_app from meerkat_api.authentication import auth import requests import json def device_api(url, data, api_key=False, params=None): """ Returns JSON data from API request. Args: url (str): The Meerkat API url from...
mit
2,162,689,992,718,866,200
28.981132
84
0.483323
false
4.771772
false
false
false
jandemter/lodstats
lodstats/util/namespace.py
3
1735
""" Copyright 2012 Jan Demter <jan@demter.de> This file is part of LODStats. LODStats 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. LODS...
gpl-3.0
212,475,305,593,917,250
34.408163
68
0.655331
false
3.456175
false
false
false
ain7/www.ain7.org
ain7/emploi/views.py
1
4789
# -*- coding: utf-8 """ ain7/emploi/views.py """ # # Copyright © 2007-2018 AIn7 Devel Team # # 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 ...
lgpl-2.1
1,005,462,343,870,514,600
30.708609
78
0.680451
false
3.422445
false
false
false
openqt/algorithms
leetcode/python/lc983-minimum-cost-for-tickets.py
1
2278
# coding=utf-8 import unittest """983. Minimum Cost For Tickets https://leetcode.com/problems/minimum-cost-for-tickets/description/ In a country popular for train travel, you have planned some train travelling one year in advance. The days of the year that you will travel is given as an array `days`. Each day is an...
gpl-3.0
4,285,979,306,147,977,000
26.240964
91
0.618525
false
3.103542
false
false
false