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
why2pac/dp-tornado
dp_tornado/helper/validator/form/__init__.py
1
1609
# -*- coding: utf-8 -*- from dp_tornado.engine.helper import Helper as dpHelper class FormHelper(dpHelper): def validate(self, controller, fields, error_res='json'): assert error_res in ('json', 'http', 'code') output = {} missing_reason = 'missing' invalid_reason = 'invalid' ...
mit
-148,264,188,733,514,530
33.978261
109
0.570541
false
4.584046
false
false
false
adstomper/adblockedge
buildtools/build.py
1
15827
# coding: utf-8 # This Source Code is subject to the terms of the Mozilla Public License # version 2.0 (the "License"). You can obtain a copy of the License at # http://mozilla.org/MPL/2.0/. import os, sys, re, subprocess, buildtools from getopt import getopt, GetoptError class Command(object): name = property(lam...
mpl-2.0
-2,171,428,615,372,930,000
35.978972
186
0.680672
false
3.773724
false
false
false
ger-ator/turnos
personal/bajas.py
1
16813
from PyQt5 import QtSql, QtCore from enum import Enum from personal import calendario from personal import personal from personal import trabajador def transaccion(func): def func_wrapper(*args): QtSql.QSqlDatabase.database().transaction() func(*args) QtSql.QSqlDatabase.database().commit(...
gpl-3.0
-4,720,994,865,346,456,000
37.291572
99
0.535158
false
3.480331
false
false
false
retooth/morse
morse/models/filters.py
1
2137
#!/usr/bin/python # This file is part of Morse. # # Morse 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. # # Morse ...
gpl-3.0
838,505,797,291,886,600
34.616667
80
0.673842
false
3.684483
false
false
false
kawashiro/dewyatochka2
src/dewyatochka/plugins/cool_story/parser/nya_sh.py
1
1954
# -*- coding: UTF-8 """ nya.sh html parser Classes ======= Parser -- Parser implementation Attributes ========== NYA_SH_SOURCE_NAME -- Source name constant """ import html from html.parser import HTMLParser from lxml.html import HtmlElement from pyquery import PyQuery from ._base import * __all__ = ['Par...
gpl-3.0
-1,173,607,798,858,651,000
22.829268
84
0.575742
false
3.786822
false
false
false
ostrovok-team/django-mediagenerator
mediagenerator/management/commands/cleanupmedia.py
1
1262
import os from django.core.management.base import NoArgsCommand from django.utils.importlib import import_module from mediagenerator import settings class Command(NoArgsCommand): help = 'Removes files from _generated_media not stored in _generated_media_file.pu' files_removed = 0 def handle_noar...
bsd-3-clause
-410,517,007,112,791,940
30.55
88
0.646593
false
3.993671
false
false
false
jgliss/pydoas
scripts/ex1_read_and_plot_example_data.py
1
6008
# -*- coding: utf-8 -*- """pydoas example script 1 Introductory script illustrating how to import data from DOASIS resultfiles. The DOASIS result file format is specified as default in the package data file "import_info.txt". Creates a result data set using DOASIS example data and plots some examples """ import pyd...
bsd-3-clause
-2,086,774,709,072,713,200
38.019481
83
0.531625
false
3.425314
true
false
false
frozflame/molbiox
molbiox/execute/generate.py
1
1357
#!/usr/bin/env python3 # coding: utf-8 from __future__ import unicode_literals, print_function import os import sys import stat from molbiox.frame.command import Command from molbiox.frame.locate import locate_template class CommandGen(Command): abbr = 'gen' name = 'generate' desc = 'generate scripts' ...
gpl-2.0
4,811,820,897,735,580,000
26.14
75
0.590273
false
4.026706
false
false
false
simongoffin/website_version
addons/website_version/models/website.py
1
1142
# -*- coding: utf-8 -*- from openerp.osv import osv,fields from openerp.http import request class NewWebsite(osv.Model): _inherit = "website" _columns = { 'snapshot_id':fields.many2one("website_version.snapshot",string="Snapshot"), } def get_current_snapshot(self,cr,uid,context=None): ...
agpl-3.0
5,451,043,187,917,340,000
33.606061
88
0.626095
false
3.707792
false
false
false
nicolacimmino/LoP-RAN
LoPAccessPoint/MacroIP_UDP.py
1
3914
# MacroIP_UDP is part of MacroIP Core. Provides Access to UDP data through simple # textual macros. # Copyright (C) 2014 Nicola Cimmino # # 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 Foundatio...
gpl-3.0
-6,346,434,358,540,674,000
37.009709
144
0.692131
false
3.597426
false
false
false
Koheron/zynq-sdk
examples/red-pitaya/oscillo/python/oscillo.py
2
3530
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import math import numpy as np from koheron import command class Oscillo(object): def __init__(self, client): self.client = client self.wfm_size = 8192 self.sampling_rate = 125e6 self.t = np.arange(self.wfm_size)/self.sampl...
mit
-7,438,568,031,150,482,000
29.439655
95
0.6
false
3.474409
false
false
false
WikiWatershed/tr-55
tr55/tables.py
1
19396
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division """ TR-55 tables """ # For the different land uses, this describes the NLCD class value, the landscape factor (ki) and the Curve # Numbers for each hydrologic soil group for that use ...
apache-2.0
2,153,564,880,117,881,900
71.096654
158
0.601526
false
2.585177
false
false
false
cryptapus/electrum
electrum/transaction.py
1
48273
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # 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...
mit
-2,018,422,330,122,193,000
37.010236
159
0.580904
false
3.509487
false
false
false
dzanotelli/python-dryrun
drypy/docs/conf.py
1
5092
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # drypy documentation build configuration file, created by # sphinx-quickstart on Mon May 29 12:24:58 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
mit
8,664,584,717,016,444,000
29.130178
79
0.675962
false
3.857576
true
false
false
bollu/polymage
sandbox/bounds.py
1
4680
# # Copyright 2014-2016 Vinay Vasista, Ravi Teja Mullapudi, Uday Bondhugula, # and others from Multicore Computing Lab, Department of Computer Science # and Automation, Indian Institute of Science # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with ...
apache-2.0
-8,621,944,478,895,732,000
38
77
0.599145
false
4.212421
false
false
false
a4a881d4/6FSK
SIOT.py
1
1816
import utils import numpy as np from modu import modu,toComplex,dpmap import math from channel import channel from rfir import rfir from const import Primary class SIOT: def __init__(self,k): self.length = 1<<k self.Gpilot = utils.gold(Primary[k][0],Primary[k][1]) self.Pilot = self.Gpilot.toReal(self....
gpl-3.0
-2,189,306,197,252,280,600
20.444444
74
0.578194
false
2.111628
false
false
false
kernsuite-debian/lofar
SAS/SpecificationServices/lib/lofarxml_to_momxml_translator.py
1
51084
#!/usr/bin/env python3 # lofarxml_to_momxml_translator.py # # Copyright (C) 2017 # 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 i...
gpl-3.0
-5,725,672,193,722,404,000
54.345612
333
0.611366
false
4.337976
false
false
false
wevoice/wesub
apps/teams/new_views.py
1
39933
#Get the main project for a team Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 o...
agpl-3.0
4,369,495,035,570,212,000
36.250933
137
0.601307
false
4.049589
false
false
false
Azure/azure-documentdb-python
azure/cosmos/endpoint_discovery_retry_policy.py
1
4650
#The MIT License (MIT) #Copyright (c) 2014 Microsoft Corporation #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, modi...
mit
-5,802,656,706,582,959,000
45.039604
106
0.726882
false
4.510184
false
false
false
gragas/buffalo
buffalo/tray.py
1
6856
from buffalo import utils class Tray(object): FEATHER = 10 # FEATHER is the number of pixels away from the edges of a tray # that the "resize region" goes DEFAULT_MIN_WIDTH = 150 DEFAULT_MAX_WIDTH = 1000 DEFAULT_MIN_HEIGHT = 150 DEFAULT_MAX_HEIGHT = 1000 DEFAULT_COLOR = (0, 0, 100, 15...
gpl-2.0
-3,845,763,640,003,592,700
39.568047
101
0.533985
false
3.539494
false
false
false
anomam/pvlib-python
setup.py
1
3709
#!/usr/bin/env python import os try: from setuptools import setup from setuptools.extension import Extension except ImportError: raise RuntimeError('setuptools is required') import versioneer DESCRIPTION = ('A set of functions and classes for simulating the ' + 'performance of photovolt...
bsd-3-clause
-5,511,466,704,249,259,000
32.116071
79
0.66433
false
3.556088
true
false
false
obtitus/py-boinc-plotter
pyBoincPlotter/plot/badge.py
1
10297
# This file is part of the py-boinc-plotter, # which provides parsing and plotting of boinc statistics and # badge information. # Copyright (C) 2013 obtitus@gmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
gpl-3.0
6,578,926,965,254,804,000
30.780864
135
0.529086
false
3.682761
false
false
false
PalisadoesFoundation/switchmap-ng
switchmap/main/agent.py
1
10245
#!/usr/bin/env python3 """switchmap.Agent class. Description: This script: 1) Processes a variety of information from agents 2) Posts the data using HTTP to a server listed in the configuration file """ # Standard libraries import textwrap import sys import time import argparse import ...
apache-2.0
-2,319,820,289,583,307,000
24.296296
81
0.538799
false
4.736477
true
false
false
MoveLab/erulet-server
appulet/migrations/0013_auto__del_field_surveyinstance_user.py
1
25798
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'SurveyInstance.user' db.delete_column(u'appulet_surveyi...
gpl-3.0
6,517,042,192,401,871,000
92.474638
203
0.555624
false
3.47401
false
false
false
julivico/tdd_python
functional_tests/base.py
1
1025
#!/usr/bin/python # -*- coding: utf-8 -*- """ functional_tests """ import sys from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium import webdriver class FunctionalTest(StaticLiveServerTestCase): @classmethod def setUpClass(cls): for arg in sys.argv: i...
mit
4,868,916,712,964,632,000
24
71
0.619512
false
3.754579
false
false
false
imk1/IMKTFBindingCode
makeNegativeSummitPairSet.py
1
6850
import sys import argparse from collections import deque def parseArgument(): # Parse the input parser = argparse.ArgumentParser(description = "Get pairs of peak summits corresponding to each loop base") parser.add_argument("--summitPairsFileName", required=True, help='Loop summit pairs sorted by the start position...
mit
-7,915,858,102,713,001,000
45.917808
139
0.752117
false
3.139322
false
false
false
evheubel/latex2edx
latex2edx/abox.py
1
26072
#!/usr/bin/env python # # Answer Box class # # object representation of abox, used in Tutor2, now generalized to latex and word input formats. # 13-Aug-12 ichaung: merge in sari's changes # 13-Aug-12 ichuang: cleaned up, does more error checking, includes stub for shortanswer # note that shortanswer ...
agpl-3.0
1,928,660,598,516,613,000
42.381032
129
0.512696
false
4.14895
false
false
false
bkad/python-stylus
stylus/__init__.py
1
2479
#!/usr/bin/env python import os from os import path import execjs import io node_modules = path.abspath("node_modules") if "NODE_PATH" not in os.environ: os.environ["NODE_PATH"] = node_modules elif node_modules not in os.environ["NODE_PATH"]: os.pathsep.join((os.environ["NODE_PATH"], node_modules)) class Stylus...
mit
1,651,126,679,889,479,700
30.379747
100
0.654296
false
4.08402
false
false
false
tcstewar/graph_based_models
gbm/models/demand.py
1
1478
import numpy as np from gbm.models.core import Parameter, Line, GraphBasedModel class DemandCurve(GraphBasedModel): def __init__(self): super(DemandCurve, self).__init__(name='Demand Curve', ylabel='price ($)', xlabel='amount produced...
gpl-2.0
7,159,270,203,059,533,000
35.04878
93
0.509472
false
3.622549
false
false
false
adamwiggins/cocos2d
test/test_transition_fadetr.py
2
1038
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # import cocos from cocos.director import director from cocos.actions import * from cocos.layer import * from cocos.scenes import * from cocos.sprite import *...
bsd-3-clause
-5,831,127,975,114,752,000
24.317073
72
0.655106
false
3.24375
false
false
false
nusenu/tor-compass
compass.py
1
27881
#!/usr/bin/env python # # This program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COP...
mit
1,551,160,011,918,299,400
41.37234
158
0.581615
false
3.910927
false
false
false
hickmank/pyda
pyda/analysis_generator/analysis_generator_class.py
1
1952
import inspect import numpy as np class AnalysisGeneratorClass(object): # This serves as a template for the user of pyda to implement # their own analysis generation. The initial conditions and # parameters used in the ensemble are contained passed to the # analysis scheme in one array. Hence the initi...
apache-2.0
53,836,932,768,927,810
41.434783
81
0.638832
false
4.252723
false
false
false
RPGOne/Skynet
pytorch-master/torch/legacy/nn/SpatialClassNLLCriterion.py
1
1214
import torch from .Criterion import Criterion class SpatialClassNLLCriterion(Criterion): def __init__(self, weights=None, sizeAverage=True): assert weights is None or weights.dim() == 1 super(SpatialClassNLLCriterion, self).__init__() self.sizeAverage = sizeAverage self.weights = ...
bsd-3-clause
-8,486,290,289,196,009,000
29.35
63
0.599671
false
4.157534
false
false
false
uber/pyro
examples/vae/ss_vae_M2.py
1
20186
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 import argparse import torch import torch.nn as nn from visdom import Visdom import pyro import pyro.distributions as dist from pyro.contrib.examples.util import print_and_log from pyro.infer import SVI, JitTrace_ELBO, JitTraceEn...
apache-2.0
-6,638,713,981,091,142,000
45.19222
117
0.619291
false
3.965036
true
false
false
Archer4499/m4a_tagger
main.py
1
18661
import queue import threading from glob import glob from os import chdir from tkinter import * from tkinter import ttk, filedialog, messagebox from mutagen.mp4 import MP4, MP4StreamInfoError from utils import get_external_tags __author__ = 'Derek' TAGS = [["Title:\t", "\xa9nam"], ["Album:\t", "\xa9alb"], ["Artist:...
mit
-4,028,104,705,513,227,300
35.662083
111
0.584963
false
3.453183
true
false
false
low-sky/degas
degas/catalogs.py
1
3472
import subprocess import glob import os import warnings from astropy.table import Table, join, Column import numpy as np from astropy.utils.data import get_pkg_data_filename import sys def updateLogs(output='ObservationLog.csv',release=None): if release is None: command = "wget --no-check-certificate --out...
gpl-3.0
-1,150,071,409,156,291,300
37.153846
178
0.585829
false
3.86637
false
false
false
ONSdigital/eq-survey-runner
app/forms/questionnaire_form.py
1
14494
import itertools import logging from datetime import datetime, timedelta from decimal import Decimal from dateutil.relativedelta import relativedelta from flask_wtf import FlaskForm from werkzeug.datastructures import MultiDict from wtforms import validators from app.forms.date_form import get_dates_for_single_date_p...
mit
3,228,227,122,332,561,400
42.39521
141
0.613771
false
4.343422
false
false
false
znick/anytask
dependencies/django-registration/registration/backends/default/__init__.py
1
5257
from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from registration import signals from registration.forms import RegistrationForm from registration.models import RegistrationProfile class DefaultBackend(object): """ A registration backend which follows a simple wor...
mit
2,244,696,606,943,012,000
37.654412
92
0.642382
false
5.225646
false
false
false
JunyaKaneko/pys3client
s3client/path.py
1
1508
import os import botocore import s3client __author__ = 'Junya Kaneko <jyuneko@hotmail.com>' def abspath(path, root_delimiter=True): path = os.path.normpath(os.path.join(s3client.getcwd(), path)) if root_delimiter: return path else: return path[1:] def join(path, *paths): return os....
mit
7,217,153,023,544,114,000
19.657534
81
0.584218
false
3.678049
false
false
false
abusesa/abusehelper
abusehelper/core/cymruwhois.py
1
5556
from __future__ import absolute_import import socket import idiokit from idiokit import dns from . import utils, transformation def _parse_ip(string, families=(socket.AF_INET, socket.AF_INET6)): for family in families: try: return socket.inet_ntop(family, socket.inet_pton(family, string)) ...
mit
-1,920,989,968,818,849,000
28.089005
81
0.551836
false
3.761679
false
false
false
sigmavirus24/github-cli
gh/commands/repo/fork.py
1
1355
from gh.base import Command class ForkRepoCommand(Command): name = 'fork.repo' usage = '%prog [options] fork.repo [options] login/repo' summary = 'Fork a repository' subcommands = {} def __init__(self): super(ForkRepoCommand, self).__init__() self.parser.add_option('-o', '--organi...
gpl-3.0
235,013,058,375,727,840
29.795455
78
0.509963
false
4.531773
false
false
false
jakevdp/ESAC-stats-2014
notebooks/fig_code/figures.py
1
6516
import numpy as np import matplotlib.pyplot as plt def plot_venn_diagram(): fig, ax = plt.subplots(subplot_kw=dict(frameon=False, xticks=[], yticks=[])) ax.add_patch(plt.Circle((0.3, 0.3), 0.3, fc='red', alpha=0.5)) ax.add_patch(plt.Circle((0.6, 0.3), 0.3, fc='blue', alpha=0.5)) ax.add_patch(plt.Recta...
bsd-2-clause
-8,262,181,070,894,841,000
36.234286
80
0.518109
false
2.959128
false
false
false
cschenck/blender_sim
fluid_sim_deps/blender-2.69/2.69/python/lib/python3.3/site-packages/numpy/ma/core.py
1
227215
""" numpy.ma : a package to handle missing or invalid values. This package was initially written for numarray by Paul F. Dubois at Lawrence Livermore National Laboratory. In 2006, the package was completely rewritten by Pierre Gerard-Marchant (University of Georgia) to make the MaskedArray class a subclass of ndarray,...
gpl-3.0
-5,252,491,265,932,812,000
30.654361
86
0.530678
false
3.939234
false
false
false
pekrau/Publications
publications/pubmed.py
1
12887
"PubMed interface." import json import os import os.path import sys import time import unicodedata import xml.etree.ElementTree import requests PUBMED_FETCH_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&rettype=abstract&id=%s" PUBMED_SEARCH_URL = "https://eutils.ncbi.nlm.nih.gov/entrez/...
mit
2,347,821,381,237,688,300
35.7151
111
0.589897
false
3.736445
false
false
false
i2y/mochi
mochi/core/global_env.py
1
4977
from collections import ( Iterable, Mapping, MutableMapping, Sequence, MutableSequence ) import sys import imp import functools import itertools from numbers import Number import operator import re from pyrsistent import ( v, pvector, m, pmap, s, pset, b, pbag, dq, pdeque, l, plist, immutab...
mit
-7,836,404,775,858,200,000
28.276471
104
0.587503
false
3.522293
false
false
false
QuLogic/meson
mesonbuild/scripts/uninstall.py
1
1622
# Copyright 2016 The Meson development 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 ...
apache-2.0
229,427,990,467,042,980
31.44
83
0.638101
false
4.106329
false
false
false
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/joris.py
1
7249
""" This page is in the table of contents. The Joris plugin makes the perimiter slowly increase in Z over the layer. This will make vases/cups without a z blob. ==Operation== The default 'Activate Joris' checkbox is off. When it is on, the Joris plugin will do it's work. ==Settings== ===Layers From=== Default: 1 De...
agpl-3.0
-5,983,618,361,555,960,000
37.354497
180
0.756518
false
3.175208
false
false
false
polarsbear/ThreeDPi
Bipolar_Stepper_Motor_Class_Full_Step.py
1
2366
import RPi.GPIO as GPIO import time #sequence for a1, b2, a2, b1 phase_seq=[[1,1,0,0],[0,1,1,0],[0,0,1,1],[1,0,0,1]]; #full step sequence. maximum torque #phase_seq=[[1,0,0,0],[1,1,0,0],[0,1,0,0],[0,1,1,0],[0,0,1,0],[0,0,1,1],[0,0,0,1],[1,0,0,1]] #half-step sequence. double resolution. But the torque of the stepper mo...
lgpl-2.1
-3,164,008,024,690,108,000
29.727273
92
0.522401
false
2.942786
false
false
false
nickkonidaris/kpy
SEDMr/Wavelength.py
1
55908
import argparse import pdb from multiprocessing import Pool import numpy as np import os import pylab as pl import pyfits as pf import scipy import sys import datetime import NPK.Fit import NPK.Bar as Bar from astropy.table import Table from scipy.spatial import KDTree import scipy.signal as SG from numpy.polyno...
gpl-2.0
-5,669,991,538,113,968,000
28.164319
230
0.546541
false
3.12737
false
false
false
sbywater/django-asana
djasana/connect.py
1
1910
import logging from requests.exceptions import ChunkedEncodingError from asana import Client as AsanaClient from asana.error import ServerError from django.conf import settings from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger(__name__) class Client(AsanaClient, object): """An ...
mit
819,242,340,096,198,900
38.791667
90
0.662304
false
3.913934
false
false
false
webnull/RaspAP
raspapd/src/libraspapd/daemons/SecureShellServer.py
1
1642
from BaseDaemon import BaseDaemon import time import os class SecureShellServer(BaseDaemon): """ Controls Privoxy daemon """ def start(self, interface, settings): """ Start processes :param interface: :param settings: :return: """ # openssh-ser...
gpl-3.0
8,426,370,058,812,727,000
27.824561
142
0.560901
false
3.966184
false
false
false
caseywstark/colab
colab/apps/account/views.py
1
17703
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db import models from django.db.models import Q from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import render_to_respon...
mit
6,328,315,120,799,732,000
33.981707
87
0.589674
false
4.388448
false
false
false
luispedro/jug
jug/subcommands/execute.py
1
6180
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008-2020, Luis Pedro Coelho <luis@luispedro.org> # vim: set ts=4 sts=4 sw=4 expandtab smartindent: # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
mit
8,235,745,497,830,285,000
36.682927
115
0.590777
false
4.201224
false
false
false
karlssonper/gpuip
python/gpuip.py
1
6372
#!/usr/bin/env python import utils import sys import signal import os try: import argparse parsermodule = argparse.ArgumentParser except: import optparse parsermodule = optparse.OptionParser parsermodule.add_argument = parsermodule.add_option def getCommandLineArguments(): # Command line argume...
mit
2,553,237,519,268,901,400
32.893617
80
0.569052
false
4.140351
false
false
false
cmput402w2016/CMPUT402W16T2
src/models/frame.py
1
6534
import math import cv2 import imutils import numpy as np import settings MIN_AREA = 500 class Frame(): """ Takes a given image with a background subtractor and provides all the functions required to count the vehicles in the frame for the CLI or drawCountVehicles can be called for the GUI that ...
apache-2.0
8,302,586,132,701,142,000
44.381944
154
0.556321
false
4.008589
false
false
false
memsharded/conan
conans/client/generators/cmake_find_package_multi.py
1
4329
from conans.client.generators.cmake import DepsCppCmake from conans.client.generators.cmake_find_package import find_dependency_lines from conans.client.generators.cmake_find_package_common import target_template from conans.model import Generator class CMakeFindPackageMultiGenerator(Generator): config_xxx_templa...
mit
-8,448,485,614,641,776,000
42.727273
134
0.603835
false
3.46875
true
false
false
smarttang/dnsfind
core/config.py
1
1176
#coding:utf-8 import os version = 'V1.1' author = 'Smarttang' def init_option(keys): vardict = { 'timeout': check_time(keys.timeout), 'target': check_target(keys.target), 'dictname': check_dictname(keys.dictname), 'threads_count': check_threads(keys.threads_count), 'finger':keys.finger, 'keywords':check_...
mit
-6,830,396,850,794,522,000
16.515625
53
0.673214
false
2.450766
false
false
false
hanw/sonic-lite
p4/tests/pcap/generate-pcap.py
1
3583
#!/user/bin/python import argparse import collections import logging import os import random import sys logging.getLogger("scapy").setLevel(1) from scapy.all import * parser = argparse.ArgumentParser(description="Test packet generator") parser.add_argument('--out-dir', help="Output path", type=str, action='store', ...
mit
-1,404,668,318,204,202,500
35.561224
105
0.5247
false
2.663941
false
false
false
eoghanbkeegan/eoghanbkeegan
eoghanbkeegan/public/views.py
1
2185
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import ( Blueprint, current_app, flash, redirect, render_template, request, url_for, ) from flask_login import login_required, login_user, logout_user from eoghanbkeegan.extensions import login_manager f...
mit
-6,613,235,925,513,384,000
27.376623
78
0.64119
false
3.659966
false
false
false
Passaudage/PLD
simulateur/GenerateurEntrees.py
1
3667
import SimulationManager import math import random import Vehicule def proba_poisson(k, freq, temps_obs): #Calcul du lambda correspondant l = freq * temps_obs p = math.e ** (-l) for i in range(0, k): p *= l/k k = k-1 return p def var_poisson(freq, temps_obs): proba_cumulee = r...
mit
-9,006,118,670,060,994,000
32.888889
96
0.568579
false
3.042394
false
false
false
jhanschoo/imprimo
models.py
1
1659
# -*- coding: utf-8 -*- from django.db import models from .validators import validate_printable import os class JobSession(models.Model): status = models.CharField(max_length=3000) all_status = models.CharField(max_length=48000) attachedfile = models.FileField( upload_to='imprimo', ...
mit
-1,411,429,079,755,548,200
31.529412
78
0.596745
false
3.9689
false
false
false
braincow/python-redisjobqueue
redisjobqueue/__init__.py
1
4096
import redis import redlock import time import datetime import json import time class JobLockHasExpiredException(Exception): """This Exception is raised when access or modify is attempted on a job that had its lock expire""" pass class JobNotValidException(Exception): """This Exception is raised when access or mod...
mit
7,279,080,969,133,416,000
34.017094
120
0.714355
false
3.468247
false
false
false
gilestrolab/ethoscope
src/ethoscope/roi_builders/target_roi_builder.py
1
16065
__author__ = 'quentin' import cv2 try: CV_VERSION = int(cv2.__version__.split(".")[0]) except: CV_VERSION = 2 try: from cv2.cv import CV_CHAIN_APPROX_SIMPLE as CHAIN_APPROX_SIMPLE from cv2.cv import CV_AA as LINE_AA except ImportError: from cv2 import CHAIN_APPROX_SIMPLE from cv2 import LINE_...
gpl-3.0
-8,499,705,433,721,836,000
44.381356
237
0.484594
false
3.955922
false
false
false
scem/zing
src/main/zing/follower.py
1
1382
''' Created on May 21, 2015 @author: scem ''' from threading import Thread import zmq ONLINE = 'online' OFFLINE = 'offline' class Follower(Thread): ''' classdocs ''' def __init__(self, me='anonymous', host='localhost', port='7002', timeout=None): self.me = me ...
gpl-2.0
-6,393,160,262,061,951,000
22.678571
84
0.524602
false
3.926136
false
false
false
felixplesoianu/advprompt
advc.py
1
6594
#!/usr/bin/env python3 # coding=utf-8 from __future__ import print_function import sys import configparser import uuid obj_types = ["actor", "room", "exit", "thing", "scenery", "vehicle", "text", "action", "spell", "topic"] lock_types = ["?", "!", "+", "-", "@", "^", "#", "~"] def new_meta(): return { "title": ...
artistic-2.0
3,651,045,482,471,274,500
26.475
76
0.617683
false
2.754386
true
false
false
oisdk/PyParse
ParseResult.py
1
2795
from FunctorApplicativeMonad import Functor, Applicative, Monad from abc import ABCMeta, abstractmethod class ParseResult(Functor, Applicative, Monad, metaclass=ABCMeta): @abstractmethod def fmap(self, fn) -> 'ParseResult': return NotImplemented @abstractmethod def apply(self, something: 'Par...
mit
3,492,548,122,189,489,700
24.409091
79
0.572809
false
3.782138
false
false
false
A-Julien/ADE-Power
parser.py
1
4937
#!/usr/bin/python2.7 # -*- coding: UTF-8 -*- from bs4 import BeautifulSoup from datetime import * # gestion des dates import sys utf = sys.argv[1] gr = sys.argv[2] #------ Definition des variables ------# MIN_activity = 2 ical_date_start = "DTSTART:" ical_date_end = "DTEND:" ical_title = "SUMMARY:" ical...
apache-2.0
6,176,875,498,330,314,000
27.468208
119
0.635736
false
2.4333
false
false
false
m0she/template-relocation
relocation/processors.py
1
3698
import copy, hashlib, logging from bunch import Bunch from django.conf import settings from django.core.cache import DEFAULT_CACHE_ALIAS from django.core.urlresolvers import reverse from .cache import cached_data from .utils import buf_to_unicode CACHE_NAME=getattr(settings, 'RELOCATION_CACHE', DEFAULT_CACHE_ALIAS) ...
bsd-3-clause
3,781,865,000,782,170,600
38.340426
135
0.685776
false
3.742915
false
false
false
bbondy/brianbondy.gae
libs/markdown/extensions/headerid.py
1
6539
#!/usr/bin/python """ HeaderID Extension for Python-Markdown ====================================== Adds ability to set HTML IDs for headers. Basic usage: >>> import markdown >>> text = "# Some Header # {#some_id}" >>> md = markdown.markdown(text, ['headerid']) >>> md u'<h1 id="som...
mit
2,910,823,453,277,771,300
31.533333
112
0.513993
false
3.766705
true
false
false
gotpredictions/vue-todo
server/server/settings.py
1
3202
""" Django settings for server project. Generated by 'django-admin startproject' using Django 1.9.7. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
apache-2.0
2,283,973,397,942,834,200
25.04065
91
0.686758
false
3.526432
false
false
false
bnbowman/HlaTools
src/pbhla/alleles/trim.py
1
2639
#! /usr/bin/env python import logging from operator import itemgetter from pbcore.io.FastqIO import FastqWriter, FastqRecord from pbcore.io.FastaIO import FastaWriter, FastaRecord from pbhla.fasta.utils import write_fasta from pbhla.filenames import get_file_type from pbhla.utils import check_output_file from pbhla.s...
bsd-3-clause
8,150,863,833,012,426,000
35.150685
111
0.665404
false
3.670376
false
false
false
edgedb/edgedb
edb/schema/expr.py
1
13042
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB authors. # # 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...
apache-2.0
-3,343,619,543,085,199,000
28.981609
79
0.547079
false
4.079449
false
false
false
nqnmovil/nqnm_e16
encuesta/settings.py
1
3613
""" Django settings for encuesta project. Generated by 'django-admin startproject' using Django 1.10.1. 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 o...
apache-2.0
7,439,655,797,284,314,000
26.165414
91
0.691946
false
3.329954
false
false
false
JASchilz/RoverMUD
interpreter/interpreter.py
1
2078
#------------------------------------------------------------------------------ # interpreter/interpreter.py # Copyright 2011 Joseph Schilz # Licensed under Apache v2 #------------------------------------------------------------------------------ articles = [" a ", " the "] def verb(command): # A function ...
apache-2.0
7,014,852,203,973,416,000
26.342105
79
0.498075
false
3.73741
false
false
false
Jordan-Zhu/RoboVision
unsorted/merge_lines_py.py
1
3796
import math import numpy as np from itertools import combinations, chain from collections import Counter def compare(s, t): return Counter(s) == Counter(t) def math_stuff(x1, y1, x2, y2): slope = float((y2 - y1) / (x2 - x1) if ((x2 - x1) != 0) else math.inf) line_len = math.sqrt((x2 - x1) **...
gpl-3.0
3,452,265,371,909,360,600
32.198198
129
0.532929
false
3.058824
false
false
false
twz915/django
tests/auth_tests/test_views.py
1
50966
import datetime import itertools import os import re from importlib import import_module from urllib.parse import ParseResult, urlparse from django.apps import apps from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth import REDIRECT_FIELD_NAME, SESSION_KEY from dj...
bsd-3-clause
3,419,193,209,463,145,000
42.007595
119
0.627149
false
3.992792
true
false
false
kingsdigitallab/gssn-django
cms/models/pages.py
1
14847
from __future__ import unicode_literals from datetime import date import logging from django.conf import settings from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator from django.db import models from django.db.models import Q from django.db.models.signals import pre_save from django.dispatch impo...
gpl-2.0
-8,299,712,338,552,435,000
28.516899
79
0.657507
false
3.885632
false
false
false
DigitalCampus/django-nurhi-oppia
oppia/gamification/models.py
1
2404
# oppia/gamification/models.py import datetime from django.conf import settings from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from oppia.models import Course, Activity, Media from oppia.quiz.models imp...
gpl-3.0
5,930,698,250,534,488,000
32.859155
77
0.715058
false
3.896272
false
false
false
cryvate/project-euler
project_euler/library/sequences.py
1
1972
from itertools import count from typing import Callable, Iterable, List from .number_theory.primes import primes_sequence # noqa: F401 def fibonacci_sequence() -> Iterable[int]: a, b = 0, 1 while True: yield a a, b = b, a + b def collatz_sequence(n: int=13) -> Iterable[int]: while n ...
mit
5,979,713,112,935,393,000
26.013699
78
0.567951
false
4.099792
false
false
false
jeremiedecock/snippets
python/pillow/mandelbrot/mandelbrot.py
1
2239
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A Mandelbrot set demo""" # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # 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...
mit
7,023,459,584,781,753,000
29.22973
79
0.670988
false
3.384266
false
false
false
RedhawkSDR/rtl-demo-app
server/_utils/audio.py
1
3110
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK server. # # REDHAWK server 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 F...
lgpl-3.0
-3,399,194,653,128,419,000
33.186813
81
0.56881
false
4.185734
false
false
false
bzamecnik/sms-tools
lectures/04-STFT/plots-code/time-freq-compromise.py
1
1036
# matplotlib without any blocking GUI import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import numpy as np from smst.utils import audio from smst.models import stft (fs, x) = audio.read_wav('../../../sounds/piano.wav') plt.figure(1, figsize=(9.5, 6)) w = np.hamming(256) N = 256 H = 128 mX1, p...
agpl-3.0
-8,702,875,251,723,081,000
24.268293
53
0.692085
false
2.387097
false
true
false
JelteF/PyLaTeX
pylatex/document.py
1
14074
# -*- coding: utf-8 -*- """ This module implements the class that deals with the full document. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ import os import sys import subprocess import errno from .base_classes import Environment, Command, Container, LatexObject, \ ...
mit
-4,159,063,675,102,418,000
32.826923
79
0.541146
false
4.864155
false
false
false
shoopio/shoop
shuup/admin/views/search.py
2
1878
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from itertools import chain from django.http.response import Json...
agpl-3.0
4,093,824,704,880,380,000
33.777778
84
0.629393
false
3.92887
false
false
false
mrjackv/bitsc
modules/temperature_sensor.py
1
5063
""" Copyright 2016 Raffaele Di Campli 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 di...
apache-2.0
-4,475,417,336,419,897,300
35.42446
116
0.663046
false
3.806767
false
false
false
TylerTemp/tomorrow
lib/hdlr/jolla/article.py
1
2576
import tornado.web import tornado.escape import logging import base64 try: from urllib.parse import unquote, quote, urlsplit except ImportError: from urllib import quote from urlparse import unquote, urlsplit try: from itertools import zip_longest except ImportError: from itertools import izip_longe...
gpl-3.0
6,466,615,259,091,580,000
26.404255
86
0.619565
false
4.006221
false
false
false
hammerlab/kubeface
kubeface/stringable.py
1
4353
import collections import string from os.path import commonprefix import parse FORMATTER = string.Formatter() class Stringable(object): def __init__(self, name, template, valid_values={}): self.template_pieces = [] self.field_names = [] parsed = FORMATTER.parse(template) for (lit...
apache-2.0
-6,636,093,332,887,671,000
37.522124
74
0.525155
false
4.478395
false
false
false
ggear/cloudera-framework
cloudera-framework-assembly/src/main/assembly/root/lib/manager/python/benchmark.py
1
13527
#!/usr/local/bin/python -u ''' Provide a Cloudera Manager benchmark pipeline Usage: %s [options] Options: -h --help Show help --user=<cloudera-user> The Cloudera services user Defaults to 'admin' --password=<cloudera-password> ...
apache-2.0
-2,847,525,859,407,920,600
48.731618
138
0.550602
false
4.087942
false
false
false
cecton/meldnafen
meldnafen/app.py
1
2961
import os import sdl2 import sdl2ui from sdl2ui.mixer import Mixer import sdl2ui.mixins from sdl2ui.debugger import Debugger from sdl2ui.joystick import JoystickManager import meldnafen from meldnafen.joystick import MenuJoystick from meldnafen.mixins.bgm import BgmMixin from meldnafen.mixins.controls import ControlsM...
mit
-5,477,925,171,610,419,000
31.184783
79
0.627828
false
3.541866
false
false
false
twisted-infra/twisted-trac-plugins
twisted_trac_plugins/ticket_reporter.py
1
2598
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. import subprocess from trac.core import Component, implements from trac.ticket.api import ITicketChangeListener class IRCTicketObserver(Component): implements(ITicketChangeListener) def ticket_created(self, ticket): subprocess.c...
mit
-6,608,386,113,944,275,000
41.590164
123
0.550808
false
4.252046
false
false
false
YujiAzama/python-soracomclient
soracomclient/v1_0/auth.py
1
1849
# Copyright 2016 Yuji Azama # # 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, s...
apache-2.0
-2,762,002,205,923,851,000
27.890625
74
0.6106
false
4.072687
false
false
false
krahman/rethinkdb
test/memcached_workloads/cas.py
1
1805
#!/usr/bin/env python # Copyright 2010-2012 RethinkDB, all rights reserved. from random import shuffle import sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import memcached_workload_common from vcoptparse import * op = memcached_workload_common.option_parse...
agpl-3.0
-7,830,055,373,795,374,000
37.404255
99
0.571745
false
3.305861
false
false
false
timborden/browser-laptop
tools/publish_release.py
1
2080
#!/usr/bin/env python import json import os from lib.github import GitHub import requests BROWSER_LAPTOP_REPO = 'brave/browser-laptop' TARGET_ARCH= os.environ['TARGET_ARCH'] if os.environ.has_key('TARGET_ARCH') else 'x64' RELEASE_NAME = 'Dev Channel Beta' def main(): github = GitHub(auth_token()) releases = gith...
mpl-2.0
1,073,077,027,997,134,500
29.144928
86
0.672596
false
3.460899
false
false
false
mesheven/pyOCD
pyocd/core/memory_interface.py
1
4407
# pyOCD debugger # Copyright (c) 2018 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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
3,468,156,629,870,681,000
29.818182
87
0.56501
false
3.709596
false
false
false
f-cap/sen
sen/tui/constants.py
1
6074
MAIN_LIST_FOCUS = "main_list_focus" STATUS_BG = "#06a" STATUS_BG_FOCUS = "#08d" # name, fg, bg, mono, fg_h, bg_h PALLETE = [ (MAIN_LIST_FOCUS, 'default', 'brown', "default", "white", "#060"), # a60 ('main_list_lg', 'light gray', 'default', "default", "g100", "default"), ('main_list_dg', 'dark gray', 'd...
mit
6,278,611,867,250,509,000
42.697842
101
0.623477
false
3.350248
false
false
false
zenoss/metrology
metrology/registry.py
1
2345
import inspect from threading import RLock from metrology.exceptions import RegistryException from metrology.instruments import Counter, Derive, Profiler, Meter, Timer, UtilizationTimer, HistogramUniform class Registry(object): def __init__(self): self.lock = RLock() self.metrics = {} def c...
mit
3,099,961,023,612,505,000
27.253012
109
0.568443
false
4.071181
false
false
false
Tivix/django-spam
demo/demo/settings.py
1
2540
""" Django settings for demo project. Generated by 'django-admin startproject' using Django 1.11.8. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os #...
mit
8,307,893,044,195,437,000
23.423077
72
0.685039
false
3.547486
false
false
false
kmhughes/robotbrains-examples
comm/mqtt/python/mqttclient.py
1
2058
## # Copyright (C) 2015 Keith M. Hughes. # # 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
3,648,597,902,645,912,000
32.737705
80
0.740525
false
3.783088
false
false
false
Nep-gear/nep-bio
py_atm/trigger_calibracion.py
1
1853
import time from nep import* import signal import sys import datetime as dt def time_diference(str_t1,str_t2): try: y = dt.datetime.strptime(str_t1, "%Y-%m-%d %H:%M:%S.%f") except: y = dt.datetime.strptime(str_t1, "%Y-%m-%d %H:%M:%S") try: x = dt.datetime.strptime(str_t2,...
mit
-338,504,633,992,957,000
20.298851
90
0.576363
false
2.950637
false
false
false
sweerpotato/Darkness
darkness.py
1
2984
from __future__ import print_function import sys class Direction: NORTH = 1 EAST = 2 SOUTH = 3 WEST = 4 def ERROR(s): sys.exit("ERROR: " + s) def check_darkness_size(lines): columns = len(lines[0]) for line in lines: if(len(line) != columns): ERROR("MALFORMED DARK...
mit
2,270,772,790,524,705,300
27.528846
107
0.463924
false
3.92328
false
false
false