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
cffex/cmdb
test/project/webci_attr_type.py
1
10754
#!/usr/bin/python #coding: utf-8 #print "Content-type: text/html\n" #Author: LIPH import web import demjson import json import string import time import urlparse import webci_attr import sys reload(sys) sys.setdefaultencoding('utf-8') render = web.template.render('templates/') urls = ( '/ciattrtyp...
apache-2.0
268,012,882,790,708,770
56.118919
407
0.603981
false
3.079038
false
false
false
egemsoft/esef-yawd-translation
translations/utils.py
1
5003
import os import sys from django.conf import settings from django.utils.encoding import smart_str from django.utils.translation import check_for_language from django.utils.translation.trans_real import get_language_from_path _default = None _supported = [] def get_default_language(): """ Detects the default...
bsd-3-clause
-1,003,490,242,642,508,300
31.914474
105
0.681991
false
4.104184
false
false
false
DBeath/flask-feedrsub
feedrsub/feeds/feedfinder/feedfinder4.py
1
7270
import logging import time from typing import Tuple from urllib.parse import urlsplit, urljoin from bs4 import BeautifulSoup from feedrsub.feeds.feedfinder.feedinfo import FeedInfo from feedrsub.utils.requests_session import RequestsSession, requests_session logger = logging.getLogger("feedfinder4") def coerce_url...
mit
-221,718,999,646,376,000
28.552846
88
0.587895
false
3.495192
false
false
false
Badg/hwiopy
hwiopy/platforms/beagle.py
1
6484
''' Beaglebone/Beagleboard/Etc hardware-specific operations. LICENSING ------------------------------------------------- hwiopy: A common API for hardware input/output access. Copyright (C) 2014-2015 Nicholas Badger badg@nickbadger.com nickbadger.com This library is free software; you can redistribut...
lgpl-2.1
-8,934,214,126,180,577,000
34.244565
78
0.571869
false
4.477901
false
false
false
TalwalkarLab/paleo
paleo/layers/conv.py
1
11804
"""The module estimates 2D convolution layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import six from paleo.layers import base class Deconv2D(base.BaseLayer): """Deconv2D""" def __init__(self, name, ...
apache-2.0
4,500,665,056,704,952,000
33.923077
119
0.527194
false
4.004071
false
false
false
nathaliaspatricio/febracev
friends/views.py
1
1329
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.shortcuts import render_to_response, get_object_or_404, redirect from django.template import RequestContext from friends.utils import get_following_set, get_follower_set, get_mutual_set from django.contrib.auth.decorators import login_requi...
gpl-2.0
-6,370,096,574,285,482,000
38.088235
77
0.712566
false
3.621253
false
false
false
cstipkovic/spidermonkey-research
testing/marionette/harness/marionette/tests/unit/test_switch_remote_frame.py
1
5471
# 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/. from marionette import MarionetteTestCase from marionette_driver.by import By OOP_BY_DEFAULT = "dom.ipc.browser_frames...
mpl-2.0
5,705,097,036,018,414,000
45.760684
94
0.618351
false
3.711669
true
false
false
stuaxo/mnd
mnd/handler.py
1
6612
""" To make callbacks work with instance methods some things need to happen. The handler decorator attaches instances of MNDInfo to functions to enable the dispatcher to work with classes and instances via the Handler metaclass. At instance creation time the metaclass converts finds any handlers with MNDFunction, rep...
mit
-7,329,817,114,201,264,000
27.747826
85
0.598306
false
3.898585
false
false
false
ofirpicazo/solitario
bin/generate_cards.py
1
8706
#!/usr/bin/python # coding: utf-8 import argparse import sys SUIT_MAP = { 'club': '♣', 'diamond': '♦', 'heart': '♥', 'spade': '♠', } templateA = """ <div class="card %(suit)s" id="%(id)s" data-suit="%(suit)s" data-number="%(number)s"> <div class="flipper"> <div class="front"> <div class="corner t...
mit
7,593,103,439,347,813,000
30.977941
85
0.557714
false
3.106429
false
false
false
brython-dev/brython
www/src/Lib/threading.py
1
51971
"""Thread module emulating a subset of Java's threading model.""" import os as _os import sys as _sys import _thread import functools from time import monotonic as _time from _weakrefset import WeakSet from itertools import islice as _islice, count as _count try: from _collections import deque as _deque except Im...
bsd-3-clause
-4,337,143,701,189,812,000
33.601198
92
0.61086
false
4.394639
false
false
false
darbula/django-form-designer
form_designer/migrations/0002_auto_20160216_1527.py
1
1389
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('form_designer', '0001_initial'), ] operations = [ migrations.AlterField( model_name='formdefinition', ...
bsd-3-clause
1,623,216,130,215,411,700
52.423077
588
0.648668
false
3.795082
false
false
false
schlegelp/pymaid
setup.py
1
1845
from setuptools import setup, find_packages import re VERSIONFILE = "pymaid/__init__.py" verstrline = open(VERSIONFILE, "rt").read() VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]" mo = re.search(VSRE, verstrline, re.M) if mo: verstr = mo.group(1) else: raise RuntimeError("Unable to find version string in %s." %...
gpl-3.0
5,979,263,114,792,834,000
33.166667
85
0.6271
false
3.520992
false
false
false
braddockcg/internet-in-a-box
iiab/whoosh_search.py
1
3339
import os from whoosh.qparser import MultifieldParser from whoosh import scoring from .whoosh_multi_field_spelling_correction import MultiFieldQueryCorrector import pagination_helper def index_directory_path(base_path, zim_name): """Returns the directory where a ZIM file's index should be located, given a ba...
bsd-2-clause
-3,125,193,210,656,872,000
43.52
126
0.712788
false
4.008403
false
false
false
copotron/car-control
datacollection/prius/log.py
1
1840
# Copyright (C) 2017 Swift Navigation Inc. # Contact: Swift Navigation <dev@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY K...
gpl-3.0
-1,142,508,516,065,610,600
35.8
113
0.643478
false
3.817427
false
false
false
PDXCodeCoop/account
models.py
1
1688
from django.db import models from django import forms from django.contrib.auth.models import User from django.utils import timezone from easy_thumbnails.fields import ThumbnailerImageField #A User's Personal Info class Profile(models.Model): user = models.OneToOneField(User) photo = ThumbnailerImageField(upl...
apache-2.0
601,757,445,029,764,600
33.44898
91
0.637441
false
3.793258
false
false
false
Arkshine/AdminFreeLook
support/generate_headers.py
1
2611
# vim: set ts=8 sts=2 sw=2 tw=99 et: import re import os, sys import subprocess argv = sys.argv[1:] if len(argv) < 2: sys.stderr.write('Usage: generate_headers.py <source_path> <output_folder>\n') sys.exit(1) SourceFolder = os.path.abspath(os.path.normpath(argv[0])) OutputFolder = os.path.normpath(argv[1]) class...
gpl-2.0
-469,546,346,124,041,700
30.457831
87
0.654538
false
3.050234
false
false
false
genonfire/bbgo
recipes/migrations/0001_initial.py
1
1108
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Category', fields=[ ('id', models.AutoField(ver...
mit
5,277,985,640,252,880,000
33.625
114
0.544224
false
4.504065
false
false
false
anarcoder/google_explorer
plugins/apache_rce_struts2_cve_2017_5638.py
1
3545
import os from lxml import html as lh from queue import Queue from urllib.parse import urlparse from threading import Thread import requests import threading from requests import get from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning...
mit
-3,332,205,755,041,157,000
29.450549
101
0.452183
false
2.730049
false
false
false
ChristosChristofidis/h2o-3
scripts/run.py
1
66029
#!/usr/bin/python import sys import os import shutil import signal import time import random import getpass import re import subprocess import ConfigParser def is_python_test_file(file_name): """ Return True if file_name matches a regexp for a python test. False otherwise. """ if (file_name == "tes...
apache-2.0
-4,628,322,847,902,796,000
32.517259
119
0.513729
false
3.879267
true
false
false
shollingsworth/HackerRank
python/re-sub-regex-substitution/main.py
1
1291
#!/usr/bin/env python # -*- coding: utf-8 -*- import __future__ import sys import json def banner(): ban = '====' * 30 print("{}\nSAMPLE INP:\n{}\n{}".format(ban,ban,open(ip, 'r').read())) print("{}\nSAMPLE OUT:\n{}\n{}".format(ban,ban,open(op, 'r').read())) print("{}\nSTART:\n{}".format(ban,ban)) ...
apache-2.0
8,672,584,622,276,070,000
22.907407
109
0.573974
false
2.712185
false
false
false
wfwei/ReadWeibo
classifier/DataProcess.py
1
3547
# !/usr/bin/python # -*- coding: utf-8 -*- ''' Created on 2013-9-2 @author: plex ''' from ReadWeibo.mainapp.models import Weibo from ReadWeibo.account.models import Account from djangodb.WeiboDao import WeiboDao from datetime import datetime from sets import Set import numpy as np import re import jieba jieba.load_u...
apache-2.0
5,765,088,084,828,768,000
22.206667
70
0.670497
false
2.344108
false
false
false
ewiger/decade
lib/antlr3c/genclib.py
1
1592
#!/usr/bin/python ''' This code will automatically generate most of the ctypes from ANTLR3 C runtime headers. ''' import os import sys import ext_path from pyclibrary import * from glob import glob ANTLR3C_INCLUDE = os.path.join( os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'libantlr3c-3.4',...
bsd-3-clause
-3,333,805,171,277,549,600
25.533333
87
0.627513
false
3.216162
false
false
false
tseaver/google-cloud-python
asset/synth.py
1
3228
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
1,773,273,584,265,377,000
35.269663
95
0.619579
false
3.419492
false
false
false
karel-brinda/rnftools
rnftools/rnfformat/Validator.py
1
4484
import rnftools.rnfformat import re reg_lrn = re.compile(r"^([!-?A-^`-~]*)__([0-9a-f]+)__([!-?A-^`-~]+)__([!-?A-^`-~]*)$") reg_prefix_part = re.compile(r"^[!-?A-^`-~]*$") reg_id_part = re.compile(r"^[0-9a-f]+$") reg_segmental_part = re.compile(r"^(?:(\([0-9FRN,]*\))(?:,(?!$)|$))+$") reg_suffix_part = re.compile(r"^(?:...
mit
-313,604,499,112,898,240
37.991304
119
0.533452
false
3.394398
false
false
false
mlperf/inference_results_v0.5
closed/NVIDIA/code/common/harness.py
1
13993
# Copyright (c) 2019, NVIDIA CORPORATION. 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 appli...
apache-2.0
-5,496,312,983,046,946,000
39.20977
186
0.590652
false
3.759538
true
false
false
alnaav/shredNN
nn/train/gradient_descent_trainer.py
1
3264
import numpy as np from nn.train.trainer import Trainer class LayerData: def __init__(self, layer): self.z = np.zeros(layer.size) self.a = np.zeros(layer.size) self.neuron_error = np.zeros(layer.size) self.grad_w = np.zeros(layer.w.shape) self.grad_b = np.zeros(layer.b.sha...
apache-2.0
-6,355,674,511,678,844,000
31.64
118
0.543811
false
3.287009
false
false
false
andyvand/cygsystem-config-llvm
src/Properties_Renderer.py
1
7792
"""This renderer class renders volume properties into a separate drawing area next to the main volume rendering drawing area. """ import sys import math import operator import types import select import signal import gobject import pango import string import os from lvmui_constants import * import stat import gett...
gpl-2.0
-4,781,185,715,055,585,000
36.104762
95
0.602156
false
3.380477
false
false
false
theeluwin/textrankr
textrankr/utils.py
1
2716
from typing import ( List, Tuple, Callable, ) from re import split from itertools import combinations from collections import Counter from networkx import Graph from .sentence import Sentence __all__: Tuple[str, ...] = ( 'parse_text_into_sentences', 'multiset_jaccard_index', 'build_sentence...
mit
-7,227,328,344,896,412,000
27.893617
126
0.647275
false
4.090361
false
false
false
dc3-plaso/plaso
plaso/parsers/winreg_plugins/usbstor.py
1
4441
# -*- coding: utf-8 -*- """File containing a Windows Registry plugin to parse the USBStor key.""" import logging from plaso.containers import windows_events from plaso.parsers import winreg from plaso.parsers.winreg_plugins import interface __author__ = 'David Nides (david.nides@gmail.com)' class USBStorPlugin(in...
apache-2.0
7,311,776,805,502,006,000
38.651786
79
0.665166
false
3.728799
false
false
false
unreal666/outwiker
src/outwiker/gui/basepagepanel.py
2
4433
# -*- coding: utf-8 -*- import logging import os.path import wx from wx.lib.scrolledpanel import ScrolledPanel from outwiker.core.event import Event logger = logging.getLogger('outwiker.gui.pasepagepanel') class BasePagePanel(ScrolledPanel): """ Базовый класс для панелей представления страниц """ ...
gpl-3.0
-5,303,935,627,709,025,000
25.157534
95
0.584446
false
2.835189
false
false
false
mozilla-it/mozlibldap
examples/make-pubkeys-investigation.py
1
3570
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2015 Mozilla Corporation # Author: jvehent@mozilla.com # Requires: # mozlibldap f...
mpl-2.0
-8,203,583,225,681,633,000
35.428571
95
0.564426
false
3.479532
false
false
false
BlackHole/enigma2-obh10
lib/python/Components/TimerSanityCheck.py
2
13683
import NavigationInstance from time import localtime, mktime, gmtime, time from enigma import iServiceInformation, eServiceCenter, eServiceReference, getBestPlayableServiceReference from timer import TimerEntry import RecordTimer from Tools.CIHelper import cihelper from Components.config import config class TimerSani...
gpl-2.0
-3,732,489,084,296,369,700
39.602374
171
0.655631
false
3.240881
false
false
false
scorpilix/Golemtest
golem/interface/client/environments.py
1
1674
from golem.core.deferred import sync_wait from golem.interface.command import group, Argument, command, CommandResult @group(name="envs", help="Manage environments") class Environments(object): name = Argument('name', help="Environment name") table_headers = ['name', 'supported', 'active', 'performance', ...
gpl-3.0
2,024,806,146,087,001,300
30
75
0.603345
false
4.440318
false
false
false
pyrrho314/recipesystem
trunk/astrodata/DataSpider.py
1
42351
try: import pyfits except: pass import os import re from AstroData import * ldebug = False verbose = False from astrodata.adutils import terminal from ReductionContextRecords import AstroDataRecord import subprocess import os from copy import copy,deepcopy from AstroData import Errors from astrodata import new...
mpl-2.0
8,175,685,783,328,367,000
42.48152
138
0.378928
false
5.384058
false
false
false
teamclairvoyant/airflow-scheduler-failover-controller
scheduler_failover_controller/metadata/base_metadata_service.py
1
1260
import datetime from scheduler_failover_controller.utils import date_utils class BaseMetadataService: def initialize_metadata_source(self): raise NotImplementedError def get_failover_heartbeat(self): raise NotImplementedError def set_failover_heartbeat(self): raise NotImplemente...
apache-2.0
6,998,434,482,056,831,000
30.5
100
0.637302
false
4.468085
false
false
false
freiheit/Bay-Oh-Woolph
cogs/basicpromotions.py
1
14770
from discord.ext import commands from utils import * import discord import asyncio from cogs.updateroster import UpdateRoster from config import Config import logging logger = logging.getLogger('bayohwoolph.cogs.basicpromotions') BASICPROMOTIONS = Config.config['BASICPROMOTIONS'] ROLE_CADET = BASICPROMOTIONS['ROLE_...
agpl-3.0
-6,239,468,246,116,860,000
43.221557
213
0.673527
false
3.42453
false
false
false
stvstnfrd/edx-platform
lms/djangoapps/verify_student/tasks.py
1
5646
""" Django Celery tasks for service status app """ import logging from smtplib import SMTPException import requests import simplejson from celery import Task, shared_task from celery.states import FAILURE from django.conf import settings from django.core.mail import EmailMessage from edx_django_utils.monitoring impor...
agpl-3.0
-5,051,165,563,618,291,000
37.937931
106
0.667906
false
4.319816
false
false
false
holgerd77/django-dynamic-scraper
tests/scraper/models.py
1
1421
#Stage 2 Update (Python 3) from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible from builtins import str from django.db import models from dynamic_scraper.models import Scraper, SchedulerRuntime from scrapy_djangoitem import DjangoItem @python_2_unicode_compatible clas...
bsd-3-clause
-963,004,689,120,053,800
33.658537
107
0.708656
false
3.606599
false
false
false
mjirik/io3d
io3d/misc.py
1
8466
#! /usr/bin/env python # -*- coding: utf-8 -*- # import sys import os from loguru import logger import sys import os.path import numpy as np from io import open from .image import DataPlus path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "./extern/sPickle")) ...
mit
-4,283,288,989,103,422,000
27.505051
84
0.568037
false
3.379641
false
false
false
mwatts15/YAROM
examples/adding_data.py
1
1499
import yarom as Y import rdflib Y.connect({'rdf.namespace': rdflib.Namespace("http://example.org/")}) def p1(): mary = Y.DataObject(key='mary') fido = Y.DataObject(key='fido') mary.relate('has_pet', fido) mary.relate('age', Y.Quantity(23, 'years')) mary.relate('email', "mary@example.org") Y.pri...
bsd-3-clause
-940,927,674,706,282,800
25.298246
69
0.597065
false
2.968317
false
false
false
vivaxy/algorithms
python/problems/prime_number_of_set_bits_in_binary_representation.py
1
1089
""" https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/ https://leetcode.com/submissions/detail/136523875/ """ class Solution: def countPrimeSetBits(self, L, R): """ :type L: int :type R: int :rtype: int """ def isPrime(n): ...
mit
2,882,310,662,519,049,700
23.75
80
0.534435
false
3.704082
true
false
false
fountainhead-gq/DjangoBlog
blogproject/urls.py
1
1922
"""blogproject URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
gpl-2.0
-8,842,098,134,731,623,000
41.711111
85
0.73257
false
3.526606
false
false
false
hasgeek/boxoffice
migrations/versions/253e7b76eb8e_modify_assignee.py
1
2138
"""modify assignee. Revision ID: 253e7b76eb8e Revises: 1ea1e8070ac8 Create Date: 2016-04-11 20:15:52.864916 """ # revision identifiers, used by Alembic. revision = '253e7b76eb8e' down_revision = '1ea1e8070ac8' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): op.add_column(...
agpl-3.0
-1,522,597,774,365,325,300
33.483871
86
0.641254
false
3.134897
false
false
false
lykops/lykops
library/frontend/__init__.py
1
13604
import logging from library.config.frontend import adminuser from library.config.security import vault_header from library.connecter.database.mongo import Op_Mongo from library.connecter.database.redis_api import Op_Redis from library.security.encryption.AES256.api import Using_AES256 from library.security.password im...
apache-2.0
5,559,556,405,368,260,000
32.727019
105
0.494136
false
3.403992
false
false
false
udoyen/pythonlearning
reading_code/password_craacker_redone.py
1
2533
# Script Name : password_cracker.py # Author : Craig Richards # Created : 20 May 2013 # Last Modified : # Version : 1.0 # Modifications : # Description : Old school password cracker using python import crypt # Import the module def testPass(cryptPass): # Start the function """ function to compare given pa...
mit
-4,450,451,968,419,236,000
40.52459
98
0.606001
false
4.242881
false
false
false
ciex/motor
application/forms.py
1
1755
""" forms.py Web forms based on Flask-WTForms See: http://flask.pocoo.org/docs/patterns/wtforms/ http://wtforms.simplecodes.com/ """ import datetime from flaskext import wtf from flaskext.wtf import validators from google.appengine.api import users from models import Movement class TimeDeltaField(wtf.Integer...
apache-2.0
-4,664,715,961,961,592,000
33.411765
109
0.68661
false
4.11007
false
false
false
lrem/chord.py
chord/peer.py
1
9656
#!/usr/bin/env python3 """ Chord peer ========== This module provides peer of a Chord distributed hash table. """ import random import time import socket import socketserver import threading import logging logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s', level=logging.DEBUG) CH...
mit
6,198,633,712,688,207,000
30.249191
79
0.545568
false
3.760125
false
false
false
podhmo/toybox
examples/jwt_server.py
1
1141
import logging from toybox.simpleapi import simple_view, run from pyramid.security import Authenticated from pyramid.authorization import ACLAuthorizationPolicy from pyramid.security import Allow # please: pip install pyramid_jwt """ python ./jwt_server.py # 403 $ http GET :8080/secure # 200 OK $ http GET :8080/logi...
mit
-1,611,208,174,127,569,200
21.372549
73
0.689746
false
3.489297
true
false
false
yarhajile/sven-daemon
Sven/Module/BeagleboneBlack/Adafruit_BBIO-0.0.19/test/test_gpio_output.py
1
1308
import pytest import os import Adafruit_BBIO.GPIO as GPIO def teardown_module(module): GPIO.cleanup() class TestGPIOOutput: def test_output_high(self): GPIO.setup("P8_10", GPIO.OUT) GPIO.output("P8_10", GPIO.HIGH) value = open('/sys/class/gpio/gpio68/value').read() assert int(...
gpl-2.0
4,022,292,955,603,422,700
28.727273
59
0.591743
false
3.362468
true
false
false
bobbydurrett/PythonDBAGraphs
onewait.py
1
2938
""" PythonDBAGraphs: Graphs to help with Oracle Database Tuning Copyright (C) 2016 Robert Taft Durrett (Bobby Durrett) 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...
gpl-3.0
-2,918,252,863,514,742,300
29.298969
125
0.730088
false
3.057232
false
false
false
nyu-mll/spinn
python/spinn/models/rl_classifier.py
1
15458
import os import json import math import random import sys import time import gflags import numpy as np from spinn.util import afs_safe_logger from spinn.util.data import SimpleProgressBar from spinn.util.blocks import to_gpu from spinn.util.misc import Accumulator, EvalReporter from spinn.util.logging import stats, ...
mit
-1,203,337,465,858,312,400
33.815315
149
0.566373
false
3.975823
false
false
false
SelvorWhim/competitive
LeetCode/MinimumSubsequenceInNonIncreasingOrder.py
1
1351
# idea: order by size and take largest elements until the sum becomes > sum of remaining class Solution: def minSubsequence(self, nums: List[int]) -> List[int]: nums = sorted(nums, reverse=True) total_sum = sum(nums) running_sum = 0 subseq_len = 0 # how many biggest members we'll nee...
unlicense
6,513,663,138,112,198,000
49.037037
146
0.617321
false
3.950292
false
false
false
Ircam-Web/mezzanine-organization
organization/core/related.py
1
2036
# -*- coding: utf-8 -*- # # Copyright (c) 2016-2017 Ircam # Copyright (c) 2016-2017 Guillaume Pellerin # Copyright (c) 2016-2017 Emilie Zawadzki # This file is part of mezzanine-organization. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
-7,799,400,437,900,264,000
37.415094
77
0.672888
false
4.121457
false
false
false
virtualnobi/MediaFiler
Model/MediaClassHandler.py
1
18503
"""Provides class and element handling functionality. (c) by nobisoft 2016- """ # Imports ## Standard import sys import copy import re import codecs import logging ## Contributed ## nobi ## Project #from .MediaOrganization import MediaOrganization # Package Variables Logger = logging.getLogger...
gpl-3.0
-4,694,349,200,343,272,000
38.755507
156
0.565908
false
4.813476
false
false
false
aurex-linux/virt-manager
virtManager/mediacombo.py
1
6975
# # Copyright (C) 2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed i...
gpl-2.0
7,790,347,630,391,545,000
30.278027
79
0.590108
false
3.739946
false
false
false
AKAMobi/ibot
ibot-kernel/ibot/extractor/startup.py
1
4162
# -*- coding: utf-8 -*- from __future__ import unicode_literals from common import get_regs, get_compile_regs import re REGS = get_compile_regs(get_regs('startup')) def get_startup(document): """ 抽取项目名 @document: Document对象 chunk @rtype: str 项目名 """ global REGS startup = '' ...
apache-2.0
-2,418,756,691,669,638,000
25.984496
61
0.508587
false
2.625455
false
false
false
vinu76jsr/django-memoize
setup.py
1
1282
#!/usr/bin/env python """ django-memoize -------------- **django-memoize** is an implementation of `memoization <http://en.wikipedia.org/wiki/Memoization>`_ technique for Django. You can think of it as a cache for function or method results. """ from setuptools import setup, find_packages setup( name='django-me...
bsd-3-clause
-3,856,313,471,149,989,000
28.813953
74
0.634165
false
3.981366
true
false
false
kinsney/sport
sport/settings.py
1
4682
#coding:utf-8 # -*- coding: utf-8 -*- """ Django settings for sport project. Generated by 'django-admin startproject' using Django 1.9.4. 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...
mit
-3,694,405,221,567,587,000
25.526316
91
0.676808
false
3.130435
false
false
false
demitri/cornish
source/cornish/region/region.py
1
28830
from __future__ import annotations # remove in Python 3.10 # Needed for forward references, see: # https://stackoverflow.com/a/33533514/2712652 import logging from abc import ABCMeta, abstractproperty, abstractmethod from typing import Union, Iterable, Tuple import math from math import radians as deg2rad from math ...
mit
-7,151,365,176,470,967,000
37.906883
191
0.728755
false
3.47475
false
false
false
Coderhypo/UIAMS
manage.py
1
1085
#-*- coding: UTF-8 -*- import os from app import app, db from app.models import User, Role from flask.ext.script import Manager, Server, Shell from flask.ext.migrate import Migrate, MigrateCommand manager = Manager(app) def make_shell_context(): return dict(app=app, db=db, User=User, Role=Role) manager.add_comma...
lgpl-3.0
-1,176,110,634,197,252,400
24.690476
68
0.639481
false
3.340557
false
false
false
maestromusic/maestro
maestro/core/domains.py
1
5562
# -*- coding: utf-8 -*- # Maestro Music Manager - https://github.com/maestromusic/maestro # Copyright (C) 2014-2015 Martin Altmayer, Michael Helmling # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foun...
gpl-3.0
-4,220,954,320,742,945,000
33.546584
107
0.647609
false
4.050983
false
false
false
PaloAltoNetworks/minemeld-core
minemeld/flask/config.py
1
5920
# Copyright 2015-2016 Palo Alto Networks, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
661,309,615,503,957,100
26.793427
82
0.572635
false
3.897301
true
false
false
jopohl/urh
src/urh/dev/native/SoundCard.py
1
4702
from collections import OrderedDict from multiprocessing import Array from multiprocessing.connection import Connection import numpy as np import pyaudio from urh.dev.native.Device import Device from urh.util.Logger import logger class SoundCard(Device): DEVICE_LIB = pyaudio ASYNCHRONOUS = False DEVICE_...
gpl-3.0
-7,528,737,987,523,719,000
37.227642
102
0.574011
false
4.313761
false
false
false
mario23285/ProyectoElectrico
src/Leg.py
1
6591
""" UNIVERSIDAD DE COSTA RICA Escuela de Ingeniería Eléctrica IE0499 | Proyecto Eléctrico Mario Alberto Castresana Avendaño A41267 Programa: BVH_TuneUp ------------------------------------------------------------------------------- archivo: Leg.py descripción: Este archivo contiene la clase Leg...
gpl-2.0
-7,727,383,819,763,163,000
38.93865
96
0.567896
false
3.126801
false
false
false
cryptapus/electrum-uno
gui/qt/__init__.py
1
7412
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
mit
-6,099,789,603,438,935,000
34.980583
118
0.642876
false
3.84839
true
false
false
gladsonvm/haystackdemo
lib/python2.7/site-packages/pyelasticsearch/client.py
1
39599
# -*- coding: utf-8 -*- from __future__ import absolute_import from datetime import datetime from operator import itemgetter from functools import wraps from logging import getLogger import re from six import (iterkeys, binary_type, text_type, string_types, integer_types, iteritems, PY3) from six.move...
mit
5,228,932,564,129,046,000
38.16815
96
0.576429
false
4.35441
false
false
false
AbhiAgarwal/prep
python/trie.py
1
3121
class Node: """Node for Python Trie Implementation""" def __init__(self): self.word = None self.nodes = {} # dict of nodes def __get_all__(self): """Get all of the words in the trie""" x = [] for key, node in self.nodes.iteritems() : ...
mit
-270,410,005,839,756,830
30.22
92
0.55495
false
3.693491
false
false
false
tobiz/OGN-Flight-Logger_V2
flogger_email_msg.py
1
1204
import smtplib import base64 from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email import encoders from __builtin__ import file import settings import os import datetime def email_msg(sender, receiver, msg, ...
gpl-3.0
594,446,723,311,701,000
29.897436
94
0.662791
false
3.449857
false
false
false
coldfix/udiskie
udiskie/tray.py
1
16508
""" Tray icon for udiskie. """ from gi.repository import Gio from gi.repository import Gtk from .async_ import run_bg, Future from .common import setdefault, DaemonBase, cachedmethod from .locale import _ from .mount import Action, prune_empty_node from .prompt import Dialog from .icons import IconDist import os _...
mit
6,167,450,907,907,872,000
32.148594
78
0.558941
false
4.127
false
false
false
DavidAndreev/indico
indico/modules/events/timetable/legacy.py
1
15015
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
6,942,691,855,398,678,000
45.775701
119
0.599734
false
4.112572
false
false
false
czayas/agenda
repl.py
1
3955
#!/usr/bin/env python3 """ Módulo repl: Interfaz de usuario en modo consola (vista). Proyecto de ejemplo - Paradigmas de la Programación Autor: Carlos Zayas (czayas en gmail) """ import sys from traceback import format_exc from collections.abc import Iterable try: # El módulo readline agrega autocompletado e histo...
mit
-375,912,725,944,871,900
30.214286
78
0.586575
false
3.477454
false
false
false
DedMemez/ODS-August-2017
catalog/CatalogBasketItem.py
1
3029
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.catalog.CatalogBasketItem from panda3d.core import Datagram import CatalogItem from toontown.estate import GardenGlobals from toontown.toonbase import ToontownGlobals from direct.actor import Actor from toontown.toonbase import TTLocalizer from ...
apache-2.0
-6,348,996,229,263,607,000
32.83908
120
0.698911
false
3.684915
false
false
false
ajerneck/rand-art
scrape.py
1
2246
import requests import bs4 import re import random URL = 'http://longform.org' def parse_page(url): page = requests.get(url) soup = bs4.BeautifulSoup(page.text) posts = soup.select('div.post') ## filter out posts whose second class element is not empty, because those are collections or sponsored posts...
gpl-2.0
5,098,242,492,153,903,000
27.794872
166
0.57569
false
3.203994
false
false
false
tuskar/tuskar-ui
openstack_dashboard/dashboards/infrastructure/models.py
1
1639
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, 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 # #...
apache-2.0
960,798,619,425,038,600
33.145833
78
0.732764
false
4.007335
false
false
false
DalenWBrauner/FloridaDataOverlay
Website/Florida_Data_Overlay/Overlay/migrations/0003_auto__del_document__add_upload.py
1
2765
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'Document' db.delete_table(u'Overlay_document') ...
mit
-7,312,602,605,645,666,000
42.904762
92
0.554069
false
3.686667
false
false
false
michaelb-01/pipe
scripts/python/createThumbnails_v004.py
1
2986
import os import subprocess import json import shlex import math import nuke def probeFile(file): cmd = "ffprobe -v quiet -print_format json -show_streams" # find video duration # ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 # find video frame rate (no...
mit
7,450,704,990,378,564,000
24.965217
117
0.581045
false
3.44406
false
false
false
mpuig/python-goose
goose/images/ImageUtils.py
1
4157
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.c...
apache-2.0
-290,774,615,213,729,860
30.740458
84
0.638201
false
4.408271
true
false
false
tuborgclassic/carlsberg
settings.py
1
2487
from os.path import exists, abspath, dirname, join import misc THIS_DIR = dirname(abspath(__file__)) # this is a personal access token used by chaosbot to perform merges and other # api requests. it is a secret, and lives on the server, but since chaosbot has # access to this secret file, it can be manipulated into...
mit
-5,332,340,821,084,454,000
34.028169
82
0.74226
false
3.392906
false
false
false
8u1a/plaso
plaso/parsers/skydrivelogerr.py
1
8915
# -*- coding: utf-8 -*- """This file contains SkyDrive error log file parser in plaso.""" import logging import pyparsing from plaso.events import time_events from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers import manager from plaso.parsers import text_parser __author__ = 'Francesc...
apache-2.0
-6,098,716,662,991,127,000
34.803213
78
0.680538
false
3.682363
false
false
false
brianbeliveau/OligoMiner
probeTm.py
1
7717
#!/usr/bin/env python # -------------------------------------------------------------------------- # OligoMiner # probeTm.py # # (c) 2017 Molecular Systems Lab # # Wyss Institute for Biologically-Inspired Engineering # Harvard University # # Permission is hereby granted, free of charge, to any person obtaining a copy #...
mit
4,938,888,727,236,498,000
41.401099
80
0.585979
false
4.221554
false
false
false
Zloool/manyfaced-honeypot
manyfaced/common/utils.py
1
1349
import time import pickle from socket import error as socket_error from status import CLIENT_TIMEOUT def dump_file(data): try: with file('temp.db') as f: string_file = f.read() db = pickle.loads(string_file) except: db = list() db.append(data) with open('temp.db', ...
mit
-9,115,461,342,038,738,000
24.942308
76
0.564863
false
4.112805
false
false
false
mitsuhiko/solace
solace/badges.py
1
7311
# -*- coding: utf-8 -*- """ solace.badges ~~~~~~~~~~~~~ This module implements the badge system. :copyright: (c) 2010 by the Solace Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from operator import attrgetter from solace.i18n import lazy_gettext, _ from sol...
bsd-3-clause
-3,068,501,602,873,117,000
32.672811
88
0.626249
false
3.316841
false
false
false
bakkerjarr/ACLSwitch
Ryu_Application/controller.py
1
11192
# Copyright 2015 Jarrod N. Bakker # # 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 writ...
apache-2.0
7,496,221,329,370,704,000
40.147059
103
0.586401
false
4.193331
false
false
false
jcrudy/grm
grm/binomial_earth_example.py
1
1250
import numpy from grm import GeneralizedRegressor, BinomialLossFunction, LogitLink import scipy.stats from pyearth.earth import Earth numpy.seterr(all='raise') m = 1000 n = 10 p = 10 def earth_basis(X, vars, parents, knots, signs): p = vars.shape[0] B = numpy.empty(shape=(m,p+1)) B[:,0] = 1.0 for i in ...
gpl-3.0
93,117,187,002,019,150
34.714286
98
0.6512
false
2.587992
false
false
false
pcolmant/repanier
repanier/xlsx/xlsx_stock.py
1
24914
import repanier.apps from django.db import transaction from django.utils.translation import ugettext_lazy as _ from repanier.const import * from repanier.models.offeritem import OfferItemReadOnly from repanier.models.product import Product from repanier.packages.openpyxl import load_workbook from repanier.packages.open...
gpl-3.0
-446,838,558,719,094,400
46.911538
132
0.457333
false
4.294777
false
false
false
1and1/confluencer
src/confluencer/tools/content.py
1
10540
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Tools to discover and modify content. """ # Copyright © 2015 1&1 Group <git@1and1.com> # # 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 Lic...
apache-2.0
-8,970,102,084,358,917,000
39.69112
127
0.567226
false
3.441868
false
false
false
kaushik94/sympy
sympy/utilities/autowrap.py
3
40995
"""Module for compiling codegen output, and wrap the binary for use in python. .. note:: To use the autowrap module it must first be imported >>> from sympy.utilities.autowrap import autowrap This module provides a common interface for different external backends, such as f2py, fwrap, Cython, SWIG(?) etc. (Curren...
bsd-3-clause
163,633,342,712,998,180
35.570027
115
0.587169
false
4.04011
false
false
false
biorack/metatlas
metatlas/io/write_utils.py
1
2914
""" Utility functions used in writing files""" import filecmp import logging import os import tempfile logger = logging.getLogger(__name__) def make_dir_for(file_path): """makes directories for file_path if they don't already exist""" directory = os.path.dirname(file_path) if directory != "": os...
bsd-3-clause
6,220,869,091,396,560,000
33.690476
97
0.668497
false
4.156919
false
false
false
PetePriority/home-assistant
homeassistant/components/zone/zone.py
1
3191
"""Component entity and functionality.""" from homeassistant.const import ATTR_HIDDEN, ATTR_LATITUDE, ATTR_LONGITUDE from homeassistant.helpers.entity import Entity from homeassistant.loader import bind_hass from homeassistant.util.async_ import run_callback_threadsafe from homeassistant.util.location import distance ...
apache-2.0
-3,663,965,267,479,924,700
28.009091
79
0.62833
false
4.220899
false
false
false
jmsleiman/hypercube-election
hypercube.py
1
5446
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 Joseph M. Sleiman # This program is free software; you can redistribute it and/or # modify it under the terms of the LGPLv2.1 or LGPLv3 License. import math import node class HyperCube(object): def __init__(self, dimension, nodeValues): ### ...
lgpl-2.1
453,523,443,621,024,500
33.251572
125
0.605215
false
2.80577
false
false
false
ChillarAnand/junction
junction/base/emailer.py
1
1236
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals # Standard Library from os import path # Third Party Stuff from django.conf import settings from django.core.mail import send_mail from django.template.loader import render_to_string def send_email(to, context, template_dir): """Re...
mit
-6,158,837,254,071,177,000
31.526316
98
0.695793
false
3.614035
false
false
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/status/cmd/devicequery/type_Params.py
1
3783
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: type_Params.py from types import * import array PARAMS_DEVICE_TYPE_USER_SPECIFIC = 0 PARAMS_DEVICE_TYPE_U1394 = 1 PARAMS_DEVICE_TYPE_ADAPTER = 2 PARA...
unlicense
8,606,701,729,567,228,000
32.785714
90
0.686228
false
3.073111
false
false
false
metacloud/python-glanceclient
glanceclient/v1/image_members.py
1
3610
# Copyright 2012 OpenStack Foundation # 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,861,809,855,356,957,000
34.048544
78
0.579778
false
3.860963
false
false
false
Juniper/ceilometer
ceilometer/compute/virt/vmware/vsphere_operations.py
1
10191
# Copyright (c) 2014 VMware, 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...
apache-2.0
-2,132,534,185,499,780,900
43.308696
79
0.631538
false
4.185216
false
false
false
YulongWu/my-utils
yidian/WYLDocFeatureDumpFetcher.py
1
6233
#coding: u8 import sys reload(sys) sys.setdefaultencoding('u8') import urllib import urllib2 import json import traceback import datetime import re # call format: class WYLDocFeatureDumpFetcher(object): serve_url = "http://10.111.0.54:8025/service/feature?docid={0}" #url for doc feature dump serve_url = "h...
mit
-2,834,678,351,225,799,000
36.654545
177
0.589087
false
3.411862
false
false
false
dplusic/daff
scripts/python23.py
1
1683
from __future__ import unicode_literals, print_function try: import builtins except: import __builtin__ builtins = __builtin__ import functools if hasattr(builtins,'unicode'): # python2 variant hxunicode = builtins.unicode hxunichr = builtins.unichr hxrange = xrange def hxnext(x): ...
mit
7,958,329,564,262,106,000
31.365385
111
0.54902
false
3.707048
false
false
false
p4r4digm/todo-helper
src/todoLogging.py
1
1872
from src.todoMelvin import settings from datetime import datetime from subprocess import check_output logSender = None class WarningLevels: Debug = {'level' : 0, 'tag' : 'DEBUG'} Info = {'level' : 1, 'tag' : 'INFO'} Warn = {'level' : 2, 'tag' : 'WARNING'} Fatal = {'level' : 3, 'tag' : 'FAT...
mit
-1,290,323,906,406,167,300
29.688525
88
0.498932
false
3.957717
false
false
false
jiadaizhao/LeetCode
0001-0100/0005-Longest Palindromic Substring/0005-Longest Palindromic Substring.py
1
1407
class Solution: def longestPalindrome(self, s): """ :type s: str :rtype: str """ n = len(s) maxLen, maxStart = 0, 0 for i in range(n): l, left, right = 1, i - 1, i + 1 while left >= 0 and right < n and s[left] == s[right]: ...
mit
-528,725,900,913,107,800
26.588235
66
0.340441
false
3.580153
false
false
false
aio-libs/aiohttp
aiohttp/web_server.py
1
2247
"""Low level HTTP server.""" import asyncio import warnings from typing import Any, Awaitable, Callable, Dict, List, Optional # noqa from .abc import AbstractStreamWriter from .http_parser import RawRequestMessage from .streams import StreamReader from .web_protocol import RequestHandler, _RequestFactory, _RequestHan...
apache-2.0
-5,668,502,912,688,113,000
32.044118
88
0.634179
false
4.39726
false
false
false
Lukas-Stuehrk/selenese
selenese/patterns.py
1
1351
import re from fnmatch import fnmatch class Pattern(object): def __init__(self, pattern_string): self.pattern_string = pattern_string class ExactPattern(Pattern): def compare(self, string): return self.pattern_string == string class RegexPattern(Pattern): def compare(self, string): ...
bsd-3-clause
8,510,309,876,751,397,000
29.727273
78
0.670614
false
4.057057
false
false
false