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
mjbrownie/django-cloudmailin
cloudmailin/views.py
1
2088
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse, HttpResponseNotFound, HttpResponseForbidden, HttpResponseServerError import hashlib def generate_signature(params, secret): sig = "".join(params[k].encode('utf-8') for k in sorted(params.k...
bsd-3-clause
6,135,572,548,960,023,000
31.625
106
0.573755
false
4.54902
false
false
false
costastf/toonlib
_CI/bin/semver.py
1
6205
# -*- coding: utf-8 -*- import re _REGEX = re.compile('^(?P<major>(?:0|[1-9][0-9]*))' '\.(?P<minor>(?:0|[1-9][0-9]*))' '\.(?P<patch>(?:0|[1-9][0-9]*))' '(\-(?P<prerelease>[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?' '(\+(?P<build>[0-9A-Za-z-]+(\.[...
mit
1,343,708,063,086,418,700
32.722826
88
0.607736
false
3.4723
false
false
false
athena-voice/athena-voice-client
athena/apis.py
1
1210
""" Finds and stores APIs in the 'api_lib' global variable """ import pkgutil import inspect import traceback from athena import settings api_lib = None def find_apis(): """ Find APIs """ global api_lib api_lib = {} print('~ Looking for APIs in:', settings.API_DIRS) for finder...
gpl-3.0
3,669,009,364,997,560,000
25.5
78
0.513223
false
3.878205
false
false
false
Blueshoe/djangocms-workflows
workflows/forms.py
1
2853
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import forms from django.contrib.auth import get_user_model from django.utils.translation import ugettext_lazy as _ from .models import Action class ActionForm(forms.Form): message_ = forms.CharField( label=_('Message'), ...
mit
9,073,147,331,475,379,000
33.373494
89
0.592709
false
3.918956
false
false
false
osroom/osroom
apps/modules/theme_setting/process/nav_setting.py
1
5260
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2019/12/2 14:43 # @Author : Allen Woo from bson import ObjectId from flask import request, g from flask_babel import gettext from apps.app import mdbs, cache from apps.core.flask.reqparse import arg_verify from apps.utils.format.obj_format import json_to_pys...
bsd-2-clause
6,717,044,610,144,772,000
26.128342
83
0.459125
false
3.836616
false
false
false
RuthAngus/chronometer
chronometer/compare.py
1
3001
""" Compare the properties injected to the properties recovered. Particularly the Ages. """ import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import h5py plotpar = {'axes.labelsize': 18, 'font.size': 10, 'legend.fontsize': 18, 'xtick.labelsize': 18, ...
mit
-151,283,496,425,190,530
31.978022
77
0.586138
false
3.126042
false
false
false
miguelinux/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenFds/OptRomInfStatement.py
1
5392
## @file # process OptionROM generation from INF statement # # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of ...
gpl-2.0
-6,444,457,340,399,212,000
33.793548
115
0.635386
false
3.967623
false
false
false
barnone/EigenD
app_cmdline/script.py
2
3985
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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) a...
gpl-3.0
-5,788,715,704,505,319,000
28.087591
123
0.65596
false
3.784425
false
false
false
World-Youth-Days/Dictionary
adapter/old_db_inserter.py
1
6193
# -*- coding: utf-8 -*- import codecs from DbAdapter import DbAdapter from display_dict import display_dict db = DbAdapter(None) # define db connection printable = [] # --------------------------------------------------------------------# # -------------------------- Open file -------------------------# # ----...
gpl-3.0
5,694,650,053,456,996,000
30.753846
94
0.465278
false
3.595819
false
false
false
gmalmquist/unix-hollymonitor
src/unix-hollymonitor.py
1
4266
#!/usr/bin/env python # This is a script to run the hollymonitor in a little # standalone webserver, rather than being integrated # into a larger application. from __future__ import print_function from BaseHTTPServer import BaseHTTPRequestHandler from subprocess import Popen, PIPE, STDOUT import mimetypes import os i...
mit
-7,604,787,221,590,789,000
28.219178
95
0.599391
false
3.361702
false
false
false
mtayseer/infoq-downloader
infoq_downloader.py
1
4839
#!/usr/bin/env python from __future__ import division, print_function import os import sys import re import argparse import requests import cssselect import lxml.html import unicodedata if sys.version_info.major == 3: text_type = str else: text_type = unicode # Some settings download_directory = 'downloads' ...
mit
752,140,745,732,130,700
33.81295
80
0.692498
false
3.36509
false
false
false
cwrubiorobots/ramblerVision
backup/shelterfind-serial-kogeto.py
1
4607
#!/usr/bin/python import cv, serial, struct from datetime import datetime cyril = serial.Serial('/dev/ttyAMA0', 9600) #open first serial port and give it a good name print "Opened "+cyril.portstr+" for serial access" centerX = 175 #160 centerY = 140 #120 cropped = None img = None # decrease angular resolution for 8...
gpl-2.0
-3,594,148,619,330,314,000
31.907143
146
0.598003
false
3.057067
false
false
false
xiexiangwei/xGame
gamecenter/main.py
1
2054
# coding:utf-8 import platform import sys sys.path.append("../") if 'twisted.internet.reactor' not in sys.modules: if platform.system() == "Linux": from twisted.internet import epollreactor epollreactor.install() else: from twisted.internet import iocpreactor iocpreactor.inst...
apache-2.0
-3,971,600,087,697,623,000
26.916667
95
0.695522
false
3.806818
true
false
false
jaredthomas68/FEM
src/fem.py
1
32857
import math as m import numpy as np import scipy.sparse as sparse from scipy.sparse.linalg import spsolve import time import matplotlib.pylab as plt def ffunc_constant(x, a): """ Constant valued forcing function :param x: point at which to evaluate the forcingg function :param a: parameter values, in t...
mit
4,212,410,585,531,477,000
30.11553
151
0.474754
false
2.815751
false
false
false
librelab/qtmoko-test
qtopiacore/qt/util/local_database/qlocalexml2cpp.py
1
18278
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEG...
gpl-2.0
4,154,200,599,349,329,400
32.661142
248
0.57747
false
3.660725
false
false
false
turdusmerula/kipartman
kipartbase/swagger_server/models/part_offer_data.py
1
7328
# coding: utf-8 from __future__ import absolute_import from .base_model_ import Model from datetime import date, datetime from typing import List, Dict from ..util import deserialize_model class PartOfferData(Model): """ NOTE: This class is auto generated by the swagger code generator program. Do not edi...
gpl-3.0
7,979,520,396,145,676,000
25.941176
178
0.586517
false
4.35413
false
false
false
sc3/cookcountyjail
scraper/inmates_scraper.py
1
1938
from monitor import MONITOR_VERBOSE_DMSG_LEVEL from concurrent_base import ConcurrentBase WORKERS_TO_START = 25 CCJ_INMATE_DETAILS_URL = 'http://www2.cookcountysheriff.org/search2/details.asp?jailnumber=' class InmatesScraper(ConcurrentBase): def __init__(self, http, inmates, inmate_details_class, monitor, wor...
gpl-3.0
-4,363,237,560,352,292,400
42.066667
104
0.674923
false
2.945289
false
false
false
jcchoiling/learningPython
s13/Day12/rabbit_rpc_server.py
1
1296
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Janice Cheng """ 把诘个服务器端改成在一个类中 """ import pika import subprocess credentials = pika.PlainCredentials('janice', 'janice123') parameters = pika.ConnectionParameters('172.16.201.134', 5672, '/', credentials) connection = pika.BlockingConnection(parameters) chan...
gpl-3.0
7,917,972,075,697,951,000
25.717391
95
0.648208
false
3.164948
false
false
false
Roel/Gyrid
gyrid/core.py
1
1416
#-*- coding: utf-8 -*- # # This file belongs to Gyrid. # # Gyrid is a mobile device scanner. # Copyright (C) 2013 Roel Huybrechts # # 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 versio...
gpl-3.0
-5,951,183,939,177,816,000
25.716981
71
0.673729
false
3.879452
false
false
false
Hossein-Noroozpour/PyHGEE
core/HGEMesh.py
1
1774
# coding=utf-8 """ Module for handling OpenGL buffers. """ __author__ = "Hossein Noroozpour" from OpenGL import GL import ctypes class Mesh(): """ A class that hold mesh information about an actor """ def __init__(self, elements, indices): temp_list = [0] # noinspection PyCallingNonCal...
mit
-570,652,836,376,594,700
30.140351
103
0.590192
false
3.340866
false
false
false
ajbouh/tfi
src/tfi/driver/tf/doc.py
1
12857
import tfi.json import tensorflow as tf import os.path import tfi.data import tfi.doc from google.protobuf.json_format import ParseDict from tfi.parse.docstring import GoogleDocstring def _detect_method_documentation(*, bibliographer, model, method_name, method, signature_def): # NOTE(adamb) Since we don't want ...
mit
4,932,963,218,364,086,000
35.842407
101
0.542584
false
4.09589
false
false
false
commaai/openpilot
selfdrive/manager/helpers.py
1
1058
import os import sys import fcntl import errno import signal def unblock_stdout(): # get a non-blocking stdout child_pid, child_pty = os.forkpty() if child_pid != 0: # parent # child is in its own process group, manually pass kill signals signal.signal(signal.SIGINT, lambda signum, frame: os.kill(chil...
mit
-6,387,018,691,051,045,000
26.842105
98
0.648393
false
3.574324
false
false
false
ONSdigital/ras-frontstage
frontstage/error_handlers.py
1
2963
import logging from flask import render_template, request, url_for from flask_wtf.csrf import CSRFError from requests.exceptions import ConnectionError from structlog import wrap_logger from werkzeug.utils import redirect from frontstage import app from frontstage.common.session import Session from frontstage.excepti...
mit
3,384,516,966,222,632,400
31.56044
118
0.733378
false
3.640049
false
false
false
manmedia/PythonToggleCharacterCases
switchLetterCase.py
1
4097
# # A module capable of changing alphabet letter cases. # # It uses very generic Python functionality to ensure # backward compatibility. # # # The programme processes a set of characters by default # If no character is entered for processing, the programme # simply exists. This can be turned off by setting 'a' to 1 # ...
apache-2.0
-4,100,419,698,377,441,000
31.259843
156
0.569685
false
3.632092
false
false
false
Azure/azure-storage-python
azure-storage-common/azure/storage/common/_error.py
1
9025
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from sys i...
mit
5,352,687,308,642,604,000
40.399083
126
0.688753
false
3.62887
false
false
false
Nonse/Feel_Like
reservations/models.py
1
3171
from django.db import models class Reservation(models.Model): start_time = models.DateTimeField() end_time = models.DateTimeField() customer = models.ForeignKey('Customer') coach = models.ForeignKey('Coach') product = models.ForeignKey('Product') location = models.CharField(max_length=200) ...
apache-2.0
4,771,702,382,574,460,000
35.448276
104
0.675497
false
3.454248
false
false
false
shoaibkamil/asp
asp/jit/asp_module.py
1
19070
import codepy, codepy.jit, codepy.toolchain, codepy.bpl, codepy.cuda from asp.util import * import asp.codegen.cpp_ast as cpp_ast import pickle from variant_history import * import sqlite3 import asp import scala_module class ASPDB(object): def __init__(self, specializer, persistent=False): """ sp...
bsd-3-clause
484,791,479,455,267,650
40.187905
210
0.581122
false
4.176522
false
false
false
kogotko/carburetor
openstack_dashboard/dashboards/project/firewalls/views.py
1
16454
# Copyright 2013, Big Switch Networks, 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 applic...
apache-2.0
-1,994,469,539,088,781,300
36.480638
78
0.633402
false
4.008283
false
false
false
stadelmanma/OpenPNM
OpenPNM/Network/__Delaunay__.py
1
16258
# -*- coding: utf-8 -*- """ =============================================================================== Delaunay: Generate random networks based on Delaunay Tessellations =============================================================================== """ import sys import scipy as sp import numpy as np import Open...
mit
3,054,005,862,668,982,000
41.560209
85
0.548714
false
3.734895
false
false
false
FabriceSalvaire/mupdf-v1.3
bindings/example.py
1
15058
#! /usr/bin/env python # -*- Python -*- #################################################################################################### import argparse import sys import numpy as np import mupdf as cmupdf from MuPDF import * from PyQt4 import QtCore, QtGui ####################################################...
agpl-3.0
8,527,913,039,060,901,000
34.682464
108
0.521052
false
4.001594
false
false
false
twitter/pants
src/python/pants/backend/jvm/ivy_utils.py
1
51293
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import json import logging import os import pkgutil import threading import xml.etree.Ele...
apache-2.0
-425,431,684,784,504,900
40.837684
111
0.651765
false
3.948957
false
false
false
patochectp/navitia
source/tyr/migrations/versions/3e56c7e0a4a4_create_billing_plan_table.py
1
2152
"""Create billing_plan table Revision ID: 3e56c7e0a4a4 Revises: 3aaddd5707bd Create Date: 2015-11-05 13:30:32.460413 """ revision = '3e56c7e0a4a4' down_revision = '3aaddd5707bd' from alembic import op, context import sqlalchemy as sa from sqlalchemy.dialects import postgresql from sqlalchemy.types import Enum def...
agpl-3.0
2,663,967,288,322,674,700
40.384615
350
0.664963
false
3.096403
false
false
false
vincegogh/ByteOS
util/syscall_gen.py
1
1793
import sys as _sys if len(_sys.argv) != 2: print("Incorrect number of arguments") exit(-1) elif ["c", "h", "asm"].index(_sys.argv[1]) == -1: print("Invalid filetype %s" % _sys.argv[1]) exit(-1) print("\t\033[32;1mGenerating\033[0m include/gen/syscall_gen.%s" % _sys.argv[1]) syscall_list = [] def sys...
mit
3,375,265,367,951,926,000
22.906667
96
0.596765
false
2.636765
false
false
false
eseom/glide
glide/process.py
1
5210
import os import multiprocessing import asyncore import datetime class Status(object): """process status enum""" REDY, RUNN, RSTT, STNG, KLNG, STPD, EXTD = \ 'READY', 'RUNNING', 'RESTARTING', \ 'STOPPING', 'KILLING', 'STOPPED', 'EXITED' class Process(asyncore.file_dispatcher): """main p...
mit
-5,170,071,940,740,597,000
29.828402
80
0.51881
false
3.998465
false
false
false
rjschwei/azure-sdk-for-python
azure-mgmt-logic/azure/mgmt/logic/models/x12_validation_override.py
1
3184
# 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 ...
mit
9,220,224,516,508,743,000
52.966102
252
0.685616
false
3.950372
false
false
false
iagcl/data_pipeline
data_pipeline/db/filedb.py
1
3423
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-8,469,073,670,559,711,000
31.292453
79
0.621677
false
4.354962
false
false
false
stuliveshere/PySeis
docs/notebooks/toolbox/toolbox.py
1
9786
import numpy as np import matplotlib.pyplot as pylab from matplotlib.widgets import Slider #================================================== # decorators #================================================== def io(func): ''' an io decorator that allows inpu...
mit
-8,316,606,742,452,979,000
29.391304
129
0.474249
false
3.491259
false
false
false
amdor/skyscraper
tests/test_scraper_service.py
1
1401
import os import unittest from skyscraper.scraper_service import ScraperServiceFactory from skyscraper.utils.constants import SPEEDOMETER_KEY, AGE_KEY, CAR_KEY, PRICE_KEY, POWER_KEY, CURRENCY_KEY from common_test_utils import gather_extension_files, VALIDATION_DATA class TestScraping(unittest.TestCase): files_under...
mit
1,581,957,246,233,209,900
42.78125
108
0.741613
false
3.025918
true
false
false
FabriceSalvaire/grouped-purchase-order
GroupedPurchaseOrder/views/account.py
1
13035
#################################################################################################### # # GroupedPurchaseOrder - A Django Application. # Copyright (C) 2014 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
-8,662,595,971,610,037,000
38.984663
115
0.531109
false
4.889347
false
false
false
bros-bioinfo/bros-bioinfo.github.io
COURS/M1/SEMESTRE1/ALGO_PROG/ALGO/Eliot/Pile_File.py
1
1911
import random as rd class Pile(list): def creer_pile(self): # Renvoie une nouvelle pile vide. return self def empiler(self, e): # Empile l ’ élément ’ e ’ dans la pile ’P’. self.append(e) def depiler(self): # Dépile un élément de la pile ’P’ et renvoie cet élément . return...
mit
-1,065,698,792,782,147,600
23.706667
105
0.571506
false
2.44137
false
false
false
Adamssss/projectEuler
Problem 001-150 Python/pb102.py
1
1225
import math import time t1 = time.time() # read the trianlges into a list f = open('pb102_triangles.txt','r') tris= f.read().split('\n') f.close() def totri(tl): triangle = [] temp = tl.split(',') for i in range(0,3): triangle.append([tonumber(temp[2*i]),tonumber(temp[2*i+1])]) return trian...
mit
-3,754,334,336,298,502,700
19.081967
68
0.533061
false
2.657267
false
false
false
quimaguirre/diana
diana/toolbox/parse_clinical_trials.py
1
12367
############################################################################## # Clinical trials parser # # eg 2013-2016 ############################################################################## import cPickle, os, re def main(): #base_dir = "../data/ct/" base_dir = "/home/eguney/data/ct/" file_name ...
mit
6,743,207,231,642,477,000
35.266862
189
0.646802
false
2.854143
false
false
false
openstack/vitrage
vitrage/tests/unit/evaluator/template_validation/content/v1/test_parameters_validator.py
1
1656
# Copyright 2019 - Nokia # # 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, sof...
apache-2.0
2,761,177,479,609,274,000
38.428571
79
0.71256
false
4.160804
true
false
false
savionok/RemoteHID
RemoteHidPythonServer/udpEchoServer.py
1
2375
############################################################################# # Copyright 2012 Virtosu Sava # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file except in compliance with the License. # # Yo...
apache-2.0
1,390,608,810,056,242,400
45.54
77
0.546947
false
4.144852
false
false
false
stamaimer/Hackthon
benchmark/stress.py
1
11486
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import collections import contextlib import functools import itertools import json import math import os import random import signal import time import redis import pymysql try: import httplib except ImportError...
gpl-2.0
2,749,461,268,001,201,000
27.014634
118
0.566255
false
3.496499
false
false
false
taurenk/Crossfit-Project-API
app/models.py
1
1269
from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() athlete_teams = db.Table('athlete_teams', db.Column('athlete_id', db.Integer, db.ForeignKey('athletes.id')), db.Column('team_id', db.Integer, db.ForeignKey('teams.id')) ) class Athlete(db.Model): __tablename__ = 'athletes' id = d...
mit
4,826,109,988,930,293,000
27.863636
70
0.5855
false
3.057831
false
false
false
wutienyang/ES_pttmovie
auto/pttmovie/crawler.py
1
8864
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import os import re import sys import json import requests import argparse import time import codecs from bs4 import BeautifulSoup from six import u __version__ = '1.0' # if python 2, disable verify flag in requests....
mit
-7,976,881,766,051,306,000
40.647619
147
0.529614
false
3.536595
false
false
false
rjkeller/gentoo-installer
BuildKernel.py
1
1521
#!/usr/bin/env python import fileinput import sys ///<summary> ///Provides a bunch of operations to format and manage hard disks. /// ///One cool thing that this class does is allow you to generate a fstab file ///based on disk formatting operations conducted earlier using this class. This ///is helpful when installin...
apache-2.0
1,754,916,898,967,739,600
33.568182
123
0.560158
false
3.727941
false
false
false
hjoliver/cylc
cylc/flow/command_polling.py
1
3469
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & Contributors. # # 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 Licen...
gpl-3.0
-7,614,361,080,997,373,000
34.762887
79
0.59066
false
4.129762
false
false
false
brglng/zobject
.ycm_extra_conf.py
1
6274
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
lgpl-3.0
2,080,756,639,750,032,000
34.050279
82
0.687121
false
3.756886
false
false
false
imanhodjaev/django-userapp
django_userapp/backends.py
1
2120
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.conf import settings from .request import login import re UserModel = get_user_model() class UserappBackend(object): def authenticate(self, username=None, password=None, request=None, **...
lgpl-3.0
-3,423,429,394,243,385,000
30.641791
92
0.579245
false
4.435146
false
false
false
jptomo/rpython-lang-scheme
rpython/rlib/parsing/parsing.py
1
12986
import py from rpython.rlib.parsing.lexer import SourcePos from rpython.rlib.parsing.tree import Node, Symbol, Nonterminal class Rule(object): def __init__(self, nonterminal, expansions): self.nonterminal = nonterminal self.expansions = expansions def getkey(self): return (self.nonterm...
mit
-8,121,115,071,978,187,000
36.423631
86
0.54243
false
4.263296
false
false
false
CosmicLaserShow/CosmicLaserShow
pysparc/pysparc/ftdi_chip.py
1
7036
"""Access FTDI hardware. Contents -------- :class:`Error` Base error class. :class:`DeviceNotFoundError` Raised when device is not connected. :class:`DeviceError` Raised for generic pylibftdi exceptions. :class:`ReadError` Raised on read errors. :class:`WriteError` Raised on write errors. :cl...
mit
-7,149,492,045,259,250,000
25.651515
114
0.599915
false
4.029782
false
false
false
lucidfrontier45/PyVB
pyvb/old_ver/vbgmm1d.py
1
7659
#!/usr/bin/python import numpy as np from numpy.random import randn,dirichlet from scipy.linalg import det, inv from scipy.cluster import vq from scipy.special import psi,gammaln from core import normalize try: from _vbgmm1d import _evaluateHiddenState_C, _lnPD_C ext_imported = True except: ext_imported = False ...
bsd-3-clause
8,080,979,700,107,704,000
29.272727
84
0.577099
false
2.515271
false
false
false
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/_pytest/main.py
1
26632
""" core implementation of testing process: init, session, runtest loop. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import fnmatch import functools import os import pkgutil import sys import warnings import attr import py import s...
mit
-9,025,339,223,619,723,000
33.452781
109
0.576938
false
4.259076
true
false
false
listyque/TACTIC-Handler
thlib/ui/items/ui_commit_item.py
1
4255
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'items\ui_commit_item.ui' # # Created: Sat Oct 5 00:17:13 2019 # by: pyside-uic 0.2.15 running on PySide 1.2.4 # # WARNING! All changes made in this file will be lost! from thlib.side.Qt import QtWidgets as QtGui from thlib.side.Qt imp...
epl-1.0
1,223,322,050,095,421,700
48.476744
147
0.709988
false
3.57563
false
false
false
sato9hara/defragTrees
paper/tests/paper_synthetic2.py
1
3367
# -*- coding: utf-8 -*- """ @author: Satoshi Hara """ import sys import os sys.path.append(os.path.abspath('./')) sys.path.append(os.path.abspath('./baselines/')) sys.path.append(os.path.abspath('../')) import numpy as np import paper_sub from RForest import RForest import matplotlib matplotlib.use('Agg') import mat...
mit
-4,752,114,063,472,154,000
32.346535
135
0.571429
false
2.659558
false
false
false
mbdriscoll/indigo
indigo/backends/backend.py
1
25493
import logging import abc, time import numpy as np import scipy.sparse as spp from contextlib import contextmanager import indigo.operators as op from indigo.util import profile log = logging.getLogger(__name__) class Backend(object): """ Provides the routines and data structures necessary to implement a...
bsd-3-clause
-2,364,064,529,511,427,600
33.637228
170
0.506453
false
3.704301
false
false
false
yaricom/brainhash
src/experiment_cA5_10_dt_th_al_ah_bl_bh.py
1
2063
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ The experiment with 10 Hz/5Hz, wisp, attention, 70, cA 5, delta, theta, alpha low, alpha high, beta low, beta high, batch size = 10 and balanced data set @author: yaric """ import experiment as ex import config from time import time n_hidden = 5 batch_size = 10 ex...
gpl-3.0
-1,605,927,457,288,513,500
31.746032
136
0.641299
false
3.159265
true
false
false
thomasorb/orb
orb/utils/fft.py
1
13896
#!/usr/bin/python # *-* coding: utf-8 *-* # Author: Thomas Martin <thomas.martin.1@ulaval.ca> # File: fft.py ## Copyright (c) 2010-2020 Thomas Martin <thomas.martin.1@ulaval.ca> ## ## This file is part of ORB ## ## ORB is free software: you can redistribute it and/or modify it ## under the terms of the GNU General Pu...
gpl-3.0
-8,758,207,435,317,938,000
32.565217
95
0.610463
false
3.15603
false
false
false
marksweiss/sofine
sofine/runner.py
1
19931
""" This module is the main driver for calls to plugins from the CLI interface. It also has all of the scaffolding and wrapper functions required to generically invoke and run any of the supported plugin methods in the plugin interface for any plugin using just the plugin name, plugin group and call args. """ impor...
mit
-5,049,273,920,547,250,000
46.007075
130
0.6956
false
3.677985
false
false
false
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/alpha/trecento/exceldiff.py
1
2662
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from music21.ext import xlrd #sys.path.append('/mit/cuthbert/www/music21') if len(sys.argv) != 3: raise Exception("Need two arguments to diff!") if (sys.argv[1].count(':') == 1): (book1name, sheetname1) = sys.argv[1].split(':') if (book1name.count('...
mit
-3,328,757,419,221,253,000
28.910112
92
0.586777
false
3.176611
false
false
false
dirkhusemann/rezzme
RezzMe/launchers/linux2.py
1
5118
#!/usr/bin/python # -*- encoding: utf-8 -*- # Copyright (c) Contributors, http://opensimulator.org/ # See CONTRIBUTORS.TXT for a full list of copyright holders. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * ...
bsd-3-clause
8,639,283,520,196,367,000
39.619048
137
0.635795
false
4.134087
false
false
false
rueckstiess/mtools
mtools/mlogfilter/filters/fast_filter.py
1
1215
from .base_filter import BaseFilter class FastFilter(BaseFilter): """ FastFilter class. Accept only lines that have a duration that is shorter than the specified parameter in ms. """ filterArgs = [ ('--fast', {'action': 'store', 'nargs': '?', 'default': False, 'ty...
apache-2.0
-160,321,035,544,508,300
30.973684
77
0.553909
false
4.323843
false
false
false
marrow/mongo
marrow/mongo/core/field/oid.py
1
1116
# encoding: utf-8 from __future__ import unicode_literals from bson import ObjectId as OID from collections import MutableMapping from datetime import datetime, timedelta from .base import Field from ....schema import Attribute from ....schema.compat import unicode class ObjectId(Field): __foreign__ = 'objectId' ...
mit
7,631,403,063,071,038,000
25.571429
76
0.701613
false
3.588424
false
false
false
majdigital/bigworldgraph
backend/tests/mock_nlp.py
1
1055
class MockTokenizer: @staticmethod def tokenize(sentence_data): return sentence_data.split(" ") # Yes, yes, very sophisticated class MockTagger: def __init__(self, naive_tag_rule): assert callable(naive_tag_rule) self.naive_tag_rule = naive_tag_rule def tag(self, tokenized_se...
mit
3,103,457,414,177,886,000
28.305556
103
0.483412
false
4.073359
false
false
false
stoic1979/careermaker
server.py
1
9828
from flask import Flask, render_template, request, redirect, jsonify, make_response from models import User, Candidate, \ Company, Vacancy, JobCategory, Skill, db, app import md5 from flask_pymongo import PyMongo import traceback import os import jwt import datetime from functools import wraps import json from ...
gpl-3.0
804,700,029,827,939,800
29.521739
119
0.597477
false
3.803406
false
false
false
jastination/software-engineering-excercise-repository
seer_python/interviewstreet/LuckyNumber.py
1
1265
''' Created on May 25, 2012 @author: jjhuang ''' def getAllPrimeNumber(N): ret = [] for n in range(2, N + 1): isPrime = True for i in range(2, n//2 + 1): if(n % i == 0): isPrime = False break if(isPrime): ...
mit
6,946,488,043,172,524,000
16.071429
49
0.355731
false
3.186398
false
false
false
steder/maroonmpi
subunit/python/subunit/tests/test_subunit_tags.py
1
2324
# # subunit: extensions to python unittest to get test results from subprocesses. # Copyright (C) 2005 Robert Collins <robertc@robertcollins.net> # # 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 Foun...
gpl-2.0
-8,039,500,400,970,692,000
32.2
80
0.63296
false
3.886288
true
false
false
liampauling/flumine
flumine/strategy/runnercontext.py
1
1835
import logging import datetime from typing import Optional logger = logging.getLogger(__name__) class RunnerContext: """Runner context at strategy level""" def __init__(self, selection_id: int): self.selection_id = selection_id self.invested = False self.datetime_last_placed = None ...
mit
4,729,211,881,912,501,000
27.671875
78
0.585286
false
3.980477
false
false
false
katadh/ngdl
ngdl.py
1
9612
import re import nltk import ngdl_classes import global_vars import ngdl_parse import ngdl_write def start_dialog(output_file="test.txt"): if not global_vars.initialized: global_vars.init() else: reset_global_vars() output = open(output_file, "w") print "Welcome to the natural language...
gpl-3.0
578,165,373,975,564,700
38.073171
139
0.577507
false
3.636776
false
false
false
Dicotomix/DicotomixNewSrv
server.py
1
12287
import asyncio import struct import dictionary import datetime import tests from collections import * from os import listdir from os.path import isfile, join from enum import Enum from dicotomix import Dicotomix, Direction, NotFoundException, OrderException import unidecode import sys import numpy as np ENABLE_TESTS =...
mit
-5,168,988,374,299,193,000
35.032258
96
0.482787
false
4.098399
true
false
false
geodynamics/citcoms
visual/Mayavi2/original_plugins/Citcoms_Hdf2Vtk.py
1
22127
#!/usr/bin/env python # Script to generate TVTK files from CitcomS hdf files # author: Martin Weier # Copyright (C) 2006 California Institue of Technology # # 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 # ...
gpl-2.0
-704,908,123,187,786,500
34.011076
173
0.519953
false
3.656751
false
false
false
inveniosoftware/invenio-communities
tests/records/collections/test_collections.py
1
3019
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016-2021 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Community module tests.""" import pytest from flask import url_for from invenio_a...
mit
7,395,856,467,491,684,000
29.806122
132
0.650547
false
3.850765
true
false
false
fanglinfang/myuw
myuw/logger/session_log.py
1
1051
from myuw.dao.affiliation import get_base_campus from myuw.dao.enrollment import get_current_quarter_enrollment from myuw.dao.gws import is_grad_student, is_undergrad_student import logging import json import hashlib logger = logging.getLogger('session') def log_session(netid, session_key, request): if session_k...
apache-2.0
1,625,579,248,412,522,000
31.84375
67
0.642245
false
3.538721
false
false
false
shiblon/pytour
3/tutorials/generators3.py
1
2336
# vim:tw=50 """Generators for Refactoring Now that we know how to make our own generators, let's do some refactoring to make use of this idea and clean up the code a bit. We'll start by splitting out the |clean_lines| function, which basically just skips blank lines and comments, stripping unnecessary space. This no...
apache-2.0
-6,395,722,228,013,602,000
29.736842
68
0.689212
false
3.792208
false
false
false
anish/buildbot
master/buildbot/test/unit/test_reporters_notifier.py
1
14563
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
6,238,227,632,631,262,000
40.847701
104
0.661334
false
3.90953
true
false
false
cavestruz/L500analysis
plotting/profiles/T_Vr_evolution/Vr_evolution/plot_Vrall_nu_binned_r500c.py
1
3207
from L500analysis.data_io.get_cluster_data import GetClusterData from L500analysis.utils.utils import aexp2redshift from L500analysis.plotting.tools.figure_formatting import * from L500analysis.plotting.profiles.tools.profiles_percentile \ import * from L500analysis.plotting.profiles.tools.select_profiles \ imp...
mit
24,674,641,612,658,730
35.033708
90
0.586218
false
2.786273
false
false
false
goldsborough/ig
ig/colors.py
1
1072
import random def random_color(base, variation): ''' Returns a random, bounded color value. Args: base: Some base color component (between 0 and 255) variation: The degree of variation (around the color) Returns: A random color. ''' color = base + (2 * random.random()...
mit
1,673,187,914,116,669,000
23.363636
75
0.570896
false
4.030075
false
false
false
NERC-CEH/jules-jasmin
job_runner/job_runner/controllers/jobs.py
1
5375
""" # Majic # Copyright (C) 2014 CEH # # 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 pr...
gpl-2.0
8,434,452,970,082,947,000
33.455128
100
0.641302
false
3.960943
false
false
false
parantapa/pbdset
pbdset.py
1
14786
# encoding: utf-8 # pylint: disable=too-many-instance-attributes # pylint: disable=attribute-defined-outside-init # # ____________________/\ # \______ \______ )/______ # | ___/| | _// ___/ # | | | | \\___ \ # |____| |______ /____ > #...
mit
649,836,582,525,200,100
27.822612
80
0.532328
false
3.702053
false
false
false
cactusbin/nyt
matplotlib/lib/matplotlib/backend_bases.py
1
106941
""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abstraction layer that separates the :class:`matplotlib.fi...
unlicense
6,469,178,272,311,308,000
32.419063
81
0.562338
false
4.196068
false
false
false
jeeftor/alfredToday
src/lib/pyexchange/exchange2010/soap_request.py
1
19212
""" (c) 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
mit
973,815,431,249,674,600
30.087379
212
0.656725
false
3.440544
false
false
false
remap/fountainhead
src/fountain_script.py
1
1679
# -*- Mode:python c-file-style:"gnu" indent-tabs-mode:nil -*- */ # # Copyright (C) 2014-2015 Regents of the University of California. # Author: Zhehao Wang <wangzhehao410305gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
-16,898,439,618,260,620
41
82
0.723049
false
4.095122
false
false
false
tumi8/sKnock
common/modules/Utils.py
1
1624
import errno import stat import pwd import os from OpenSSL import crypto def convertDERtoPEM(key): return crypto.dump_publickey(crypto.FILETYPE_PEM, crypto.load_publickey(crypto.FILETYPE_ASN1, key)) def convertPEMtoDER(key): return crypto.dump_publickey(crypto.FILETYPE_ASN1, crypto.load_publickey(crypto.FILE...
gpl-3.0
235,730,516,789,654,750
30.230769
103
0.644089
false
3.569231
false
false
false
hasadna/open-shot
polyorg/migrations/0001_initial.py
1
9185
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'CandidateList' db.create_table(u'polyorg_candidatelist', ( (u'id', self.gf('djan...
bsd-3-clause
8,433,865,259,077,570,000
69.122137
208
0.573435
false
3.58649
false
false
false
christabor/MoAL
MOAL/data_structures/graphs/hypergraph.py
1
1461
# -*- coding: utf-8 -*- __author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import print_h3 from MOAL.helpers import datamaker as dmkr from MOA...
apache-2.0
-2,256,337,737,574,232,800
31.466667
75
0.609856
false
3.366359
false
false
false
DOAJ/doaj
portality/scripts/sage_update.py
1
4491
import csv from openpyxl import load_workbook from portality.models import Journal if __name__ == "__main__": import argparse parser = argparse.ArgumentParser() parser.add_argument("-i", "--infile", help="path to SAGE spreadsheet", required=True) parser.add_argument("-o", "--out", help="output file p...
apache-2.0
8,343,009,261,149,139,000
47.290323
119
0.498775
false
4.322425
false
false
false
Outernet-Project/librarian
librarian/routes/firmware.py
1
1624
import logging from bottle_utils.i18n import lazy_gettext as _ from streamline import XHRPartialFormRoute, RouteBase from ..core.contrib.templates.renderer import template from ..core.exts import ext_container as exts from ..forms.firmware import FirmwareUpdateForm from ..helpers.firmware import update_firmware, FIRM...
gpl-3.0
2,844,891,010,243,496,000
32.142857
71
0.678571
false
4.10101
false
false
false
mhvlug/ical2mailman
ical2mailman.py
1
3412
#!/usr/bin/env python # 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 agre...
apache-2.0
-8,760,569,111,229,455,000
31.807692
79
0.646249
false
3.684665
false
false
false
Huyuwei/tvm
rust/runtime/tests/build_model.py
2
2571
#!/usr/bin/env python3 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
apache-2.0
7,480,344,979,134,752,000
35.211268
74
0.651886
false
3.5758
false
false
false
tonyin/optionstg
run.py
1
9422
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import argparse import json import os import shutil import sys import time from main import config ############################################################################### # Options ###################################################...
mit
3,240,041,015,489,999,400
26.469388
87
0.609425
false
3.221197
true
false
false
igel-kun/pyload
module/plugins/internal/UnTar.py
1
1811
# -*- coding: utf-8 -*- from __future__ import with_statement import sys import tarfile from .Extractor import ArchiveError, CRCError, Extractor from .misc import encode, fsjoin class UnTar(Extractor): __name__ = "UnTar" __type__ = "extractor" __version__ = "0.05" __status__ = "stable" __descr...
gpl-3.0
7,260,781,826,180,916,000
24.507042
71
0.555494
false
3.828753
false
false
false
kubeflow/testing
py/kubeflow/testing/delete_kf_instance.py
1
2404
"""Delete a kubeflow instance.""" import fire import json import logging import retrying from googleapiclient import discovery from googleapiclient import errors from oauth2client.client import GoogleCredentials from kubeflow.testing import util @retrying.retry(stop_max_delay=10*60*1000, wait_exponential_max=60*100...
apache-2.0
50,440,597,814,513,940
37.774194
80
0.665141
false
3.934534
false
false
false
morepath/more.jwtauth
more/jwtauth/main.py
1
15396
"""Provides the JWTIdentityPolicy. The following settings are available: * master_secret: A secret known only by the server, used for the default HMAC (HS*) algorithm. * private_key: An Elliptic Curve or an RSA private_key used for the EC (EC*) or RSA (PS*/RS*) algorithms. * private_key...
bsd-3-clause
8,533,879,541,043,725,000
36.009615
79
0.626137
false
4.292166
false
false
false
open-rnd/ros3d-dev-controller
ros3ddevcontroller/mqtt/mqttornado.py
1
4038
# # Copyright (c) 2015 Open-RnD Sp. z o.o. # # 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, publ...
mit
-2,852,210,188,878,344,700
32.932773
69
0.604755
false
4.360691
false
false
false
ThunderGemios10/The-Super-Duper-Script-Editor
wrd/bin.py
1
5171
################################################################################ ### Copyright © 2012-2013 BlackDragonHunt ### ### This file is part of the Super Duper Script Editor. ### ### The Super Duper Script Editor is free software: you can redistribute it ### and/or modify it under the terms of the GNU Genera...
gpl-3.0
-3,351,541,255,566,452,700
31.509434
101
0.555728
false
3.742216
false
false
false
sdss/marvin
tasks.py
1
6407
# !usr/bin/env python2 # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: Brian Cherinka # @Date: 2017-06-10 16:46:40 # @Last modified by: José Sánchez-Gallego (gallegoj@uw.edu) # @Last modified time: 2018-11-14 19:37:22 from __future__ import absolute_import, division, print_function i...
bsd-3-clause
-28,274,147,638,332,620
31.18593
140
0.667291
false
3.16609
false
false
false
Kronos3/HTML_PARSER
src/config.py
1
6102
#!/usr/bin/env python # -*- coding: utf-8 -*- # # config.py # # Copyright 2016 Andrei Tumbar <atuser@Kronos> # # 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 Li...
gpl-3.0
-1,421,159,499,639,127,300
28.196172
104
0.621599
false
2.919617
true
false
false
intuition-io/intuition
tests/data/test_universe.py
1
2697
''' Tests for intuition.data.universe ''' import os import unittest from nose.tools import raises, eq_ import dna.test_utils import intuition.data.universe as universe from intuition.errors import LoadMarketSchemeFailed class MarketTestCase(unittest.TestCase): def setUp(self): dna.test_utils.setup_logge...
apache-2.0
-2,435,537,797,693,956,600
34.486842
77
0.652948
false
3.605615
true
false
false