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
e-democracy/edem.profile.base
setup.py
1
1428
# -*- coding=utf-8 -*- import os from setuptools import setup, find_packages from version import get_version version = get_version() setup(name='edem.profile.base', version=version, description="Customization of the core profile system", long_description=open("README.txt").read() + "\n" + ...
gpl-3.0
-9,073,239,956,995,717,000
31.454545
83
0.611345
false
3.859459
false
false
false
SandStormHoldings/libvirt-fabric-restapi
macgen.py
1
1414
#!/usr/bin/python # macgen.py script to generate a MAC address for virtualized guests # from __future__ import print_function from builtins import map from builtins import range import random import sys import re import hashlib from config import HOSTS,HOST_IDX, main_network # def randomMAC(host,counters): if hos...
mit
5,409,914,169,610,697,000
26.72549
136
0.618105
false
3.121413
false
false
false
Yordan92/Pac-man-multiplayer
Ghosts.py
1
5718
from MakeGraph import MakeGraph from Moving_pacman import PacMan import pygame class Ghost(MakeGraph): index = 0 def __init__(self,class_graph,x,y): Ghost.index = Ghost.index + 1 self.all_nodes = class_graph.get_nodes() self.paths_to_all_nodes = class_graph.get_shortest_path() self.path = [] self.hunt...
gpl-3.0
8,085,236,753,210,260,000
25.719626
68
0.59164
false
2.353086
false
false
false
digidotcom/epoxy
setup.py
1
1990
# 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/. # # Copyright (c) 2014 Etherios, Inc. All rights reserved. # Etherios, Inc. is a Division of Digi International. from se...
mpl-2.0
-2,129,511,811,997,380,000
32.728814
91
0.650251
false
3.917323
false
false
false
DBuildService/atomic-reactor
atomic_reactor/api.py
1
5538
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. Python API for atomic-reactor. This is the official way of interacting with atomic-reactor. """ from atomic_reactor.inner import DockerBuildWork...
bsd-3-clause
5,659,945,660,937,605,000
40.022222
98
0.650235
false
4.173323
false
false
false
padmec-reservoir/ELLIPTIc
elliptic/Kernel/DSL.py
1
3082
from abc import ABC, abstractmethod from contextlib import contextmanager from types import ModuleType from typing import List, Iterator from elliptic.Kernel.Expression import Expression from .Contract import DSLContract from .TemplateManager import TemplateManagerBase from .TreeBuilder import TreeBuild class DSLMet...
mit
7,916,992,614,376,502,000
28.92233
101
0.634653
false
4.402857
false
false
false
coxmediagroup/django-socialregistration
socialregistration/views.py
1
14068
import uuid from django.conf import settings from django.template import RequestContext from django.core.urlresolvers import reverse from django.shortcuts import render_to_response from django.utils.translation import gettext as _ from django.http import HttpResponseRedirect try: from django.views.decorators.csrf...
mit
469,264,267,113,633,500
35.73107
109
0.643091
false
4.535139
false
false
false
emulbreh/shrubbery
shrubbery/db/utils.py
1
11220
import re from django.db import models from shrubbery.utils.text import camel_case def no_related_name(hidden=False): no_related_name._next += 1 name = "_no_related_name_%%(class)s_%s" % (no_related_name._next) if hidden: name += '+' return name no_related_name._next = 0 def _remove_related_a...
mit
3,695,699,204,477,365,000
30.968661
156
0.582888
false
3.834586
false
false
false
sql-machine-learning/sqlflow
python/runtime/pai/pai_ml/random_forest.py
1
3027
# Copyright 2020 The SQLFlow 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 applicable law o...
apache-2.0
8,734,393,181,451,080,000
39.905405
79
0.663693
false
3.895753
false
false
false
pawelmhm/splash
splash/html_element.py
1
12235
from __future__ import absolute_import from functools import wraps from splash.exceptions import DOMError from splash.jsutils import escape_js from splash.casperjs_utils import ( VISIBLE_JS_FUNC, ELEMENT_INFO_JS, FIELD_VALUE_JS, FORM_VALUES_JS, SET_FIELD_VALUE_JS ) DIMENSIONS_JS_FUNC = """ (funct...
bsd-3-clause
-242,330,115,481,414,270
33.758523
107
0.586105
false
3.780902
false
false
false
wdecoster/nanoget
nanoget/extraction_functions.py
1
18527
import logging from functools import reduce import nanoget.utils as ut import pandas as pd import sys import pysam import re from Bio import SeqIO import concurrent.futures as cfutures from itertools import repeat def process_summary(summaryfile, **kwargs): """Extracting information from an albacore summary file....
gpl-3.0
-1,263,447,835,598,286,300
38.169133
100
0.616344
false
3.843776
false
false
false
richteer/wambda
creature.py
1
2038
class Creature(): _maxhealth = 1 _health = 1 _speed = 1 _ch = '=' _zone = None _gold = 0 _name = "wat" _initiative = 0 _x = 0 _y = 0 def __init__(self, hp, speed, ch, name): self._health = hp self._maxhealth = hp self._speed = speed self._ch = ch self._name = name def _set_pos(self, y,x): se...
gpl-2.0
6,510,516,860,936,087,000
18.786408
78
0.580471
false
2.431981
false
false
false
littlecodersh/itchatmp
itchatmp/controllers/mpapi/mp/users.py
1
8744
''' This package is for user managing in wechat mp 1. What can we do? - set tags and everything around them - get all your users (of course not at a time) or get detailed information of one - set blacklist and everything around it 3. I alse listed API list for you: - TAGS create_tag ...
mit
5,263,644,145,367,471,000
35.689655
95
0.612534
false
3.508828
false
false
false
shahabsaf1/Python
plugins/chatter.py
1
1250
# -*- coding: utf-8 -*- from utils import * from cleverbot import Cleverbot from HTMLParser import HTMLParser # If someone mentions the bot's username, it replies commands = [('@' + bot['username'].lower())] action = 'typing' hidden = True def run(msg): input = msg['text'].replace(bot['first_name'] +...
gpl-2.0
-4,327,251,469,896,459,000
29.974359
85
0.531676
false
3.583333
false
false
false
gpmidi/zabbixMongoDB
src/mon/zbx/comm/metrics/discovery.py
1
3356
''' Created on Jan 12, 2014 @author: Paulson McIntyre (GpMidi) <paul@gpmidi.net> ''' # Built-in import time import logging import socket import collections import re try: # Python 3.x? import json # @UnresolvedImport except: # Python 2.7 import simplejson as json # @UnresolvedImport @Reimport # Oth...
gpl-2.0
-6,271,459,724,271,895,000
35.879121
131
0.561979
false
3.608602
false
false
false
cpknowles/BRG
black_rapids_forward_model/black_rapids_depth_integrated.py
1
14468
from pylab import * from scipy.interpolate import RectBivariateSpline from scipy import ndimage as nd import numpy as np import gdal def fill(data, invalid=None): """ Replace the value of invalid 'data' cells (indicated by 'invalid') by the value of the nearest valid data cell Input: data: ...
mit
8,416,404,929,511,161,000
29.91453
406
0.593655
false
2.520118
false
false
false
TradeHero/gitinspector
gitinspector/main.py
1
2678
#!/usr/bin/python # coding: utf-8 # # Copyright © 2012-2014 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 ve...
gpl-3.0
-6,643,906,900,088,932,000
30.127907
119
0.663429
false
3.930984
false
false
false
nuobit/odoo-addons
connector_sage/models/payroll_sage_labour_agreement/adapter.py
1
1429
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import models, fields from odoo.addons.component.core import Component from odoo.addons.queue_job.job import job class PayrollSageLabourAgreemen...
agpl-3.0
7,343,226,407,742,488,000
43.65625
104
0.604619
false
3.370283
false
false
false
bjornwallner/proq2-server
apps/modeller9v8/modlib/modeller/salign.py
1
7695
import modeller class SalignData(object): """Data returned from the 'alignment.salign' method""" def __init__(self, aln_score, qscorepct): self.aln_score = aln_score self.qscorepct = qscorepct def _salign_fw_local_gaps1(aln, feature_weights, ogp, egp, matrix_offset): """Local alignment wi...
gpl-3.0
6,687,180,254,797,475,000
41.28022
109
0.535802
false
3.436802
false
false
false
GoogleCloudPlatform/gsutil
gslib/parallel_tracker_file.py
1
12431
# -*- coding: utf-8 -*- # 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 require...
apache-2.0
-5,276,166,415,215,530,000
39.891447
80
0.690773
false
4.40972
false
false
false
LuyaoHuang/depend-test-framework
examples/vm_basic_doc.py
1
1635
from utils import STEPS, RESULT, SETUP import copy # TODO: use a class for this DEFAULT = { 'memory': 1048576, 'uuid': 'c156ca6f-3c16-435b-980d-9745e1d84ad1', 'name': 'vm1', 'id': 1, } def start_guest(params, env): """ Start guest """ params.doc_logger.info(STEPS + "# virsh start %s" %...
mit
8,700,338,535,210,262,000
29.849057
89
0.615902
false
3.31643
false
false
false
Nextdoor/ndscheduler
ndscheduler/corescheduler/job.py
1
3499
"""Base class for a job.""" import os import socket from ndscheduler.corescheduler import utils class JobBase: def __init__(self, job_id, execution_id): self.job_id = job_id self.execution_id = execution_id @classmethod def create_test_instance(cls): """Creates an instance of t...
bsd-2-clause
-5,716,953,715,774,555,000
32.32381
99
0.577022
false
4.261876
false
false
false
bloer/bgexplorer
bgexplorer/modelviewer/modelviewer.py
1
25907
#python 2/3 compatibility from __future__ import (absolute_import, division, print_function, unicode_literals) from itertools import chain from flask import (Blueprint, render_template, request, abort, url_for, g, Response, make_response, current_app) import threading import z...
bsd-2-clause
1,891,880,198,293,276,000
38.979938
88
0.53557
false
4.400713
false
false
false
michaelchughes/satdetect
satdetect/ioutil/IOUtil.py
1
2151
''' IOUtil.py ''' import os import numpy as np import glob import joblib import scipy.io from skimage.data import imread from distutils.dir_util import mkpath def imgpath2list(imgpath): ''' Transform provided path (or path pattern) into a list of valid paths Args ------- imgpath : list or string ...
mit
501,435,163,611,969,660
24.927711
79
0.623896
false
3.452648
false
false
false
ericholscher/django
django/core/management/__init__.py
1
15955
import collections import imp from importlib import import_module from optparse import OptionParser, NO_DEFAULT import os import sys from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import...
bsd-3-clause
-5,019,545,367,211,549,000
38.105392
98
0.59812
false
4.498167
false
false
false
Nexedi/neoppod
neo/neoctl/neoctl.py
1
7980
# # Copyright (C) 2006-2019 Nexedi SA # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed...
gpl-2.0
-5,549,362,815,099,683,000
34.625
79
0.624561
false
4.271949
false
false
false
klahnakoski/MySQL-to-S3
vendor/mo_times/dates.py
1
13619
# encoding: utf-8 # # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __...
mpl-2.0
-7,967,396,073,122,584,000
27.080412
121
0.543432
false
3.694791
false
false
false
coolsvap/clapper
ansible-tests/validations/library/discovery_diff.py
1
1534
#!/usr/bin/env python import json import os import sys from ansible.module_utils.basic import * from subprocess import Popen, PIPE DOCUMENTATION = ''' --- module: discovery_diff short_description: Provide difference in hardware configuration author: "Swapnil Kulkarni, @coolsvap" ''' def get_node_hardware_data(hw_i...
apache-2.0
-5,402,917,734,117,416,000
24.566667
89
0.6206
false
3.40133
false
false
false
simvisage/oricreate
docs/howtos/ex08_rigid_facets/sim013_single_fold_quad_psi_cntl.py
1
4000
r''' Fold control using dihedral angle with quadrilateral facets ----------------------------------------------------------- This example shows the folding process controlled by a dihedral angle between two facets. In addition to the previous example, this one introduces quadrilateral facets that are symmetrically c...
gpl-3.0
4,225,928,669,675,981,000
32.613445
79
0.4195
false
3.610108
true
false
false
arielalmendral/ert
python/python/ert/enkf/plot_data/ensemble_plot_gen_kw_vector.py
2
1627
# Copyright (C) 2014 Statoil ASA, Norway. # # The file 'ensemble_plot_gen_kw_vector.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...
gpl-3.0
-4,897,229,285,005,481,000
32.204082
103
0.657652
false
3.560175
false
false
false
OMS-NetZero/FAIR
fair/tools/magicc.py
1
6123
from __future__ import division import numpy as np from scipy.interpolate import interp1d def _import_emis_file(rcp): if rcp in ['rcp3pd', 'rcp26']: from ..RCPs.rcp26 import Emissions as rcp_emis elif rcp=='rcp45': from ..RCPs.rcp45 import Emissions as rcp_emis elif rcp in ['rcp6', 'rcp60...
apache-2.0
8,400,502,087,455,092,000
41.520833
85
0.614895
false
3.451522
false
false
false
NCI-GDC/gdcdatamodel
migrations/update_case_cache_append_only.py
1
5901
#!/usr/bin/env python from psqlgraph import Node, Edge from gdcdatamodel import models as md CACHE_EDGES = { Node.get_subclass_named(edge.__src_class__): edge for edge in Edge.get_subclasses() if 'RelatesToCase' in edge.__name__ } LEVEL_1_SQL = """ INSERT INTO {cache_edge_table} (src_id, dst_id, _prop...
apache-2.0
-4,557,591,127,347,263,500
28.068966
82
0.597356
false
3.567715
false
false
false
Southpaw-TACTIC/TACTIC
src/pyasm/widget/error_wdg.py
1
6906
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
5,733,914,920,654,536,000
28.262712
96
0.5585
false
3.669501
false
false
false
novafloss/populous
populous/cli.py
1
2649
import importlib import logging import click import click_log import six from .loader import load_blueprint from .exceptions import ValidationError, YAMLError, BackendError logger = logging.getLogger('populous') click_log.basic_config(logger) def get_blueprint(files, **kwargs): try: return load_bluepri...
mit
-7,277,352,776,441,271,000
26.309278
76
0.619857
false
4.22488
false
false
false
highweb-project/highweb-webcl-html5spec
tools/android/loading/activity_lens.py
1
11113
# Copyright 2016 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. """Gives a picture of the CPU activity between timestamps. When executed as a script, takes a loading trace, and prints the activity breakdown for the reque...
bsd-3-clause
3,075,392,639,984,073,700
38.130282
80
0.651219
false
3.803217
false
false
false
prospero78/pyPC
pak_pc/pak_gui/pak_widgets/mod_frm_cpu.py
1
1734
# -*- coding: utf8 -*- ''' Этот модуль заточен под отображение состояния центрального процессора. Ввиду его отдельности -- его можно втыкать куда угодно. ) ''' from Tkinter import Frame from pak_pc.pak_gui.pak_widgets.mod_frm_reg import ClsFrmReg from pak_pc.pak_gui.pak_widgets.mod_frm_reg_pc import ClsFrmRegPC from ...
lgpl-3.0
-1,709,216,792,433,874,700
32.214286
70
0.683154
false
1.948324
false
false
false
alex-petrenko/hierarchical-rl
microtbs_rl/algorithms/a2c/multi_env.py
1
3019
import threading import numpy as np from queue import Queue from microtbs_rl.utils.common_utils import * logger = logging.getLogger(os.path.basename(__file__)) class _MultiEnvWorker: """ Helper class for the MultiEnv. Currently implemented with threads, and it's slow because of GIL. It would be mu...
mit
1,352,694,666,587,328,800
30.447917
104
0.60583
false
3.890464
false
false
false
amarian12/p2pool-adaptive-nvc
p2pool/networks.py
1
2034
from p2pool.bitcoin import networks from p2pool.util import math # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # ...
gpl-3.0
8,468,677,192,613,597,000
40.510204
358
0.636676
false
2.809392
false
false
false
bburan/psiexperiment
psi/controller/output.py
1
9465
import logging log = logging.getLogger(__name__) from types import GeneratorType from functools import partial import numpy as np from atom.api import (Unicode, Enum, Event, Typed, Property, Float, Int, Bool, List) import enaml from enaml.application import deferred_call from enaml.core.api im...
mit
1,338,692,515,982,732,500
28.670846
81
0.604015
false
4.032808
false
false
false
elemel/torn
lib/torn/ik.py
1
1441
from euclid import * from math import * __all__ = ['solve'] def solve(vertices, target): if len(vertices) == 2: return solve_one_edge(vertices, target) elif len(vertices) == 3: return solve_two_edges(vertices, target) else: return vertices def solve_one_edge(vertices, target): ...
mit
-3,554,647,439,984,454,700
24.732143
70
0.461485
false
2.634369
false
false
false
montylounge/django-sugar
sugar/templatetags/media.py
1
1435
from django.template import Library, Node from django.template.loader import render_to_string from django.contrib.sites.models import Site from django.conf import settings import os, urlparse register = Library() def _absolute_url(url): if url.startswith('http://') or url.startswith('https://'): ...
bsd-3-clause
6,945,768,594,678,225,000
37.810811
99
0.611847
false
3.578554
false
false
false
google/mirandum
alerts/main/migrations/0015_auto_20160606_0610.py
1
4393
# -*- coding: utf-8 -*- # Copyright 2016 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 # # Un...
apache-2.0
7,792,831,731,491,586,000
85.137255
941
0.644434
false
2.980326
false
false
false
FordyceLab/AcqPack
acqpack/fractioncollector.py
1
3626
import numpy as np import pandas as pd import utils as ut class FractionCollector: """ A high-level wrapper around an XY stage. """ def __init__(self, xy): self.frames = pd.DataFrame(index=['trans', 'position_table']) self.add_frame('hardware') self.XY = xy def add_f...
mit
6,732,813,930,604,466,000
37.168421
115
0.593767
false
3.898925
false
false
false
juju-solutions/charms.reactive
charms/reactive/relations.py
1
33565
# Copyright 2014-2017 Canonical Limited. # # This file is part of charms.reactive # # charms.reactive is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charms.reactive is distributed in the ...
apache-2.0
-2,251,918,463,404,787,500
34.556144
98
0.623834
false
4.344984
false
false
false
robertnishihara/ray
python/ray/signature.py
1
5787
import inspect from inspect import Parameter import logging from ray.utils import is_cython # Logger for this module. It should be configured at the entry point # into the program using Ray. Ray provides a default configuration at # entry/init points. logger = logging.getLogger(__name__) # This dummy type is also de...
apache-2.0
-1,852,312,170,600,221,700
32.258621
79
0.654398
false
4.482572
false
false
false
FabriceSalvaire/Musica
other-examples/audio/generate-wav-tone.py
1
7254
#################################################################################################### # # Musica - A Music Theory Package for Python # Copyright (C) 2017 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
gpl-3.0
8,334,232,289,626,942,000
34.73399
106
0.489109
false
4.325581
false
false
false
hendrikwout/pynacolada
old/pynacolada/pynacolada.py
1
59125
from operator import itemgetter,mul import numpy as np from netcdf import netcdf_file import sys from Scientific.IO import NetCDF from ncdfextract import ncgettypecode from ncdfproc import nccopydimension,nccopyattrvar class SomeError(Exception): def __init__(self, value): self.value = value def _...
gpl-3.0
-6,246,336,281,871,507,000
51.979391
332
0.582512
false
3.417038
false
false
false
gaufung/LMDI
Figures/app.py
1
5703
import numpy as np import matplotlib.pyplot as plt from matplotlib.font_manager import FontProperties, findfont from matplotlib.legend_handler import HandlerPatch import matplotlib.patches as mpatches import matplotlib as mpl from matplotlib import cm import xlrd from config import SHEET_INDEX, ROW_START, ROW_END, COLU...
mit
-4,575,353,626,627,105,300
36.774834
127
0.607049
false
2.814906
false
false
false
xs2maverick/adhocracy3.mercator
src/adhocracy_frontend/adhocracy_frontend/tests/acceptance/shared.py
1
5414
"""Shared acceptance test functions.""" from random import choice from time import sleep import requests import json from splinter.driver.webdriver import WebDriverElement from adhocracy_core.testing import god_login from adhocracy_core.testing import god_password from adhocracy_core.testing import participant_passwo...
agpl-3.0
-2,467,685,987,288,279,600
29.937143
75
0.634281
false
3.688011
false
false
false
matrix-org/synapse
tests/storage/test_state.py
1
17131
# Copyright 2018-2021 The Matrix.org Foundation C.I.C. # # 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,163,653,240,456,441,000
35.217759
88
0.556885
false
3.760922
true
false
false
kenjyoung/MinAtar
examples/human_play.py
1
3764
################################################################################################################ # Authors: # # Kenny Young (kjyoung@ualberta.ca) ...
gpl-3.0
-8,559,620,511,119,420,000
39.042553
112
0.459086
false
4.449173
false
false
false
thortex/rpi3-webiopi
webiopi_0.7.1/python/webiopi/devices/memory/__init__.py
1
12397
# Copyright 2014 Andreas Riegg - t-h-i-n-x.net # # 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
-2,507,982,289,497,271,000
33.628492
113
0.571267
false
3.658011
false
false
false
mattjj/pylds
pylds/distributions.py
1
8777
import autograd.numpy as np from autograd import value_and_grad from autograd.scipy.special import gammaln from scipy.optimize import minimize from pybasicbayes.distributions import Regression from pybasicbayes.util.text import progprint_xrange class PoissonRegression(Regression): """ Poisson regression wit...
mit
6,226,444,625,505,084,000
30.124113
97
0.53982
false
3.517836
false
false
false
botswana-harvard/edc-rule-groups
edc_rule_groups/rule_group.py
1
4885
import inspect import copy from .exceptions import RuleGroupError from .rule import Rule class BaseMeta: """Base class for RuleGroup "Meta" class.""" app_label = None source_model = None source_fk = None rules = None def __init__(self, group_name, **meta_attrs): for k, v in meta_att...
gpl-2.0
1,186,585,431,572,537,900
38.715447
113
0.510952
false
4.578257
false
false
false
oolorg/ool-l1patch-dev
patch_ofc.py
1
8096
import logging import json from webob import Response from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller import dpset # from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.of...
apache-2.0
517,307,418,234,747,600
36.655814
97
0.587204
false
3.765581
false
false
false
RuiNascimento/krepo
script.module.lambdascrapers/lib/lambdascrapers/sources_placenta/en_placenta-1.7.8/cmovie.py
1
3714
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @Daddy_Blamo wrote this file. As long as you retain this notice you # can do whatever you want wi...
gpl-2.0
706,845,749,741,321,600
39.369565
100
0.462305
false
3.972193
false
false
false
jemofthewest/mykoans
python3/koans/about_tuples.py
1
2314
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutTuples(Koan): def test_creating_a_tuple(self): count_of_three = (1, 2, 5) self.assertEqual(5, count_of_three[2]) def test_tuples_are_immutable_so_item_assignment_is_not_possible(self): count_of_three =...
mit
-1,628,391,265,102,596,600
33.029412
83
0.571305
false
3.204986
true
false
false
joshwatson/binaryninja-api
python/settings.py
1
18886
# Copyright (c) 2015-2021 Vector 35 Inc # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, ...
mit
2,208,039,915,937,876,000
46.571788
202
0.67378
false
3.850357
false
false
false
pywren/pywren
fabfile.py
1
11297
# # Copyright 2018 PyWren Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-8,836,333,643,246,532,000
29.045213
136
0.565548
false
3.564847
true
false
false
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3/dialogflow-cx-v3-py/google/cloud/dialogflowcx_v3/types/version.py
1
8929
# -*- 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
1,017,226,616,603,671,700
29.578767
118
0.62045
false
4.17243
false
false
false
quantopian/qdb
qdb/comm.py
1
34207
# # Copyright 2015 Quantopian, 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 to in writin...
apache-2.0
-142,132,856,372,043,680
29.541964
79
0.540679
false
4.275341
false
false
false
open-synergy/opnsynid-hr
hr_expense_header_account/tests/test_onchange.py
1
2544
# -*- coding: utf-8 -*- # Copyright 2016 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from .base import BaseCase class HrExpensePayableAccount(BaseCase): # Check value account_id # Condition : # journal_id == True # default_credit_account == True # home_ad...
agpl-3.0
-4,510,974,846,039,466,000
27.266667
63
0.56761
false
3.814093
false
false
false
ForAP/Advanc3d-Pr0graming
A5-Tree/A5-Updated/toolbox.py
1
2769
# File name: toolbox.py import kivy kivy.require('1.7.0') import math from kivy.uix.togglebutton import ToggleButton from kivy.graphics import Line from turingwidgets import StateRep, DraggableWidget, Transition1, Transition2 from kivy.utils import get_color_from_hex from kivy.graphics import Color, Ellipse, Line, Bezi...
gpl-2.0
2,529,451,731,753,912,300
39.130435
84
0.615746
false
3.696929
false
false
false
leebecker/jembatan
jembatan/analyzers/spacy.py
1
10874
import re import itertools import functools from enum import auto, Flag from jembatan.core.spandex import (Span, Spandex) from jembatan.core.af import process_default_view, AnalysisFunction from jembatan.typesys.chunking import NounChunk, Entity from jembatan.typesys.segmentation import (Document, Sentence, Token) fro...
apache-2.0
1,064,162,214,636,632,700
35.489933
118
0.573754
false
4.000736
false
false
false
nonsk131/USRP2016
generate_tests0000-0999.py
1
3341
from isochrones.dartmouth import Dartmouth_Isochrone from isochrones.utils import addmags import numpy as np import pandas as pd file = open('/tigress/np5/true_params.txt','a') def get_index(n): if n < 10: return '000' + str(n) elif n < 100: return '00' + str(n) elif n < 1000: retu...
mit
-4,797,106,223,220,081,000
28.566372
102
0.516911
false
2.933275
false
false
false
potato16/pythonl
dirtylook/widgetsII.py
1
2420
import sys from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QLabel, QApplication, QLineEdit, QFrame, QSplitter, QStyleFactory, QComboBox) from PyQt5.QtGui import QPixmap from PyQt5.QtCore import Qt class Example(QWidget): def __init__(self): super().__init__() self.initUI(...
apache-2.0
1,898,606,519,239,225,300
30.842105
54
0.606198
false
3.558824
false
false
false
piface/pifacecad
setup.py
2
1293
import sys from distutils.core import setup #PY3 = sys.version_info.major >= 3 PY3 = sys.version_info[0] >= 3 VERSION_FILE = "pifacecad/version.py" def get_version(): if PY3: version_vars = {} with open(VERSION_FILE) as f: code = compile(f.read(), VERSION_FILE, 'exec') ex...
gpl-3.0
8,687,815,180,526,768,000
29.785714
77
0.621036
false
3.715517
false
false
false
kedz/sumpy
duc_testbed.py
1
2216
import argparse import pandas as pd import os import sumpy import sumpy.eval def load_docsets(duc_dir): docset_paths = [os.path.join(duc_dir, fname) for fname in os.listdir(duc_dir)] docset_paths = [path for path in docset_paths if os.path.isdir(path)] docsets = {} for docset_path ...
apache-2.0
1,770,225,091,152,493,600
34.174603
77
0.618682
false
3.183908
false
false
false
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/sources/it/freedownload.py
1
3281
import requests import re import xbmc,xbmcaddon,time from ..scraper import Scraper from ..common import clean_title,clean_search,random_agent,send_log,error_log dev_log = xbmcaddon.Addon('script.module.universalscrapers').getSetting("dev_log") class freedownload(Scraper): ...
gpl-2.0
967,297,113,718,419,100
37.6
135
0.477294
false
4.116688
false
false
false
DarjaGFX/GroupWeb
web/settings.py
1
3218
""" Django settings for web project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os # ...
gpl-3.0
-8,696,760,926,007,692,000
24.744
91
0.684587
false
3.45279
false
false
false
aksareen/balrog
auslib/test/admin/views/test_releases.py
1
71942
import mock import simplejson as json from sqlalchemy import select from auslib.blobs.base import createBlob from auslib.global_state import dbo from auslib.test.admin.views.base import ViewTest class TestReleasesAPI_JSON(ViewTest): def testGetRelease(self): ret = self._get("/releases/b") self....
mpl-2.0
-5,560,149,751,817,180,000
41.393636
157
0.531345
false
3.698247
true
false
false
ForToffee/UnicornHAT
wordclock.py
1
4259
#!/usr/bin/env python # wordclock.py by Carl Monk (@ForToffee) # https://github.com/ForToffee/UnicornHAT # no unicorns were harmed in the making of this code import unicornhat as UH import time #global variables hourPattern = [] minPattern = [] #pre-defined patterns - groups of x,y co-ords - 0,0 is bottom right wit...
mit
1,032,687,860,614,343,800
23.477011
87
0.61329
false
2.484831
false
false
false
erikiado/jp2_online
familias/migrations/0004_alumno_tutor.py
1
1205
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-02-23 05:32 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('familias', '0003_merge_20170223_0525'), ] operatio...
mit
-2,830,436,533,046,184,000
36.65625
124
0.587552
false
3.887097
false
false
false
ojosedo/programacion_morada
Pygame/juego/personaje.py
1
11020
#!/usr/bin/env python # -*- coding: utf-8 -*- # Importa la librería de funciones llamada 'pygame' import pygame import pytmx import copy # Definimos algunos colores NEGRO = [ 0, 0, 0] BLANCO = [ 255, 255, 255] VERDE = [ 0, 255, 0] ROJO = [ 255, 0, 0] # Constantes en mayúsculas # Inicializa el motor de juegos pygam...
gpl-3.0
4,637,477,412,209,843,000
34.025478
132
0.602019
false
2.77517
false
false
false
paul-jean/ud858
Lesson_2/000_Hello_Endpoints/helloworld_api.py
1
1742
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
gpl-3.0
-2,053,519,090,300,488,000
30.672727
74
0.729047
false
3.778742
false
false
false
blurstudio/cross3d
cross3d/abstract/abstractapplication.py
1
8664
""" The AbstractApplication class will define all operations for application interaction. It is a singleton class, so calling cross3d.Application() will always return the same instance of Application. One of its main functions is connecting application callbacks to cross3d.Dispatch. The AbstractApplication is a QOb...
mit
2,690,035,886,214,266,000
26.075
82
0.742267
false
3.831933
false
false
false
EconForge/dolo
dolo/misc/caching.py
1
4370
import functools class memoized(object): """Decorator that caches a function's return value each time it is called. If called later with the same arguments, the cached value is returned, and not re-evaluated. """ def __init__(self, func): self.func = func self.cache = {} def ...
bsd-2-clause
8,237,001,637,224,577,000
27.376623
84
0.556979
false
4.130435
false
false
false
daniellawrence/pyspeccheck
speccheck/file.py
1
2560
#!/usr/bin/env python from .util import Spec class File(Spec): STATES = [ "directory", "file", "owned_by", "smaller_than", "larger_than" ] def __init__(self, path): self.path = path self.state = {} self.get_state() self.WIN = "File %s is %%s" % se...
mit
-4,272,780,294,364,306,000
27.764045
77
0.494141
false
3.386243
false
false
false
ahmadcahyana/xyberville
xyberville/apps/sales/migrations/0001_initial.py
1
2125
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Item', f...
mit
-8,822,335,561,830,740,000
47.295455
167
0.568941
false
4.207921
false
false
false
olkku/tf-info
apps/voteresults/views.py
1
1866
from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponse from django.utils import timezone from django.conf import settings from django.views.decorators.cache import cache_page import urllib2 """ Takes in results from a vote in the following form...
bsd-3-clause
1,497,367,023,401,473,300
19.282609
128
0.633976
false
2.584488
false
false
false
srinivasanmit/all-in-all
DSAlgo/LinkedLists/linked_list.py
1
4932
class Node() : def __init__(self, data): self.data = data self.next = None class LinkedList() : def __init__(self): self.head = None self.tail = None self.ll_length = 0 def appendNode(self, data): new_node = Node(data) self.ll_length += 1 ...
gpl-3.0
134,500,026,237,291,900
30.018868
71
0.538727
false
3.802621
false
false
false
bhecquet/seleniumRobot-server
snapshotServer/views/TestResultView.py
1
3829
''' Created on 4 sept. 2017 @author: worm ''' from django.views.generic.list import ListView from snapshotServer.models import TestCaseInSession, StepResult, Snapshot import json from snapshotServer.views.LoginRequiredMixinConditional import LoginRequiredMixinConditional class TestResultView(LoginRequiredMixinConditi...
apache-2.0
8,277,047,193,499,717,000
34.794393
143
0.511883
false
4.569212
true
false
false
MattBlack85/dunning-cruncher
utils/func_utils.py
1
4192
#-*- coding: utf-8 -*- from django.conf import settings from django.http import HttpResponse from django.template.context import Context from django.template.loader import get_template from xhtml2pdf import pisa # TODO: Change this when the lib changes. import StringIO import os #=====================================...
bsd-3-clause
-8,430,157,454,704,671,000
38.54717
114
0.558922
false
3.766397
false
false
false
dknez/libmesh
doc/statistics/libmesh_pagehits.py
1
7992
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np # Import stuff for working with dates from datetime import datetime from matplotlib.dates import date2num # Hits/month, pages, and gigabytes served. # To get the Google analytics data: # .) go to analytics.google.com # .) click on libmesh # .) ...
lgpl-2.1
-8,665,432,598,488,634,000
34.052632
131
0.519144
false
2.295892
false
false
false
Urinx/Project_Euler_Answers
050.py
1
1316
#!/usr/bin/env python #coding:utf-8 """ Consecutive prime sum The prime 41, can be written as the sum of six consecutive primes: 41 = 2 + 3 + 5 + 7 + 11 + 13 This is the longest sum of consecutive primes that adds to a prime below one-hundred. The longest sum of consecutive primes below one-thousand that adds to a p...
gpl-2.0
-2,962,537,939,399,148,000
22.517857
118
0.572188
false
3.096471
false
false
false
topliceanu/learn
python/algo/test/test_programming_set_2_1.py
1
3883
# -*- coding: utf-8 -*- """ In this programming problem and the next you'll code up the greedy algorithms from lecture for minimizing the weighted sum of completion times.. Use file [./Jobs.txt]. This file describes a set of jobs with positive and integral weights and lengths. It has the format [job_1_weight] [job_1_...
mit
2,231,773,159,586,177,300
38.622449
79
0.714139
false
3.358997
false
false
false
Micronaet/micronaet-sql7
sql_due_list_cei/cei.py
1
1889
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
agpl-3.0
534,603,551,880,628,500
37.55102
121
0.625199
false
4.106522
false
false
false
HybridF5/jacket
jacket/tests/compute/unit/image/test_fake.py
1
4715
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
2,027,542,659,760,899,800
39.299145
84
0.564793
false
4.165194
true
false
false
TrondKjeldas/SoCo
soco/compat.py
1
2435
# -*- coding: utf-8 -*- # pylint: disable=unused-import,import-error,no-name-in-module, # pylint: disable=ungrouped-imports """This module contains various compatibility definitions and imports. It is used internally by SoCo to ensure compatibility with Python 2.""" from __future__ import unicode_literals try: # p...
mit
347,761,600,964,849,000
32.356164
79
0.668172
false
3.840694
false
false
false
40323107/cpw12
wsgi.py
1
1498
#!/usr/bin/env python import os def application(environ, start_response): ctype = 'text/plain' if environ['PATH_INFO'] == '/health': response_body = "1" elif environ['PATH_INFO'] == '/env': response_body = ['%s: %s' % (key, value) for key, value in sorted(environ.items(...
gpl-3.0
-5,194,370,457,277,970,000
36.45
93
0.62283
false
2.180495
false
false
false
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/backend_services/update_backend.py
4
12042
# 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 ag...
mit
1,338,644,663,265,337,000
37.350318
80
0.711344
false
4.128214
false
false
false
scottnm/Pong
testText.py
1
1120
import pygame, sys from pygame.locals import * pygame.init() dSurf = pygame.display.set_mode((400, 400)) pygame.display.set_caption("Test Text") myFont = pygame.font.SysFont("Times New Roman", 30) while True: testText = myFont.render("Test Text", 0, (255,255,255)) for event in pygame.event.get(): if...
apache-2.0
-7,127,174,258,844,549,000
22.829787
59
0.508036
false
3.294118
false
false
false
quiltdata/quilt
lambdas/pkgselect/test/test_pkgselect.py
1
19970
""" Test functions for pkgselect endpoint """ import json import os from unittest import TestCase from unittest.mock import patch import boto3 import pandas as pd import responses from botocore.stub import Stubber from t4_lambda_shared.utils import buffer_s3response, read_body from ..index import file_list_to_folde...
apache-2.0
8,699,328,862,312,954,000
32.008264
97
0.499449
false
4.216639
true
false
false
afg984/pyardrone
pyardrone/at/parameters.py
1
4104
import enum import functools import json import io import operator from pyardrone.utils import repack_to_int class Parameter: ''' Base class of all at command parameters. :param description: description of the parameter, stored in __doc__ :param default: default value of the parameter ''' ...
mit
-8,764,931,321,798,617,000
24.02439
79
0.516813
false
4.124623
false
false
false
narock/agu_analytics
query_KeywordSection.py
1
1271
import math, sys from SPARQLWrapper import SPARQLWrapper, JSON from queries.keywordSectionCount import keywordSectionCount from queries.createKeywordSectionQuery import createKeywordSectionQuery # get the year to query from the user year = input("Enter year to query: ") year = str(year) # there are too many results t...
gpl-3.0
7,374,139,133,229,208,000
36.382353
71
0.763179
false
3.694767
false
false
false
quantumlib/Cirq
cirq-core/cirq/ops/measurement_gate_test.py
1
15471
# Copyright 2018 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
-8,647,133,064,538,131,000
34.263761
100
0.592455
false
2.952756
true
false
false
repotvsupertuga/tvsupertuga.repository
plugin.video.TVsupertuga/resources/lib/plugins/b98tv.py
1
9567
""" Copyright (C) 2018 MuadDib ---------------------------------------------------------------------------- "THE BEER-WARE LICENSE" (Revision 42): @tantrumdev wrote this file. As long as you retain this notice you can do whatever you want with this stuff. Just Ask first when not released through...
gpl-2.0
-4,601,575,278,499,375,000
34.565056
133
0.464513
false
3.979617
false
false
false
nagaozen/my-os-customizations
usr/share/gtksourceview-2.0/language-specs/convert.py
1
17436
#!/usr/bin/env python2 import xml.dom.minidom as dom import cgi default_styles = { 'Comment' : 'def:comment', 'String' : 'def:string', 'Preprocessor' : 'def:preprocessor', 'Keyword' : 'def:keyword', 'Data Type' : 'def:type', 'Decimal' : 'def:decimal', 'Specials' : 'def:specials', 'Func...
gpl-3.0
1,176,061,598,190,677,800
32.725338
152
0.558385
false
3.674605
false
false
false
qedsoftware/commcare-hq
corehq/ex-submodules/casexml/apps/case/templatetags/case_tags.py
1
17357
from functools import partial import copy import datetime import numbers import pytz import json import types from django import template from django.core.urlresolvers import reverse from django.template.loader import render_to_string from django.utils.translation import ugettext as _ from django.utils.safestring impo...
bsd-3-clause
6,098,225,041,910,975,000
32.507722
107
0.520366
false
4.199613
false
false
false
ianmtaylor1/MCL
mcl/sparse.py
1
8987
"""mcl/sparse.py Code for performing the Markov Cluster Algorithm using scipy.sparse.spmatrix as the underlying matrix. (AKA "sparse" matrices)""" import numpy import scipy.sparse as sparse from datetime import datetime _DEFAULT_ROW_THRESH=1E-14 _DEFAULT_CHECK_ITERATIONS=50 def _delta(A,B): """Computes the diffe...
lgpl-3.0
5,609,223,975,875,018,000
45.092308
127
0.640036
false
3.615044
false
false
false