repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
spitz-dan-l/param-space
param_space.py
1
11698
from itertools import product from collections import abc, defaultdict from functools import partial class ParamSpace: def __init__(self, spec): self.spec = self.validate_spec(spec) def validate_spec(self, spec): if not isinstance(spec, dict): raise TypeError('spec must be a dict...
mit
-8,730,825,284,243,174,000
30.194667
125
0.579244
false
3.583946
false
false
false
texnofobix/pyhwtherm
pyhwtherm/pyhwtherm.py
1
7219
import requests import datetime import time import json class PyHWTherm(object): """ PyHWTherm is Python code to connect to the Honeywell Thermostat (currently at https://mytotalconnectcomfort.com/portal/TotalConnectComfort) website to query and change settings. """ HOST = 'mytotalconnectcomfo...
mit
6,461,863,274,536,040,000
27.876
89
0.534007
false
4.048794
false
false
false
SuLab/genewiki
old-assets/genewiki/genewiki.py
1
1719
import sys, re, argparse, urllib import mygeneinfo as mygene class GeneWiki(object): def names_and_entrez(self): ''' Returns a tuple (name, entrez) for all articles in the Gene Wiki where the entrez corresponds to the PBB template being used. ''' for page in self.arti...
mit
8,939,434,427,858,771,000
33.38
143
0.57708
false
3.769737
false
false
false
mfe5003/rydtip
Rb87Spectrum.py
1
2324
# coding: utf-8 # In[1]: import scipy.constants as consts from lib.AtomNumbers import QD, Rb87, State, TransitionFrequency, TermEnergy import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt get_ipython().run_line_magic('matplotlib', 'inline') # In[2]: s1 = State(5,0,0.5) s2 = State(5,1,1.5)...
gpl-3.0
-1,884,640,207,877,702,400
22.958763
139
0.60241
false
2.278431
false
false
false
smnitro555/ESWegarden
systemSensors/Float_Switch.py
1
1148
import RPi.GPIO as GPIO import Base_Sensor class Float_Switch(Base_Sensor.Base_Sensor): def __init__(self, sensorPinIn): super(Float_Switch, self).__init__(sensorPinIn) GPIO.setup(self.port, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) #Checks whether to start in water high or low condition if GPIO.input...
gpl-3.0
8,822,688,708,425,898,000
40
105
0.678571
false
3.317919
false
false
false
kingjr/meg_expectation_p3
scripts/run_stats_sensors_.py
1
5583
import sys sys.path.insert(0, './') import matplotlib matplotlib.use('Agg') import pickle import numpy as np import matplotlib.pyplot as plt from itertools import product import mne from mne.epochs import EpochsArray from mne.stats import spatio_temporal_cluster_1samp_test as stats from meeg_preprocessing.utils impo...
gpl-3.0
3,276,049,627,302,928,400
35.97351
73
0.555973
false
3.641879
false
false
false
stwagnr/tpm2simulator
scripts/modules/part3_commands/tpm2_part3_command_attributes_h.py
1
2391
# -*- coding: utf-8 -*- from textwrap import dedent from modules import constants from modules.file_handling import FileHandling class CommandAttributesHeaderFile: """ """ # Initializes command attributes header content with according defines def __init__(self): self.file_path = constants.S...
bsd-2-clause
6,239,348,928,516,156,000
44.980769
101
0.427436
false
4.277281
false
false
false
XVMX/vmbot
vmbot/price.py
1
8348
# coding: utf-8 from __future__ import absolute_import, division, unicode_literals, print_function import threading import sqlite3 from concurrent import futures from .botcmd import botcmd from .helpers.files import STATICDATA_DB from .helpers.exceptions import APIError, APIStatusError from .helpers import api from...
gpl-3.0
8,404,268,093,759,323,000
38.752381
95
0.535218
false
3.758667
false
false
false
LCAV/pylocus
pylocus/basics.py
1
5490
#!/usr/bin/env python """ Useful basic math tools for localization from distances. """ import numpy as np import itertools from math import pi, atan, atan2, sqrt, acos, cos, sin def mse(x, xhat): """ Calcualte mse between vector or matrix x and xhat """ buf_ = x - xhat np.square(buf_, out=buf_) # square ...
bsd-2-clause
-9,192,029,301,282,475,000
29
114
0.606011
false
2.926439
false
false
false
openfoodfacts/OpenFoodFacts-APIRestPython
flask_rest_service/resources_products.py
1
13855
import json import pymongo from flask import request, abort, json from flask.ext import restful from flask.ext.restful import reqparse from flask_rest_service import app, api, mongo from bson.objectid import ObjectId from bson.code import Code # ----- /products ----- class ProductsList(restful.Resource): # ----- ...
apache-2.0
-5,029,315,690,742,986,000
40.48503
233
0.478888
false
4.21509
false
false
false
typemytype/RoboFontExamples
observers/drawVerticalMetricsBox.py
1
1127
from mojo.events import addObserver from mojo.drawingTools import * from lib.tools.defaults import getDefault class DrawVerticalMetricBox(object): def __init__(self): addObserver(self, "drawMetricsBox", "drawBackground") self.color = getDefault("glyphViewMarginColor") ...
mit
-1,749,495,039,459,770,600
26.512195
83
0.581189
false
4.318008
false
false
false
Niklas9/retwis-py
app.py
1
1409
#!/usr/bin/python import flask import os import redis API_BASE_URL = '/api/v1' app = flask.Flask(__name__) r = redis.Redis(os.environ['DB_PORT_6379_TCP_ADDR'], port=6379) @app.route('%s/users' % API_BASE_URL, methods=['GET']) def users(): users = [] return flask.jsonify({'users': users}) @app.route('%s/us...
mit
1,092,248,687,387,597,800
26.096154
73
0.540099
false
3.010684
false
false
false
ctogle/msched
src/msched/core/tree.py
1
5743
import pdb # implementation of a topological tree class tree: def __str__(self):return 'tree:'+str(self.vertcount)+str(edgecount) def vcnt(self):return self.cnt(self.verts) def ecnt(self):return self.cnt(self.edges) def cnt(self,tobjs): x = 0 for v in tobjs: if not...
mit
3,885,776,081,203,027,000
27.859296
71
0.555285
false
3.428657
false
false
false
parejadan/feature-center
feature/test/test_unit.py
1
1800
import pytest from random import random from feature.model import ProductTypes, ClientFeatureRequest from feature.model.logic import update_feature_and_peers def test_full_safe_serialize_serialize(): properties = {'product_code': 'telecommunication'} definition = ProductTypes(**properties) defini...
mit
-9,014,354,538,263,389,000
41.902439
117
0.684444
false
3.6
true
false
false
baoboa/pyqt5
examples/designer/plugins/python/datetimeeditplugin.py
3
4449
#============================================================================# # Designer plugins for PyDateEdit and PyDateTimeEdit # #----------------------------------------------------------------------------# # Copyright (c) 2008 by Denviso GmbH, <ulrich.berning@denviso.de> # # ...
gpl-3.0
-2,221,159,281,036,188,700
34.309524
83
0.458305
false
5.540473
false
false
false
xraywu/wegene-python-sdk
wegene/Models/Profile.py
1
2690
# -*- coding: utf-8 -*- """ wegene.Models.Profile This file was automatically generated by APIMATIC BETA v2.0 on 02/22/2016 """ from wegene.APIHelper import APIHelper class Profile(object): """Implementation of the 'profile' model. Genetic profile available for Wegene User Attri...
mit
3,735,735,774,472,061,000
30.02381
76
0.552416
false
5.028037
false
false
false
matthewwardrop/python-qubricks
qubricks/integrator.py
1
25406
from abc import ABCMeta, abstractmethod import math import sys import types from sympy.core.cache import clear_cache as sympy_clear_cache import numpy as np from parampy import Parameters from .operator import Operator from .stateoperator import StateOperator class Integrator(object): ''' `Integrator` instances ...
mit
-6,354,044,745,220,805,000
30.717853
140
0.695781
false
3.456128
false
false
false
RachellCalhoun/craftsite
accounts/urls.py
1
1059
from django.conf.urls import include, url from . import views urlpatterns = [ url(r'^register/$', views.register,name="register"), # url('^logout', views.logout_view,name="logout"), # url('^login', views.logout_view,name="login"), url(r'^password_change/$','django.contrib.auth.views.pa...
gpl-3.0
2,913,436,607,652,759,600
43.125
130
0.611898
false
3.602041
false
true
false
pfmoore/pip
src/pip/_vendor/pep517/dirtools.py
34
1129
import os import io import contextlib import tempfile import shutil import errno import zipfile @contextlib.contextmanager def tempdir(): """Create a temporary directory in a context manager.""" td = tempfile.mkdtemp() try: yield td finally: shutil.rmtree(td) def mkdir_p(*args, **kwa...
mit
-247,291,851,958,298,400
24.659091
60
0.603189
false
3.77592
false
false
false
nomicflux/hexation
python/doublebrain.py
1
1070
from quickbrain import * from math import log, e, exp, atan class DoubleBrain(object): maxval = log(e-1) def __init__(self, size, weights1 = None, weights2 = None, rotate = False): self.size = size self.inputsize = 3 self.outputsize = 3 midpoint = 48 + 6*self.inputsize ...
gpl-2.0
-2,945,846,518,714,678,000
33.516129
85
0.627103
false
3.627119
false
false
false
FluidityProject/multifluids
examples/backward_facing_step_3d/postprocessor_3d.py
1
9284
#!/usr/bin/env python import glob import sys import os import vtktools import numpy import pylab import re def get_filelist(): def key(s): return int(s.split('_')[-1].split('.')[0]) list = glob.glob("*vtu") list = [l for l in list if 'check' not in l] vtu_nos = [float(s.split('_')[-1].spl...
lgpl-2.1
-4,985,801,101,077,331,000
32.157143
161
0.600603
false
3.195869
false
false
false
mikeres0/weaved-cli
weaved.py
1
2546
import json, requests, sys, getpass, os def Init(): print("+===== Weaved CLI - Mike Resoli (c) =====+") print("") print("") try: username = input("Enter your email address: ") password = getpass.getpass() url = "https://api.weaved.com/v22/api/user/login/" + username + "/" + password print("...
mit
860,637,556,011,252,400
24.520833
172
0.649254
false
3.394667
false
false
false
anastue/netforce
netforce_purchase/netforce_purchase/models/report_purchase.py
2
7254
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, publ...
mit
3,669,559,999,013,543,000
37.791444
352
0.573615
false
3.678499
false
false
false
david672orford/GPX_Trip_Planner
Code/gpx_layer_photos.py
1
2346
#============================================================================= # gpx_layer_photos.py # Photos map layer # Copyright 2013, 2014, Trinity College # Last modified: 7 November 2013 #============================================================================= import gtk from pykarta.maps.layers import Map...
gpl-2.0
-2,741,385,240,548,556,000
30.28
115
0.638534
false
3.054688
false
false
false
gem/oq-hazardlib
openquake/hazardlib/tests/gsim/sharma_2009_test.py
1
3799
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2017 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
-7,838,120,027,742,161,000
35.883495
77
0.693077
false
3.635407
true
false
false
indexofire/gork
src/gork/application/article/module/category/content.py
1
2999
# -*- coding: utf-8 -*- from django import forms from django.db import models from django.contrib.admin.widgets import AdminRadioSelect from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ from feincms.admin.item_editor import ItemEditorForm from article.models imp...
mit
-1,127,058,956,256,634,100
36.024691
93
0.594532
false
4.516566
false
false
false
fetux/redslack
redslack/views.py
1
20634
from django.utils import timezone from django.db import IntegrityError from rest_framework.decorators import api_view from redmine import * from models import User from utilities import * redmine = None @api_view(['POST']) def router(request): """ API entry point that routes outside world requests """ ...
lgpl-3.0
3,829,118,535,143,366,000
35.010471
190
0.518077
false
3.998837
false
false
false
duyuan11/glumpy
examples/smoke/smoke.py
1
8460
#! /usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------...
bsd-3-clause
-8,401,504,842,533,994,000
34.39749
96
0.662057
false
3.161435
false
false
false
mpg-age-bioinformatics/AGEpy
AGEpy/blast.py
1
7885
import requests import itertools import pandas as pd import sys def variablename(var): """ Returns the string of a variable name. """ s=[tpl[0] for tpl in itertools.ifilter(lambda x: var is x[1], globals().items())] s=s[0].upper() return s def BLASTquery(query,database,program,filter=None,\ ...
mit
-780,215,468,911,908,900
48.28125
205
0.660748
false
3.487395
false
false
false
USGSDenverPychron/pychron
pychron/remote_hardware/registry.py
1
9895
# =============================================================================== # Copyright 2015 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
5,191,059,779,973,962,000
28.537313
94
0.530369
false
3.758071
false
false
false
fsalmoir/PyGeM
pygem/stlhandler.py
1
3986
""" Derived module from filehandler.py to handle STereoLithography files. """ import numpy as np from mpl_toolkits import mplot3d from matplotlib import pyplot from stl import mesh, Mode import pygem.filehandler as fh class StlHandler(fh.FileHandler): """ STereoLithography file handler class :cvar string infile: ...
mit
-4,913,880,133,908,250,000
30.385827
102
0.685148
false
2.930882
false
false
false
fzadow/CATMAID
scripts/neurohdf/neurohdf.py
3
14399
import json import time from django.conf import settings from django.http import HttpResponse from django.shortcuts import get_object_or_404 from catmaid.models import * from catmaid.control.authentication import * from catmaid.control.common import * from catmaid.control.object import get_annotation_graph from cat...
agpl-3.0
-4,449,091,573,013,935,600
41.854167
114
0.626571
false
3.534364
false
false
false
bnjones/Mathics
mathics/builtin/randomnumbers.py
1
23908
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Random number generation Random numbers are generated using the Mersenne Twister. """ from __future__ import unicode_literals from __future__ import absolute_import import six from six.moves import range import six.moves.cPickle as pickle import binascii import has...
gpl-3.0
3,079,572,510,946,784,000
34.577381
180
0.589719
false
3.555093
false
false
false
cebel/pyctd
src/pyctd/cli.py
1
2467
# -*- coding: utf-8 -*- """ Module that contains the command line app Why does this file exist, and why not put this in __main__? You might be tempted to import things from __main__ later, but that will cause problems--the code will get executed twice: - When you run `python -m pyctd` python will execute ``__main...
apache-2.0
-2,753,371,247,931,955,000
27.356322
109
0.683016
false
3.499291
false
false
false
lidavidm/sympy
sympy/physics/quantum/piab.py
124
1756
"""1D quantum particle in a box.""" from __future__ import print_function, division from sympy import Symbol, pi, sqrt, sin, Interval, S from sympy.physics.quantum.operator import HermitianOperator from sympy.physics.quantum.state import Ket, Bra from sympy.physics.quantum.constants import hbar from sympy.functions....
bsd-3-clause
8,298,416,204,019,598,000
24.449275
67
0.657745
false
3.251852
false
false
false
tallakahath/pymatgen
pymatgen/analysis/elasticity/elastic.py
2
26939
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, print_function, unicode_literals from __future__ import absolute_import from pymatgen.analysis.elasticity.tensors import Tensor, \ voigt_map as vmap, TensorCollection f...
mit
-903,694,304,969,467,600
35.159732
80
0.598203
false
3.652746
false
false
false
joachimmetz/dfvfs
tests/path/gzip_path_spec.py
2
1113
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for the gzip file path specification implementation.""" import unittest from dfvfs.path import gzip_path_spec from tests.path import test_lib class GzipPathSpecTest(test_lib.PathSpecTestCase): """Tests for the gzip file path specification implementation.""" ...
apache-2.0
7,392,989,838,175,239,000
25.5
72
0.697215
false
3.772881
true
false
false
Romaingin/Antlia
examples/gallery/gallery.py
1
1681
import sys, os sys.path.insert(1, os.path.join(sys.path[0], '../..')) from antlia import * import time as ti import urllib.request import threading # Variables current_theme = "nature" is_running = True # Create a GUI based on a layout file and a style file GUI = Antlia("gallery_layout", "gallery_style") def onStar...
mit
-7,790,302,961,429,041,000
25.68254
127
0.696609
false
2.923478
false
false
false
flypy/flypy
flypy/compiler/special.py
1
1899
# -*- coding: utf-8 -*- """ Simple definitions to work with special methods. """ from __future__ import print_function, division, absolute_import from pykit.ir import ops, defs from pykit.utils import invert #===------------------------------------------------------------------=== # Special methods #===------------...
bsd-2-clause
-8,841,108,598,271,795,000
30.666667
74
0.447604
false
4.229399
false
false
false
zeinsteinz/tacker
tacker/extensions/vnfm.py
1
17029
# Copyright 2015 Intel Corporation.. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
2,791,974,590,965,299,000
28.770979
79
0.515239
false
4.211971
false
false
false
theyosh/TerrariumPI
terrariumNotification.py
1
35471
# -*- coding: utf-8 -*- import re import datetime import RPi.GPIO as GPIO import time import os import os.path try: import thread as _thread except ImportError as ex: import _thread try: import configparser except ImportError as ex: import ConfigParser as configparser import gettext # Email support import em...
gpl-3.0
2,265,883,581,726,947,300
44.071156
270
0.612867
false
3.816138
true
false
false
cloudboss/bossformation
bossformation/cli.py
1
1965
# Copyright 2016 Joseph Wright <rjosephwright@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
mit
-4,540,132,683,114,888,000
39.9375
79
0.727735
false
4.102296
false
false
false
cbeighley/peregrine
peregrine/iqgen/bits/tcxo_poly.py
2
2620
# Copyright (C) 2016 Swift Navigation Inc. # Contact: Valeri Atamaniouk <valeri@swiftnav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights reserved. # # THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF A...
gpl-3.0
2,740,121,078,052,650,500
28.438202
79
0.637023
false
3.852941
false
false
false
hdoria/HnTool
HnTool/modules/postgresql.py
1
4045
# -*- coding: utf-8 -*- # # HnTool rules - PostgreSQL # Copyright (C) 2009-2010 Sebastian SWC <mail@sebastianswc.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 Free Software Foundation; either version 2 of ...
gpl-2.0
6,752,388,499,986,701,000
45.505747
124
0.519407
false
4.714452
false
false
false
observerss/yamo
yamo/connection.py
1
2079
import time import queue import pickle import functools import threading task = queue.Queue() prepared = {} def myopen(oldopen, conn): task.put(conn) return oldopen() def bg_prepare(started=[]): def _prepare(prepared={}): while True: try: conn = task.get(timeout=1) ...
mit
-3,813,213,131,026,854,000
23.458824
74
0.531506
false
3.9375
false
false
false
xxyxyz/flat
flat/group.py
1
1859
from copy import copy from .misc import dump, scale class group(object): __slots__ = 'k', 'items' @staticmethod def open(path): raise NotImplementedError def __init__(self, units='mm'): self.k = scale(units) self.items = [] def units(self, units='mm'):...
mit
626,735,445,238,940,900
22.833333
77
0.518558
false
3.367754
false
false
false
dilawar/ncbs-hippo
concurrent_usage.py
2
1268
"""concurrent_usage.py: """ __author__ = "Dilawar Singh" __copyright__ = "Copyright 2017-, Dilawar Singh" __version__ = "1.0.0" __maintainer__ = "Dilawar Singh" __email__ = "dilawars@ncbs.res.in" __status__ = "Development" import sys import os from db_connect impo...
mit
-57,502,025,827,606,930
26.565217
77
0.561514
false
2.990566
false
false
false
AlanJAS/iknowAmerica
recursos/0sanvicenteyg/datos/0sanvicenteyg.py
1
2542
# -*- coding: utf-8 -*- from gettext import gettext as _ NAME = _('Saint Vincent and the Grenadines') STATES = [ (_('Saint David'), 254, 176, 173, 60), (_('Carlotte'), 253, 293, 271, 80), (_('Saint Andrew'), 252, 112, 409, 30), (_('Saint Patrick'), 251, 106, 317, 20), (_('Saint George'), 250, 197...
gpl-3.0
6,157,162,200,731,662,000
35.271429
116
0.45963
false
2.465049
false
true
false
oemof/feedinlib
docs/conf.py
1
1230
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.coverage', 'sphinx.ext.doctest', 'sphinx.ext.extlinks', 'sphinx.ext.ifconfig', 'sphinx.ext.napoleon', 'sphinx.ext.todo', 'sphinx.ext....
mit
-2,232,436,364,708,445,400
25.170213
67
0.649593
false
2.853828
false
true
false
NicRSkinner/cnn-number-identification-tf
DeepCNN.py
1
3484
import tensorflow as tf import numpy as np from Batching import Batching class DeepCNN: def __init__(self, savefile): self.savefile = savefile def build(self, x): x_image = tf.reshape(x, [-1, 28, 28, 1]) W_conv1 = self.weight_variable([5, 5, 1, 32]) b_conv1 = self.bias_variabl...
gpl-3.0
1,721,568,586,004,654,300
36.06383
86
0.576062
false
3.184644
false
false
false
tirth/PyBot
utils/windows.py
1
5793
__author__ = 'Tirth Patel <complaints@tirthpatel.com>' import win32api as windows import win32con from time import sleep # build command > python -m py2exe.build_exe pybot.py -c -b 0 -x tkinter # dictionary to hold key name and VK value VK_CODE = {'backspace': 0x08, 'tab': 0x09, 'clear': 0x0C, ...
mit
-124,341,326,609,480,580
23.760684
72
0.440877
false
2.853695
false
false
false
JConwayAWT/PGSS14CC
lib/python/multimetallics/ase/calculators/abinit.py
3
27548
"""This module defines an ASE interface to ABINIT. http://www.abinit.org/ """ import os from glob import glob from os.path import join, isfile, islink import numpy as np from ase.data import chemical_symbols from ase.data import atomic_numbers from ase.units import Bohr, Hartree class Abinit: """Class for doi...
gpl-2.0
1,767,865,768,434,912,500
36.685363
179
0.512269
false
3.642952
false
false
false
Patchett/Leetcode-Problems
medium/remove_nth_node_from_end_of_list.py
1
1381
# Author: Ryan Bridges - 9/9/2017 # Given a linked list, remove the nth node from the end of list and return its head. # For example, # Given linked list: 1->2->3->4->5, and n = 2. # After removing the second node from the end, the linked list becomes 1->2->3->5. # Note: # Given n will always be valid. # Try...
apache-2.0
3,780,286,430,233,830,000
21.274194
85
0.581463
false
3.189376
false
false
false
ankurankan/pgmpy
pgmpy/inference/bn_inference.py
2
8890
from pgmpy.inference import Inference from pgmpy.models import BayesianNetwork import pandas as pd import numpy as np import networkx as nx import itertools class BayesianModelInference(Inference): """ Inference class specific to Bayesian Models """ def __init__(self, model): """ Clas...
mit
6,684,041,470,712,929,000
34
108
0.597075
false
4.483106
false
false
false
erikvolz/idepi-ev0
idepi/normalvalue/__init__.py
4
4100
# # idepi :: (IDentify EPItope) python libraries containing some useful machine # learning interfaces for regression and discrete analysis (including # cross-validation, grid-search, and maximum-relevance/mRMR feature selection) # and utilities to help identify neutralizing antibody epitopes via machine # learning. # #...
gpl-3.0
-3,535,296,051,073,404,400
29.827068
113
0.623171
false
3.949904
false
false
false
ExtTy/python_training
my_first_auto.py
1
1936
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class my_first_auto(unitte...
apache-2.0
8,331,089,467,146,186,000
37.72
73
0.616219
false
3.361111
false
false
false
cristian99garcia/pyeyes-activity
eyes.py
1
7894
#!/usr/bin/env python # -*- coding: utf-8 -*- import math from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GdkPixbuf class Eye(Gtk.DrawingArea): def __init__(self, fill_color): Gtk.DrawingArea.__init__(self) self.frame = 0 self.blink = False ...
gpl-3.0
8,793,362,493,901,408,000
37.507317
192
0.576767
false
2.91399
false
false
false
DavideCanton/Python3
num/fact_decomposition.py
1
1141
import functools import itertools as it import heapq import math import operator __author__ = 'Davide' def primes(): yield 2 todel = [(4, 2)] n = 3 while True: if todel[0][0] != n: yield n heapq.heappush(todel, (n * n, n)) else: while todel[0][0] ==...
gpl-3.0
-1,502,140,248,254,707,700
19.017544
79
0.574058
false
3.143251
false
false
false
pratikmallya/pyrax
pyrax/rackconnect.py
2
7668
# -*- coding: utf-8 -*- # Copyright (c) 2014 Rackspace US, 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/LI...
apache-2.0
1,401,828,649,441,042,700
32.33913
78
0.611894
false
3.77734
false
false
false
ssdxiao/kimchi
tests/utils.py
1
5459
# # Project Kimchi # # Copyright IBM, Corp. 2013 # # 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 lib...
lgpl-2.1
1,401,033,226,183,563,500
29.668539
79
0.629053
false
3.828191
true
false
false
padraic-padraic/bad-boids
boids/flock.py
1
5665
""" A hopefully no longer bad implementation of [Boids](http://dl.acm.org/citation.cfm?doid=37401.37406) for use as an exercise on refactoring. """ from matplotlib import pyplot as plt from matplotlib import animation import numpy as np import os import random import six import yaml class Flock(object): """The Flo...
gpl-2.0
4,753,831,681,701,463,000
39.755396
194
0.606178
false
3.784235
false
false
false
quentinlautischer/291MiniProject2
src/phase3.py
1
15532
# 1. p:camera The first query returns all records that have the term camera in the product title. # 2. r:great The second query return all records that have the term great in the review summary or text. # 3. camera The third query returns all records that have the term camera in one of the fields product title, revie...
apache-2.0
-8,887,391,866,331,831,000
34.3
541
0.470963
false
3.997941
false
false
false
Tillwoofie/Flinx
flinx_lib/request_router.py
1
1711
# Written by Jeff Hickson (rvbcaboose@gmail.com). # This file is part of Flinx, a Python web-framework. # Flinx is free software, and comes with no warranty. # It is licenced under the GNU GLP v3. # The full terms of this are available in the LICENCE file, # in the root of the project, at <http://www.gnu.org/licenses...
gpl-3.0
-3,715,660,854,869,226,500
30.685185
78
0.635301
false
3.655983
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/notify_parameters.py
1
1211
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-9,828,393,977,432,604
35.69697
76
0.602808
false
4.371841
false
false
false
kizniche/Mycodo
mycodo/tests/manual_tests/test_gpio_detect_edge.py
1
2386
#!/usr/bin/python # coding=utf-8 import argparse import RPi.GPIO as GPIO import os import sys import time class EdgeDetect(object): def __init__(self, pin, rising): self.count = 0 self.pin = pin self.running = True GPIO.setmode(GPIO.BCM) GPIO.setup(self.pin, GPIO.IN) ...
gpl-3.0
-5,535,261,474,389,928,000
31.243243
95
0.55658
false
3.873377
false
false
false
gratefulfrog/ArduGuitar
linux/preset.py
1
4329
#!/usr/bin/python # -*- coding: utf-8 -*- """ preset.py preset mgt. part of the model layer """ import sys,csv import config class Preset(): # the presets are kept in a dictionary of form: #{'presetName':{ # 'vol':10, # 'tone':10; # 'neck':True, # ...
gpl-2.0
-1,126,626,072,916,568,700
33.632
112
0.520213
false
3.949818
false
false
false
LeonidasAntoniou/dk-plus
listen.py
1
4883
import socket, select, threading, time, math, uuid import cPickle as pickle from collections import namedtuple from params import Params MAX_DRONES = 15 MAX_STAY = 4 #seconds SAFETY_ZONE = 40 #meters CRITICAL_ZONE = 10 #meters HEADING_TOLERANCE = 5 #degrees # Set the socket parameters addr = ("192.168.2.255", 54545) ...
gpl-3.0
-6,755,910,107,590,526,000
31.771812
122
0.659021
false
2.984719
false
false
false
ImpGuard/instaparse
src/pygen.py
1
15780
from codegen import CodeGenerator from converter import * from util import StringConstants from pygenStatic import pygenStaticHelpers class PythonGenerator(CodeGenerator): def write( self, line ): self.currentFile.write(line) def writeLine( self, line ): self.currentFile.writeLine(line) ...
mit
2,001,027,693,499,268,000
50.568627
201
0.559696
false
4.390651
false
false
false
acaciawater/iom
iom/api.py
1
2685
''' Created on Jul 15, 2017 @author: theo ''' from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS from tastypie.authorization import DjangoAuthorization from tastypie import fields from tastypie.authentication import BasicAuthentication from models import Waarnemer, Meetpunt, Waarneming from tastypi...
apache-2.0
6,048,786,530,033,775,000
32.575
82
0.635382
false
3.891304
false
false
false
prtkm/jasp
jasp/database.py
3
20688
'''Module to integrate jasp with sqlite TODO 1. Figure out how to have initial and final (or subsequent positions). One way is to add a field for image number. However, then I need to keep track of the energy for each image if that is going to be in the database. 2. we need a way to update an entry 3. There needs to ...
gpl-2.0
5,770,105,108,402,863,000
25.287166
100
0.427398
false
4.01397
false
false
false
nkrode/autopilot
src/www/controller/base.py
1
8273
from datetime import datetime import glob import logging import operator import os import re import time import traceback import tornado.web import markdown2 import util.settings class BaseController(tornado.web.RequestHandler): """Base class for all controllers in the application.""" settings = {} art...
mit
539,344,678,303,226,750
32.767347
87
0.50139
false
4.852199
false
false
false
rayluo/boto
boto/dynamodb/table.py
153
21808
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without ...
mit
5,617,974,324,499,381,000
38.941392
95
0.617984
false
4.439739
false
false
false
DougMac/e2m3u2bouquet-plugin
menu.py
1
21833
import time import os import tempfile import sys import enigma import log import plugin as E2m3u2b_Plugin from about import E2m3u2b_About from providers import E2m3u2b_Providers from enigma import eTimer from Components.config import config, ConfigEnableDisable, ConfigSubsection, \ ConfigYesNo, ConfigCloc...
gpl-3.0
6,003,087,901,680,595,000
44.869748
221
0.583062
false
3.908521
true
false
false
ihuston/pyflation
pyflation/analysis/utilities.py
1
10552
""" pyflation.analysis.utilities - Helper module for analysis package """ #Author: Ian Huston #For license and copyright information see LICENSE.txt which was distributed with this file. from __future__ import division import numpy as np def kscaling(k, kix=None): """Return the k scaling for power spectrum cal...
bsd-3-clause
-1,121,261,725,650,011,300
30.498507
99
0.603867
false
3.95058
false
false
false
IBYoung/MiniJavaLLVM
runTests.py
2
10427
#!/usr/bin/env python3 # MiniJava Compiler - X86, LLVM Compiler/Interpreter for MiniJava. # Copyright (C) 2014, 2008 Mitch Souders, Mark A. Smith, Mark P. Jones # # MiniJava Compiler 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
-5,112,113,893,622,754,000
34.465986
105
0.507241
false
4.174139
true
false
false
i3detroit/i3ircterm
ircterm.py
1
11091
#!/usr/bin/env python # -*- coding: UTF-8 -*- # printer imports from printer import ThermalPrinter as tp from datetime import datetime,timedelta,time import logging from logging import StreamHandler from logging.handlers import TimedRotatingFileHandler from textwrap import TextWrapper import signal # irc imports from...
mit
2,119,944,351,998,736,600
37.244828
116
0.586421
false
3.636393
false
false
false
leiferikb/bitpop
build/scripts/master/factory/swarm_factory.py
1
4425
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility class to build the Swarm master BuildFactory's. Based on chromium_factory.py and adds chromium-on-swarm-specific steps. Common usage: - For ...
gpl-3.0
-8,578,439,712,642,343,000
36.184874
80
0.700791
false
4.116279
true
false
false
BlessedAndy/Programming-Foundations-with-Python
Programming Foundations with Python/src/cn/careerwinner/sap/callExport.py
1
2362
''' Created on Jul 14, 2017 @author: I310003 ''' import autoExportReport import time import datetime from dateutil.relativedelta import relativedelta from datetime import date #Wait for logoff server #time.sleep(60) #System will be used ERPSystem = 'PED' #ERPSystem = 'DED' #save_folder = r'C:\User...
apache-2.0
-4,437,479,318,796,498,000
31.267606
141
0.57282
false
3.673406
false
false
false
michaelsouza/network
python/create_instance.py
1
2478
import numpy as np import pandas as pd def distance_from_coordinates(x_lon, x_lat, y_lon, y_lat): # Reference: Wiki2012 - Geographical distances # Earth radius radii = 6371.009 # kilometers # radii = 3958.761; # statute miles # radii = 3440.069; # nautical miles # Conversion to radians ...
mit
838,559,064,022,801,000
36.545455
187
0.616223
false
3.085928
false
false
false
nkurihar/pulsar
docker/pulsar/scripts/gen-yml-from-env.py
1
2358
#!/usr/bin/env python # # 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 # "...
apache-2.0
2,346,724,670,139,997,000
28.111111
66
0.618745
false
3.650155
false
false
false
scollis/SULI-2015
code/retrieve_datas.py
2
2556
"""Script to retrieve dates from HRRR files""" from datetime import date, timedelta as td import datetime import matplotlib.pyplot as plt import numpy as np import glob import os """Extracts and collects files into a list""" def listfiles(): files = [] os.chdir("/data/san_store/HRRR") for file in glob.glob("*.grib...
bsd-2-clause
-8,467,848,995,404,902,000
24.56
82
0.651017
false
2.635052
false
false
false
adle29/matasono_crypto
python/detect_single_chr.py
1
1556
# # Author: Abraham Adberstein # Date: May 16, 2016 # from xor_cipher import xor_cipher import sys def get_score(text): text = text[1].lower() frequency = { 'a': 8.167, 'c': 2.782, 'b': 1.492, 'e': 12.702, 'd': 4.253, 'g': 2.015, 'f': 2.228, 'i': 6.966, 'h': 6.094, 'k': 0.772, 'j': 0.153,...
mit
5,422,004,056,474,634,000
22.575758
114
0.497429
false
2.952562
false
false
false
lo100/MyRaspiHome
framework/data_accessor/data_accessor_interface.py
1
2447
""" module:: data_accessor :synopsis: Wrapper class for data accessors. moduleauthor:: Bernhard Hari <github@taschenwerkstatt.ch> """ from data_accessor.exceptions import DataAccessorError from data_accessor.data_accessor_hdf5 import DataAccessorHDF5 class DataAccessorInterface(): """Data accessor i...
mit
-883,701,635,349,640,700
27.788235
72
0.573764
false
4.625709
false
false
false
hperala/kontuwikibot
scripts/unlink.py
1
7658
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot unlinks a page on every page that links to it. This script understands this command-line argument: -namespace:n Number of namespace to process. The parameter can be used multiple times. It works in combination with all other ...
mit
-1,897,056,853,038,016,300
36.724138
125
0.544006
false
4.416378
false
false
false
akuks/pretix
src/tests/control/test_user.py
1
4535
from tests.base import BrowserTest from pretix.base.models import User class UserSettingsTest(BrowserTest): def setUp(self): super().setUp() self.user = User.objects.create_user('dummy@dummy.dummy', 'dummy') self.driver.implicitly_wait(10) self.driver.get('%s%s' % (self.live_serve...
apache-2.0
-7,445,550,968,740,224,000
51.732558
81
0.660198
false
3.241601
true
false
false
clipo/idss-seriation
setup.py
1
1389
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Command from setuptools.command.develop import develop from setuptools.command.install import install import subprocess import os import re setup(name="idss-seriation", #version=get_versi...
apache-2.0
-8,653,546,103,023,137,000
30.568182
108
0.652988
false
3.754054
false
false
false
jdavidrcamacho/Tests_GP
08 - Thesis results/test_qp.py
1
38651
# -*- coding: utf-8 -*- import sys #sys.path.append('/home/camacho/Downloads/emcee-master') #sys.path.append('/home/up200908455/Desktop/Github/Gedi') #sys.path.append('/home/up200908455/Desktop/Github/Emcee') #sys.path.append('/home/up200908455/Desktop/Github/George') #sys.path.append('/home/up200908455/Desktop/Github/...
mit
-3,188,913,922,627,995,000
37.268317
109
0.503247
false
3.223065
false
false
false
vlinhart/django-smsbrana
setup.py
1
1049
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup, find_packages except ImportError: import ez_setup ez_setup.use_setuptools() from setuptools import setup, find_packages import os setup( name = "django-smsbrana", version = "0.2", url = 'https://github.co...
bsd-3-clause
-8,090,914,069,313,086,000
28.971429
75
0.630124
false
3.629758
false
true
false
astrophysicist87/iEBE-Plumberg
ParameterDict.py
1
5058
controlParameterList = { 'simulation_type' : 'hydro', # options: 'hybrid', 'hydro', 'hydroEM', 'hydroEM_with_decaycocktail', # 'hydroEM_preEquilibrium', 'hydroEM_with_decaycocktail_with_urqmd' 'niceness' : 0, # range from 0 to 19 for process priority, 0 for the hi...
gpl-3.0
-6,503,005,716,776,503,000
38.515625
93
0.451562
false
3.169173
false
false
false
dmsurti/mayavi
mayavi/core/pipeline_info.py
3
2173
""" Defines the class that describes the information on the inputs and outputs of an object in the pipeline. """ # Author: Prabhu Ramachandran <prabhu@aero.iitb.ac.in> # Copyright (c) 2008, Prabhu Ramachandran Enthought, Inc. # License: BSD Style. # Enthought library imports. from traits.api import HasTraits, Enum, ...
bsd-3-clause
6,412,746,988,080,657,000
30.955882
80
0.54763
false
4.363454
false
false
false
openqt/algorithms
projecteuler/pe376-nontransitive-sets-of-dice.py
1
1452
#!/usr/bin/env python # coding=utf-8 """376. Nontransitive sets of dice https://projecteuler.net/problem=376 Consider the following set of dice with nonstandard pips: Die A: 1 4 4 4 4 4 Die B: 2 2 2 5 5 5 Die C: 3 3 3 3 3 6 A game is played by two players picking a die in turn and rolling it. The player who r...
gpl-3.0
1,563,337,029,175,992,600
36.230769
108
0.725207
false
3.285068
false
false
false
licko/vpp-1701-licko
test/test_lb.py
1
8078
import socket from scapy.layers.inet import IP, UDP from scapy.layers.inet6 import IPv6 from scapy.layers.l2 import Ether, GRE from scapy.packet import Raw from framework import VppTestCase from util import ppp """ TestLB is a subclass of VPPTestCase classes. TestLB class defines Load Balancer test cases for: -...
apache-2.0
7,602,186,339,303,331,000
36.225806
79
0.525997
false
3.314731
true
false
false
valsteen/ableton-live-webapi
WebAPI.py
1
14639
import asynchat import logging import socket import sys import os import threading import simplejson import time import asyncore import heapq # Import Live libraries import Live import types from _Framework.ControlSurface import ControlSurface REQUEST_PORT = 5553 # request and replies ( pipeline, not interactive ...
unlicense
2,884,177,063,861,127,700
34.615572
151
0.523946
false
4.480257
false
false
false
xray/xray
xarray/tests/test_cftimeindex.py
1
37968
from datetime import timedelta from textwrap import dedent import numpy as np import pandas as pd import pytest import xarray as xr from xarray.coding.cftimeindex import ( CFTimeIndex, _parse_array_of_cftime_strings, _parse_iso8601_with_reso, _parsed_string_to_bounds, assert_all_valid_date_type, ...
apache-2.0
7,952,406,520,627,975,000
29.447474
87
0.629082
false
3.054054
true
false
false
morepath/morepath-cookiecutter
hooks/post_gen_project.py
1
1411
#!/bin/python import os import shutil from contextlib import contextmanager @contextmanager def switch_directory(path): previous_path = os.getcwd() os.chdir(path) yield os.chdir(previous_path) def get_parent_directory(path): return os.path.split(path) def get_directory_name(path): return...
unlicense
2,772,319,376,404,015,600
22.131148
76
0.61871
false
3.684073
false
false
false
fedhere/StatisticalCompass
main.py
1
1156
import numpy as np import pandas as pd from transform import transform # Load the questions questions = pd.read_csv('questions.csv') # Initialise the position of the user at the origin pos = np.zeros(3) input_text = 'Enter response from -2 (strongly disagree) to +2 (strongly agree): ' # Using a C-style loop over qu...
mit
7,020,711,855,204,617,000
27.195122
82
0.705882
false
3.19337
false
false
false
agrinh/cluster
cluster.py
1
3301
#!/usr/bin/env python """ Simple command line utility for clustering text. Reads standard input or reads the lines of the file specified as the first argument. Examples -------- Cluster lines of a file: >>> ./cluster.py lines.txt Cluster contents of a directory: >>> ls | ./cluster.py Requirements ------------ * num...
mit
-2,573,226,783,772,500,500
22.411348
79
0.621327
false
3.897285
false
false
false
beaker-project/beaker
Client/src/bkr/client/commands/cmd_pool_create.py
1
3147
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. """ .. _bkr-pool-create: bkr pool-create: Create a system pool ======...
gpl-2.0
-8,930,176,907,031,873,000
26.365217
85
0.618684
false
3.828467
false
false
false
wormone/ClimateOnLine
myfunctions.py
1
5807
# -*- coding: utf-8 -*- ''' 常量和通用函数 注有【### 仅示例】的参数仅为示例,并非全部数据或真实数据,仅供参考 ''' ###################################### 台站信息 ###################################### meta = [ "西青,54527", "市区,54517", "全市平均,99999" ] ### 仅示例 ###################################### 台站处理 ###################################### ''' 定义函数 ''' de...
mit
7,800,759,933,524,535,000
28.754286
93
0.516804
false
2.508189
false
false
false
dedoogong/asrada
yolov2_caffe/darknetBBoxViewer.py
1
1458
import os import glob list = glob.glob('/home/lee/Documents/face/*.jpg') for i in range(len(list)): annoPath=list[i].replace('.jpg','.txt') newAnnoPath = annoPath.replace('face', 'faceAnno') fnew = open(newAnnoPath, 'a') with open(annoPath,'r') as f: while True: lines=f.readline() ...
apache-2.0
-5,745,368,413,312,679,000
44.5625
150
0.423182
false
2.725234
false
false
false