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
abeing/droog
droog/world.py
1
26187
# -*- coding: UTF-8 -*- # Droog # Copyright (C) 2015 Adam Miezianko # # 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. ...
gpl-2.0
4,446,171,767,116,297,000
39.041284
79
0.543743
false
3.848765
false
false
false
QuintilianoB/Violent-Python-examples
Chapter 2/5.debianSshWeakPK.py
1
3380
# SSH brute force with pxssh class and keyfile, based on chapter 2 # Python 3.4 """ Another example of this script: https://www.exploit-db.com/exploits/5720/ The 32768 keys can be found here: https://github.com/g0tmi1k/debian-ssh The exploit CVE: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0166 For th...
gpl-2.0
-930,355,457,819,945,000
30.598131
110
0.633728
false
3.806306
false
false
false
Fxrh/tispa-wm
libqtile/command.py
1
12105
# Copyright (c) 2008, Aldo Cortesi. All rights reserved. # # 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,...
gpl-3.0
-735,328,225,687,440,100
29.11194
79
0.581
false
4.108961
false
false
false
sillygod/my-travel-in-learning-python
databaseProject/DataBase.py
1
2520
''' FUNC: read a xml file(database) and transfer it to a list of dictionary type note: no case sensitive I will make a rule about the database in xml form ex. ____________________________ Student |name | ID | score | and ID is a key |aa | 1 | 10 | |bb | 2 | 20 | in XML file, I will use som...
gpl-2.0
2,119,482,450,881,611,800
23.950495
102
0.658333
false
3.214286
false
false
false
DarkDruiD/Machinery
Python/Machinery/example.py
1
1470
import time import random from datapath import Datapath from controller import Delta from controller import State from controller import FSMD def locked_on_enter(): print "Entered locked state" time.sleep(3) def locked_on_leave(): pass locked = State("locked") locked.on_enter = locked_on_enter locke...
mit
-3,953,514,065,446,916,000
12.125
50
0.669388
false
3.230769
false
false
false
anushbmx/kitsune
kitsune/users/urls.py
1
4192
from django.conf import settings from django.conf.urls import include, url from django.views.decorators.cache import never_cache from mozilla_django_oidc.views import OIDCAuthenticationCallbackView import kitsune.flagit.views from kitsune.sumo.views import redirect_to from kitsune.users import api, views from kitsune...
bsd-3-clause
7,517,170,160,506,751,000
40.098039
86
0.649332
false
3.303388
false
false
false
jelly/calibre
src/calibre/ebooks/pdf/pdftohtml.py
1
6990
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>, ' \ '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import errno, os, sys, subprocess, shutil, re from functools import partial from calibre.ebooks import Con...
gpl-3.0
4,022,858,997,273,561,000
37.406593
121
0.558798
false
3.484546
false
false
false
chaen/DIRAC
ResourceStatusSystem/Client/ResourceStatusClient.py
1
14924
''' ResourceStatusClient Client to interact with the ResourceStatusDB. ''' # pylint: disable=unused-argument __RCSID__ = '$Id$' from DIRAC import S_OK from DIRAC.Core.Base.Client import Client from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations from DIRAC.FrameworkSystem.Client.Notificatio...
gpl-3.0
-4,775,719,922,118,156,000
38.170604
94
0.607679
false
4.267658
false
false
false
cstipkovic/spidermonkey-research
testing/talos/talos/ffsetup.py
1
6208
# 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/. """ Set up a browser environment before running a test. """ import os import re import tempfile import mozfile from moz...
mpl-2.0
83,377,925,997,244,750
34.678161
79
0.597777
false
3.989717
true
false
false
jasonfleming/asgs
output/paraviewBathyWSE.py
1
7106
#!/usr/bin/env python #---------------------------------------------------------------------- # paraviewBathyWSE.py : Visualize bathy and wse simultaneously in # Paraview. #---------------------------------------------------------------------- # Copyright(C) 2016 Jason Fleming # # This file is part of the ADCIRC Surge...
gpl-3.0
-6,397,047,685,143,120,000
53.661538
802
0.698987
false
2.74575
false
false
false
Pantynopants/DBMS_BANK
app/admin/views.py
1
6292
# -*- coding=utf-8 -*- from flask import render_template, flash, redirect, url_for, request, make_response, current_app from flask_login import login_required, current_user, login_user, logout_user from forms import * from ..models import * from .. import db from ..utils import db_utils from . import admin ...
gpl-3.0
-3,674,240,570,483,265,000
33.609195
102
0.591026
false
3.498588
false
false
false
prcutler/nflpool
nflpool/viewmodels/playerpicks_viewmodel.py
1
4310
from nflpool.viewmodels.viewmodelbase import ViewModelBase class PlayerPicksViewModel(ViewModelBase): def __init__(self): self.afc_east_winner_pick = None self.afc_east_second = None self.afc_east_last = None self.afc_north_winner_pick = None self.afc_north_second = None ...
mit
2,485,024,036,205,383,700
47.426966
75
0.623666
false
2.802341
false
false
false
702nADOS/sumo
tools/contributed/sumopy/agilepy/lib_base/logger.py
1
1227
import types class Logger: def __init__(self, filepath=None, is_stdout=True): self._filepath = filepath self._logfile = None self._callbacks = {} self._is_stdout = is_stdout def start(self, text=''): if self._filepath != None: self._logfile = open(self._fi...
gpl-3.0
895,495,032,246,819,500
26.266667
54
0.519152
false
4.131313
false
false
false
ayepezv/GAD_ERP
addons/hr_expense/__openerp__.py
2
1889
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Expense Tracker', 'version': '2.0', 'category': 'Human Resources', 'sequence': 95, 'summary': 'Expenses Validation, Invoicing', 'description': """ Manage expenses by Employees ========...
gpl-3.0
-3,994,445,756,238,314,000
38.3125
244
0.661897
false
3.914938
false
false
false
meatballhat/ansible-inventory-hacks
ansible_inventory_hacks/etcd/touch.py
1
2242
#!/usr/bin/env python # vim:fileencoding=utf-8 import argparse import datetime import os import socket import subprocess import sys import etcd from . import DEFAULT_PREFIX ETCD_KEY_TMPL = '{prefix}/{hostname}/{key}' USAGE = """%(prog)s [options] Splat some metadata into etcd! """ def main(sysargs=sys.argv[:]):...
mit
-579,326,199,278,497,900
27.74359
79
0.630687
false
3.645528
false
false
false
datapythonista/pandas
pandas/core/groupby/generic.py
1
63278
""" Define the SeriesGroupBy and DataFrameGroupBy classes that hold the groupby interfaces (and some implementations). These are user facing as the result of the ``df.groupby(...)`` operations, which here returns a DataFrameGroupBy object. """ from __future__ import annotations from collections import ( abc, ...
bsd-3-clause
-8,992,444,320,100,172,000
32.947425
88
0.548184
false
4.146386
false
false
false
Pulgama/supriya
tests/test_patterns_Pgpar_Pfx_Pgroup.py
1
11524
import pytest import uqbar.strings import supriya.assets.synthdefs import supriya.nonrealtime import supriya.patterns import supriya.synthdefs import supriya.ugens with supriya.synthdefs.SynthDefBuilder(in_=0, out=0) as builder: source = supriya.ugens.In.ar(bus=builder["in_"]) source = supriya.ugens.Limiter.a...
mit
-7,873,358,582,196,026,000
31.645892
95
0.342676
false
4.015331
false
false
false
tgbugs/pyontutils
test/test_oboio.py
1
6002
import os import shutil import unittest import pytest from pyontutils import obo_io as oio from .common import temp_path obo_test_string = """format-version: 1.2 ontology: uberon/core subsetdef: cumbo "CUMBO" treat-xrefs-as-has-subclass: EV import: http://purl.obolibrary.org/obo/uberon/chebi_import.owl treat-xrefs-as-...
mit
-6,232,890,414,575,821,000
34.72619
201
0.598967
false
3.077949
true
false
false
tensorflow/model-analysis
tensorflow_model_analysis/eval_saved_model/example_trainers/control_dependency_estimator.py
1
6700
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,121,643,079,959,225,000
38.64497
80
0.673134
false
3.893085
false
false
false
pedro2d10/SickRage-FR
sickbeard/notifiers/emby.py
1
4193
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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
-1,720,672,605,901,913,900
33.652893
178
0.576198
false
4.151485
false
false
false
CyberTaoFlow/scirius
scirius/settings.py
1
4444
""" Django settings for scirius project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) fr...
gpl-3.0
-3,509,663,828,025,243,000
24.988304
98
0.726373
false
3.129577
false
false
false
bt3gl/Neat-Problems-in-Python-and-Flask
USEFUL/snippets_and_examples_Flask/example_password_reset/app/auth/views.py
1
4889
from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, \ current_user from . import auth from .. import db from ..models import User from ..email import send_email from .forms import LoginForm, RegistrationForm, ChangePasswordForm,\ ...
mit
-1,030,766,068,768,395,900
35.485075
78
0.644713
false
3.923756
false
false
false
meahmadi/nsun
server.py
1
2333
import web import traceback import webbrowser from web.contrib import template import os import json from datetime import datetime #from ir.idehgostar.modir.assistant.mind import Mind from ir.ac.iust.me_ahmadi.multiProcessMind.mind import Mind render = template.render_genshi(['./templates/']) urls = ( '/(.*)', ...
gpl-2.0
-8,180,544,014,247,534,000
24.086022
109
0.672953
false
3.065703
false
false
false
guh/guh-cli
nymea/notifications.py
1
3045
# -*- coding: UTF-8 -*- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (C) 2015 - 2018 Simon Stuerz <simon.stuerz@guh.io> # # ...
gpl-2.0
2,748,701,511,971,271,000
37.544304
92
0.469951
false
4.300847
false
false
false
maurozucchelli/dipy
dipy/tests/test_scripts.py
1
5495
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Test scripts If we appear to be running from the development directory, use the scripts in the top-level folder ``scripts``. Otherwise try and get the scripts from the path """ from __future__ import ...
bsd-3-clause
-1,704,001,170,354,622,000
35.390728
84
0.648408
false
3.326271
true
false
false
MJ-meo-dmt/Ecliptic
src/player.py
1
10301
#!/usr/bin/python # System imports import sys, math, os # Panda imports from panda3d.core import * from pandac.PandaModules import * from direct.actor.Actor import Actor from direct.interval.IntervalGlobal import * from direct.task import Task from direct.showbase.DirectObject import DirectObject from panda3d.core im...
bsd-3-clause
5,954,991,454,922,168,000
31.701587
101
0.558878
false
3.616924
false
false
false
yamins81/tabular
tabular/spreadsheet.py
1
57202
""" Spreadsheet-style functions for NumPy ndarray with structured dtype or recarray objects: aggregate, aggregate_in, pivot, addrecords, addcols, deletecols, renamecol, replace, colstack, rowstack, nullvalue Note that these functions are also wrapped as methods of the tabular tabarray object, which is a subclass of...
mit
-489,199,996,321,512,960
34.931533
92
0.546152
false
4.103149
false
false
false
KiMiralles/Python-Learning
Computational Physics Newman/Book Resources/bulirsch.py
1
1824
from math import sin,pi from numpy import empty,array,arange from pylab import plot,show g = 9.81 l = 0.1 theta0 = 179*pi/180 a = 0.0 b = 10.0 N = 100 # Number of "big steps" H = (b-a)/N # Size of "big steps" delta = 1e-8 # Required position accuracy per unit time def f(r): theta = r[0] ome...
gpl-3.0
7,120,225,636,442,674,000
23.648649
62
0.565241
false
2.784733
false
false
false
ESSS/pytest-regressions
src/pytest_regressions/data_regression.py
1
3451
from functools import partial import yaml from pytest_regressions.common import Path, check_text_files, perform_regression_check class DataRegressionFixture: """ Implementation of `data_regression` fixture. """ def __init__(self, datadir, original_datadir, request): """ :type datadi...
mit
7,882,442,899,186,516,000
33.858586
110
0.622718
false
4.487646
false
false
false
Skynet2-0/Skynet2.0
agent/Wallet.py
1
4754
""" Created on Apr 26, 2016 @author: niels """ from subprocess import PIPE, STDOUT from BogusFormBuilder import BogusFormBuilder import subprocess import re import os import time import sys import pexpect class Wallet(object): """ This class will manage the bitcoins going in and out off the agent. """ def __init...
gpl-3.0
8,826,590,145,078,224,000
30.071895
126
0.689314
false
3.371631
false
false
false
hkkwok/MachOTool
utils/progress_indicator.py
1
1267
import sys import datetime class ProgressIndicator(object): ENABLED = True RECORDS = list() def __init__(self, prompt, frequency): self._display(prompt) self._record(prompt + 'start') self.prompt = prompt self.frequency = frequency self.count = 0 def click(sel...
apache-2.0
1,150,852,479,338,861,800
23.365385
68
0.539069
false
3.996845
false
false
false
minzhangcheng/MPL
MPL/Network/Download.py
1
3810
# ############################################################################ # # Copyright (C) 2015 Minzhang Cheng # Contact: minzhangcheng@gmail.com # # This file is part of the Minzhang's Python Library, a Python library with many utils by Minzhang Cheng. # # GNU Lesser General Public License Usage # This file may ...
lgpl-3.0
6,221,154,197,156,404,000
30.237705
105
0.505512
false
4.339408
false
false
false
debugger06/MiroX
linux/plat/options.py
1
3688
# Miro - an RSS based video player application # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 # Participatory Culture Foundation # # 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; eithe...
gpl-2.0
1,548,895,991,307,455,500
33.46729
79
0.714208
false
3.666004
false
false
false
lingmann/dcos
dcos_installer/test_backend.py
1
12788
import json import os import subprocess import uuid import passlib.hash import pytest import gen import gen.build_deploy.aws import release from dcos_installer import backend from dcos_installer.config import Config, make_default_config_if_needed, to_config os.environ["BOOTSTRAP_ID"] = "12345" @pytest.fixture(scop...
apache-2.0
-2,982,937,157,660,341,000
33.562162
115
0.665077
false
3.474056
true
false
false
adrianbeloqui/Python
nested_lists.py
1
1675
"""Given the names and grades for each student in a Physics class of N students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade, order their names alphabetically and print each name on a new line. Input For...
mit
-7,068,788,371,389,833,000
29.472727
80
0.666269
false
3.86836
false
false
false
duncan-r/SHIP
tests/test_riverunit.py
1
13279
from __future__ import unicode_literals import unittest from ship.fmp.datunits import riverunit from ship.fmp.datunits import ROW_DATA_TYPES as rdt from ship.datastructures.rowdatacollection import RowDataCollection from ship.datastructures import dataobject as do from ship.fmp.fmpunitfactory import FmpUnitFactory ...
mit
-1,056,165,014,091,718,900
63.461165
144
0.498607
false
3.155656
true
false
false
Matt-Deacalion/Pomodoro-Calculator
pomodoro_calculator/__init__.py
1
6013
""" A pretty command line tool to calculate the number of Pomodori available between two points in time. """ __author__ = 'Matt Deacalion Stevens' __version__ = '1.0.2' import datetime from itertools import cycle class PomodoroCalculator: """ Calculates the number of Pomodori available in an amount of time. ...
mit
6,045,448,055,413,695,000
30.317708
90
0.557126
false
3.979484
false
false
false
colour-science/colour-branding
utilities/colour.py
1
1033
import maya.cmds as cmds import numpy as np spectrum = np.load( r"D:\Documents\Personal\Graphics\Colour\spectrum.npy")[:, 35:325, :] materials = [u'mia_material_x01', u'mia_material_x02', u'mia_material_x03', u'mia_material_x04', u'mia_material_x05', u'mia_material_x06', u'mia_mate...
bsd-3-clause
428,703,372,718,615,200
37.730769
77
0.549855
false
3.074405
false
false
false
alainrinder/quoridor.py
src/GridCoordinates.py
1
2281
# # GridCoordinates.py # # @author Alain Rinder # @date 2017.06.02 # @version 0.1 # class GridCoordinates: """ Coordinates on square grid """ def __init__(self, col, row): self.col = col self.row = row def left(self): """ Return ...
mit
4,232,492,451,206,281,700
26.873418
113
0.562034
false
4.147273
false
false
false
brunofin/coinvalue
backend/backend/settings.py
1
2626
# -*- coding: utf-8 -*- """ Django settings for backend project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/se...
gpl-3.0
-8,834,992,552,321,021,000
24.504854
71
0.686976
false
3.473545
false
false
false
Coriolan8/python_traning
fixture/session.py
1
1518
__author__ = "yulya" class SessionHelper: def __init__(self, app): self.app = app def Login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() wd.find_element_by...
apache-2.0
7,454,230,980,946,180,000
28.211538
78
0.54809
false
3.434389
false
false
false
grmToolbox/grmpy
promotion/grmpy_tutorial/create_slides.py
1
1443
#!/usr/bin/env python """This module compiles the lecture notes.""" import argparse import glob import os import shutil import subprocess def compile_single(is_update): """Compile a single lecture.""" for task in ["pdflatex", "bibtex", "pdflatex", "pdflatex"]: cmd = [task, "main"] subprocess.c...
mit
3,772,548,930,021,324,300
27.294118
87
0.57727
false
3.738342
false
false
false
qstokkink/py-ipv8
ipv8/attestation/wallet/pengbaorange/boudot.py
1
4606
""" Implementation of proofs for checking commitment equality and if a commitment is a square ("Efficient Proofs that a Committed NumberLies in an Interval" by F. Boudot). Modified for use with range proofs ("An efficient range proof scheme." by K. Peng and F. Bao). """ from binascii import hexlify from math import ce...
lgpl-3.0
3,775,615,382,115,306,500
31.43662
115
0.558402
false
2.839704
false
false
false
lamter/slaveo
loadhistory/futures.py
1
4133
# coding: utf-8 import pymongo import pandas as pd import datetime try: from .newbar import NewMinuteBar, NewDayBar except SystemError: pass class LoadBase(object): """ 导入期货历史数据 """ def __init__(self, path, symbol): """ :param path: 数据路径 :param contract: 合约名 ...
gpl-3.0
-6,288,002,198,736,356,000
23.324841
103
0.515318
false
2.820532
false
false
false
PuercoPop/FaceRec
apps/WebUi/testhaar.py
1
1298
import cv import os from os.path import join from django.conf import settings def find_faces( img_url ): cascade = cv.Load( join(settings.ROOT_DIR,'apps/WebUi/haarcascade_frontalface_alt.xml') ) directory= join(settings.MEDIA_ROOT , 'Uploads/') target_directory = join( directory, 'Portraits/') portrait...
bsd-2-clause
2,583,801,675,626,725,000
30.658537
97
0.656394
false
2.852747
false
false
false
jessada/pyCMM
pycmm/cmmlib/intervarlib.py
1
2195
import re RAW_INTERVAR_CLASS_BENIGN = "Benign" RAW_INTERVAR_CLASS_LIKELY_BENIGN = "Likelybenign" RAW_INTERVAR_CLASS_UNCERTAIN_SIGNIFICANCE = "UncertainSignificance" RAW_INTERVAR_CLASS_LIKELY_PATHOGENIC = "Likelypathogenic" RAW_INTERVAR_CLASS_PATHOGENIC = "Pathogenic" INTERVAR_CLASS_BENIGN = "Benign" INTERVAR_CLASS_LI...
gpl-2.0
5,027,679,920,982,609,000
41.211538
101
0.676538
false
2.962213
false
false
false
jamalmoir/ml_demo
libs/garden/xpopup/xbase.py
1
4736
""" XBase class ============ Subclass of :class:`xpopup.XPopup`. Base class for all popup extensions. Don't use this class directly. Examples -------- How to create your own class based on :class:`XBase`? It's easy! The content of the popup should be implemented in the :meth:`XBase._get_body`:: class MyPopup(X...
gpl-3.0
3,830,199,417,355,320,300
28.786164
79
0.641047
false
3.878788
false
false
false
DolphinDream/sverchok
nodes/scene/objects_mk3.py
1
12461
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-3.0
-1,058,146,421,217,799,300
33.233516
143
0.595137
false
3.761244
false
false
false
mwweinberg/china-daily-email
combine_rfa_qz.py
1
4422
from bs4 import BeautifulSoup import urllib #csv is for the csv writer import csv #this will hold the output holder = {} #opens the input doc txt = open("qz-rfa.csv") #is the contents of the doc #inputs = txt.read() #opens the output doc output_txt = open("output.txt", "w") print txt def headliner(url): #it...
mit
8,655,176,811,197,885,000
27.901961
100
0.55337
false
3.976619
false
false
false
eddiejessup/ahoy
ahoy/dc_dx_measurers.py
1
3735
from __future__ import print_function, division from abc import ABCMeta, abstractmethod import numpy as np from ciabatta.meta import make_repr_str from ahoy.ring_buffer import CylinderBuffer from ahoy import measurers, c_measurers def get_K(t, dt, t_rot_0): A = 0.5 ts = np.arange(0.0, t, dt) gs = ts / t_r...
bsd-3-clause
5,803,516,902,066,002,000
31.763158
86
0.584739
false
2.842466
false
false
false
Bleyddyn/malpi
exp/test.py
1
5744
from time import time import datetime import numpy as np import matplotlib.pyplot as plt from malpi.cnn import * from malpi.data_utils import get_CIFAR10_data from malpi.solver import Solver from optparse import OptionParser from malpi.fast_layers import * def plot_solver(solver): plt.subplot(2, 1, 1) plt.plot...
mit
7,756,415,624,282,956,000
32.788235
183
0.584784
false
3.021568
true
false
false
tomis007/pyboi
pyboi/processor/z80.py
1
71153
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, PickleType from ..base import Base from ctypes import c_int8 from enum import Enum import pickle import logging logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(name='z80') class CpuState(Base): ...
mit
-9,042,496,380,038,771,000
29.895788
98
0.479938
false
3.15157
false
false
false
gpoulin/pybeem
beem/ui/ui.py
1
2119
import os import json import sip sip.setapi('QString', 2) sip.setapi('QVariant', 2) sip.setapi('QDate', 2) sip.setapi('QDateTime', 2) sip.setapi('QTextStream', 2) sip.setapi('QTime', 2) sip.setapi('QUrl', 2) from PyQt4 import QtGui, QtCore signal = QtCore.pyqtSignal slot = QtCore.pyqtSlot property = QtCore.pyqtPropert...
gpl-3.0
6,990,025,243,627,736,000
23.356322
71
0.622935
false
3.47377
false
false
false
kapadia/geoblend
benchmark/benchmark_vector.py
1
2033
import os import benchmark import numpy as np import rasterio as rio from skimage.morphology import disk from geoblend.vector import create_vector class Benchmark_Vector_Small(benchmark.Benchmark): def setUp(self): directory = os.path.dirname(os.path.realpath(__file__)) fixtures = os.path.join...
mit
-4,203,776,271,449,375,000
30.292308
110
0.618298
false
3.216772
false
false
false
stochasticHydroTools/RigidMultiblobsWall
single_sphere/single_sphere_rejection.py
1
1547
'''This script will display a histogram of a single sphere's height when next to a wall using sphere.py. 1,000,000 heights will be generated by iterating over n_steps, and written to a text file: rejection_locations.txt On top of the histogram is a plot of the analytical GB distribution Prints the time taken for all ...
gpl-3.0
848,121,353,568,755,100
34.976744
114
0.74596
false
3.209544
false
false
false
abmantz/lmc
setup.py
1
3790
"""A setuptools based setup module. See (and based on): https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path h...
lgpl-3.0
3,584,288,068,886,303,000
34.092593
94
0.665963
false
3.947917
false
false
false
icoderaven/slytherin_dagger
src/utils.py
1
1217
#!/usr/bin/env python import math import numpy as np #---------------------------------------------------------------------- #converts angles in degrees to radians #---------------------------------------------------------------------- def deg_to_rad(angle): return angle*math.pi/180.0 #---------------------------...
bsd-3-clause
7,963,987,814,229,428,000
32.805556
72
0.380444
false
4.698842
false
false
false
i-am-Q/my_py
mypa.py
1
12022
#mypa.py import speech_recognition as sr #imports Speech_Recognition Modules from AppKit import NSSpeechSynthesizer #imports Speech Synthesizer for tts from random import randint #imports randint function import time #imports time modules to pause actions import sys #imports system functions import ...
gpl-2.0
7,865,665,472,232,642,000
45.242308
278
0.619198
false
3.332964
false
false
false
jessica-taylor/quipp2
src/python/graphbuilder.py
1
16660
import math import numpy as np from numpy import linalg import itertools from callhaskell import * class Queue(object): def __init__(self, items=None): if items is None: self.items = [] else: self.items = list(reversed(items)) def dequeue(self): return self.items.pop() class VarId(objec...
mit
7,413,421,166,586,676,000
28.176883
155
0.635954
false
2.904969
false
false
false
agilman/flask-template
app/auth.py
1
1738
from flask import session, redirect, request, render_template from app import app from app.models import * def getUserFromDb(username,password): userQuery = Users.query.filter_by(username=username) if userQuery.count()==0: return "No such user" else: usr = userQuery.first() if us...
mit
-1,983,810,625,785,931,800
25.738462
72
0.600115
false
4.157895
false
false
false
NoneGroupTeam/Let-s-Go
webapp/webapp/settings.py
1
3246
""" Django settings for webapp project. Generated by 'django-admin startproject' using Django 1.9.9. 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 # ...
gpl-3.0
7,738,174,100,558,951,000
27.725664
78
0.687616
false
3.453191
false
false
false
ENCODE-DCC/pyencoded-tools
permissions_qa_scripts/originals/UPLOADS/submit.bam.py
1
4935
""" Example file submission script Requires the `aws` command line utility: http://aws.amazon.com/cli/ """ import hashlib import json import os import requests import subprocess import sys import time host = 'REPLACEME' encoded_access_key = 'UISQC32B' encoded_secret_access_key = 'ikc2wbs27minvwo4' path = 'test.bam' ...
mit
467,417,177,298,291,700
29.091463
106
0.611145
false
2.867519
false
false
false
novafloss/django-agnocomplete
demo/tests/test_errors.py
1
4942
from django.test import TestCase from django.urls import reverse from django.test import override_settings from django.core.exceptions import SuspiciousOperation import mock from requests.exceptions import Timeout from agnocomplete import get_namespace from . import get_json from . import LoaddataLiveTestCase from ....
mit
7,850,101,734,890,066,000
31.300654
77
0.616754
false
4.223932
true
false
false
gabinetedigital/videre
videos/models.py
1
2845
# -*- coding: utf-8 -*- # # Copyright (C) 2011 Governo do Estado do Rio Grande do Sul # Copyright (C) 2011 Lincoln de Sousa <lincoln@comum.org> # # 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 Fou...
agpl-3.0
8,764,051,673,740,353,000
38.513889
78
0.643234
false
3.808568
false
false
false
pacificgilly1992/PGrainrate
Backups/Externals/externals1.0.5.py
1
4428
############################################################################ # Project: The Lenard effect of preciptation at the RUAO, # Title: Ensemble processing of the PG, Time and Rain Rate data, # Author: James Gilmore, # Email: james.gilmore@pgr.reading.ac.uk. # Version: 1.0.5 # Date: 07/12/15 ###################...
gpl-3.0
-4,713,461,817,470,815,000
31.8
248
0.648374
false
2.397401
false
false
false
javierLiarte/tdd-goat-python
tests/selenium/conftest.py
1
1089
import pytest import os from selenium import webdriver browsers = { 'firefox': webdriver.Firefox, 'chrome': webdriver.Chrome, } @pytest.fixture(scope='session', params=browsers.keys()) def driver(request): ''' driver factory, for allowing more than one browser object in a fixture ''' if 'DISPLAY' not in os.en...
gpl-2.0
-5,603,045,507,090,966,000
25.585366
81
0.68595
false
3.768166
true
false
false
zijistark/ck2utils
esc/eu4culture_map.py
1
4853
#!/usr/bin/env python3 from collections import defaultdict import math from pathlib import Path import re import sys import urllib.request import numpy as np from PIL import Image import spectra from ck2parser import rootpath, csv_rows, SimpleParser, Obj from localpaths import eu4dir from print_time import print_time ...
gpl-2.0
2,957,810,107,190,530,600
37.212598
79
0.571605
false
3.194865
false
false
false
cgwire/zou
zou/app/blueprints/playlists/resources.py
1
9428
import slugify from flask import request, send_file as flask_send_file from flask_restful import Resource from flask_jwt_extended import jwt_required from zou.app import config from zou.app.mixin import ArgsMixin from zou.app.utils import permissions from zou.app.services import ( entities_service, playlists...
agpl-3.0
1,423,871,682,942,486,500
34.443609
80
0.609037
false
4.044616
false
false
false
trevor/mailman3
src/mailman/database/schema/mm_20121015000000.py
1
3289
# Copyright (C) 2012-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
3,540,926,000,866,135,600
32.561224
78
0.679842
false
3.977025
false
false
false
sixam/dw6824
src/ui/stroke.py
1
2694
import copy from PyQt4 import QtCore, QtGui from utils.utils import Utils sizeX = 1024 sizeY = 768 class Stroke: """Basic Stroke""" def __init__(self, path=[], width=0, color=[0,0,0,255], id='none'): self.path = path self.width = width self.color = color if id == 'none': ...
bsd-3-clause
2,516,270,057,821,345,000
27.357895
140
0.489978
false
3.467181
false
false
false
daniyalzade/burgaz
settings.py
1
4442
import os from shopify_settings import * SITE_ROOT = os.path.dirname(os.path.realpath(__file__)) try: from djangoappengine.settings_base import * USING_APP_ENGINE = True except ImportError: USING_APP_ENGINE = False DEBUG = True TEMPLATE_DEBUG = DEBUG DATABASES = { 'default': { ...
mit
-8,659,885,461,204,517,000
30.062937
96
0.660288
false
3.698585
false
false
false
thijsmie/tantalus
src/tantalus/logic/transaction.py
1
9287
from tantalus_db.base import db from tantalus_db.models import Referencing, Transaction, TransactionLine, ServiceLine, Relation, Product, BtwType from tantalus_db.utility import get_or_none, transactional from tantalus.logic.rows import transform_collection from collections import defaultdict from datetime import dat...
mit
3,800,890,605,192,939,000
32.527076
113
0.582535
false
3.501885
false
false
false
jackrzhang/zulip
scripts/lib/clean_node_cache.py
1
2324
#!/usr/bin/env python3 import argparse import os import subprocess import sys if False: from typing import Set ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(ZULIP_PATH) from scripts.lib.node_cache import generate_sha1sum_node_modules from scripts.lib.zul...
apache-2.0
6,640,714,881,982,662,000
37.733333
99
0.673838
false
3.373004
false
false
false
MaxMorgenstern/EmeraldAI
EmeraldAI/Logic/Database/SQlite3.py
1
5843
#!/usr/bin/python # -*- coding: utf-8 -*- import os from cachetools import cached from EmeraldAI.Logic.Singleton import Singleton from EmeraldAI.Logic.Modules import Global from EmeraldAI.Config.Config import Config from EmeraldAI.Logic.Logger import FileLogger class SQlite3(object): __metaclass__ = Singleton ...
apache-2.0
-8,573,672,131,020,047,000
33.988024
115
0.608249
false
4.032436
false
false
false
basho-labs/riak-mesos-tools
setup.py
1
4313
# # Copyright (C) 2016 Basho Technologies, 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 a...
apache-2.0
3,413,416,331,684,066,300
34.941667
79
0.663112
false
4.061205
false
false
false
fperez/sympy
sympy/functions/special/tensor_functions.py
1
1178
from sympy.core.function import Function from sympy.core import sympify, S from sympy.utilities.decorator import deprecated ############################################################################### ###################### Kronecker Delta, Levi-Civita etc. ###################### ###################################...
bsd-3-clause
-3,756,714,093,554,926,600
27.731707
79
0.44652
false
3.526946
false
false
false
ryanvarley/ExoData
exodata/astroquantities.py
1
1806
""" Temp module until astro units are added to quantities """ from quantities import * L_s = solar_luminosity = UnitQuantity( 'solar_luminosity', 3.839*(10**26)*W, symbol='L_s', ) L_s.latex_symbol = 'L_\odot' R_s = solar_radius = UnitLength( 'solar_radius', 6.995 * (10**8) * m, aliases=['solar...
mit
8,007,810,740,782,752,000
21.036585
119
0.609081
false
2.443843
false
false
false
richardliaw/ray
python/ray/runtime_context.py
1
4842
import ray.worker import logging logger = logging.getLogger(__name__) class RuntimeContext(object): """A class used for getting runtime context.""" def __init__(self, worker): assert worker is not None self.worker = worker def get(self): """Get a dictionary of the current_contex...
apache-2.0
-9,188,469,718,043,545,000
29.840764
78
0.57311
false
4.39782
false
false
false
andy-z/ged4py
docs/example_code/example3.py
1
1988
import sys from ged4py.parser import GedcomReader from ged4py.date import DateValueVisitor class DateFormatter(DateValueVisitor): """Visitor class that produces string representation of dates. """ def visitSimple(self, date): return f"{date.date}" def visitPeriod(self, date): return f...
mit
2,323,925,988,355,210,000
29.584615
80
0.612173
false
3.641026
false
false
false
luckydonald/pytgbot
pytgbot/webhook.py
1
5203
# -*- coding: utf-8 -*- from luckydonaldUtils.logger import logging from pytgbot.bot import Bot from pytgbot.exceptions import TgApiServerException, TgApiParseException __author__ = 'luckydonald' logger = logging.getLogger(__name__) class Webhook(Bot): """ Subclass of Bot, will be returned of a sucessful we...
gpl-3.0
6,613,766,085,546,908,000
34.155405
120
0.596771
false
4.209547
false
false
false
schilli/MOPS
MOPS/CorrFunction.py
1
2568
# -*- coding: UTF-8 -*- from __future__ import print_function, division import numpy as np class CorrFunction(object): """ correlation function data, additional information and manipulation methods Parameters ---------- corr : (nvec, nframes) array Correlation functions std : (nvec,...
gpl-3.0
2,965,479,022,776,792,600
34.666667
78
0.511682
false
4.323232
false
false
false
narfman0/D3OrganDropCalculator
calculator.py
1
1510
#!/bin/python import sys from math import pow DEFAULT_TORMENT = 2 DEFAULT_RUNS = 5 #generate pascals triangle def pascalsTriangle(rows): for rownum in range (rows): newValue=1 rlist = [newValue] for iteration in range (rownum): newValue = newValue * ( rownum-iteration ) * 1 / ( iteration + 1 ) ...
gpl-2.0
294,702,526,321,510,850
27.490566
100
0.653642
false
2.89272
false
false
false
anpingli/openshift-ansible
playbooks/openstack/inventory.py
1
8124
#!/usr/bin/env python """ This is an Ansible dynamic inventory for OpenStack. It requires your OpenStack credentials to be set in clouds.yaml or your shell environment. """ from __future__ import print_function from collections import Mapping import json import os import shade def base_openshift_inventory(cluste...
apache-2.0
-2,398,377,176,609,801,000
36.09589
94
0.634663
false
3.868571
false
false
false
ryfx/modrana
modules/mod_sketch.py
1
2168
# -*- coding: utf-8 -*- #---------------------------------------------------------------------------- # Sketching on touchscreen #---------------------------------------------------------------------------- # Copyright 2008, Oliver White # # This program is free software: you can redistribute it and/or modify # it unde...
gpl-3.0
3,229,469,049,537,184,000
32.369231
77
0.532749
false
4.082863
false
false
false
Paymiumm/virtual_wallet_api
app/api_version/utils/__init__.py
1
8126
# ~ util package that would hold common functionalities and tools that all versions of the api would use # (@: Name): "mailMorth" # (@:Description): "email Management, and automation api code" # (@:Author): "inteliJence development team" # under the license of Apache License 2.0 and intelijence Protective Rig...
apache-2.0
-1,626,510,524,226,959,000
24.469055
129
0.52412
false
3.888038
false
false
false
aurigadl/EnvReactAsk
server/apiFuec/models.py
1
3422
from server import db class Fuec(db.Model): __table_args__ = {'extend_existing': True} __tablename__ = 'fuec' id = db.Column(db.Integer, primary_key=True) created_at = db.Column(db.DateTime, default=db.func.current_timestamp()) created_by = db.Column(db.Integer, db.ForeignKey('user.id')) no_fu...
gpl-3.0
7,552,208,850,233,082,000
31.292453
76
0.544126
false
3.735808
false
false
false
moocowmoo/pycoin
pycoin/contrib/msg_signing.py
1
11785
import hashlib import hmac import io import os import re from binascii import b2a_base64, a2b_base64 from .. import ecdsa from ..serialize.bitcoin_streamer import stream_bc_string from ..ecdsa import ellipticcurve, numbertheory from ..networks import address_prefix_for_netcode, network_name_for_netcode from ..encodi...
mit
2,836,944,414,860,314,600
31.376374
98
0.623929
false
3.561499
false
false
false
google/telluride_decoding
telluride_decoding/csv_util.py
1
5394
# Copyright 2020 Google 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 writing, ...
apache-2.0
-7,502,328,681,272,178,000
35.945205
80
0.688172
false
3.957447
false
false
false
qurit/rt-utils
rt_utils/ds_helper.py
1
8750
import datetime from rt_utils.image_helper import get_contours_coords from rt_utils.utils import ROIData, SOPClassUID import numpy as np from pydicom.uid import generate_uid from pydicom.dataset import Dataset, FileDataset, FileMetaDataset from pydicom.sequence import Sequence from pydicom.uid import ImplicitVRLittleEn...
mit
-1,413,595,311,255,209,200
41.067308
134
0.729829
false
3.461234
false
false
false
roatienza/dl-keras
chapter2-neural-networks/mlp-mnist-data_augment-2.1.7.py
1
3959
''' A MLP network for MNIST digits classification Project: https://github.com/roatienza/dl-keras Usage: python3 <this file> ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function # numpy package import numpy as np from keras.models import Sequential from kera...
mit
4,741,922,929,612,429,000
35.657407
86
0.691589
false
3.488106
true
false
false
nmc-probe/emulab-nome
protogeni/test/listactiveslivers.py
1
1713
#! /usr/bin/env python # # Copyright (c) 2008-2014 University of Utah and the Flux Group. # # {{{GENIPUBLIC-LICENSE # # GENI Public License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without rest...
agpl-3.0
-7,036,149,344,814,738,000
27.55
72
0.737303
false
3.652452
false
false
false
polysquare/polysquare-ci-scripts
ciscripts/deploy/conan/deploy.py
1
4874
# /ciscripts/deploy/conan/deploy.py # # Copy directories into place to prepare for publishing conan project # # See /LICENCE.md for Copyright information """Copy directories into place to prepare for publishing conan project.""" import argparse import json import os from contextlib import contextmanager try: f...
mit
-7,925,659,697,915,147,000
33.083916
79
0.489536
false
4.878879
false
false
false
fmfn/FTRLp
FTRLp.py
1
31553
from __future__ import division from __future__ import print_function """ ------------ Follow The Regularized Leader - Proximal ------------ FTRL-P is an online classification algorithm that combines both L1 and L2 norms, particularly suited for large data sets with extremely high dimensionality. This implementatio...
mit
-5,593,943,148,002,153,000
37.527473
114
0.565461
false
4.608969
false
false
false
abitofalchemy/hrg_nets
bters.py
1
13299
import shelve import networkx as nx import pandas as pd import numpy as np import math import os import sys import re import argparse import traceback import net_metrics as metrics from glob import glob __version__ = "0.1.0" __author__ = ['Salvador Aguinaga'] # alchemee analyze the BTER generated graphs def get_bas...
gpl-3.0
-7,554,848,798,561,009,000
32.330827
176
0.558764
false
2.811034
false
false
false
infinisql/infinisql
manager/infinisqlmgr/management_server.py
1
4169
__author__ = 'Christopher Nelson' import logging import os import signal import time from infinisqlmgr import common, management def start_management_server(config): from infinisqlmgr.management import util common.configure_logging(config) cluster_name = config.get("management", "cluster_name") exis...
gpl-3.0
-880,550,437,333,261,600
41.111111
128
0.638283
false
4.297938
true
false
false
ndparker/tdi3
tdi/_abstract.py
1
1329
# -*- coding: ascii -*- u""" :Copyright: Copyright 2017 Andr\xe9 Malo or his licensors, as applicable :License: 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/lic...
apache-2.0
-4,359,358,447,965,685,000
25.058824
73
0.638074
false
4.287097
false
false
false
NileshPS/OS-and-Networking-programs
5_ftp/client.py
1
5165
#!/usr/bin/python3 import socket import os import sys import logging as log import getpass from helper import * log.basicConfig(format="[%(levelname)s] %(message)s", level=log.DEBUG) class FTPError(Exception): pass class FTPClient: def __init__(self): self.sock = None self.is_connected =...
gpl-3.0
5,413,776,981,236,701,000
32.322581
79
0.501839
false
4.347643
false
false
false
juanc27/myfavteam
mysite/urls.py
1
1833
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings from django.conf.urls.static import static admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'mysite.views.home', name='home'), # url(r'^blog/', include('blog.urls')...
mit
-4,842,875,258,234,641,000
28.095238
65
0.556465
false
3.320652
false
true
false
ElementalAlchemist/txircd
txircd/modules/rfc/cmd_userhost.py
1
1249
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from zope.interface import implements class UserhostCommand(ModuleData, Command): implements(IPlugin, IModuleData, ICommand) name = "UserhostCommand" core = Tru...
bsd-3-clause
-2,786,711,777,351,139,300
28.761905
102
0.707766
false
3.252604
false
false
false
Theoklitos/chestfreezer
chestfreezer-backend/util/json_parser.py
1
6422
''' Created on Apr 4, 2014 Simple json marshalling utils for the classes in this project #TODO Note: This whole module is pointless! Bottle.py can easily marshal dictionaries into/from json! @author: theoklitos ''' from control import brew_logic from util import misc_utils, configuration from database import db_adap...
mit
5,555,243,227,549,169,000
53.888889
439
0.646372
false
3.325738
false
false
false