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
ess-dmsc/do-ess-data-simulator
DonkiPlayer/DonkiOrchestraLib.py
1
7360
import zmq import traceback import socket import time class CommunicationClass: def __init__(self, name='director'): self.context = zmq.Context() self.poller = zmq.Poller() self.pub_sock = None self.sub_socks = {} self.pub_tag = name # self.create_pub_socket(...
bsd-2-clause
-3,240,108,281,225,997,000
37.134715
85
0.38125
false
4.6494
false
false
false
ragupta-git/ImcSdk
imcsdk/mometa/storage/StorageFlexFlashVirtualDrive.py
1
7941
"""This module contains the general information for StorageFlexFlashVirtualDrive ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class StorageFlexFlashVirtualDriveConsts: ADMIN_ACTION_DISABLE_VD = "disable-vd" ADMIN_ACT...
apache-2.0
-984,964,799,914,068,200
65.175
258
0.625866
false
3.607905
false
false
false
ErnieAllen/qpid-dispatch
tests/system_tests_protocol_settings.py
1
16207
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-6,041,756,895,692,285,000
39.31592
127
0.604554
false
3.805353
true
false
false
acressity/acressity
narratives/forms.py
1
2019
from datetime import date from django import forms from narratives.models import Narrative from django.forms.extras.widgets import SelectDateWidget from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from django.http import HttpResponse from django.core.exceptions import Permissio...
gpl-3.0
-5,569,418,809,155,219,000
34.421053
250
0.65577
false
3.867816
false
false
false
rigetticomputing/grove
grove/tomography/state_tomography.py
1
11664
############################################################################## # Copyright 2017-2018 Rigetti Computing # # 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...
apache-2.0
-8,882,595,617,667,638,000
43.015094
100
0.650034
false
3.650704
false
false
false
ecohealthalliance/eidr-connect
.scripts/utils.py
1
1603
import re import requests import os import functools import json try: from functools import lru_cache except ImportError: from backports.functools_lru_cache import lru_cache GRITS_URL = os.environ.get("GRITS_URL", "https://grits.eha.io") def clean(s): return re.sub(r"\s+", " ", s).strip() def clean_di...
apache-2.0
-169,896,742,788,247,500
24.870968
79
0.601996
false
3.238384
false
false
false
kevin-intel/scikit-learn
sklearn/datasets/_openml.py
2
34451
import gzip import json import os import shutil import hashlib from os.path import join from warnings import warn from contextlib import closing from functools import wraps from typing import Callable, Optional, Dict, Tuple, List, Any, Union import itertools from collections.abc import Generator from collections import...
bsd-3-clause
66,852,054,886,861,020
35.845989
79
0.604017
false
4.03313
false
false
false
yoazmenda/Hearthstone_deck_builder
run_games.py
1
1724
import json from hearthbreaker.agents.basic_agents import RandomAgent from hearthbreaker.cards.heroes import hero_for_class from hearthbreaker.constants import CHARACTER_CLASS from hearthbreaker.engine import Game, Deck, card_lookup from hearthbreaker.cards import * import timeit def load_deck(filename): cards = ...
mit
-2,154,089,804,845,221,400
27.733333
98
0.563805
false
3.723542
false
false
false
donlorenzo/AdvancedConfigParser
src/AdvancedConfigParser.py
1
17728
# -*- coding: utf-8 -*- # Copyright (c) 2010, 2014 Lorenz Quack # This code is released under the MIT License: # 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 ...
mit
-2,125,530,160,059,667,500
38.838202
104
0.542137
false
4.147871
true
false
false
rmanoni/mi-instrument
mi/instrument/kut/ek60/ooicore/driver.py
1
39253
""" @package mi.instrument.kut.ek60.ooicore.driver @file /mi/instrument/kut/ek60/ooicore/driver.py @author Richard Han @brief Driver for the ooicore Release notes: This Driver supports the Kongsberg UnderWater Technology's EK60 Instrument. """ __author__ = 'Richard Han & Craig Risien' __license__ = 'Apache 2.0' impo...
bsd-2-clause
1,710,098,018,871,872,300
42.567148
132
0.572542
false
4.178518
true
false
false
EmbodiedCognition/pagoda
pagoda/physics.py
1
47156
'''This module contains convenience wrappers for ODE objects.''' from __future__ import division import collections import numpy as np import ode BodyState = collections.namedtuple( 'BodyState', 'name position quaternion linear_velocity angular_velocity') class Registrar(type): '''A metaclass that builds ...
mit
-2,953,832,453,207,946,000
32.349364
86
0.58192
false
4.007479
false
false
false
IQSS/geoconnect
gc_apps/gis_shapefiles/views_02_visualize.py
1
4711
from __future__ import print_function import logging from django.http import HttpResponse from django.views.generic import View from django.template.loader import render_to_string from django.conf import settings from gc_apps.gis_shapefiles.models import ShapefileInfo from gc_apps.worldmap_layers.models import World...
apache-2.0
1,538,729,477,637,049,300
37.300813
116
0.612397
false
3.968829
false
false
false
nickmilon/milonpy
milonpy/utils/basic2.py
1
14147
#!/usr/bin/env python # -*- coding: UTF-8 -*- ####################################################### ''' module: utilities.basic2 Created:Aug 21, 2012 author: nickmilon Description: Description: Simple utilities (2) and Vars - Very Limited IMPORTS HERE ! ''' ###############################...
apache-2.0
-7,230,937,652,603,792,000
37.752747
168
0.57072
false
3.306376
false
false
false
AnthonyCheetham/naco_ispy
data_handling_scripts/queue_cal_analysis.py
1
1931
# -*- coding: utf-8 -*- """ Created on Fri Nov 11 10:41:32 2016 Program to run through the calibrations folders and queue all data for analysis It isn't yet smart enough to check which ones are done already @author: cheetham """ import naco_ispy,subprocess,os,argparse,glob parser = argparse.ArgumentParser(descript...
gpl-3.0
-3,123,554,130,894,556,000
32.310345
127
0.684102
false
3.523723
false
false
false
Maronato/SpottedBot
custom_auth/facebook_methods.py
1
4677
import facebook from django.conf import settings from django.shortcuts import reverse from urllib.parse import urlencode, quote, unquote from django.contrib.auth import login from django.contrib import messages app_id = settings.SOCIAL_FACEBOOK_KEY app_secret = settings.SOCIAL_FACEBOOK_SECRET def get_graph(): "...
agpl-3.0
7,889,079,061,397,053,000
30.38255
122
0.663388
false
3.676101
false
false
false
LegoStormtroopr/canard
SQBLWidgets/sqblUI/statementText.py
1
1584
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/statementText.ui' # # Created: Sat Jul 25 12:17:11 2015 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 excep...
gpl-3.0
-4,289,232,995,782,310,000
39.615385
250
0.696338
false
3.789474
false
false
false
samueldeng/crosslan
headquarter/iptman.py
1
2445
import iptc import logging logging.basicConfig(format='[%(levelname)s]\t%(asctime)s\t%(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.DEBUG) log = logging.getLogger("iptman") class IptMan(): def __init__(self): pass @staticmethod def insert_rule(port): try: ...
gpl-2.0
5,179,356,324,944,784,000
27.44186
103
0.503476
false
4.179487
false
false
false
google-research/falken
service/generated_flatbuffers/tflite/LessEqualOptions.py
1
2218
# Copyright 2021 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, ...
apache-2.0
3,640,308,164,800,651,300
29.805556
114
0.708747
false
3.857391
false
false
false
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/itemviews/addressbook/addresswidget.py
1
10279
#!/usr/bin/python """************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the examples of the Qt Toolkit. ** ** You may use ...
epl-1.0
-137,049,467,144,635,650
40.447581
86
0.628369
false
4.394613
false
false
false
googleapis/python-grafeas
grafeas/grafeas_v1/services/grafeas/transports/grpc_asyncio.py
1
26599
# -*- coding: utf-8 -*- # Copyright 2020 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...
apache-2.0
-3,522,779,740,541,284,000
41.626603
89
0.617956
false
4.548393
false
false
false
terranum-ch/GraphLink
graphlink/ui/gkui_node_manager.py
1
2716
#!/urs/bin/python import os import wx from ..core.gk_node import GKNode from .gkui_node_dlg import GKUINodeEditDialog class GKUINodeManager(object): def __init__(self, parentframe, listctrl): self.m_listctrl = listctrl assert (self.m_listctrl is not None), "listctrl is None!" self.m_paren...
apache-2.0
-1,177,501,102,955,131,400
31.710843
77
0.559116
false
3.71409
false
false
false
chrplr/AIP2015
resources/python-scripts/dualscope.py
1
28502
#!/usr/bin/env python """ Oscilloscope + spectrum analyser in Python. ------------------------------------------------------------ Copyright (C) 2008, Roger Fearick, University of Cape Town This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
gpl-2.0
2,410,628,168,513,785,300
32.026651
83
0.586941
false
3.21439
false
false
false
alexgorban/models
official/modeling/tf_utils.py
1
5438
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
7,756,442,032,010,609,000
30.074286
80
0.690143
false
3.926354
false
false
false
PyFilesystem/pyfilesystem
fs/rpcfs.py
1
11326
""" fs.rpcfs ======== This module provides the class 'RPCFS' to access a remote FS object over XML-RPC. You probably want to use this in conjunction with the 'RPCFSServer' class from the :mod:`~fs.expose.xmlrpc` module. """ import xmlrpclib import socket import base64 from fs.base import * from fs.errors import * ...
bsd-3-clause
6,380,686,112,742,397,000
30.373961
123
0.555183
false
4.05659
false
false
false
orlenko/bccf
src/pybb/permissions.py
1
6478
# -*- coding: utf-8 -*- """ Extensible permission system for pybbm """ from django.utils.importlib import import_module from django.db.models import Q from pybb import defaults def _resolve_class(name): """ resolves a class function given as string, returning the function """ if not name: return False mo...
unlicense
-5,898,669,304,835,996,000
38.506098
108
0.629824
false
3.926061
false
false
false
ktok07b6/polyphony
polyphony/compiler/libs.py
1
3330
single_port_ram = """module SinglePortRam # ( parameter DATA_WIDTH = 8, parameter ADDR_WIDTH = 4, parameter RAM_DEPTH = 1 << ADDR_WIDTH ) ( input clk, input rst, input [ADDR_WIDTH-1:0] ram_addr, input [DATA_WIDTH-1:0] ram_d, input ram_we, output [DATA_WIDTH-1:0] ram_q ); reg [DATA_WIDTH-1:0] mem [0...
mit
682,272,391,786,811,300
20.907895
70
0.571471
false
2.878133
false
false
false
tonioo/modoboa
modoboa/core/forms.py
1
4606
# -*- coding: utf-8 -*- """Core forms.""" from __future__ import unicode_literals from django import forms from django.contrib.auth import ( forms as auth_forms, get_user_model, password_validation ) from django.db.models import Q from django.utils.translation import ugettext as _, ugettext_lazy from modoboa.co...
isc
-1,737,334,883,102,439,700
34.160305
78
0.621146
false
4.276695
false
false
false
praekelt/txtalert
txtalert/apps/bookings/views.py
1
7598
from django.http import HttpResponse, Http404, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import render_to_response, get_object_or_404 from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse fro...
gpl-3.0
-763,102,905,537,551,700
36.995
93
0.622664
false
4.007384
false
false
false
Flamacue/pretix
src/tests/plugins/test_ticketoutputpdf.py
2
1826
from datetime import timedelta from decimal import Decimal from io import BytesIO import pytest from django.utils.timezone import now from PyPDF2 import PdfFileReader from pretix.base.models import ( Event, Item, ItemVariation, Order, OrderPosition, Organizer, ) from pretix.plugins.ticketoutputpdf.ticketoutput im...
apache-2.0
6,230,654,048,277,624,000
33.45283
87
0.693866
false
3.406716
false
false
false
abusesa/abusehelper
abusehelper/core/rules/classifier.py
1
1033
class Classifier(object): def __init__(self): self._rules = dict() def inc(self, rule, class_id): classes = self._rules.get(rule, None) if classes is None: classes = dict() self._rules[rule] = classes classes[class_id] = classes.get(class_id, 0) + 1 ...
mit
496,745,086,639,479,040
25.487179
56
0.516941
false
4.066929
false
false
false
geobricks/pgeo
pgeo/metadata/metadata.py
1
2602
import os import json from pgeo.utils.json import dict_merge_and_convert_dates from pgeo.metadata.db_metadata import DBMetadata from pgeo.metadata.search import MongoSearch from pgeo.utils import log from pgeo.config.metadata.core import template as core_template from pgeo.config.metadata.raster import template as rast...
gpl-2.0
-6,503,222,040,618,752,000
40.31746
164
0.673328
false
3.423684
false
false
false
habalux/pglog2grok
pglog2grok.py
1
4033
#!/usr/bin/env python # # Small script for generating a logstash grok filter and patterns for postgresql # using a non-default log_line_prefix setting. # # Output of this script has NOT been tested in any production environment as of yet. # # Copyright (c) 2014, Teemu Haapoja <teemu.haapoja@gmail.com> # All rights rese...
bsd-2-clause
-7,059,104,021,549,284,000
38.539216
117
0.706422
false
3.046073
false
false
false
TeMPO-Consulting/mediadrop
mediacore/controllers/login.py
1
4471
# This file is a part of MediaDrop (http://www.mediadrop.net), # Copyright 2009-2013 MediaCore Inc., Felix Schwarz and other contributors. # For the exact contribution history, see the git revision log. # The source code contained in this file is licensed under the GPLv3 or # (at your option) any later version. # See L...
gpl-3.0
-8,258,448,679,975,395,000
39.645455
99
0.641244
false
4.198122
false
false
false
cryptica/slapnet
benchmarks/scalable/PhilosophersCM84/make_net.py
1
2045
#!/usr/bin/python3 import sys print(""" petri net "The drinking philosophers for n=2" { places { p1h p1e p2h p2e req1p1 req1p2 req2p1 req2p2 fork1p1 fork1p2 fork2p1 fork2p2 fork1clean fork1dirty fork2clean fork2dirty } transitions { ...
gpl-3.0
-4,088,092,992,242,717,000
33.083333
112
0.605868
false
2.310734
false
false
false
uwosh/uwosh.intranet.policy
uwosh/intranet/policy/importexport.py
1
5459
from Products.CMFCore.utils import getToolByName from Products.LDAPMultiPlugins import manage_addLDAPMultiPlugin def install(context): if not context.readDataFile('uwosh.intranet.policy.txt'): return setupLDAPPlugin(context) def setupLDAPPlugin(context): ldap_plugin_id = 'ldap_authentication' ...
gpl-2.0
-1,045,420,193,652,714,100
32.913043
113
0.52702
false
4.067809
false
false
false
realopenit/bubble
bubble/commands/cmd_examples.py
1
1437
# -*- coding: utf-8 -*- # Part of bubble. See LICENSE file for full copyright and licensing details. import click from ..cli import pass_bubble from ..util.examples import all_examples_functions @click.command('examples', short_help='Show example for doing some task in bubble(experimental)') @click.op...
gpl-3.0
-2,532,512,840,913,987,000
33.214286
85
0.557411
false
4.047887
false
false
false
yw374cornell/e-mission-server
emission/core/wrapper/stop.py
1
1696
import logging import emission.core.wrapper.wrapperbase as ecwb class Stop(ecwb.WrapperBase): props = {"trip_id": ecwb.WrapperBase.Access.WORM, # trip_id of the parent trip "enter_ts": ecwb.WrapperBase.Access.WORM, # the timestamp of entry (in secs) "enter_local_dt": ecwb.WrapperBase.Acc...
bsd-3-clause
-4,098,555,770,510,610,400
64.230769
104
0.653892
false
3.608511
false
false
false
RNAcentral/rnacentral-import-pipeline
tests/cli/pdb_test.py
1
1261
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
apache-2.0
7,726,899,241,946,992,000
29.756098
72
0.694687
false
3.730769
false
false
false
ekapujiw2002/kweb
kwebhelper.py
1
34980
#!/usr/bin/env python # -*- coding: utf-8 -*- # helper file for kweb Minimal Kiosk Browser # Copyright 2013-2014 by Guenter Kreidl # free software without any warranty # you can do with it what you like # version 1.4 import os,urllib,sys,subprocess,threading,time import Tkinter as tk # GLOBAL OPTIONS # use external ...
gpl-3.0
2,244,612,217,892,959,500
41.185766
235
0.53966
false
3.798414
false
false
false
bwohlberg/sporco
sporco/dictlrn/cbpdndl.py
1
18601
# -*- coding: utf-8 -*- # Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. """Dictionary learning based ...
bsd-3-clause
8,305,897,426,569,706,000
34.498092
77
0.626257
false
3.833677
false
false
false
kism/RViProgramLauncher
viinputdaemon.py
1
18123
# Input Daemon for the Visually Impared # For use with a device that outputs serial import uinput #interface between python and the uinput kernel module import time #for time.sleep() import serial #the keyboard this program interfaces with uses serial import os import sys # Easier debugging :^) class termcolour: ...
mit
-6,499,945,008,790,168,000
27.81399
90
0.674668
false
2.501795
false
false
false
JNeiger/robocup-software
soccer/gameplay/plays/no_opponents/offensive_pivot_kick.py
1
1448
import play import behavior import robocup import skills.line_kick import tactics.defense import main import constants import enum import role_assignment class OffensivePivotKick(play.Play): def __init__(self): super().__init__(continuous=False) self.add_transition(behavior.Behavior.State.start, ...
apache-2.0
-2,246,814,608,390,388,200
31.177778
120
0.627072
false
3.934783
false
false
false
FederatedAI/FATE
examples/benchmark_quality/hetero_nn/fate-hetero_nn.py
1
6666
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
4,090,263,162,999,835,600
46.276596
117
0.671467
false
3.547632
true
false
false
wadobo/GECO
src/gecod/gecod/xmlrpc_frontend.py
1
3242
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Provides a xmlrpc frontend to gecod backend ''' import backend import secure_xmlrpc as sxmlrpc HOST = 'localhost' PORT = 4343 DATABASE = 'sqlite:///database.sqlite' KEYFILE='certs/key.pem' CERTFILE='certs/cert.pem' def parseconfig(configfile): global HOST, PORT, DAT...
gpl-3.0
-6,722,768,706,466,853,000
22.664234
60
0.572795
false
4.124682
true
false
false
prior/webinars
webinars_web/webinars/views/events.py
1
10543
from operator import attrgetter from django.http import HttpResponse,HttpResponseRedirect,HttpResponseNotFound,HttpResponseForbidden from django.shortcuts import render_to_response from django.views.decorators.http import require_GET, require_POST from webinars_web.webinars.forms.event import EventForm from marketplace...
apache-2.0
-1,903,053,518,049,108,200
44.640693
265
0.656455
false
3.433084
false
false
false
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/distutils/command/bdist_dumb.py
1
4801
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" __revision__ = "$Id$" import os from distutils.core import Command from distutils.util import get_platform from distu...
gpl-2.0
-1,751,620,946,305,370,000
38.008333
76
0.519267
false
4.533522
false
false
false
Fabien-B/Web_ASA_Sourdoire
www/parcelle.py
1
4236
import mysql.connector import datetime class Parcelle(object): database = 'IENAC14_asa' user = 'root' password = 'root' host = '127.0.0.1' def __init__(self,id_parc,compteur=None,nom=None,lat=None,lon=None,altitude=None): if id_parc>0: self.load(id_parc) else: ...
lgpl-3.0
-4,204,626,003,705,896,400
41.37
216
0.628895
false
3.27357
false
false
false
saknis/upelis
logs4.py
1
5178
#!/usr/bin/env python import base64 import cgi import datetime import logging import os import time #from datetime import datetime, date, time import urllib import wsgiref.handlers import string from google.appengine.api import users from google.appengine.api.logservice import logservice from google....
lgpl-2.1
5,720,461,625,587,779,000
33
131
0.60506
false
3.415567
false
false
false
clearpathrobotics/axis_camera
nodes/axis.py
1
8123
#!/usr/bin/env python # # Axis camera image driver. Based on: # https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/axis_camera # /axis.py # import threading import urllib2 import rospy from sensor_msgs.msg import CompressedImage, CameraInfo import camera_info_manager class StreamThread(threading.Thr...
bsd-3-clause
9,019,188,777,415,011,000
36.43318
95
0.562723
false
4.117081
false
false
false
jacebrowning/gridcommand
setup.py
1
1810
#!/usr/bin/env python """Setup script for the package.""" import os import sys import setuptools PACKAGE_NAME = 'gridcommand' MINIMUM_PYTHON_VERSION = 3, 5 def check_python_version(): """Exit when the Python version is too low.""" if sys.version_info < MINIMUM_PYTHON_VERSION: sys.exit("Python {}....
lgpl-3.0
-8,046,625,268,878,089,000
25.617647
78
0.628729
false
3.892473
false
false
false
ledbutter/ProjectEulerPython
Problem39.py
1
1375
# If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120. # {20,48,52}, {24,45,51}, {30,40,50} # For which value of p 1000, is the number of solutions maximised? # p = 120 # sols = 0 # for a in range(1, p//2): # for b in range...
mit
9,017,787,300,578,095,000
22.157895
133
0.576727
false
2.468582
false
false
false
google/personfinder
app/indexing.py
1
10056
# Copyright 2010 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
7,982,706,846,564,120,000
38.590551
81
0.625597
false
4.020792
false
false
false
miguelalba89/hfdp-python
combining/observer.py
1
7761
""" Ducks problem with quackologists (observers) Author: m1ge7 Date: 2014/03/24 """ from abc import ABCMeta, abstractmethod ############################################################################### # ############################################################################### class QuackObservable: _...
gpl-3.0
939,939,761,361,892,700
21.365994
79
0.541039
false
3.943598
false
false
false
pattisdr/osf.io
api/meetings/views.py
1
9146
from rest_framework import generics, permissions as drf_permissions from rest_framework.exceptions import NotFound from django.db.models import Q, Count, Subquery, OuterRef, Case, When, Value, CharField, F, IntegerField from django.db.models.functions import Length, Substr, Coalesce from django.contrib.contenttypes.mo...
apache-2.0
-3,653,973,906,636,123,000
36.63786
104
0.663459
false
4.083036
false
false
false
duonys/deep-learning-chainer
dlchainer/SdA.py
1
5225
#-*- coding: utf-8 -*- from abc import ABCMeta, abstractmethod import copy import numpy as np from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin from sklearn.externals.six import with_metaclass from chainer import Variable, FunctionSet, optimizers, cuda import chainer.functions as F from .dA impor...
mit
-6,527,209,594,631,249,000
32.280255
110
0.587368
false
3.347213
false
false
false
SecPi/SecPi
worker/temperature_sensor.py
1
2642
from tools.sensor import Sensor import glob import logging import os import threading import time class TemperatureSensor(Sensor): #DS18B20 digital temperature sensor def __init__(self, id, params, worker): super(TemperatureSensor, self).__init__(id, params, worker) #self.active = False try: self.min = int...
gpl-3.0
729,324,569,803,099,900
30.452381
130
0.696064
false
3.214112
false
false
false
openstates/openstates
openstates/ct/events.py
1
1993
import datetime import json from pupa.scrape import Scraper, Event import pytz from .utils import open_csv class CTEventScraper(Scraper): _tz = pytz.timezone("US/Eastern") def __init__(self, *args, **kwargs): super(CTEventScraper, self).__init__(*args, **kwargs) def scrape(self): for...
gpl-3.0
-1,077,329,166,467,352,700
31.145161
88
0.537883
false
3.869903
false
false
false
frink182/stevostat
pir.py
1
1322
#!/usr/bin/env python from time import sleep from time import strftime import RPi.GPIO as GPIO import os import paho.mqtt.publish as publish import paho.mqtt.client as mqtt from datetime import datetime PIR=26 SCREEN_TIMEOUT=300 SCREEN='/sys/class/backlight/rpi_backlight/bl_power' ON=0 OFF=1 TOPIC="presence/PIR" GPI...
gpl-2.0
-4,928,873,503,737,569,000
23.036364
79
0.712557
false
2.794926
false
false
false
rane-hs/fabric-py3
tests/Python26SocketServer.py
1
22074
"""Generic socket server classes. This module tries to capture the various aspects of defining a server: For socket-based servers: - address family: - AF_INET{,6}: IP (Internet Protocol) sockets (default) - AF_UNIX: Unix domain sockets - others, e.g. AF_DECNET are conceivable (see <socket.h> ...
bsd-2-clause
8,849,255,045,800,621,000
30.670014
94
0.642339
false
4.378893
false
false
false
StefGou/Kijiji-Repost-Headless
kijiji_repost_headless/kijiji_cmd.py
1
4487
import argparse import os import sys from time import sleep import kijiji_api if sys.version_info < (3, 0): raise Exception("This program requires Python 3.0 or greater") def main(): ##Start here #Takes: config(user/pass) #One of: #post adPostingFile #show #delete adId #show #repost adPo...
mit
-5,459,380,662,855,144,000
32.485075
118
0.682416
false
3.253807
false
false
false
Ophiuchus1312/enigma2-master
Navigation.py
1
7217
from enigma import eServiceCenter, eServiceReference, eTimer, pNavigation, getBestPlayableServiceReference, iPlayableService from Components.ParentalControl import parentalControl from Components.config import config from Tools.BoundFunction import boundFunction from Tools.StbHardware import setFPWakeuptime, getFPWakeu...
gpl-2.0
6,904,893,535,751,126,000
34.033981
159
0.749758
false
3.361435
false
false
false
john5223/bottle-auth
auth/controllers/user_controller.py
1
2915
import logging logger = logging.getLogger(__name__) from bottle import route, get, post, delete from bottle import request, response def error(code, message): response.status = code message['status'] = code return message get_user_table = lambda db: db.get_table('users', primary_id='userid', primary_t...
gpl-2.0
-8,540,600,454,075,682,000
34.120482
107
0.616467
false
3.576687
false
false
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KPixmapCache.py
1
2878
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
gpl-2.0
-1,374,738,902,669,333,000
26.941748
101
0.646977
false
3.915646
false
false
false
EclipseXuLu/DataHouse
DataHouse/crawler/university_spider.py
1
3941
import requests from bs4 import BeautifulSoup from lxml import etree import pandas as pd from io import StringIO, BytesIO university_list = [] class University(): def __init__(self, name='', is_985=False, is_211=False, has_institute=False, location='', orgnization='', education_level='', educat...
mit
-7,579,131,018,589,852,000
40.423913
119
0.558908
false
3.000787
false
false
false
vinhqdang/algorithms_for_interviews
chapter1/problem1_3.py
1
1291
# given a sorted array and a key # find the first occurrence that larger than k # return -1 if there is no such element from problem0 import binary_search def test_find_first_larger_1 (): assert (find_first_larger([1,2,3,4,5,5,6],7) == -1) def test_find_first_larger_2 (): assert (find_first_larger([1,2,3,4,...
gpl-3.0
55,772,695,387,996,910
24.333333
83
0.492641
false
2.338768
false
false
false
iynaix/manga-downloader-flask
manga/spiders/animea.py
1
1663
import datetime from scrapy.selector import Selector from .base import BaseSpider as Spider from manga.items import MangaItem, MangaChapterItem from utils import extract_link class AnimeA(Spider): name = "animea" allowed_domains = ["animea.net"] start_urls = [ "http://manga.animea.net/series_old...
mit
-8,047,761,475,780,702,000
26.716667
76
0.549008
false
3.662996
false
false
false
libravatar/libravatar
libravatar/account/urls.py
1
5296
# Copyright (C) 2011, 2013, 2015, 2016 Francois Marier <francois@libravatar.org> # Copyright (C) 2010 Francois Marier <francois@libravatar.org> # Jonathan Harker <jon@jon.geek.nz> # Brett Wilkins <bushido.katana@gmail.com> # # This file is part of Libravatar # # Libravatar is f...
agpl-3.0
-5,768,908,466,926,725,000
55.946237
87
0.498301
false
4.52263
false
false
false
natsheh/semantic_query
api.py
1
4747
# -*- coding: utf-8 -*- # # This file is part of semantic_query. # Copyright (C) 2016 CIAPPLE. # # This is a free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. # Semantic Query API # Author: Hussein AL-NATSHEH <h.natsheh@ciapple.c...
bsd-3-clause
6,488,388,960,674,293,000
30.230263
127
0.688224
false
3.168892
false
false
false
SitiBanc/1061_NCTU_IOMDS
1108/HW7/HW7.py
1
3177
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 8 20:25:18 2017 @author: sitibanc """ import numpy as np from scipy import signal from PIL import Image def gen2DGaussian(stdv, mean, h, w): x, y = np.meshgrid(np.linspace(-1, 1, w), np.linspace(-1, 1, h)) d = np.sqrt(x ** 2 + y ** 2) ...
apache-2.0
7,698,695,683,274,534,000
30.2
79
0.460083
false
2.820072
false
false
false
wufangjie/leetcode
015. 3Sum.py
1
1747
''' Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. For example, given array S = [-1, 0, 1, 2, -1, -4], A solution set is: [ [-1, 0, 1], [-1, -1,...
gpl-3.0
6,233,434,110,019,889,000
25.876923
155
0.502003
false
3.253259
false
false
false
satterly/alerta5
alerta/app/database/backends/mongodb/base.py
1
40457
import json import pytz import re from datetime import datetime, timedelta from flask import current_app, g from pymongo import MongoClient, ASCENDING, TEXT, ReturnDocument from pymongo.errors import ConnectionFailure from alerta.app.models import status_code from alerta.app.utils.format import DateTime from alerta....
apache-2.0
-2,205,730,669,139,260,000
33.756873
133
0.470994
false
4.378463
false
false
false
ckan/ckanext-archiver
ckanext/archiver/lib.py
1
1725
import os import logging import ckan.plugins as p from ckanext.archiver.tasks import update_package, update_resource log = logging.getLogger(__name__) def compat_enqueue(name, fn, queue, args=None): u''' Enqueue a background job using Celery or RQ. ''' try: # Try to use RQ from ckan....
mit
7,860,166,736,346,997,000
30.944444
104
0.663188
false
3.571429
false
false
false
jhermann/rituals
src/rituals/util/shell.py
1
2127
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Shell command calls. """ # Copyright ⓒ 2015 Jürgen Hermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This pr...
gpl-2.0
1,718,451,169,136,169,700
31.676923
96
0.669021
false
3.840868
false
false
false
Nth-iteration-labs/streamingbandit
app/handlers/evalhandlers.py
1
3985
# -* coding: utf-8 -*- import json import numpy as np from handlers.basehandler import BaseHandler, ExceptionHandler from core.experiment import Experiment global numpy global random class Simulate(BaseHandler): def get(self, exp_id): """ Simulate your experiment based on four scripts, which create a cl...
mit
-3,311,606,737,012,722,000
42.791209
143
0.473275
false
5.018892
false
false
false
brettcs/diffoscope
diffoscope/comparators/utils/archive.py
1
3833
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2016 Chris Lamb <lamby@debian.org> # # diffoscope 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,...
gpl-3.0
5,791,410,520,121,028,000
25.611111
84
0.63857
false
4.12931
false
false
false
edx/pyrasite
pyrasite/inspector.py
1
1168
# This file is part of pyrasite. # # pyrasite is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # pyrasite is distributed in the hope t...
gpl-3.0
1,011,668,733,586,748,900
39.275862
79
0.694349
false
3.719745
false
false
false
ojii/django-shop
tests/testapp/settings.py
1
4005
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Christopher Glass', 'tribaal@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
bsd-3-clause
-8,624,996,170,369,027,000
34.758929
122
0.698127
false
3.608108
false
false
false
cgqyh/pyalgotrade-mod
pyalgotrade/tools/quandl.py
1
5711
# PyAlgoTrade # # Copyright 2011-2015 Gabriel Martin Becedillas Ruiz # # 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 ap...
apache-2.0
-7,145,280,726,221,592,000
38.386207
162
0.66941
false
3.653871
false
false
false
evancasey/demeter
demeter/unsup/common/image_pool.py
1
1090
import tensorflow as tf import copy class ImagePool: def __init__(self, pool_size): self.pool_size = pool_size if self.pool_size > 0: self.num_imgs = 0 self.images = [] def query(self, images): if self.pool_size == 0: return images ret_imgs ...
mit
6,230,843,943,123,238,000
33.0625
101
0.480734
false
3.633333
false
false
false
mvaled/sentry
src/sentry/south_migrations/0277_auto__add_commitfilechange__add_unique_commitfilechange_commit_filenam.py
1
92625
# -*- 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): # Adding model 'CommitFileChange' db.create_table( 'sentry_com...
bsd-3-clause
-4,519,465,274,450,707,000
35.799762
97
0.40068
false
4.716141
false
false
false
sassoftware/mint
mint/buildtypes.py
1
14373
# # Copyright (c) SAS Institute 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 w...
apache-2.0
-8,518,906,341,440,424,000
33.970803
88
0.598066
false
3.110366
false
false
false
KIOS-Research/effinet-smart-water-game
test.py
1
6635
# -*- coding: cp1253 -*- from tkinter import * from time import sleep def create(w, x1, y1): w.place(x=x1, y=y1) def erase(w): w.destroy() def reset(w): w.destroy() start() def exit(w): w.destroy() def e_q1(root, counter, step): TL = Toplevel() w, h = TL.winfo_screenwidth(), TL.winf...
bsd-2-clause
6,492,672,037,668,850,000
30.009346
111
0.547099
false
3.049173
false
false
false
bbengfort/inigo
inigo/image.py
1
7931
# inigo.image # Handles data dealing with images, particularly EXIF for JPEG # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Jun 14 22:32:17 2015 -0400 # # Copyright (C) 2015 Bengfort.com # For license information, see LICENSE.txt # # ID: image.py [] benjamin@bengfort.com $ """ Handles data dea...
mit
2,563,230,144,697,206,000
30.724
86
0.536628
false
4.31267
false
false
false
macarthur-lab/xbrowse
seqr/views/apis/locus_list_api_tests.py
1
8486
import json import mock from django.test import TransactionTestCase from django.urls.base import reverse from seqr.models import LocusList, Project from seqr.views.apis.locus_list_api import locus_lists, locus_list_info, create_locus_list_handler, \ update_locus_list_handler, delete_locus_list_handler, add_projec...
agpl-3.0
3,673,026,669,628,493,000
49.511905
180
0.665213
false
3.397118
true
false
false
bjtox/ec2ssh-manager
ec2ssh/ec2ssh.py
1
11122
import subprocess import boto3 import sys import configparser from codecs import open from os.path import expanduser import os import glob import inquirer import argparse import libtmux import time class Connector: def __init__(self, connection_name, profile): self.hosts_folder = expanduser("~") print(self....
mit
-2,762,748,396,079,273,000
39.155235
139
0.605107
false
3.521849
true
false
false
mmahut/openshift-ansible
roles/openshift_health_checker/action_plugins/openshift_health_check.py
1
5501
""" Ansible action plugin to execute health checks in OpenShift clusters. """ # pylint: disable=wrong-import-position,missing-docstring,invalid-name import sys import os from collections import defaultdict try: from __main__ import display except ImportError: from ansible.utils.display import Display displ...
apache-2.0
1,259,086,927,939,239,200
36.168919
109
0.612979
false
4.154834
false
false
false
jakub-m/phantomcurl
phantomcurl/test/test_post_data.py
1
1059
from nose.tools import * from phantomcurl.utils import split_post_items def test_post_data_good(): expected_given = [ ([('foo', 'bar')], ['foo=bar']), ([('foo', '')], ['foo=']), ([('foo', '=')], ['foo==']), ([('', '')], ['=']), ([('', '=')], ['==']), ([('', 'bar')]...
gpl-2.0
-7,154,057,688,203,821,000
24.214286
60
0.525024
false
3.105572
false
false
false
richardkiss/pycoinnet
pycoinnet/peer/Fetcher.py
1
4318
import asyncio import logging import weakref from pycoin.serialize import b2h_rev from pycoinnet.InvItem import InvItem, ITEM_TYPE_TX, ITEM_TYPE_BLOCK, ITEM_TYPE_MERKLEBLOCK class Fetcher: """ Fetching a merkleblock also fetches the transactions that follow, and includes them in the message as the "tx" ...
mit
-5,082,640,224,147,455,000
40.12381
107
0.46943
false
4.540484
false
false
false
GNOME/orca
src/orca/scripts/apps/Instantbird/chat.py
1
6860
# Orca # # Copyright 2010 Joanmarie Diggs. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library i...
lgpl-2.1
-3,200,580,494,293,113,300
37.757062
79
0.530029
false
4.803922
false
false
false
wfhio/tramcar
job_board/models/site_config.py
1
2504
from __future__ import unicode_literals from django.db import models from django.contrib.sites.models import Site class SiteConfig(models.Model): expire_after = models.SmallIntegerField(default=30) # NOTE: We set a default here, but we will override this with a more # suitable default when we creat...
mit
-7,891,469,627,665,054,000
42.929825
78
0.580272
false
4.324698
false
false
false
furthz/colegio
src/discounts/forms.py
1
4824
from django import forms from enrollment.models import Servicio from enrollment.models import TipoServicio from enrollment.models import Matricula from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from django.forms import ModelForm, Form from utils.models import TiposNivel from django.ut...
mit
4,555,708,221,566,041,000
35.793893
126
0.578423
false
3.632253
false
false
false
daviddeng/azrael
demos/ctrl_swarm.py
1
4132
# Copyright 2014, Oliver Nagy <olitheolix@gmail.com> # # This file is part of Azrael (https://github.com/olitheolix/azrael) # # Azrael 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...
agpl-3.0
8,619,977,157,674,257,000
32.056
79
0.616167
false
3.364821
false
false
false
scott-maddox/simplepl
src/simplepl/dialogs/lockin_config_dialog.py
1
4145
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of SimplePL. # # SimplePL is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your opt...
agpl-3.0
-6,380,274,891,226,863,000
42.177083
83
0.666104
false
4.456989
false
false
false
eawag-rdm/xlsxtocsv
xlsxtocsv/xlsxtocsv.py
1
3605
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import datetime as dt from Tkinter import Tk import tkFileDialog import openpyxl as op import argparse import os.path import sys import re import csv __metaclass__ = type class RFC4180(csv.Dialect): def __i...
agpl-3.0
8,526,891,086,674,498,000
30.347826
82
0.561165
false
3.601399
false
false
false
rboman/progs
bin/powergrep.py
1
3561
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # try to replace "old_div(a,b)"" by "a/b" # with a and b being complex expressions involving brackets, etc. # processes all the python files recursively from the current folder # # you must use the script several times # (it processes 1 "old_div" per line at a time...
apache-2.0
5,097,906,595,243,001,000
30.236842
99
0.495366
false
3.764271
false
false
false
soupmonkey/pushcoin
PoS/payment-processor/settings.py
1
1339
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012 Slawomir Lisznianski <sl@minta.com> # # GNU General Public Licence (GPL) # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; eithe...
gpl-3.0
-4,831,188,054,566,369,000
33.333333
79
0.765497
false
3.099537
false
false
false
PuzzleboxIO/brainstorms-python
setup.py2app.py
1
3818
""" This is a setup.py script generated by py2applet Usage: python2.7 setup.py py2app """ from setuptools import setup APP = ['brainstorms-local.py'] data_files=[ \ (".", \ #("Content/Resources", \ ["puzzlebox_brainstorms_configuration.ini"]), ("images", \ ["images/puzzlebox.ico", \ "images/puzzlebox....
agpl-3.0
-7,486,098,163,901,852,000
30.04065
109
0.680723
false
2.666201
false
false
false
nmih/ssbio
ssbio/databases/pdb.py
1
34959
""" PDBProp ======= """ import gzip import json import logging import os.path as op import mmtf import os from cobra.core import DictList import pandas as pd import requests import deprecation from Bio.PDB import PDBList from lxml import etree from six.moves.urllib_error import URLError from six.moves.urllib.request i...
mit
1,119,046,539,905,341,600
40.225236
268
0.615778
false
3.782623
false
false
false
tensorflow/probability
tensorflow_probability/python/optimizer/linesearch/hager_zhang.py
1
30378
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
6,853,210,817,681,248,000
46.539906
94
0.697511
false
3.993427
false
false
false
tonyduckles/svn2svn
svn2svn/run/parse.py
1
2731
""" optparser helper functions """ import optparse import textwrap class HelpFormatter(optparse.IndentedHelpFormatter): """ Modified version of certain optparse.IndentedHelpFormatter methods: * Respect line-breaks in parser.desription and option.help_text * Vertically-align long_opts Inspired by: ...
gpl-3.0
-6,258,201,666,401,967,000
40.378788
125
0.556573
false
3.912607
false
false
false