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
hkff/AccLab
pyAAL/shell.py
1
5489
""" Shell Copyright (C) 2014 Walid Benghabrit This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in t...
gpl-3.0
-8,510,460,452,724,908,000
31.473373
107
0.574891
false
3.779614
false
false
false
kenyansongithub/django-rog
setup.py
1
1360
__author__ = 'ndieks' import os from setuptools import setup import setuptools with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( ...
bsd-2-clause
-8,937,582,572,829,403,000
34.789474
92
0.580882
false
4.197531
false
true
false
osuripple/lets
helpers/leaderboardHelper.py
1
2869
from common.log import logUtils as log from common.ripple import scoreUtils from objects import glob from common.ripple import userUtils def getRankInfo(userID, gameMode): """ Get userID's current rank, user above us and pp/score difference :param userID: user :param gameMode: gameMode number :return: {"nextUser...
agpl-3.0
9,100,213,351,443,686,000
36.25974
102
0.721854
false
3.234498
false
false
false
wolcomm/djangolg
djangolg/dialects/base.py
1
2044
# Copyright 2017 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are 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/LIC...
apache-2.0
8,075,817,260,728,690,000
33.644068
79
0.65362
false
4.433839
false
false
false
juancarlosqr/datascience
python/playground/distributed_systems/classes.py
1
3241
#!/usr/bin/env python import sqlalchemy from sqlalchemy import Column, ForeignKey, Integer, String, Float from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() """ ****** New Class ****** """ class Servidor(Base): """docstring for Servid...
mit
-4,709,690,366,457,514,000
33.849462
120
0.668929
false
2.825632
false
false
false
ChristopherHogan/cython
Cython/Compiler/UtilityCode.py
2
9261
from __future__ import absolute_import from .TreeFragment import parse_from_strings, StringParseContext from . import Symtab from . import Naming from . import Code class NonManglingModuleScope(Symtab.ModuleScope): cpp = False def __init__(self, prefix, *args, **kw): self.prefix = prefix se...
apache-2.0
8,189,437,940,946,829,000
38.075949
110
0.620451
false
4.407901
true
false
false
cschenck/blender_sim
cutil/video_creator.py
1
18026
#!/usr/bin/env python import os import cv2 import numpy as np import subprocess import tempfile import connor_util as cutil def draw_arrow(image, p, q, color, arrow_magnitude=9, thickness=1, line_type=8, shift=0): # adapted from http://mlikihazar.blogspot.com.au/2013/02/draw-arrow-opencv.html # draw arrow t...
gpl-3.0
5,922,609,657,792,200,000
41.514151
129
0.524576
false
3.1978
false
false
false
diogenesfilho/Estadio
Estádio/ArquibancadaMetalicaTeste.py
1
5668
# -*- coding: utf-8 -*- from math import cos from math import pi from math import sin import timeit #import numpy import ctypes import random from sys import argv from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * global esqdir,cimabaixo global mouseX, mouseY,mouseX_ant, mouseY_ant global dis...
gpl-2.0
-4,241,487,094,422,690,000
23.876652
129
0.630777
false
2.535698
false
false
false
radio-ho0/rpi_temp_humi
dht11_py/xtemp.py
1
3048
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ """ import sys import time import datetime import dht11 import RPi.GPIO as GPIO from PySide import QtGui, QtCore # initialize GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.cleanup() # read data using pin 14 #instance = dht11.DHT11(pin ...
gpl-2.0
-5,555,138,411,479,741,000
24.830508
74
0.593504
false
3.184953
false
false
false
jjdmol/LOFAR
LCU/StationTest/prbs_dir_test.py
1
7843
""" script for testing PRBS data in dir. This script can be used for testing data from the TBB, it will be used by TBB test scripts. Started by Gijs, 16 dec 07 Modified by Gijs on March 17 2009: -PRBS test bug fixed, when data is all 0 error did't count. -CRC test on files with RRBS errors. When a PRBS error and no C...
gpl-3.0
6,226,011,526,394,658,000
32.806034
178
0.536529
false
2.945175
true
false
false
uwosh/uwosh.itpeoplesoftdocs
uwosh/itdocs/content/queryinstructions.py
1
2467
"""Definition of the QueryInstructions content type """ from zope.interface import implements from Products.Archetypes import atapi from Products.ATContentTypes.content import folder from Products.ATContentTypes.content import schemata from uwosh.itdocs import itdocsMessageFactory as _ from uwosh.itdocs.interfaces i...
gpl-2.0
6,203,758,016,776,983,000
33.746479
95
0.68788
false
4.188455
false
false
false
Jc2k/libcloudcore
libcloudcore/importer.py
1
3816
# 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 use ...
apache-2.0
-4,060,576,626,925,605,400
33.378378
74
0.622904
false
4.297297
false
false
false
ToAruShiroiNeko/revscoring
revscoring/datasources/parent_revision.py
1
1575
import mwparserfromhell as mwp from deltas.tokenizers import wikitext_split from . import revision from .datasource import Datasource metadata = Datasource("parent_revision.metadata") """ Returns a :class:`~revscoring.datasources.types.RevisionMetadata` for the parent revision. """ text = Datasource("parent_revision...
mit
6,807,011,217,652,050,000
28.716981
79
0.633651
false
4.048843
false
false
false
ses4j/THEbot
database_generator.py
1
5097
""" THEbot, a Texas Hold'em poker software library. Copyright (C) 2011 Scott Stafford This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
gpl-3.0
202,160,966,135,602,700
37.330827
208
0.613694
false
3.803731
false
false
false
jeffFranklin/iam-resttools
resttools/models/irws.py
1
5374
from base64 import b64encode, b64decode from datetime import datetime # IRWS Name class Name(): validid = '' formal_cname = '' formal_fname = '' formal_lname = '' formal_privacy = '' display_cname = '' display_fname = '' display_mname = '' display_lname = '' display_privacy = '...
apache-2.0
7,709,327,650,782,617,000
18.613139
64
0.51284
false
3.544855
false
false
false
yushroom/FishEngine
script/gen_enum_to_string.py
1
2907
from mako.template import Template t_str = ''' // enum count template<> constexpr int EnumCount<${T}>() { return ${length}; } // string array static const char* ${T}Strings[] = { ${CStrings} }; // cstring array template<> inline constexpr const char** EnumToCStringArray<${T}>() { return ${T}Strings; } // ind...
mit
687,920,250,908,670,300
26.424528
116
0.642931
false
2.978484
false
false
false
McGill-DMaS/Kam1n0-Plugin-IDA-Pro
ida-plugin/Kam1n0/Plugin.py
1
1702
# ******************************************************************************* # * Copyright 2017 McGill University 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 L...
apache-2.0
9,062,801,436,616,464,000
31.75
83
0.576968
false
3.833333
false
false
false
ghchinoy/tensorflow
tensorflow/python/framework/ops.py
1
245803
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
4,550,424,314,189,283,000
35.490944
116
0.666058
false
3.969494
false
false
false
andrew-blais/VirtualMachine
model.py
1
23863
#!/usr/bin/python2.7 # Copyright 2014 by Andrew L. Blais. # This program is distributed under the terms of the # GNU General Public License version 3. from constants import Range8, Egnar8, Egnar16, listToList, \ listToLists, listsToList, RangeMEM from random import randint from thread import start_new_thread #...
gpl-3.0
2,728,928,531,485,198,300
30.112125
92
0.471315
false
3.480601
false
false
false
fernandog/Medusa
medusa/providers/torrent/html/morethantv.py
1
9151
# coding=utf-8 """Provider code for MoreThanTV.""" from __future__ import unicode_literals import logging import re import time from medusa import tv from medusa.bs4_parser import BS4Parser from medusa.helper.common import ( convert_size, try_int, ) from medusa.helper.exceptions import AuthException from me...
gpl-3.0
2,425,226,955,275,046,400
34.607004
110
0.538083
false
4.435773
false
false
false
igrowing/Orchids
orchid_app/utils/__init__.py
1
2936
import re import time import pushb import cPickle import hashlib import sendmail from functools import wraps class Dict(dict): """Represent dictionary items as object attributes.""" def filter(self, *args): return Dict((k, v) for k, v in self.items() if k in args) def __getattr__(self, name): ...
mit
6,515,311,847,145,798,000
27.504854
122
0.560627
false
3.878468
false
false
false
LamCiuLoeng/fd
rpac/util/layout_pdf.py
1
4038
# -*- coding: utf-8 -*- import traceback import os import random # import json import subprocess import zipfile import zlib from datetime import datetime as dt from tg import request, config from rpac.model import * __all__ = [ 'gen_pdf', 'null_string_sizes', 'format_fibers', 'format_cares', 'f...
mit
5,333,141,877,359,527,000
22.614035
154
0.521545
false
3.248592
false
false
false
isstiaung/Adimal
adimal/twitter_feed/get_metadata.py
1
2472
from __future__ import absolute_import from __future__ import division, print_function, unicode_literals import requests import urllib from newspaper import Article import string from . import config from sumy.parsers.html import HtmlParser from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers imp...
mit
-8,905,665,559,059,703,000
33.830986
230
0.737864
false
3.04059
false
false
false
maheshp/novatest
nova/api/openstack/compute/contrib/volumes.py
1
22325
# Copyright 2011 Justin Santa Barbara # 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 requ...
apache-2.0
5,517,570,708,372,171,000
32.877086
79
0.598253
false
4.394685
false
false
false
PowerDNS/exabgp
lib/exabgp/reactor/__init__.py
1
13895
# encoding: utf-8 """ reactor.py Created by Thomas Mangin on 2012-06-10. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ import os import re import sys import time import signal import select from collections import deque from exabgp.reactor.daemon import Daemon from exabgp.reactor.listener import Li...
bsd-3-clause
1,335,862,084,631,700,000
30.942529
126
0.684131
false
3.45389
true
false
false
eirmag/weboob
modules/bp/browser.py
1
5496
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Nicolas Duhamel # # This file is part of weboob. # # weboob 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 of the License, or # (at yo...
agpl-3.0
-1,063,427,746,391,495,000
45.184874
176
0.663937
false
3.474083
false
false
false
bitdancer/pynvm
nvm/pmemobj/list.py
1
7019
import collections import sys from .compat import recursive_repr, abc from _pmem import ffi # XXX refactor to make this import unneeded? # XXX: refactor to allocate this instead of hardcoding it. LIST_POBJPTR_ARRAY_TYPE_NUM = 30 class PersistentList(abc.MutableSequence): """Persistent version of the 'list' ...
bsd-3-clause
-1,384,105,293,564,038,400
33.406863
77
0.515601
false
4.187947
false
false
false
thirdkey-solutions/granary
granary/seed.py
1
1984
import seedlib import string import json from mnemonic import Mnemonic from binascii import hexlify, unhexlify import bitcoin # class Granary(): # pass class Seed(): def __init__(self): self._bin_seed = None self._fingerprint = None self._bip32_xpriv = None def __no...
mit
700,877,953,537,606,800
28.176471
82
0.588206
false
3.736347
false
false
false
peraktong/Cannon-Experiment
DR13/0330_read_table_rc.py
1
24195
import numpy as np from astropy.table import Table from astropy.io import fits import matplotlib.pyplot as plt import matplotlib import pickle from matplotlib import cm from numpy.random import randn # table path path = "/Users/caojunzhi/Downloads/upload_20170330/red_clump_dr13.fits" star = fits.open(path) table =...
mit
-1,033,193,668,488,516,000
21.633302
102
0.538128
false
2.976015
false
false
false
motion-planning/rrt-algorithms
examples/rrt_connect/rrt_connect_2d_with_random_obstacles.py
1
1254
# This file is subject to the terms and conditions defined in # file 'LICENSE', which is part of this source code package. import numpy as np from src.rrt.rrt_connect import RRTConnect from src.search_space.search_space import SearchSpace from src.utilities.obstacle_generation import generate_random_obstacles from src...
mit
4,732,484,829,832,730,000
34.828571
75
0.73764
false
2.923077
false
false
false
Midnighter/foggy-march
foggy/plots.py
1
3454
# -*- coding: utf-8 -*- """ ====================== Variance Scaling Plots ====================== :Author: Moritz Emanuel Beber :Date: 2013-05-03 :Copyright: Copyright |c| 2013 Jacobs University Bremen gGmbH, all rights reserved. :File: plots.py .. |c| unicode:: U+A9 """ __all__ = ["BREWER_SET1", ...
bsd-3-clause
-80,002,290,279,166,700
29.034783
137
0.556456
false
2.734759
false
false
false
salv-orlando/MyRepo
nova/image/fake.py
1
7157
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Justin Santa Barbara # 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.apach...
apache-2.0
-7,230,544,118,180,133,000
34.430693
78
0.54562
false
4.101433
false
false
false
MowenPan/star_wars
ship.py
1
1577
import pygame from pygame.sprite import Sprite class Ship(Sprite): def __init__(self, ai_settings, screen): """Initialize the ship, and set its starting position.""" super(Ship, self).__init__() self.screen = screen self.ai_settings = ai_settings # Load the ship image, and...
apache-2.0
-7,004,505,927,314,254,000
34.044444
74
0.623335
false
3.913151
false
false
false
joeyoung658/A-Level_2016-18
Other/numbers.py
1
1301
# 09/09/2016 # Joe Young import random from time import sleep count = 0 alist = [] randomc = 0 while randomc != 4: ran = random.randint(1, 100) alist.append(ran) randomc = randomc + 1 alist.sort() def question(): global alist global count number = 0 clist = le...
gpl-3.0
7,266,662,100,259,031,000
21.654545
74
0.496541
false
4.117089
false
false
false
OAButton/tricorder
plugins/python/sciencedirect.py
1
7168
#!/usr/bin/env python2.7 # NOTE THIS NEEDS 2.6 as parser breaks with 2.5 :-) import warnings warnings.simplefilter("ignore",DeprecationWarning) import os, sys, re, urllib2, string, socket import htmlentitydefs import mechanize import html5lib from html5lib import treebuilders import lxml.html, lxml.etree from lxml.css...
bsd-3-clause
-3,845,690,253,872,181,000
25.947368
165
0.628906
false
2.946157
false
false
false
forkbong/qutebrowser
tests/end2end/features/test_completion_bdd.py
1
1124
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-5,833,988,742,366,090,000
39.142857
74
0.75089
false
3.746667
false
false
false
MasterOdin/gitvier
setup.py
1
1816
#!/usr/bin/env python """Setup script for the package.""" import os import sys import setuptools from gitvier import __project__, __version__, __author__, DESCRIPTION PACKAGE_NAME = "gitvier" MINIMUM_PYTHON_VERSION = (3, 5) def check_python_version(): """Exit when the Python version is too low.""" if sys....
mit
4,129,258,678,640,155,000
26.515152
80
0.616189
false
4.165138
false
false
false
thecookieraider/PyStar
Maze Generation/Pathfinder.py
1
14841
from math import sqrt from random import shuffle, randint, seed from Mazers import Depth_First from pygame.locals import * from time import time import sys import pygame import Main class Pathfinder: START_COLOR = (0, 0, 255) END_COLOR = (255, 20, 147) SEARCHED_COLOR = (255, 0, 0) PATH_COLOR = (0, 255...
mit
-1,412,383,707,930,343,000
37.952756
145
0.457112
false
4.049386
false
false
false
citrtech/DJLand-Tools
audio_splitter/test/test_slice.py
1
1077
from pydub import AudioSegment # pydub does things in milliseconds ten_seconds = 10 * 1000 one_second = 1000 #Examples #first_10_seconds = song[:ten_seconds] #last_5_seconds = song[-5000:] song = AudioSegment.from_mp3("2016.01.04-09.00.00-S.mp3") #print("Test") #last_second = song[-ten_seconds:] #last_second.expor...
gpl-3.0
-2,184,063,138,072,133,000
30.676471
98
0.707521
false
3.234234
false
false
false
farseerfc/pacvis
pacvis/pacvis.py
1
7040
#!/usr/bin/env python import sys import json from types import SimpleNamespace from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from webbrowser import open_new_tab import tornado.ioloop import tornado.web from .console import start_message, append_message, print_message from .infos import DbInfo, P...
mit
1,197,412,450,875,610,600
37.681319
107
0.446023
false
4.433249
false
false
false
abingham/ackward
src/ackward/logging/LoggerBase.py
1
3176
from ackward import (Class, method, Namespace, Property, TranslationUnit) def tunit(): return TranslationUnit( forward_declarations=[('ackward', 'logging', 'class Filter'), ('ackward', 'logging...
mit
8,258,628,040,254,271,000
43.111111
181
0.567695
false
4.517781
false
false
false
faisal-oead/My-Twitter-Bot
main-bot.py
1
1851
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # Copyright 2014 faisal oead <fafagold@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 Free Software Foundation; either version 2 of the License, or #...
gpl-2.0
-3,045,754,460,581,140,500
25.072464
71
0.707615
false
2.929967
false
false
false
MatthewShao/mitmproxy
test/pathod/test_pathod.py
1
7341
import io import pytest from pathod import pathod from mitmproxy.net import tcp from mitmproxy import exceptions from mitmproxy.test import tutils from . import tservers class TestPathod: def test_logging(self): s = io.StringIO() p = pathod.Pathod(("127.0.0.1", 0), logfp=s) assert len(...
mit
7,214,238,150,954,249,000
27.126437
98
0.558507
false
3.284564
true
false
false
pi19404/robosub-1
src/microcontroller_interface/microcontroller_debugging_interface.py
1
11005
#!/usr/bin/python #import statements import serial import os import time #Global Constants############################################################################# #These values are temporary, for testing. They WILL change in the final product #It was recommended that these values should be placed in a dictionary...
gpl-3.0
-8,604,657,200,176,266,000
22.2173
114
0.649159
false
2.614014
false
false
false
hivetech/dna
python/dna/cli.py
1
2375
# -*- coding: utf-8 -*- # vim:fenc=utf-8 ''' :copyright (c) 2014 Xavier Bruhiere. :license: MIT, see LICENSE for more details. ''' import os import abc import click class Cli(object): ''' Convenient wrapper around UI interface boilerplate. Make the app prettier and more robust. ''' __metacl...
apache-2.0
2,027,917,352,932,338,700
27.27381
78
0.548632
false
3.818328
false
false
false
boegel/easybuild-easyblocks
easybuild/easyblocks/p/psi.py
1
11600
## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
-9,018,316,180,705,056,000
44.669291
116
0.585259
false
3.903096
true
false
false
diplomacy/research
diplomacy_research/models/policy/order_based/dataset/base.py
1
19541
# ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: 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 rest...
mit
-6,682,590,270,983,825,000
51.52957
120
0.592703
false
4.182577
false
false
false
MFry/pyAlgoDataStructures
Interview_Cake/p1_stock_price.py
1
1516
""" Problem 1 Greedy """ import unittest def brute_get_max_profits(yesterday_prices): """ Brute Force method :param yesterday_prices: :return: """ max_price = float('-inf') for i, buy_price in enumerate(yesterday_prices): best_price = float('-inf') for sell_pric...
mit
-4,202,641,034,049,540,000
29.32
75
0.60752
false
3.399103
false
false
false
nishant-jain-94/Autofill
src/lstm-3-1024-1024-batchsize-512-epochs-30-Sequence.py
1
4123
from __future__ import print_function import json import os import numpy as np import sys import h5py from gensim.models import Word2Vec from gensim.utils import simple_preprocess from keras.layers import Embedding from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from ...
gpl-3.0
1,490,675,374,157,375,700
33.949153
132
0.732961
false
3.311647
false
false
false
ARMmbed/greentea
test/gtea/gt_cli.py
1
4917
# # Copyright (c) 2021 Arm Limited and Contributors. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # import six import sys import unittest from greentea import greentea_cli from greentea.gtea.tests_spec import TestSpec test_spec_def = { "builds": { "K64F-ARM": { "platform": "K64F...
apache-2.0
-5,142,583,259,424,977,000
30.928571
92
0.55725
false
3.650334
true
false
false
b-cube/thredds_catalog_crawler
thredds_catalog_crawler/crawl.py
1
11950
from thredds_crawler.etree import etree import urllib import urlparse import requests import os import sys import re from thredds_crawler.utils import construct_url INV_NS = "http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0" XLINK_NS = "http://www.w3.org/1999/xlink" import logging try: # Python >= 2...
gpl-3.0
-8,937,101,400,914,662,000
32.194444
114
0.529456
false
4.028995
false
false
false
lichuan261/wuand
XX-Net/python27/1.0/lib/noarch/dnslib/ranges.py
1
2427
# -*- coding: utf-8 -*- """ Wrapper around property builtin to restrict attribute to defined integer value range (throws ValueError). Intended to ensure that values packed with struct are in the correct range >>> class T(object): ... a = range_property('a',-100,100) ... b = B('b...
gpl-2.0
5,592,855,449,354,411,000
25.096774
84
0.526164
false
3.502165
false
false
false
arefenayat/pysend
asli.py
1
3605
import sys import urllib.request from urllib.parse import urlparse class check(object): def __init__(self):pass def address(self): add=input("Enter URL Address With HTTP to Send Data: \n") if add: o = urlparse(add) if not o.scheme: self.address() ...
cc0-1.0
1,671,651,297,372,823,600
31.772727
107
0.521221
false
3.782791
false
false
false
iniverno/RnR-LLC
simics-3.0-install/simics-3.0.31/amd64-linux/lib/leon2_components.py
1
10174
# MODULE: leon2-components # CLASS: leon2-simple from sim_core import * from components import * def _make_leon_cfg(dsu, sdram, wpts, mac, nwin, icsz, ilsz, dcsz, dlsz, div, mul, wdog, mst, fpu, pci, wp): leoncfg = 0 leoncfg = leoncfg | dsu << 30 # Debug Support Unit leoncfg = leoncf...
gpl-2.0
7,219,553,931,094,871,000
35.597122
85
0.546098
false
3.144005
true
false
false
leoc/home-assistant
homeassistant/components/climate/nest.py
1
6636
""" Support for Nest thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.nest/ """ import logging import voluptuous as vol import homeassistant.components.nest as nest from homeassistant.components.climate import ( STATE_AUTO, STATE_C...
mit
3,391,957,943,504,084,000
31.851485
74
0.602471
false
4.137157
false
false
false
bazwilliams/openhomedevice
tests/DidlLiteTest.py
1
4675
import unittest from openhomedevice.didl_lite import generate_string, parse, parse_duration, parse_int class DidlLiteTests(unittest.TestCase): def test_int_parsing(self): self.assertEqual(parse_duration("42"), 42) self.assertEqual(parse_duration("42.5"), 42) self.assertIsNone(parse_int("f...
mit
-3,629,042,253,428,072,000
56.716049
395
0.643422
false
3.158784
true
false
false
Barrog/C4-Datapack
data/jscript/quests/8_AnAdventureBegins/__init__.py
1
2997
# Created by CubicVirtuoso # Any problems feel free to drop by #l2j-datapack on irc.freenode.net import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest #NPCs JASMINE = 7134 ROSE...
gpl-2.0
-565,340,082,806,344,960
29.272727
123
0.634968
false
2.659272
false
false
false
USGSDenverPychron/pychron
pychron/processing/analyses/view/error_components_view.py
1
4244
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
apache-2.0
4,124,247,835,074,852,400
37.234234
82
0.536522
false
4.313008
false
false
false
windflyer/apport
test/test_backend_apt_dpkg.py
1
41266
import unittest, gzip, imp, subprocess, tempfile, shutil, os, os.path, time import glob, urllib from apt import apt_pkg if os.environ.get('APPORT_TEST_LOCAL'): impl = imp.load_source('', 'backends/packaging-apt-dpkg.py').impl else: from apport.packaging_impl import impl def _has_internet(): '''Return if ...
gpl-2.0
9,061,224,673,467,465,000
45.004459
108
0.551471
false
3.86603
true
false
false
sony/nnabla
build-tools/code_generator/update_function_types.py
1
1554
# Copyright 2018,2019,2020,2021 Sony Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
1,218,484,060,768,999,700
31.375
74
0.676319
false
3.771845
false
false
false
david2307/backend_159
activities/migrations/0001_initial.py
1
1103
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('persons', '0007_auto_20150711_2332'), ] operations = [ migrations.CreateModel( name='Activity', fiel...
gpl-3.0
-1,431,205,959,632,305,700
37.034483
114
0.56573
false
4.359684
false
false
false
xiang12835/python_web
py2_web2py/web2py/gluon/restricted.py
1
10754
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Restricted environment to execute application's code -------------------------------------------------...
apache-2.0
-6,934,575,283,434,433,000
31.489426
106
0.548075
false
4.145721
false
false
false
ikreymer/pywb
tests/memento_fixture.py
1
1343
import re MEMENTO_DATETIME = 'Memento-Datetime' ACCEPT_DATETIME = 'Accept-Datetime' LINK = 'Link' VARY = 'Vary' LINK_FORMAT = 'application/link-format' class MementoMixin(object): def _timemap_get(self, url, fmod=True, **kwargs): app = self.testapp if fmod else self.testapp_non_frame return app.ge...
gpl-3.0
9,091,554,098,200,876,000
36.305556
90
0.597915
false
3.116009
false
false
false
jbfavre/exabgp
lib/exabgp/bgp/message/update/attribute/mpurnlri.py
1
2146
# encoding: utf-8 """ mprnlri.py Created by Thomas Mangin on 2009-11-05. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ from struct import unpack from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.protocol.ip.address import Address from exabgp.bgp.message impo...
bsd-3-clause
2,751,306,918,672,450,000
26.164557
92
0.687325
false
2.823684
false
false
false
kreatorkodi/repository.torrentbr
plugin.video.youtube/resources/lib/youtube_plugin/youtube/helper/tv.py
1
5888
__author__ = 'bromix' from six import PY2 from ... import kodion from ...youtube.helper import utils from ...kodion.items.video_item import VideoItem def my_subscriptions_to_items(provider, context, json_data, do_filter=False): result = [] video_id_dict = {} incognito = str(context.get_param('incognito'...
gpl-2.0
8,029,044,386,622,593,000
37.48366
129
0.631284
false
3.467609
false
false
false
lwerdna/chess
PgnParser.py
1
9869
#!/usr/bin/python # Copyright 2012-2016 Andrew Lamoureux # # This file is a part of FunChess # # FunChess is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
gpl-3.0
1,263,938,477,565,290,800
31.251634
133
0.510791
false
4.183552
false
false
false
poppogbr/genropy
gnrpy/gnr/pdf/test/testsuite.py
1
1391
from gnr.pdf.gnrpdf import GnrPdf from reportlab.lib.units import inch def testPage(root): for x in range(2): page = root.page(x=1 * inch, y=1 * inch) page.setFont("Helvetica", 9) pane1 = page.pane(x_=1, y_=15) pane2 = page.pane(x_=9, y_=9) pane2.setFont("Helvetica", 12) ...
lgpl-2.1
-5,206,272,216,680,700,000
26.294118
56
0.558591
false
2.947034
false
false
false
ecbtln/1411wrightfisher
wright_fisher.py
1
24312
__author__ = 'eblubin@mit.edu, nanaya@mit.edu' import math import numpy as np from random import choice from inspect import isfunction from matplotlib import pyplot as plt from UserDict import IterableUserDict import random import operator import heapq from progressbar import AnimatedProgressBar # This is used to hel...
mit
6,413,463,132,501,530,000
46.116279
305
0.622861
false
3.996712
false
false
false
google-research/tf-slim
tf_slim/losses/__init__.py
1
1814
# coding=utf-8 # Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
8,135,164,806,222,323,000
30.275862
80
0.688534
false
3.787056
false
false
false
us-ignite/us_ignite
us_ignite/apps/importer.py
1
4966
import logging import pytz import requests from StringIO import StringIO from django.contrib.auth.models import User from django.core import files from django.core.files.storage import default_storage from django.core.files.base import ContentFile from django.utils import timezone from django.utils.dateparse import p...
bsd-3-clause
1,271,934,513,240,245,200
30.833333
80
0.639952
false
3.76783
false
false
false
i3visio/osrframework
osrframework/wrappers/goodreads.py
1
3899
################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Softwa...
agpl-3.0
6,122,434,766,374,014,000
37.98
80
0.524371
false
4.365062
false
false
false
Tesora-Release/tesora-trove
trove/db/sqlalchemy/migrate_repo/versions/038_instance_faults.py
1
2042
# Copyright 2016 Tesora, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-6,658,379,695,200,043,000
35.464286
78
0.728208
false
3.942085
false
false
false
neozhangthe1/coverage_model
groundhog/trainer/SGD.py
1
6790
""" Stochastic Gradient Descent with momentum. TODO: write more documentation """ __docformat__ = 'restructedtext en' __authors__ = ("KyungHyun Cho " "Razvan Pascanu " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import time import theano import the...
bsd-3-clause
-7,551,729,599,220,333,000
36.103825
100
0.508837
false
3.904543
false
false
false
jamesiter/JimV-C
jimvc/api/snapshot.py
1
12999
#!/usr/bin/env python # -*- coding: utf-8 -*- from math import ceil import requests from flask import Blueprint, url_for from flask import request import json import jimit as ji import os from jimvc.api.base import Base from jimvc.models import Guest, Config, Disk from jimvc.models import Snapshot, SnapshotDiskMapp...
gpl-3.0
4,323,306,669,651,697,000
25.970772
118
0.571639
false
3.573721
true
false
false
AlienCowEatCake/ImageViewer
src/ThirdParty/Exiv2/exiv2-0.27.3-Source/tests/bugfixes/redmine/test_issue_540.py
3
5145
# -*- coding: utf-8 -*- import system_tests class PrettyPrintXmp(metaclass=system_tests.CaseMeta): url = "http://dev.exiv2.org/issues/540" filename = "$data_path/exiv2-bug540.jpg" commands = ["$exiv2 -u -px $filename"] stdout = ["""Xmp.dc.creator XmpSeq 1 Ian Bri...
gpl-3.0
4,314,905,811,117,422,000
62.518519
118
0.515063
false
3.398283
false
false
false
fabiking/plugin.video.Mfabiking
resources/tools/livesoccertv.py
1
9605
# -*- coding: utf-8 -*- #------------------------------------------------------------ # Parser de LiveSoccerTV para PalcoTV # Version 0.1 (05.05.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) #------------------------------------------------...
gpl-2.0
-7,714,623,710,669,975,000
46.058824
227
0.587083
false
3.276451
false
false
false
mar29th/ring
ring/connection.py
1
8091
# Copyright 2016 Douban 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, soft...
apache-2.0
-2,285,787,492,178,655,700
30.119231
92
0.577555
false
4.283219
false
false
false
liquidinstruments/pymoku
pymoku/_waveform_generator.py
1
66353
import math import logging import warnings from pymoku._instrument import to_reg_unsigned from pymoku._instrument import from_reg_unsigned from pymoku._instrument import to_reg_signed from pymoku._instrument import from_reg_signed from pymoku._instrument import deprecated from pymoku._instrument import MokuInstrument...
mit
-7,956,985,272,048,114,000
38.26213
79
0.532666
false
3.653196
false
false
false
targueriano/neuroIFC
neuro-ifc_1.0.16_amd64/usr/local/neuro-ifc/src/Treinamento.py
1
4811
#!/usr/bin/env python #-*- coding: utf-8 -*- #autor Taylan Branco Meurer import neurolab class Treinamento(object): def __init__(self, net, inputs, targets, epocas, show, goal, lr, lr_inc, lr_dec, mc, rr): self.net = net self.inputs = inputs self.targets = targets self.epocas = epo...
gpl-3.0
-5,539,195,246,021,007,000
49.114583
93
0.437331
false
4.20542
false
false
false
OscarPDR/projects_morelab
projects/views.py
1
21846
# coding: utf-8 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.template.defaultfi...
gpl-3.0
-7,591,338,815,435,761,000
34.637847
131
0.61018
false
4.078029
false
false
false
chrisdjscott/Atoman
atoman/system/lattice.py
1
15979
""" Lattice module, with Lattice object and utilities @author: Chris Scott """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division import logging import copy import numpy as np from .atoms import elements from ..algebra import vectors from . import _lattic...
mit
-2,791,847,265,881,904,600
32.569328
120
0.553476
false
3.681797
false
false
false
OpenNetworkingFoundation/PIF-Open-Intermediate-Representation
pif_ir/bir/tests/test_parser.py
1
2151
#!/usr/bin/env python import logging import struct from pif_ir.bir.objects.bir_struct import BIRStruct from pif_ir.bir.objects.packet_instance import PacketInstance from pif_ir.bir.utils.bir_parser import BIRParser from test_common import yaml_eth_struct_dict def fail(case): logging.error("Test Case {}: Failed"....
apache-2.0
-7,633,070,394,601,520,000
38.833333
76
0.65086
false
2.579137
false
false
false
FedoraScientific/salome-smesh
doc/salome/examples/creating_meshes_ex03.py
1
2218
# Change priority of submeshes in Mesh import salome salome.salome_init() import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200) [Face_1...
lgpl-2.1
-7,202,010,096,023,731,000
34.774194
103
0.756087
false
2.464444
false
true
false
Scriptkiddi/Ankipubsub-Client
pubsub/models/Template.py
1
2259
__author__ = 'fritz' import json from pubsub.database.models import db, AnkiPubSubTemplate from copy import deepcopy class Template(): def __init__(self, name, answer_format, question_format, deck, ord, back_answ...
gpl-3.0
-4,366,288,978,875,604,000
42.442308
108
0.486056
false
4.806383
false
false
false
google/grr
grr/server/grr_response_server/flow_utils_test.py
1
2306
#!/usr/bin/env python """Tests for flow utils classes.""" from absl import app from grr_response_core.lib import rdfvalue from grr_response_core.lib.rdfvalues import client as rdf_client from grr_response_server import flow_utils from grr.test_lib import flow_test_lib from grr.test_lib import test_lib class TestInt...
apache-2.0
2,136,674,623,070,125,000
31.027778
77
0.630095
false
3.436662
true
false
false
texastribune/tt_disposal_wells
example/example/settings.py
1
5210
# Django settings for example project. # Setup a ``project_dir`` function import os from dj_settings_helpers import create_project_dir project_dir = create_project_dir(os.path.join(os.path.dirname(__file__), '..', '..')) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.c...
apache-2.0
-4,731,053,268,762,224,000
31.974684
88
0.702495
false
3.661279
false
false
false
eyaler/tensorpack
tensorpack/utils/palette.py
1
1914
# -*- coding: utf-8 -*- # File: palette.py import numpy as np __all__ = ['PALETTE_RGB'] # copied from https://stackoverflow.com/questions/2328339/how-to-generate-n-different-colors-for-any-natural-number-n PALETTE_HEX = [ "#000000", "#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059", ...
apache-2.0
-6,845,373,950,139,188,000
49.368421
117
0.541797
false
2.117257
false
false
false
google-research/google-research
tf3d/instance_segmentation/model_utils.py
1
4801
# coding=utf-8 # Copyright 2021 The Google Research 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
5,561,826,398,023,108,000
41.486726
78
0.705478
false
3.954695
false
false
false
simbtrix/mxnix
project/crossSectionView/rectangleView.py
1
4807
''' Created on 14.03.2016 @author: mkennert ''' from kivy.properties import NumericProperty from kivy.uix.gridlayout import GridLayout from crossSectionView.aview import AView from ownComponents.design import Design from ownComponents.ownGraph import OwnGraph from plot.dashedLine import DashedLine from ...
gpl-3.0
8,672,656,484,019,362,000
31.158621
127
0.564801
false
3.550222
false
false
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/phonenumbers/shortnumberinfo.py
1
15445
"""Methods for getting information about short phone numbers, such as short codes and emergency numbers. Note most commercial short numbers are not handled here, but by phonenumberutil.py """ # Based on original Java code: # java/src/com/google/i18n/phonenumbers/ShortNumberInfo.java # Copyright (C) 2013 The Libpho...
bsd-3-clause
3,237,084,498,279,031,300
41.665746
106
0.722888
false
3.990956
true
false
false
tomdyson/wagtail-modeltranslation
wagtail_modeltranslation/fields.py
1
16968
# -*- coding: utf-8 -*- from django import forms from django.core.exceptions import ImproperlyConfigured from django.db.models import fields from wagtail.wagtailcore.fields import StreamField from django.utils import six from wagtail_modeltranslation import settings as mt_settings from wagtail_modeltranslation.utils i...
bsd-3-clause
1,340,835,948,762,362,000
43.1875
100
0.643388
false
4.546624
false
false
false
burrsettles/ml-talks-duolingo
03_clustering/voting_em.py
1
3646
""" Burr Settles Duolingo ML Dev Talk #3: Clustering EM-GMM (expectaction maximization with Gaussian mixture models) clustering example using scikit-learn. """ import argparse import math import json import numpy as np from bs4 import BeautifulSoup from sklearn.mixture import GaussianMixture # cluster colors (for ...
gpl-3.0
-6,921,857,075,692,596,000
33.396226
143
0.582008
false
3.249554
false
false
false
firestrand/pybrain-gpu
pybraingpu/datasets/supervised.py
1
4176
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de' from random import sample from scipy import isscalar from dataset import DataSet from pybraingpu.utilities import fListToString class SupervisedDataSet(DataSet): """SupervisedDataSets have two fields, one for input and one for the target. """ def __...
bsd-3-clause
1,078,351,008,453,465,500
34.692308
80
0.58501
false
4.184369
false
false
false
GraveRaven/hivemind
hivemindsrc/ants.py
1
15536
#!/bin/env python """ The MIT License Copyright (c) 2010 The Chicago Tribune & Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
mit
2,145,380,531,466,934,800
33.678571
177
0.630021
false
3.964277
false
false
false
kayhayen/Nuitka
nuitka/tools/quality/pylint/__main__.py
1
4063
#!/usr/bin/env python # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fi...
apache-2.0
-8,395,116,404,153,469,000
26.828767
95
0.630815
false
3.888038
false
false
false
DedMemez/ODS-August-2017
building/DistributedPaintShopInterior.py
1
1302
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.building.DistributedPaintShopInterior from direct.distributed.DistributedObject import DistributedObject from direct.actor.Actor import Actor from RandomBuilding import RandomBuilding class DistributedPaintShopInterior(DistributedObject, RandomBu...
apache-2.0
-2,224,954,339,351,331,600
40.064516
118
0.685868
false
3.626741
false
false
false
Wolfterro/Criador-De-Postagens
src/old/v1.0/CriadorDePostagens.py
1
13285
# -*- coding: utf-8 -*- ''' The MIT License (MIT) Copyright (c) 2017 Wolfgang Almeida <wolfgang.almeida@yahoo.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, i...
mit
7,671,738,107,317,394,000
49.851563
172
0.714361
false
3.332998
false
false
false
davidfischer-ch/django-imagefit
imagefit/models.py
1
3608
from __future__ import division from imagefit.conf import ext_to_format, settings from PIL import Image as PilImage import mimetypes try: import StringIO except ImportError: import io as StringIO import re import os class Image(object): """ Represents an Image file on the system. """ def __i...
bsd-3-clause
6,212,976,185,050,799,000
26.968992
76
0.54296
false
3.670397
false
false
false
berth64/modded_modded_1257ad
source/process_presentations.py
1
1453
import sys sys.dont_write_bytecode = True import string from module_info import * from module_presentations import * from ID_meshes import * from process_common import * from process_operations import * # Lav's export_dir tweak export_dir = '%s/' % export_dir.replace('\\', '/').rstrip('/') def save_...
agpl-3.0
8,558,168,947,293,909,000
32.595238
99
0.714384
false
3.193407
false
false
false
Dinnerbone/mcstatus
setup.py
1
1718
from setuptools import setup with open("requirements.txt") as f: install_requires = f.read().splitlines() with open("test-requirements.txt") as f: tests_require = f.read().splitlines() tests_require.pop(0) # remove '-r requirements.txt' line setup( name="mcstatus", version="6.4.0", author="N...
apache-2.0
-681,558,182,179,929,600
34.791667
90
0.623981
false
4.023419
false
false
false