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
timgrossmann/InstaPy
instapy/time_util.py
1
1588
"""Helper module to handle time related stuff""" from time import sleep as original_sleep from datetime import datetime from random import gauss from random import uniform # Amount of variance to be introduced # i.e. random time will be in the range: TIME +/- STDEV % STDEV = 0.5 sleep_percentage = 1 sleep_percentage =...
gpl-3.0
-4,373,231,225,892,659,700
24.612903
73
0.654912
false
3.789976
false
false
false
PeridotYouClod/gRPC-Makerboards
DaoServer.py
1
2008
import concurrent.futures as futures import grpc import time import ProtoConfig import generated.proto_out.dao_pb2 as dao_pb2 import generated.proto_out.dao_pb2_grpc as dao_grpc from pylibs.Database import Mongo _ONE_DAY_IN_SECONDS = 60 * 60 * 24 class Dao(dao_grpc.DaoServicer): def __init__(self, sensor_db): ...
mit
6,045,501,900,179,157,000
30.375
80
0.667829
false
3.380471
false
false
false
tind/invenio-communities
tests/test_utils.py
1
2203
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016 CERN. # # Invenio 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...
gpl-2.0
-8,326,078,723,156,442,000
35.716667
79
0.687245
false
3.990942
false
false
false
viaregio/django-newsletter
newsletter/admin_utils.py
1
1463
from django.http import Http404 from django.utils.functional import update_wrapper from django.utils.translation import ugettext_lazy as _ from django.contrib.admin.util import unquote from django.utils.encoding import force_unicode class ExtendibleModelAdminMixin(object): def _getobj(self, request, object_id):...
agpl-3.0
-6,176,417,406,292,895,000
33.023256
77
0.549556
false
4.515432
false
false
false
zhinaonet/sqlmap-z
extra/mssqlsig/update.py
1
5109
#!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import codecs import os import re import urllib2 import urlparse from xml.dom.minidom import Document # Path to the XML file with signatures MSSQL_XML = os.path.abspath("../...
gpl-3.0
-4,861,813,990,019,743,000
36.291971
153
0.614014
false
4.177433
false
false
false
ekansa/open-context-py
opencontext_py/libs/binaryfiles.py
1
9846
import os, sys, shutil import codecs import requests from io import BytesIO from time import sleep from internetarchive import get_session, get_item from django.conf import settings from django.utils.http import urlquote, quote_plus, urlquote_plus from opencontext_py.libs.generalapi import GeneralAPI from opencontext_p...
gpl-3.0
-2,155,670,723,415,455,500
43.355856
131
0.538899
false
4.100791
false
false
false
joerick/pyinstrument
pyinstrument/renderers/jsonrenderer.py
1
2646
import json from pyinstrument.renderers.base import Renderer from pyinstrument import processors # note: this file is called jsonrenderer to avoid hiding built-in module 'json'. encode_str = json.encoder.encode_basestring def encode_bool(a_bool): return 'true' if a_bool else 'false' class JSONRenderer(Renderer...
bsd-3-clause
8,942,332,713,662,596,000
38.492537
100
0.62963
false
3.66482
false
false
false
B3AU/micropython
PDM.py
1
1141
__author__ = 'beau' import pyb class PDM(): def __init__(self,pout='X11',tim=4,freq=50): """ :param pout: output pin nr :param tim: timer number :param freq: frequency of the bitstream """ self.max = 2**24-1#2**31-1 crashes with larger ints? 24bit resolution is fin...
lgpl-3.0
8,587,209,012,637,136,000
24.954545
95
0.533742
false
3.426426
false
false
false
oliviertilmans/ipmininet
ipmininet/router/config/openrd.py
1
14773
from .base import RouterDaemon from .utils import ConfigDict class OpenrDaemon(RouterDaemon): """The base class for the OpenR daemon""" NAME = 'openr' @property def STARTUP_LINE_EXTRA(self): # Add options to the standard startup line return '' @property def startup_line(self...
gpl-2.0
7,937,481,067,980,952,000
58.329317
80
0.658363
false
4.54414
true
false
false
initbrain/intelwiz
intelwiz/core/flowchart/Node.py
1
26899
# -*- coding: utf-8 -*- from pyqtgraph.Qt import QtCore, QtGui from pyqtgraph.graphicsItems.GraphicsObject import GraphicsObject import pyqtgraph.functions as fn from .Terminal import * from pyqtgraph.pgcollections import OrderedDict from pyqtgraph.debug import * import numpy as np from .eq import * def strDict(d): ...
mit
7,973,248,571,719,320,000
38.326023
570
0.583479
false
4.372399
false
false
false
rodo/pyrede
pyrede/provider/utils/distro.py
1
1219
# -*- coding: utf-8 -*- # # Copyright (c) 2013 Rodolphe Quiédeville <rodolphe@quiedeville.org> # # 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 #...
gpl-3.0
6,025,037,577,612,015,000
31.918919
75
0.698686
false
3.625
false
false
false
dhis2/dhis2-python
dhis2_core/src/dhis2/e2b/common.py
1
2145
from datetime import datetime from typing import Union from .models.e2b import AttributeValue, Enrollment, Event, EventDataValue, TrackedEntity def date_format_102(dt: datetime) -> str: return dt.strftime("%Y%m%d") def date_format_204(dt: datetime) -> str: return dt.strftime("%Y%m%d%H%M%S") def get_attri...
bsd-3-clause
2,216,280,784,871,009,300
21.819149
102
0.617249
false
3.182493
false
false
false
phbono/openfisca-web
simulation/views_old.py
1
3992
# -*-coding:Utf-8 -* from django.http import HttpResponse from django.shortcuts import render from simulation.models import IndividualForm from django.forms.formsets import formset_factory, BaseFormSet from datetime import datetime from core.utils import Scenario from simulation.lanceur import Simu class BaseSc...
gpl-3.0
588,075,695,828,365,300
31.463415
101
0.576403
false
4.085977
false
false
false
ryad-eldajani/dbs_project_pub
scraper_heise.py
1
1689
import bs4 import requests import csv import re import operator def get_page(url): """ Returns a BeautifulSoup object from an URL request :param url: URL :return: BeautifulSoup object """ r = requests.get(url) data = r.text return bs4.BeautifulSoup(data, "lxml") def main(): """ ...
mit
-5,539,494,937,456,852,000
26.704918
80
0.569568
false
3.728477
false
false
false
pulse-project/mss
mss/www/settings.py
1
4685
# -*- coding: UTF-8 -*- # # (c) 2012 Mandriva, http://www.mandriva.com/ # # This file is part of Management Server Setup # # MSS 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,...
gpl-3.0
-7,318,028,767,869,020,000
25.76
99
0.580824
false
3.61064
false
false
false
tunetosuraj/spectrum
recommenders/document_api.py
1
1706
import nltk, string from sklearn.feature_extraction.text import TfidfVectorizer from items.models import BookProfile from recommenders.models import DocToDocLink class DocumentSimilarity: def __init__(self, doc1=None, doc2=None): self.b1 = doc1 self.b2 = doc2 def calculate_cosine(self): ...
agpl-3.0
-348,521,159,580,769,150
32.45098
146
0.632474
false
3.676724
false
false
false
jdvelasq/cashflows
cashflows/utilityfun.py
1
1162
""" Economic utility functions =============================================================================== Overview ------------------------------------------------------------------------------- Functions in this module ------------------------------------------------------------------------------- """ from ...
mit
-1,251,830,415,994,589,000
21.784314
79
0.451807
false
4.120567
false
false
false
dmargala/tpcorr
tpcorr/observation.py
1
17935
## Observation correction model import numpy as np import astropy.time import astropy.coordinates import astropy.units as u import astropy.units.imperial import astropy.units.cds import bossdata import specsim import tpcorr.pointing import tpcorr.guider import tpcorr.acceptance_model class Observation(object): ...
mit
-6,213,619,020,246,203,000
52.537313
145
0.633789
false
3.444402
false
false
false
transientskp/tkp
tkp/db/alchemy/image.py
1
8193
import math from datetime import datetime from tkp.db.model import Frequencyband, Skyregion, Image, Dataset from tkp.utility.coordinates import eq_to_cart from sqlalchemy import func, cast from sqlalchemy.dialects.postgresql import DOUBLE_PRECISION as Double def get_band(session, dataset, freq_eff, freq_bw, freq_bw_...
bsd-2-clause
2,059,044,770,803,609,900
40.378788
118
0.620896
false
3.644573
false
false
false
TiddlySpace/tiddlyspace
tiddlywebplugins/tiddlyspace/web.py
1
2486
""" Web related utility functions. """ from httpexceptor import HTTP404 from tiddlyweb.model.policy import PermissionsError from tiddlyweb.model.recipe import Recipe from tiddlyweb.model.tiddler import Tiddler from tiddlyweb.store import StoreError from tiddlywebplugins.tiddlyspace.space import Space def determine_...
bsd-3-clause
-7,599,089,718,721,337,000
30.468354
76
0.626307
false
3.661267
false
false
false
craigmbooth/chicago_neighborhood_finder
chicago_community_areas.py
1
4133
import requests import os import zipfile import StringIO import glob import shapefile import tempfile import json def point_inside_polygon(x,y,poly): """Return True if the point described by x, y is inside of the polygon described by the list of points [(x0, y0), (x1, y1), ... (xn, yn)] in ``poly`` Co...
apache-2.0
-5,800,915,206,791,777,000
32.601626
80
0.602952
false
3.550687
false
false
false
aileron-split/aileron-web
server/news/serializers.py
1
2606
from rest_framework import serializers from server import settings from .models import Article from team.serializers import MemberShortSerializer from gallery.serializers import AlbumSerializer class ArticleSerializer(serializers.ModelSerializer): card_sm_image = serializers.SerializerMethodField() card_mat...
gpl-3.0
-7,981,823,308,071,281,000
29.658824
96
0.60284
false
3.984709
false
false
false
asrivat1/word2vec
scripts/doc2vec.py
1
2019
#!/usr/bin/pypy import sys import utilities # This file will compute a vector representation # of each document, based on the words in that document. def readInput(): if len(sys.argv) < 4: print "./doc2vec.py <cluster_file> <vector_file> <doc_file> <output_file>" sys.exit() clustFileName = s...
apache-2.0
1,266,811,214,027,012,000
25.220779
82
0.637444
false
3.787992
false
false
false
Southpaw-TACTIC/TACTIC
src/pyasm/common/container.py
1
6371
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
-1,837,061,838,531,271,000
22.167273
73
0.585622
false
4.134328
false
false
false
pyannote/pyannote-audio
pyannote/audio/core/task.py
1
14390
# MIT License # # Copyright (c) 2020-2021 CNRS # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pu...
mit
-7,840,265,510,211,118,000
32.774648
92
0.62712
false
4.310365
false
false
false
butterscotchstallion/SpiffyRPG
SpiffyRPG/SpiffyWorld/unit_level.py
1
2607
#!/usr/bin/env python # -*- coding: utf-8 -*- class UnitLevel: """ Functionality related to how much xp a unit has """ def get_level_by_xp(self, total_experience): player_level = 1 levels = self.get_levels() for level, experience_needed in levels: if total_experi...
mit
723,719,038,350,232,700
25.333333
75
0.380898
false
4.035604
false
false
false
PuercoPop/EleccionesPeru
Elecciones/views.py
1
1263
# coding=utf8 # Create your views here. from django.shortcuts import render from django.http import HttpResponse from ONPEcrawler import ONPEcrawler import Elecciones.models as m def index(request): return render(request,'index.html') def seed(request): crawler = ONPEcrawler(url = "http://www.web.onpe....
mit
-7,431,224,069,060,348,000
27.704545
127
0.697546
false
3.189394
false
false
false
bellowsj/aiopogo
aiopogo/pogoprotos/networking/platform/responses/plat_eight_response_pb2.py
1
2327
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: pogoprotos/networking/platform/responses/plat_eight_response.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _mes...
mit
-7,797,228,191,189,211,000
32.724638
210
0.758917
false
3.324286
false
true
false
chandangreddy/autotuner
individual.py
1
13400
import timeit import os import re import debug import compiler_flags import config import enums import collections import subprocess import threading import internal_exceptions import time class EndOfQueue: def __init__(self): pass def get_fittest(population): fittest = None for individual in po...
mit
1,518,361,591,463,232,800
38.64497
165
0.578209
false
3.871713
true
false
false
swipeat/back
interfaces/login.py
1
1560
# # list.py : Interfaces to access list. # from db import user from interfaces import app import json from flask import request from flask import make_response from flask import session # /login : Login to user's account @app.route("/login", methods=["POST"]) def login(): """ Login to user's account """ # Ge...
bsd-3-clause
-8,406,343,558,309,903,000
25.913793
99
0.633974
false
4
false
false
false
iandees/all-the-places
locations/spiders/jamba_juice.py
1
3672
import json import scrapy from six.moves.urllib.parse import urlencode import re from locations.items import GeojsonPointItem DAYS = { '1': 'Mo', '2': 'Tu', '3': 'We', '4': 'Th', '5': 'Fr', '6': 'Sa', '7': 'Su' } class JambaJuiceSpider(scrapy.Spider): name = "jambajuice" allowed_doma...
mit
2,389,071,301,505,917,000
32.688073
91
0.455065
false
3.865263
false
false
false
alephdata/ingestors
ingestors/media/image.py
1
2561
import logging from io import BytesIO from PIL import Image, ExifTags from followthemoney import model from ingestors.ingestor import Ingestor from ingestors.support.ocr import OCRSupport from ingestors.support.timestamp import TimestampSupport from ingestors.exc import ProcessingException log = logging.getLogger(__n...
mit
7,502,466,121,803,189,000
31.0125
77
0.565795
false
3.909924
false
false
false
cthit/singIT
utilities/singIT-scraper.py
1
4562
#!/usr/bin/env python3 from pathlib import Path from PIL import Image, ImageFile import requests import time import chardet import hashlib import json import argparse import sys ImageFile.LOAD_TRUNCATED_IMAGES = True config = {} api_key = '' image_dir = Path('.') / 'images' def main(args): l = [] root = get_roo...
mit
-8,570,207,953,481,354,000
26.648485
90
0.620342
false
3.320233
true
false
false
noba3/KoTos
addons/plugin.video.movie25/resources/libs/live/nhl.py
1
7302
import urllib,urllib2,re,cookielib,os,sys import xbmc, xbmcgui, xbmcaddon, xbmcplugin,time from resources.libs import main #Mash Up - by Mash2k3 2012. from t0mm0.common.addon import Addon addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) addon = Addon('plugin.video.movie25', sys.argv) art = ma...
gpl-2.0
-4,919,304,330,789,671,000
53.088889
231
0.556012
false
3.326651
false
false
false
jthi3rry/hasoffers
tests/test_api.py
1
4154
import unittest from tests import mocks from hasoffers.api import Client, BrandClient, AffiliateClient class TestBrandAPI(unittest.TestCase): def setUp(self): self.client = BrandClient("token", "id") def test_client(self): self.assertEqual("token", self.client.network_token) self.ass...
mit
6,900,767,210,658,063,000
47.870588
101
0.590997
false
4.495671
true
false
false
red-hood/calendarserver
contrib/performance/_event_change.py
1
3820
## # Copyright (c) 2010-2015 Apple 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 applicab...
apache-2.0
-910,572,483,388,707,700
31.649573
109
0.674607
false
3.886063
false
false
false
hrhtspr/IkaLog
ikalog/utils/__init__.py
1
1183
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
apache-2.0
-2,459,047,259,338,792,400
38.433333
75
0.782756
false
3.409222
false
false
false
quantopian/zipline
zipline/examples/__init__.py
1
2271
from importlib import import_module import os from toolz import merge from trading_calendars import register_calendar, get_calendar from zipline import run_algorithm # These are used by test_examples.py to discover the examples to run. def load_example_modules(): example_modules = {} for f in os.listdir(os....
apache-2.0
26,062,786,449,103,360
25.717647
73
0.620872
false
3.692683
false
false
false
jokey2k/sentry
src/sentry/models/authidentity.py
1
1441
from __future__ import absolute_import, print_function from datetime import timedelta from django.db import models from django.utils import timezone from jsonfield import JSONField from sentry.db.models import FlexibleForeignKey, Model class AuthIdentity(Model): user = FlexibleForeignKey('sentry.User') auth...
bsd-3-clause
8,686,039,802,315,802,000
32.511628
81
0.66204
false
4.117143
false
false
false
ATIX-AG/foreman-ansible-modules
plugins/modules/compute_resource.py
1
14623
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) Philipp Joos 2017 # (c) Baptiste Agasse 2019 # (c) Mark Hlawatschek 2020 # # 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...
gpl-3.0
-3,207,990,238,659,505,700
29.150515
158
0.592491
false
3.917225
false
false
false
clld/tsezacp
tsezacp/models.py
1
3804
from zope.interface import implementer from sqlalchemy import ( Column, Unicode, Integer, ForeignKey, ) from sqlalchemy.orm import relationship, backref from sqlalchemy.ext.declarative import declared_attr from clld import interfaces from clld.db.meta import Base, CustomModelMixin from clld.db.models.c...
apache-2.0
-3,154,290,188,002,359,300
31.793103
87
0.667981
false
3.535316
false
false
false
nttks/edx-platform
cms/djangoapps/contentstore/views/user.py
1
8092
from django.core.exceptions import PermissionDenied from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django.utils.translation import ugettext as _ from django.views.decorators.http import require_POST...
agpl-3.0
-6,771,547,991,346,686,000
39.258706
125
0.673381
false
4.078629
false
false
false
gkc1000/pyscf
pyscf/nao/m_csphar.py
1
2662
# Copyright 2014-2018 The PySCF Developers. 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 appl...
apache-2.0
7,247,452,411,345,700,000
27.319149
163
0.572126
false
2.840982
false
false
false
VCTLabs/openadams
_oatr_importwizard.py
1
7291
# -*- coding: utf-8 -*- # $Id$ # ------------------------------------------------------------------- # Copyright 2012 Achim K�hler # # This file is part of openADAMS. # # openADAMS 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...
gpl-2.0
7,267,512,760,369,657,000
46.032258
120
0.64124
false
4.018192
true
false
false
Mirantis/stackalytics
stackalytics/dashboard/decorators.py
1
19240
# Copyright (c) 2013 Mirantis 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 writi...
apache-2.0
5,466,360,063,047,401,000
32.873239
79
0.553846
false
4.135856
false
false
false
puttarajubr/commcare-hq
corehq/apps/sms/backend/http_api.py
1
5139
import re from urllib import urlencode from urllib2 import urlopen import sys from corehq.apps.sms.mixin import SMSBackend, BackendProcessingException from corehq.apps.sms.forms import BackendForm from corehq.apps.reminders.forms import RecordListField from django.forms.fields import * from django.core.exceptions impor...
bsd-3-clause
7,341,694,058,746,408,000
34.441379
148
0.610235
false
4.121091
false
false
false
yahyanik/phd_research
detection.py
1
3222
import numpy as np import cv2 #import matplotlib.pyplot as plt from collections import deque import imutils import argparse import sys ap = argparse.ArgumentParser() ap.add_argument("-b", "--buffer", type=int, default=32, help="max buffer size") ap.add_argument("-v", "--video", default=0, help="path to the (optiona...
mit
-7,583,451,804,171,879,000
44.380282
122
0.598076
false
2.929091
false
false
false
fnoeding/exoself
src/compiler/ast2llvm.py
1
36178
# # The BSD License # # Copyright (c) 2008, Florian Noeding # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # li...
bsd-3-clause
6,913,820,680,705,112,000
31.330652
238
0.71842
false
3.181882
false
false
false
jkarabas/snarkx
snarkx/io/miscs.py
1
6382
import os import re import networkx as nx import string from os.path import abspath, expanduser, isdir, join, isfile, splitext from os import walk from random import randint from snarkx.common import FrozenDic from snarkx.io import GraphReaderBA, GraphReaderG6, GraphWriterBA, GraphWriterG6, GraphReaderS6, GraphWrite...
bsd-3-clause
421,645,369,970,011,000
28.141553
115
0.558446
false
3.672037
false
false
false
bmaupin/junkpile
python/wordpress-mu/wpmu_usage_data.py
1
6008
#!/usr/bin/env python import MySQLdb import os import sys import wpmu home = os.getenv('HOME') daily_filename = '%s/Desktop/daily.txt' % (home) total_filename = '%s/Desktop/total.txt' % (home) daily_users_filename = '%s/Desktop/daily_users.txt' % (home) total_users_filename = '%s/Desktop/total_users.txt' % (home) ...
mit
-1,525,131,400,748,672,000
33.337143
91
0.633822
false
3.747973
false
false
false
sourcepole/qgis-openlayers-plugin
openlayers/plugin_upload.py
1
2703
#!/usr/bin/env python # This script uploads a plugin package on the server # # Author: A. Pasotti, V. Picavet import xmlrpclib, sys, os import getpass from optparse import OptionParser # Configuration PROTOCOL='https' SERVER='plugins.qgis.org' PORT='443' ENDPOINT='/plugins/RPC2/' VERBOSE=False def main(options, args...
gpl-2.0
2,325,613,006,822,997,500
34.103896
92
0.610433
false
3.754167
false
false
false
mouradmourafiq/data-analysis
quora/feed_optimizer.py
1
11042
# -*- coding: utf-8 -*- """ Created on Jan 11, 2013 @author: Mourad Mourafiq About: This is an attempt to solve the Quora challenge Feed Optimizer. """ import itertools import copy import math from random import choice, random BRUTE_FORCE = 1 ANNEALING_SIMULATED = 2 class Story(object): """ Story object ...
bsd-2-clause
-8,738,647,890,914,487,000
32.978462
112
0.562851
false
4.117077
false
false
false
004helix/bybankpy
contrib/insync-add-shortcut.py
1
1123
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from six.moves import input import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import insync def main(): i = insync.client(os.path.expanduser('~/lib/insync.db')) i.login() i...
gpl-3.0
4,726,185,302,800,300,000
25.738095
62
0.51024
false
3.819728
false
false
false
Harvard-ATG/HarvardCards
flash/decorators.py
1
1485
from functools import wraps from django.core.exceptions import PermissionDenied from flash.models import Deck from flash.services import has_role_with_request def check_role(roles, entity_type): """ A decorator that checks to see if a user has the required role in a collection. Allows the user to enter t...
bsd-3-clause
7,790,181,930,741,742,000
39.135135
125
0.617508
false
4.419643
false
false
false
sehoonha/optskills
optskills/problems/gp_jump.py
1
6468
import numpy as np from numpy.linalg import norm from sim_problem import SimProblem, STR import phase_controller import math class GPJump(SimProblem): def __init__(self): super(GPJump, self).__init__('urdf/BioloidGP/BioloidGP.URDF', fps=1000.0) self.__init__sim...
mit
991,349,405,432,925,200
32.863874
78
0.493816
false
2.921409
false
false
false
strazzere/pfp
setup.py
1
1092
#!/usr/bin/env python # encoding: utf-8 import os, sys from setuptools import setup setup( # metadata name='pfp', description='An 010 template interpreter for Python', long_description=""" pfp is an 010 template interpreter for Python. It accepts an input data stream and an 010 template and return...
mit
4,640,449,585,166,833,000
33.125
105
0.67674
false
3.4125
false
false
false
nguy/pyparticleprobe
pyparticleprobe/dsd_calcs/attenuation.py
1
3961
""" pyparticleprobe.dsd_calcs.attenuation ========================= A grouping of functions that calcuates attenuation characteristics 7 Feb 2014 - Adapted by Nick Guy NOAA/NSSL/WRDD, NRC """ # HISTORY:: # 3 Feb 2014 - Nick Guy. NOAA/NSSL, NRC (nick.guy@noaa.gov) # # NOTES:: # Arrays seem to be able to be passe...
lgpl-2.1
6,669,627,535,984,001,000
31.735537
76
0.533199
false
3.348267
false
false
false
dishbreak/bluesync
python/modules/bluetoothdevice.py
1
12044
from contrib import bglib from collections import namedtuple from modules import types import time class BleHandles(): """docstring for BleHandles""" def __init__( self, connection = -1, service_start = -1, service_end = -1, timestamp = -1, ...
bsd-2-clause
-8,836,920,886,961,241,000
35.49697
115
0.583029
false
3.957936
false
false
false
OpenReliability/OpenReliability
veusz/embed.py
1
19768
# A module for embedding Veusz within another python program # Copyright (C) 2005 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
gpl-2.0
-839,175,214,798,296,300
33.319444
89
0.565055
false
4.31993
false
false
false
jzellman/webpy-crust
crust/auth.py
1
3655
from uuid import uuid4 import web def AuthorizationProcessor(session, user_field="user_id", require_login=None): """ Authorization processor useful for authorizing URL paths. Example: session = web.session.Session(app, session_store, initializer={"user_id":...
mit
-677,115,743,829,445,000
30.508621
89
0.560055
false
4.305065
false
false
false
minrk/sympy
sympy/polys/polyroots.py
1
18245
"""Algorithms for computing symbolic roots of polynomials. """ from sympy.core.symbol import Dummy from sympy.core.add import Add from sympy.core.mul import Mul from sympy.core import S, I, Basic from sympy.core.sympify import sympify from sympy.core.numbers import Rational, igcd from sympy.ntheory import divisors, i...
bsd-3-clause
9,109,196,948,957,987,000
25.064286
91
0.509455
false
3.369344
false
false
false
JoshBradshaw/Arterial-BP-MRI-Triggering-Unit
monitoring_tool/realtimePlot.py
1
8458
from __future__ import division import os import ui_trigger import sys import numpy from PyQt4 import QtCore, QtGui, Qt import PyQt4.Qwt5 as Qwt import serial import serial.tools.list_ports import logging import logging.handlers from datetime import datetime from pprint import pprint TRIGGER_PULSE_CODE = 100000 SIXTE...
mit
-1,731,087,471,367,237,400
35.304721
137
0.657839
false
3.555275
false
false
false
jrossi/paver
bootstrap.py
1
53941
#!/usr/bin/env python ## WARNING: This file is generated #!/usr/bin/env python """Create a "virtual" Python installation """ import sys import os import optparse import shutil import logging import distutils.sysconfig try: import subprocess except ImportError, e: if sys.version_info <= (2, 3): print 'E...
bsd-3-clause
6,592,291,573,075,368,000
42.997553
179
0.696613
false
2.421811
false
false
false
nouiz/pydy
examples/Kane1985/Chapter5/Example5.1.py
1
2090
#!/usr/bin/env python # -*- coding: utf-8 -*- """Example 5.1 from Kane 1985.""" from __future__ import division from sympy import Dummy, Matrix from sympy import expand, solve, symbols, trigsimp from sympy.physics.mechanics import ReferenceFrame, Point, dot, dynamicsymbols from util import msprint, subs, partial_veloc...
bsd-3-clause
5,703,394,762,670,879,000
32.66129
78
0.62482
false
2.352875
false
false
false
js850/pele
pele/takestep/adaptive_step_temperature.py
1
6316
import numpy as np from pele.takestep import TakestepInterface __all__ = ["AdaptiveStepsizeTemperature"] class AdaptiveStepsizeTemperature(TakestepInterface): """ adjust both the stepsize and the temperature adaptively Parameters ---------- stepclass : the step taking class ...
gpl-3.0
5,482,753,251,001,163,000
34.488764
126
0.581539
false
4.193891
false
false
false
t794104/ansible
lib/ansible/modules/cloud/podman/podman_image_info.py
1
8244
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'sta...
gpl-3.0
-807,328,375,958,436,000
38.444976
911
0.617783
false
2.998909
false
false
false
robertour/miller-knowles
miller_knowles.py
1
14416
import random import time import csv import sys from sortedcontainers import SortedSet import networkx as nx from networkx.classes.function import neighbors from networkx.classes import graph from networkx.classes.graph import Graph import matplotlib.pyplot as plt import numpy as np from sortedcontainers.sortedlist im...
gpl-2.0
4,134,597,714,533,187,000
33.737349
83
0.450364
false
4.234724
false
false
false
magne-max/zipline-ja
zipline/data/bundles/quandl_xjpx.py
1
1446
""" """ from io import BytesIO from itertools import count import tarfile from time import time, sleep from click import progressbar from logbook import Logger import pandas as pd import requests from six.moves.urllib.parse import urlencode from boto import connect_s3 import tarfile from . import core as bundles fro...
apache-2.0
1,609,607,526,491,879,200
27.352941
70
0.628631
false
3.588089
false
false
false
czardoz/hornet
hornet/common/helpers.py
1
1802
# !/usr/bin/env python # # Hornet - SSH Honeypot # # Copyright (C) 2015 Aniket Panse <aniketpanse@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 3 of the License, or...
gpl-3.0
-3,653,899,845,252,679,700
32.37037
104
0.68535
false
3.526419
false
false
false
edx/edx-ora2
openassessment/assessment/serializers/base.py
1
10553
""" Serializers common to all assessment types. """ from copy import deepcopy import logging from rest_framework import serializers from rest_framework.fields import DateTimeField, IntegerField from django.core.cache import cache from openassessment.assessment.models import Assessment, AssessmentPart, Criterion, C...
agpl-3.0
548,526,941,250,778,600
34.531987
110
0.630721
false
4.281136
false
false
false
jonobacon/ubuntu-accomplishments-viewer
accomplishments_viewer/PreferencesAccomplishmentsViewerDialog.py
1
4585
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2012 Jono Bacon <jono@ubuntu.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foun...
gpl-3.0
-5,662,133,192,924,543,000
44.39604
98
0.714722
false
3.630245
false
false
false
5g-empower/empower-runtime
empower/managers/ranmanager/lvapp/wifiapp.py
1
2751
#!/usr/bin/env python3 # # Copyright (c) 2019 Roberto Riggio # # 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 applicabl...
apache-2.0
770,378,161,406,520,600
25.708738
74
0.641948
false
3.768493
false
false
false
keelerm84/powerline
powerline/lib/inotify.py
1
6156
# vim:fileencoding=utf-8:noet from __future__ import unicode_literals, absolute_import __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys import os import errno class INotifyError(Exception): pass _inotify = None def load_inotify(): ''' Initialize th...
mit
-1,538,661,437,192,925,000
32.456522
112
0.671702
false
2.934223
false
false
false
pixlra/HARP-fork
Various/ThirdParty/pyqtgraph/graphicsItems/PlotItem/PlotItem.py
1
48518
# -*- coding: utf-8 -*- """ PlotItem.py - Graphics item implementing a scalable ViewBox with plotting powers. Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. This class is one of the workhorses of pyqtgraph. It implements a graphics item with plots, labels, and...
gpl-3.0
-2,996,013,384,908,142,600
37.173092
148
0.549075
false
4.097804
false
false
false
patta42/pySICM
pySICMgui/widgetFloatingBackstep.py
1
7883
# -*- coding: utf-8 -*- # Copyright (C) 2015 Patrick Happel <patrick.happel@rub.de> # # This file is part of pySICM. # # pySICM 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, ...
gpl-3.0
3,839,185,758,363,953,000
40.272251
142
0.584676
false
3.634394
false
false
false
orbkit/orbkit
setup.py
1
2718
#!/usr/bin/env python import sys from setuptools import find_packages, setup, Extension from Cython.Distutils import build_ext from os.path import join import numpy with open('README.rst', 'r') as fh: # Remove header for line in fh: if 'ORBKIT' in line: next(fh) next(fh) break long_descri...
lgpl-3.0
-2,076,100,841,732,056,000
27.020619
81
0.62362
false
3.243437
false
false
false
itzsarim/wordfilter
app.py
1
1871
from flask import Flask, render_template, request, jsonify # Initialize the Flask application app = Flask(__name__) # This route will show a form to perform an AJAX request # jQuery is loaded to execute the request and update the # value of the operation @app.route('/') def index(): return render_template('index...
mit
-5,892,173,469,965,913,000
19.56044
81
0.53768
false
3.543561
false
false
false
spatialfrog/soil_tools
qgis/qgis_progressing_framework_scripts/src/1_connect_soil_db.py
1
3864
""" purpose: loads the database table "availableSoilTableJoins", cmp table if selected and slc shapefile notes: - loads "permittedOperations" table into qgis toc. becomes drop down in processing framework for next script. will allows user to specific what tables they wish to use and if a join operation is required - l...
gpl-3.0
2,176,013,862,879,242,000
32.318966
178
0.761387
false
3.722543
false
false
false
alchayward/seeding
views.py
1
6614
from django.contrib.auth.decorators import login_required from django.shortcuts import render, render_to_response from seeding.models import Tournament, Team, Session, Game from django.contrib.auth import authenticate, login from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestC...
gpl-2.0
-2,677,022,637,569,270,300
34.55914
81
0.636831
false
3.779429
false
false
false
edsu/twarc
utils/retweets.py
1
1795
#!/usr/bin/env python """ Reads a stream of twitter data and writes out data for the top 10 retweets. Use the --results option to change the number of results. """ from __future__ import print_function import json import optparse import fileinput def main(): retweets = [] parser = optparse.OptionParser() ...
mit
-2,691,810,667,764,524,500
27.492063
80
0.594429
false
3.708678
false
false
false
jmwright/cadquery-freecad-module
Libs/docutils/core.py
1
29533
# $Id: core.py 8126 2017-06-23 09:34:28Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with component names will result in default behavior. For custom beha...
lgpl-3.0
-3,714,240,824,547,092,000
43.410526
78
0.622287
false
4.385004
true
false
false
sixty-north/cosmic-ray
src/cosmic_ray/operators/comparison_operator_replacement.py
1
3252
"""This module contains mutation operators which replace one comparison operator with another. """ from enum import Enum import itertools import parso.python.tree from ..ast import is_none, is_number from .operator import Operator from .util import extend_name class ComparisonOperators(Enum): "All comparison op...
mit
5,231,077,477,629,382,000
29.971429
97
0.629151
false
3.637584
false
false
false
axltxl/zenfig
setup.py
1
1765
#!/usr/bin/env python # -*- coding: utf-8 -*- """ setuptools config file """ import sys import pip from pip.req import parse_requirements from setuptools import setup, find_packages import os from zenfig import __version__ as version from zenfig import __author__ as author from zenfig import PKG_URL as pkg_url from z...
mit
-2,105,482,101,273,021,200
28.915254
88
0.640793
false
3.747346
false
false
false
tjcsl/ion
intranet/middleware/session_management.py
1
1764
import time from django.contrib.auth import logout from ..apps.sessionmgmt.models import TrustedSession class SessionManagementMiddleware: """ Handles session management. """ def __init__(self, get_response): self.get_response = get_response def __call__(self, request): if requ...
gpl-2.0
3,265,476,217,240,224,300
43.1
146
0.590703
false
4.729223
false
false
false
flumotion-mirror/flumotion-windowsmedia
flumotion/component/consumers/wms/pull_producer.py
1
9190
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # Licensees having purchased or holding a valid Flumotion Advanced # Streaming Server license may use this file in accordance with the # Flum...
lgpl-2.1
-3,519,288,965,423,223,300
31.020906
79
0.612187
false
3.892418
false
false
false
osiam/connector4python
python/osiam/connector.py
1
10883
# coding=utf-8 import json import requests import collections import logging __author__ = 'phil' # logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) def doLog(func): def wrapped(*args, **kwargs): result = func(*args, **kwargs) logger.debug('called {0} params: {1} re...
mit
2,842,563,191,492,891,000
36.6609
90
0.577322
false
3.986447
false
false
false
mlperf/training_results_v0.6
NVIDIA/benchmarks/gnmt/implementations/pytorch/setup.py
1
1082
from setuptools import setup, find_packages from torch.utils.cpp_extension import BuildExtension, CUDAExtension import sys if sys.version_info < (3,): sys.exit('Sorry, Python3 is required for gnmt.') with open('requirements.txt') as f: reqs = f.read() extra_cuda_compile_args = { 'cxx': ['-O2', ], 'nvcc...
apache-2.0
-957,689,414,757,461,600
24.162791
67
0.62939
false
3.056497
false
false
false
SGenheden/Scripts
Projects/Gpcr/gpcr_anal_lifetimes.py
1
5680
# Author: Samuel Genheden samuel.genheden@gmail.com """ Program to analyse state files in order to compute lifetimes of molecules or other states The state series can be files on disc or logical combinations of already open state series. It will analyse group of files, each group with a number of repeats. Median an...
mit
6,737,768,644,979,249,000
34.72956
147
0.654401
false
3.088635
false
false
false
Vignesh2208/Awlsim
awlsim/core/systemblocks/systemblocks.py
1
3090
# -*- coding: utf-8 -*- # # AWL simulator - System-blocks # # Copyright 2012-2015 Michael Buesch <m@bues.ch> # # 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
-159,100,157,252,867,070
30.212121
82
0.731392
false
3.355049
false
false
false
moverlan/LOTlib
LOTlib/Hypotheses/RecursiveLOTHypothesis.py
1
2953
from LOTHypothesis import LOTHypothesis, raise_exception, evaluate_expression from LOTlib.Evaluation.EvaluationException import RecursionDepthException, TooBigException, EvaluationException class RecursiveLOTHypothesis(LOTHypothesis): """ A LOTHypothesis that permits recursive calls to itself via the primitiv...
gpl-3.0
-8,645,650,876,244,384,000
42.441176
129
0.655266
false
4.368343
false
false
false
ArcherSys/ArcherSys
Lib/multiprocessing/connection.py
1
91847
<<<<<<< HEAD <<<<<<< HEAD # # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ] import io import os import sys import socket imp...
mit
484,566,150,979,678,700
31.022664
84
0.548524
false
4.207871
false
false
false
supermarkion/Life-Backup
Python/CanIWin.py
1
2531
''' In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach or exceed 100 wins. What if we change the game so that players cannot re-use integers? For example, two players might take turns drawing from a comm...
mit
4,426,303,549,233,985,000
35.695652
118
0.641644
false
4.363793
false
false
false
devilry/devilry-django
devilry/devilry_account/migrations/0003_datamigrate-admins-into-permissiongroups.py
1
2619
# -*- coding: utf-8 -*- from django.db import models, migrations def datamigrate_admins_into_permissiongroups(apps, schema_editor): permissiongroup_model = apps.get_model('devilry_account', 'PermissionGroup') permissiongroupuser_model = apps.get_model('devilry_account', 'PermissionGroupUser') subject_mo...
bsd-3-clause
4,552,534,692,730,217,500
36.414286
94
0.649866
false
4.570681
false
false
false
tejal29/pants
src/python/pants/backend/core/wrapped_globs.py
1
3765
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from six ...
apache-2.0
-2,163,516,751,647,764,200
36.65
97
0.692696
false
3.78012
true
false
false
UltronAI/Deep-Learning
CS231n/reference/CS231n-master/assignment2/cs231n/layer_utils.py
1
2538
from cs231n.layers import * from cs231n.fast_layers import * def affine_relu_forward(x, w, b): """ Convenience layer that perorms an affine transform followed by a ReLU Inputs: - x: Input to the affine layer - w, b: Weights for the affine layer Returns a tuple of: - out: Output from the R...
mit
6,864,787,935,838,201,000
25.290323
72
0.657998
false
3.266409
false
false
false
OpenAT/cu_eura
eura_config/__openerp__.py
1
1681
# -*- coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the #...
agpl-3.0
-4,298,214,358,802,706,000
34.020833
78
0.595479
false
4.140394
false
false
false
ifarup/colourlab
colourlab/space.py
1
67700
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ space: Colour spaces, part of the colourlab package Copyright (C) 2013-2016 Ivar Farup 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 versi...
gpl-3.0
1,189,778,251,837,604,400
28.771328
79
0.468863
false
3.389406
false
false
false
lizerd123/github
game compalation/jack.py
1
1810
# A map GUI thing # +---------+ # |####|****| # |####|****| # |####|****| # |----+----| # |::::|$$$$| # |::::|$$$$| # |::::|$$$$| # +---------+ print "+-----------+" print "| U = Up |" print "| D = Down |" print "| R = Right |" print "| L = Left |" print "| Q = Quit |" print "+-----------+" mainmap = [] coords ...
mit
-8,454,774,936,096,684,000
17.670103
70
0.523204
false
2.459239
false
false
false
apporc/cinder
cinder/volume/drivers/emc/emc_cli_fc.py
1
11978
# Copyright (c) 2012 - 2015 EMC Corporation, 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 # # ...
apache-2.0
2,333,369,983,232,384,500
38.531353
79
0.570463
false
4.655266
false
false
false
3dfxmadscientist/odoo-infrastructure
addons/infrastructure/environment_step.py
1
1539
# -*- coding: utf-8 -*- ############################################################################## # # Infrastructure # Copyright (C) 2014 Ingenieria ADHOC # No email # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
237,234,166,110,134,460
29.176471
154
0.621832
false
4.286908
false
false
false