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
openstack/horizon
horizon/forms/base.py
1
2359
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
5,488,790,799,278,107,000
37.672131
79
0.662145
false
4.102609
false
false
false
lennywile/Project-4-Conference-Organization-App
models.py
1
5163
#!/usr/bin/env python """models.py Udacity conference server-side Python App Engine data & ProtoRPC models $Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $ created/forked from conferences.py by wesc on 2014 may 24 """ __author__ = 'wesc+api@google.com (Wesley Chun)' import httplib import endpoints from protor...
apache-2.0
-1,937,257,789,870,535,200
31.677215
86
0.666086
false
4.024162
false
false
false
stefanpeidli/GoNet
TrainingDataFromSgfValue.py
1
14987
# -*- coding: utf-8 -*- """ Created on Sat Nov 18 12:27:16 2017 @author: Stefan Peidli This script reads sgf files from a file directory, converts them into pairs of "current board - next move" and stores them either in a dictionary or in a sqlite3 database. """ import os from collections import defaultdict from Boa...
mit
-6,093,970,981,653,002,000
42.309249
183
0.57304
false
3.722981
true
false
false
nrgaway/qubes-tools
builder-tools/libs/say/textrange.py
1
8648
""" A range of say.text.Text lines that can be edited on their own, effecting the underlying lines. If the underlying text object changes (especially changing the number of lines somewhere before or overlapping whether the text range lies), TextRange will probably become confused. However, edits made through the TextRa...
gpl-2.0
-3,921,016,752,647,922,700
37.959459
98
0.635176
false
4.108314
false
false
false
RPGOne/Skynet
pytorch-master/torch/autograd/engine.py
1
3553
from collections import deque, defaultdict from torch._C import _ImperativeEngine as ImperativeEngine from .variable import Variable class BasicEngine(object): def _compute_dependencies(self, function): dependencies = defaultdict(int) seen = {function} queue = [function] while len...
bsd-3-clause
-9,149,757,074,559,987,000
40.8
90
0.518154
false
4.244922
false
false
false
astonshane/EventsNearMe
eventsnearme/form_parsers.py
1
5758
# flask imports from flask.ext.pymongo import PyMongo from flask import Flask, request, render_template, abort, jsonify, redirect, url_for, session # base python imports import json import uuid import random from bson.json_util import dumps from datetime import datetime # EventsNear.me imports from event import * from ...
mit
4,050,863,831,509,375,000
32.870588
93
0.569642
false
3.775738
false
false
false
Brainbuster/openpli-buildumgebung
openembedded-core/scripts/lib/wic/plugins/source/rawcopy.py
1
2926
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- # # 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 program is distributed in the hope t...
gpl-2.0
7,822,382,105,433,211,000
34.253012
75
0.606972
false
3.765766
false
false
false
AlChernoff/python_training
generator/contact.py
1
2161
__author__ = 'adeksandrcernov' from model.contact import Contact import random import string import os.path import jsonpickle import getopt import sys try: opts,args = getopt.getopt(sys.argv[1:], "n:f:", ["number od groups", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f ...
apache-2.0
5,256,364,335,404,790,000
34.442623
131
0.63813
false
3.350388
false
false
false
deannariddlespur/django-easy-timezones
setup.py
1
1181
import os from setuptools import setup README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-easy-timezones', version='0.2.0', packages=['easy_t...
apache-2.0
8,752,165,778,230,941,000
31.805556
78
0.62066
false
3.822006
false
false
false
picrust/picrust
picrust/parallel.py
1
2505
#!/usr/bin/env python from __future__ import division __author__ = "Morgan Langille" __copyright__ = "Copyright 2015, The PICRUSt Project" __credits__ = ["Morgan Langille"] __license__ = "GPL" __version__ = "1.1.4" __maintainer__ = "Morgan Langille" __email__ = "morgan.g.i.langille@gmail.com" __status__ = "Developmen...
gpl-3.0
-7,899,336,269,619,359,000
34.28169
99
0.671457
false
3.394309
false
false
false
altai/altai-api
altai_api/default_settings.py
1
2666
# vim: tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab autoindent # Altai API Service # Copyright (C) 2012-2013 Grid Dynamics Consulting Services, Inc # All Rights Reserved # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License ...
lgpl-2.1
6,384,461,379,763,490,000
28.955056
75
0.747937
false
3.40051
false
false
false
dhouck/effulgence2epub
src/common.py
1
4175
import sys from bs4 import BeautifulSoup import effulgence_pb2 as eproto import google.protobuf import re import os import urlparse def get_chapters_from_stdin(): chapters = eproto.Chapters() google.protobuf.text_format.Merge(sys.stdin.read(), chapters) return chapters def load_profile_data(): ...
agpl-3.0
2,628,677,086,459,557,000
34.084034
89
0.589461
false
3.73769
false
false
false
QISKit/qiskit-sdk-py
qiskit/qasm/node/opaque.py
1
1971
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
apache-2.0
-8,590,149,094,928,597,000
30.790323
77
0.621512
false
3.879921
false
false
false
benrudolph/commcare-hq
corehq/apps/ota/views.py
1
6338
from django.core.urlresolvers import reverse from django.shortcuts import redirect from django.utils.decorators import method_decorator from django.utils.translation import ugettext_noop from casexml.apps.case.xml import V2 from corehq import toggles from corehq.apps.domain.decorators import login_or_digest_ex, domain_...
bsd-3-clause
-8,967,154,829,076,823,000
33.445652
90
0.635847
false
3.907522
false
false
false
imrehg/pydc1394
pydc1394/camera.py
1
38722
#!/usr/bin/env python # encoding: utf-8 # # This file is part of pydc1394. # # pydc1394 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 3 of the # License, or (at your option) any later v...
gpl-3.0
-3,187,467,221,128,079,400
34.042534
85
0.551444
false
4.323582
false
false
false
azumimuo/family-xbmc-addon
plugin.video.genesisreborn/resources/lib/sources/scnsrc.py
1
6067
# -*- coding: utf-8 -*- ''' This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is dis...
gpl-2.0
2,198,906,722,075,115,800
38.660131
321
0.595352
false
3.486782
false
false
false
splunk/splunk-app-splunkgit
lib/joblib/memory.py
1
22966
""" A context object for caching a function's return value each time it is called with the same input arguments. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import os import shutil import sys import time import pydoc tr...
apache-2.0
4,666,869,375,027,219,000
38.733564
79
0.521379
false
4.598718
false
false
false
chrisnorman7/gmp3
gui/menus/play.py
1
3839
"""Play menu.""" import wx, application, logging from .base import BaseMenu from functions.sound import queue, set_volume, get_previous, get_next from config import config logger = logging.getLogger(__name__) class PlayMenu(BaseMenu): """The play menu.""" def __init__(self, parent): self.name = '&Pla...
mpl-2.0
8,328,855,897,360,905,000
66.553571
247
0.700964
false
3.318064
true
false
false
KoolJBlack/MotionPlanning
osm_parser.py
1
3129
import xml.etree.ElementTree as ET import math from util import * ''' Reference for next 2 functions: http://wiki.openstreetmap.org/wiki/Mercator''' def merc_x(lon): r_major=6378137.000 return r_major*math.radians(lon) def merc_y(lat): if lat>89.5:lat=89.5 if lat<-89.5:lat=-89.5 r_major=6378137.000 r_minor=63...
mit
2,519,494,955,798,692,400
25.516949
94
0.645893
false
2.749561
false
false
false
maxshell/envcontamination
contamination/initializer.py
1
3149
from django.http import HttpResponse from contamination.models import DVS from contamination.models import Substance from contamination.models import K7 from contamination.models import K4 from contamination.models import SpeedOfTransfer from contamination.models import DepthZone from contamination.models import Wind ...
mit
-3,735,730,250,034,322,400
36.5
91
0.669736
false
2.881061
false
false
false
edreamleo/check_attrs
leoAst.py
1
86136
'''AST (Abstract Syntax Tree) related classes.''' import ast import xml.sax.saxutils as saxutils import textwrap import token as token_module import leo.core.leoGlobals as g # Python 2: https://docs.python.org/2/library/ast.html # Python 3: https://docs.python.org/3/library/ast.html _op_names = { # Binary operato...
mit
644,832,739,070,282,000
32.091049
99
0.518784
false
3.607791
false
false
false
anthkris/oppia
feconf.py
1
30687
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
4,988,535,052,358,936,000
35.499403
80
0.707463
false
3.240692
false
false
false
xnextx/openpaste
openpaste/settings.py
1
2545
""" Django settings for openpaste project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
mit
-8,678,790,641,501,653,000
25.237113
134
0.726916
false
3.193225
false
false
false
Fablab-Sevilla/ghPython101
Día_003/01_EJ/Koch_curve.py
1
1067
import rhinoscriptsyntax as rs import math as m ptList = [] def koch(ptA, ptB, r0, r1, r2, rM): #points = [] pt0 = ((ptB-ptA)*r0)+ptA pt1 = ((ptB-ptA)*r1)+ptA #Calculating vector perpendicular to ptB-ptA cross = rs.VectorCrossProduct((ptB-ptA),(0,0,1)) cross = rs.VectorUnitize(...
mit
7,704,502,042,199,426,000
24.380952
52
0.552113
false
2.553957
false
false
false
simple-dmrg/simple-dmrg
simple_dmrg_02_finite_system.py
1
10076
#!/usr/bin/env python # # Simple DMRG tutorial. This code integrates the following concepts: # - Infinite system algorithm # - Finite system algorithm # # Copyright 2013 James R. Garrison and Ryan V. Mishmash. # Open source under the MIT license. Source code at # <https://github.com/simple-dmrg/simple-dmrg/> # Thi...
mit
-291,769,840,985,521,300
41.514768
123
0.651647
false
3.421392
false
false
false
pbl64k/CodeSprints
CodeSprint-2012-10-27-(3)/PowerOutageII/poii.py
1
2850
import sys n, m = map(int, sys.stdin.readline().split(' ')) es = {} for i in range(n): es[(i, i)] = 0 for i in range(m): i, j, d = map(int, sys.stdin.readline().split(' ')) i -= 1 j -= 1 es[(i, j)] = d es[(j, i)] = d ls = map(int, sys.stdin.readline().split(' ')) gs = map(int, sys.stdin.re...
bsd-2-clause
7,806,811,669,467,195,000
22.360656
72
0.444211
false
2.90224
false
false
false
erickthered/duplicate-files-remover
duplitector.py
1
2883
import sys import os import hashlib class Duplitector: filesizes = {} total_files = 0 duplicated_files = 0 used_space = 0 autodelete = False def chunk_reader(self, fobj, chunk_size=1024): while True: chunk = fobj.read(chunk_size) if not chunk: r...
mit
-6,957,278,802,601,742,000
34.592593
77
0.501908
false
4.190407
false
false
false
bmihaylov/pycella
automaton/testDriver.py
1
1369
from pycella.automaton.automaton import CA from pycella.GUI.console_display import display from pycella.automaton.rules import life_rules from pycella.automaton.rules import seeds_rules buff = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0,...
gpl-3.0
-4,498,678,893,897,850,000
38.114286
57
0.403214
false
2.010279
false
false
false
dasmithii/Kit
kit/main.py
1
1709
import sys import commands import utility usage = ''' Kit, a project manager for C/C++ -------------------------------- - usage: kit <command> [all|<module>] [flags/options] kit [flags/options] - commands: build ...... compile all sources clean ...... remove compilati...
mit
8,207,855,328,674,199,000
24.132353
68
0.530135
false
3.739606
false
false
false
miso-belica/sumy
tests/test_summarizers/test_reduction.py
1
3095
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from sumy.summarizers.reduction import ReductionSummarizer from sumy.nlp.stemmers import Stemmer from sumy._compat import to_unicode from ..utils import build_document def test_empty_docu...
apache-2.0
7,325,072,529,167,067,000
31.578947
85
0.656543
false
3.465845
true
false
false
FEniCS/dolfin
site-packages/dolfin/fem/errorcontrolgenerator.py
1
3387
# -*- coding: utf-8 -*- """ This module provides a DOLFINErrorControlGenerator for handling UFL forms defined over DOLFIN objects. """ # Copyright (C) 2011 Marie E. Rognes # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General ...
lgpl-3.0
3,011,024,684,107,766,300
32.87
77
0.657219
false
4.155828
false
false
false
adventurerscodex/uat
components/core/character/armor.py
1
4509
"""Armor components.""" from component_objects import Component, Element class ArmorAddModal(Component): """Definition of armor add modal component.""" modal_div_id = 'addArmor' name_id = 'armorAddNameInput' type_id = 'armorAddTypeInput' magical_modifier_id = 'armorAddMagicalModifierInput' p...
gpl-3.0
-3,005,153,581,754,183,000
35.658537
87
0.703038
false
3.322771
false
false
false
zenn1989/scoria-interlude
L2Jscoria-Game/data/scripts/quests/228_TestOfMagus/__init__.py
1
11600
# Maked by Mr. Have fun! Version 0.2 # Shadow Weapon Coupons contributed by BiTi for the Official L2J Datapack Project # Visit http://forum.l2jdp.com for more details import sys from com.l2scoria.gameserver.model.quest import State from com.l2scoria.gameserver.model.quest import QuestState from com.l2scoria.gameserver....
gpl-3.0
3,641,466,301,420,339,000
39.003448
170
0.642155
false
2.666054
false
false
false
macborowy/dajsiepoznac-feed
DajSiePoznacFeed-Server/crawler/src/scrapper/html_sanitizer.py
1
1583
import logging from HTMLParser import HTMLParser from lxml.html.clean import Cleaner from lxml.etree import XMLSyntaxError class HTMLSanitizer: @classmethod def sanitize_and_parse(cls, data): if data is not None: sanitized = HTMLSanitizer._sanitize(data) parsed = HTMLSanitize...
mit
-236,594,831,555,061,700
24.548387
110
0.578016
false
4.058974
false
false
false
samgiles/grapl
grapl_gyp.py
1
2058
#!/usr/bin/env python import os import platform import sys import fnmatch import re # Preamble: to try and reduce friction set up include of the scripts. This # means we don't have to worry about the python path this_script_dir = os.path.dirname(__file__) grapl_root = os.path.normpath(this_script_dir) output_dir = o...
mpl-2.0
9,196,552,055,265,611,000
29.264706
81
0.632167
false
3.190698
false
false
false
wbinventor/openmc
openmc/data/multipole.py
1
18433
from numbers import Integral, Real from math import exp, erf, pi, sqrt import h5py import numpy as np from . import WMP_VERSION, WMP_VERSION_MAJOR from .data import K_BOLTZMANN import openmc.checkvalue as cv from openmc.mixin import EqualityMixin # Constants that determine which value to access _MP_EA = 0 # P...
mit
-3,601,111,008,269,153,000
33.454206
81
0.549232
false
3.598087
false
false
false
mrocklin/streams
streamz/dataframe/core.py
1
31023
from __future__ import division, print_function import operator from collections import OrderedDict import numpy as np import pandas as pd import toolz from tornado.ioloop import IOLoop from tornado import gen from ..collection import Streaming, _stream_types, OperatorMixin from ..sources import Source from ..utils i...
bsd-3-clause
5,644,813,473,153,213,000
32.466019
111
0.57467
false
4.233488
false
false
false
gvnn/memd
memd.py
1
2359
""" memd - memcached decorator for lazy developers (like me) usage: # simple @memd() def foo(bar): return bar # with custom key @memd(custom_key="yourkey") def foo(bar): return bar # or with ttl @memd(ttl=100) def foo(bar): return bar """ impo...
mit
-4,662,682,817,053,300,000
26.764706
67
0.505299
false
4.510516
false
false
false
jaustinpage/frc_rekt
frc_rekt/battery.py
1
1403
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- """Battery model. Models a battery on an frc robot. """ import logging import pandas as pd import numpy as np # Pandas options pd.set_option('max_rows', 121) pd.set_option('max_columns', 132) pd.set_option('expand_frame_repr', False) # just a convenience, so we dont h...
mit
2,688,775,966,512,877,000
27.632653
82
0.627227
false
3.751337
false
false
false
tgetzoya/project-euler-python
problems/pe23.py
1
1500
# A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, # the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. # # A number n is called deficient if the sum of its proper divisors is less than n and i...
bsd-2-clause
4,948,917,734,388,098,000
38.473684
119
0.674667
false
3.846154
false
false
false
ilcn/NumericalAnalysis
a8n.py
1
2226
import copy def pprint(A): n = len(A) for i in range(0, n): line = "" for j in range(0, n+1): A[i][j] = float(A[i][j]) line += str(A[i][j]) + "\t" if j == n-1: line += "| " print(line) print("") def gauss(A): ...
gpl-2.0
3,889,608,696,763,734,500
24.819277
93
0.391734
false
2.717949
false
false
false
irvs/ros_tms
tms_rc/tms_rc_ninebot/scripts/ninebot_controller.py
1
5519
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys import time import rospy import tf import wiringpi2 from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import PoseWithCovarianceStamped from actionlib_msgs.msg import GoalID from actionlib_msgs.msg import GoalStatusArray from geometry_msgs.msg im...
bsd-3-clause
903,457,179,073,788,500
33.279503
98
0.64432
false
3.076366
false
false
false
dhhxu/LBNL-energydb
load_data_files.py
1
11240
""" Loads the energy data csv files acquired through the loader scripts (ion_get_data.py or jci_get_data.py), and inserts them into the Postgres energy database. """ import csv import os import pyodbc import sys import util DB = util.PG_DB USER = util.PG_USER PWD = uti.PG_PWD # Default data directory if none is supp...
mit
-438,127,930,442,834,400
30.049724
80
0.600445
false
3.586471
false
false
false
REVLWorld/elasticsearch-dsl-py
elasticsearch_dsl/search.py
1
22718
from six import iteritems, string_types from elasticsearch.helpers import scan from elasticsearch.exceptions import TransportError from .query import Q, EMPTY_QUERY, Bool from .aggs import A, AggBase from .utils import DslBase from .result import Response, Result, SuggestResponse from .connections import connections ...
apache-2.0
-3,655,751,191,727,448,600
30.120548
105
0.528568
false
4.289653
false
false
false
TheEarnest/Prognostic-Potential-Predictability
functions/ps_func_micom_read_and_regriding_2Df.py
1
7606
#! /usr/bin/env python #coding=utf-8 #-------------------------------------------------------------------- # for micom regriding, 2014 0815 by M. Shen # modify, creating netcdf file, 2015 0227 by M. Shen # load module # import time start_time = time.time() import sys import os import numpy as np impo...
gpl-2.0
7,402,180,470,677,165,000
33.107623
104
0.617407
false
2.7749
false
false
false
nocarryr/django-safe-project
django_safe_project/template.py
1
7303
import os import sys import shutil from django_safe_project import safe_settings PY3 = sys.version_info.major > 2 if PY3: basestring = str class Template(object): """Handles copying and modifying the project template. :param source: Source path of the project template :param dest: Destination for m...
mit
-3,841,658,761,935,630,000
37.235602
122
0.502807
false
4.211649
false
false
false
jingwangian/tutorial
python/pandas_tutorial/pd_merge.py
1
1265
#!/usr/bin/env python3 import numpy as np import pandas as pd df1 = pd.DataFrame({'employee': ['Bob', 'Jake', 'Lisa', 'Sue'], 'group': ['Accounting', 'Engineering', 'Engineering', 'HR']}) df2 = pd.DataFrame({'employee': ['Lisa', 'Bob', 'Jake', 'Sue'], 'hire_date': [2004, 2008, ...
gpl-3.0
-6,150,018,606,436,728,000
31.435897
81
0.558103
false
2.908046
false
true
false
RKI027/FFXIV-DPS-Simulation
brd_rotation_simulation.py
1
18634
# To Do # Other class Scenarii: run several AvgSimulation with different configurations (Attributes) # Ideally, be able to pass the logic of the decision tree as a parameter to the simulation so that we can test several rotations # Also, program to read a gearset from a file, reference the stats on that ...
gpl-2.0
1,851,919,005,181,124,000
46.055556
304
0.500859
false
2.910198
false
false
false
kingsamchen/Eureka
crack-data-structures-and-algorithms/leetcode/python-impl/combination_sum_II_q40.py
1
1037
class Solution(object): def combinationSum2(self, candidates, target): """ :type candidates: List[int] :type target: int :rtype: List[List[int]] """ candidates.sort() out = [] results = [] combi_sum(candidates, 0, target, out, results) ...
mit
6,457,486,731,774,181,000
28.628571
90
0.554484
false
3.651408
false
false
false
otherpirate/dbaas-slack-bot
tests/persistence_persist.py
1
1450
from unittest import TestCase from unittest.mock import patch from src.persistence.persist import Persistence from src.settings import REDIS_KEY_TTL from tests import build_task_database, build_task_running class FakeCache(): def __init__(self): self.cached = {} def set(self, key, value, *args): ...
bsd-3-clause
4,721,076,175,228,485,000
31.954545
85
0.664828
false
3.74677
true
false
false
pawl/Chinese-RFID-Access-Control-Library
examples/webserver.py
1
1596
import os import cherrypy from rfid import RFIDClient, ten_digit_to_comma_format ip_address = "192.168.1.20" controller_serial = 123106461 client = RFIDClient(ip_address, controller_serial) class RootServer: @cherrypy.expose def index(self, apiKey=None, action=None, badge=None): if apiKey == "secre...
mit
7,881,688,605,406,129,000
30.92
73
0.502506
false
4.27882
false
false
false
tavy14t/tw_project
Testing/Feedly_Testing.py
1
1327
from FeedlyClient import FeedlyClient FEEDLY_REDIRECT_URI = 'http://localhost:8000' FEEDLY_CLIENT_ID = 'sandbox' FEEDLY_CLIENT_SECRET = 'JGC5BYXNVW9NXAK48KH9' def get_feedly_client(token=None): if token: return FeedlyClient(token=token, sandbox=True) else: return FeedlyClient( cli...
mit
6,974,458,998,591,357,000
25.54
73
0.671439
false
3.510582
false
false
false
ttm/percolationlegacy
percolation/text/overallMeasuring.py
1
3089
__doc__="functions for analysis of text by isolated functionalities \ or analysis and rendering roadmaps" def measureAll(authors_texts,sectorialized_agents): """Overall text analysis routine, uses all resources Uses: P.text.aux.textFromAuthors() P.text.aux.textFromSectors() Used by: P.re...
mit
5,813,451,784,363,345,000
62
141
0.730159
false
3.185759
false
false
false
kgori/treeCl
treeCl/parameters.py
1
4939
""" Data structures to hold model parameters and attributes such as alignment file paths """ import json import sys import logging logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger(__name__) def setter_helper(fn, value): """ Some property setters need to call a function on their value -- e.g....
mit
-507,496,236,752,300,400
23.944444
107
0.591415
false
4.005677
false
false
false
JaneliaSciComp/osgpyplusplus
examples/rough_translated1/osggeometryshaders.py
1
5638
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osggeometryshaders" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgViewer # Translated from file 'osggeometryshaders.cpp' # OpenSceneGrap...
bsd-3-clause
1,823,625,950,031,431,400
27.619289
81
0.641007
false
2.961134
false
false
false
alejandroautalan/pygubu
pygubu/stockimage.py
1
6962
# encoding: utf8 from __future__ import unicode_literals __all__ = ['StockImage', 'StockImageException', 'TK_IMAGE_FORMATS'] import os import logging try: import tkinter as tk except: import Tkinter as tk logger = logging.getLogger(__name__) class StockImageException(Exception): pass BITMAP_TEMP...
gpl-3.0
-1,455,857,756,914,723,600
34.340102
86
0.632577
false
2.91541
false
false
false
dagwieers/ansible
lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy_facts.py
1
5509
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
-6,791,383,005,751,069,000
30.124294
133
0.565257
false
4.368755
false
false
false
saicoco/leetcode
array/381_Inser_Del_GetRandom.py
1
2773
import random from collections import defaultdict """ 这里设计python数据结构基本操作的(时间复杂度)[http://www.orangecube.net/python-time-complexity#comment-1018], 以上可以看到,List中append, pop方法平均时间复杂度为O(1),而remove时间复杂度为O(n),那么这里重点在remove方法的写法。为了达到O(1),即无需遍历得到要删除val的位置,并只用pop方法达到O(1)的删除速度。只好空间换时间的方法。需要借助dict,set标记每个插入元素的位置,在删除时从字典中获取对应元素的位置,...
gpl-3.0
-5,344,287,801,004,124,000
29.671233
222
0.615007
false
2.524239
false
false
false
calispac/digicampipe
digicampipe/scripts/nsb_rate_camera.py
1
5147
""" Display the NSB rate for each pixel Usage: nsb_rate_camera.py [options] [--] <INPUT> Options: --help Show this <INPUT> File of histogram of baselines during a run. Output of raw.py with --baseline_filename on ...
gpl-3.0
1,548,803,328,053,787,000
40.184
81
0.626967
false
3.535027
false
false
false
textioHQ/pattern
examples/03-en/06-wordnet.py
1
2333
from __future__ import print_function import os import sys sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) from pattern_text.en import wordnet from pattern_text.en import NOUN, VERB # WordNet is a lexical database for the English language. # It groups English words into sets of synonyms called...
bsd-3-clause
-4,744,862,285,363,094,000
40.660714
100
0.691813
false
3.276685
false
false
false
balena/xray
xray4scm/storage/__init__.py
1
2593
# __init__.py - storage (sql database) for XRay data # # Original author: Copyright 2005, 2006 Matt Mackall <mpm@selenic.com> # Modified by: Copyright (C) 2009 Guilherme Versiani <guibv@comunip.com.br> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, in...
gpl-2.0
6,607,263,857,297,741,000
28.804598
93
0.658311
false
3.586445
false
false
false
Azure/azure-sdk-for-python
sdk/servermanager/azure-mgmt-servermanager/azure/mgmt/servermanager/models/error.py
1
1492
# 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
-3,741,178,787,969,728,000
29.44898
83
0.576408
false
4.349854
false
false
false
NOAA-ORR-ERD/gridded
gridded/tests/test_read.py
1
8347
#!/usr/bin/env python """ Tests for testing a UGrid file read. We really need a **lot** more sample data files... """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os from gridded import Dataset from gridded.variable import Variable from gridded.tests.utilities impor...
unlicense
8,598,337,106,367,611,000
32.930894
87
0.59734
false
3.149811
true
false
false
agoose77/hivesystem
hiveguilib/segments/antenna.py
1
1481
""" Dummy nodes for bee.segments.antenna in the GUI """ class push_antenna(object): metaguiparams = {"type": "type"} def __new__(cls, type): antennas = dict( ) outputs = dict( outp=("push", type), ) params = dict( ) class push_antenna(objec...
bsd-2-clause
-2,409,348,707,566,875,600
22.140625
47
0.53815
false
3.568675
false
false
false
clchiou/garage
py/garage/garage/sql/sqlite.py
1
1035
__all__ = [ 'create_engine', ] import sqlalchemy from garage.assertions import ASSERT def create_engine( db_uri, *, check_same_thread=False, echo=False, pragmas=()): ASSERT(db_uri.startswith('sqlite://'), 'expect sqlite URI: %s', db_uri) engine = sqlalchemy.create_engine...
mit
1,636,288,993,508,638,200
24.875
75
0.598068
false
3.709677
false
false
false
Gamegos/cesi
cesi/api/v2/users.py
1
3067
from flask import Blueprint, jsonify, request, g from decorators import is_user_logged_in, is_admin from loggers import ActivityLog import controllers from models import User users = Blueprint("users", __name__) activity = ActivityLog.getInstance() @users.route("/", methods=["GET"]) @is_user_logged_in("Illegal requ...
gpl-3.0
7,768,540,260,359,591,000
29.67
98
0.574503
false
4.301543
false
false
false
andrewyoung1991/abjad
abjad/tools/quantizationtools/UnweightedSearchTree.py
1
6407
# -*- encoding: utf-8 -*- import pprint from abjad.tools import mathtools from abjad.tools.quantizationtools.SearchTree import SearchTree class UnweightedSearchTree(SearchTree): r'''Concrete ``SearchTree`` subclass, based on Paul Nauert's search tree model: :: >>> search_tree = quantizationtools...
gpl-3.0
2,315,979,662,854,614,000
32.196891
78
0.447948
false
4.122909
false
false
false
kwss/keystone
keystone/common/wsgi.py
1
18032
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (...
apache-2.0
4,608,817,303,602,747,400
32.958569
79
0.604814
false
4.305635
true
false
false
ikedumancas/ikequizgen
quizzes/migrations/0003_auto_20150811_0355.py
1
1209
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('quizzes', '0002_auto_20150802_1350'), ] operations = [ migrations.AlterModelOptions( name='choice', ...
mit
4,443,893,360,978,393,000
26.477273
117
0.539289
false
4.461255
false
false
false
yarko/scrape
_scrape/plugins/affiliations.py
1
15248
# # # Scrape affiliations plugin; import csv import re import string from StringIO import StringIO from functools import partial ''' Affiliations - Given a list of authors, and a list of affiliations, parse them out in preparation for csv output. The functions here starting with '_' are private to this plugin, an...
bsd-3-clause
1,128,336,146,292,292,900
37.311558
123
0.567747
false
3.705468
false
false
false
LevyCory/vmpie
vmpie/datastore.py
1
3391
from pyVmomi import vim from pyVmomi import vmodl import utils import virtual_machine import vmpie_exceptions class Datastore(object): def __init__(self, datastore_name, _pyVmomiDatastore=None): # Name of the datastore self.name = datastore_name if isinstance(_pyVmomiDat...
gpl-3.0
-7,702,933,310,882,920,000
31.245098
92
0.590976
false
4.607337
false
false
false
mangaki/mangaki
mangaki/mangaki/migrations/0087_auto_20171023_2100.py
1
1628
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-23 21:00 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
agpl-3.0
-8,703,183,010,947,442,000
48.30303
505
0.622004
false
3.591611
false
false
false
maxeler/maxskins
format.py
1
5548
""" Functions used for formating header file. """ def remove_duplicates(seq): """ Removes duplicates from a list. This is the fastest solution, source: http://www.peterbe.com/plog/uniqifiers-benchmark Input arguments: seq -- list from which we are removing duplicates Output: ...
bsd-2-clause
2,574,910,828,867,918,300
35.741722
79
0.431687
false
4.588916
false
false
false
ewerybody/a2
ui/a2widget/a2hotkey/keyboard_dialog/base.py
1
20022
import os import inspect import a2uic import a2ahk import a2ctrl import a2core import a2util import a2ctrl.connect from a2widget.a2hotkey import hotkey_common from a2qt import QtGui, QtCore, QtWidgets log = a2core.get_logger('keyboard_base') BASE_MODIFIERS = ['alt', 'ctrl', 'shift', 'win'] SIDES = 'lr' DB_KEY_MOUS...
gpl-3.0
-3,080,107,559,730,773,500
35.319419
100
0.58395
false
3.712801
false
false
false
SneakersInc/HoneyMalt
src/HoneyMalt/transforms/kipposearchsession.py
1
1087
#!/usr/bin/env python from common.dbconnect import db_connect from common.entities import KippoHoneypot from canari.maltego.entities import IPv4Address from canari.maltego.message import Field from canari.framework import configure __author__ = 'catalyst256' __copyright__ = 'Copyright 2014, Honeymalt Project' __credi...
apache-2.0
-6,240,856,740,751,593,000
24.880952
71
0.675253
false
3.150725
false
false
false
alexandermueller/ImgProcess
ImgProcess/ImgProcess.py
1
1496
#!/usr/bin/env python # Intellijoint Advanced Technical Assessment # Alexander Mueller # Jan 6, 2017 import sys import Transforms from Constants import COMMANDS from Error import handle, ImgProcessException def main(argc, argv): try: if argc >= 2: inputFile = argv[0] ...
mit
-5,720,572,451,019,021,000
34.487805
160
0.524064
false
4.574924
false
false
false
goFrendiAsgard/kokoropy
kokoropy/html.py
1
14504
def presented_html_code(script): return script.replace('<','&lt;').\ replace('>','&gt;').\ replace(' ','&nbsp;').\ replace('\r\n','<br />').\ replace('\n','<br />') def include_js(path): return '<script type="text/javascript" src="' + base_url(path) + '"></script>' def includ...
mit
7,014,356,696,376,780,000
26.523719
123
0.547022
false
3.459098
false
false
false
tedor/home-blog
content/admin_views.py
1
1817
from django.shortcuts import render from content.models import Picture from django.middleware.csrf import get_token from django.core.files.uploadedfile import SimpleUploadedFile from django.http import HttpResponse from django.core.exceptions import ObjectDoesNotExist def blog_list(request): if not request.user.is...
bsd-3-clause
4,365,211,583,473,941,000
34.647059
98
0.565768
false
4.635204
false
false
false
jerkos/mzOS
mzos/utils.py
1
1192
from __future__ import absolute_import import subprocess import logging import os.path as op EMASS_PATH = [op.abspath("mzos/third_party/emass/emass"), "-i", op.abspath("mzos/third_party/emass/ISOTOPE.DAT")] def get_theo_ip(f, min_rel_int=5.0): """ # todo ask wich adducts to pass i...
mit
-5,491,475,203,034,667,000
29.564103
93
0.622483
false
3.283747
false
false
false
valkyriesavage/invenio
modules/bibupload/lib/batchuploader_webinterface.py
1
15550
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 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 opt...
gpl-2.0
-2,699,387,068,133,863,400
41.955801
125
0.551576
false
4.177861
false
false
false
1200wd/bitcoinlib
bitcoinlib/mnemonic.py
1
9732
# -*- coding: utf-8 -*- # # BitcoinLib - Python Cryptocurrency Library # MNEMONIC class for BIP0039 Mnemonic Key management # © 2016 - 2020 November - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
gpl-3.0
-1,756,085,141,937,569,300
39.377593
166
0.611859
false
3.962134
false
false
false
jeremiahyan/odoo
addons/calendar/tests/test_event_notifications.py
1
6828
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from unittest.mock import patch from datetime import datetime, date from dateutil.relativedelta import relativedelta from odoo import fields from odoo.tests.common import TransactionCase, new_test_user from odoo.addons....
gpl-3.0
3,856,420,590,592,227,000
39.402367
122
0.562537
false
4
true
false
false
anguoyang/SMQTK
MASIR/python/masir/search/EventContentDescriptor/cross_validation/iqr_cross_validation.py
1
8028
# coding=utf-8 """ Attempt at implementing k-fold cross validation for model parameter tuning. """ __author__ = 'paul.tunison@kitware.com' import logging import numpy from masir import FeatureMemory from masir.search.EventContentDescriptor import iqr_modules from masir.search.EventContentDescriptor.cross_validation...
bsd-3-clause
-4,572,529,651,450,485,000
35.995392
82
0.575486
false
3.817404
true
false
false
robinson96/GRAPE
stashy/stashy/client.py
1
2416
import json import requests.requests as requests from .helpers import Nested, add_json_headers from .admin import Admin from .projects import Projects from .compat import basestring class Stash(object): _url = "/" def __init__(self, base_url, username, password, verify=True): self._client = StashCli...
bsd-3-clause
7,640,460,409,182,509,000
31.648649
120
0.620447
false
3.847134
false
false
false
gtozzi/dophp
tools/rpctest.py
1
6968
#!/usr/bin/env python3 ''' @file rpctest.py @author Gabriele Tozzi <gabriele@tozzi.eu> @package DoPhp @brief Simple RPC JSON client in python for tetsing methods ''' import sys import argparse import re import hashlib import http.client, urllib.parse import gzip, zlib import json import logging class ParamAction(arg...
lgpl-3.0
3,012,288,344,756,890,000
27.325203
129
0.668628
false
3.233411
false
false
false
dlebauer/plantcv
scripts/dev/vis_tv_phenohex_digicam.py
1
4702
#!/usr/bin/python import sys, traceback import cv2 import numpy as np import argparse import string import plantcv as pcv ### Parse command-line arguments def options(): parser = argparse.ArgumentParser(description="Imaging processing with opencv") parser.add_argument("-i", "--image", help="Input image file.", req...
gpl-2.0
2,093,232,921,008,201,200
42.146789
167
0.70268
false
3.231615
false
false
false
alphagov/notifications-api
migrations/versions/0181_billing_primary_key.py
1
1685
""" Revision ID: 0181_billing_primary_key Revises: 0180_another_letter_org Create Date: 2018-03-21 13:41:26.203712 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0181_billing_primary_key' down_revision = '0180_another_letter_org' def upgrade(): op.alte...
mit
404,826,400,869,608,400
38.186047
99
0.47003
false
4.554054
false
false
false
wwitzel3/awx
awx/main/management/commands/register_queue.py
1
5280
# Copyright (c) 2017 Ansible Tower by Red Hat # All Rights Reserved. import sys import six from awx.main.utils.pglock import advisory_lock from awx.main.models import Instance, InstanceGroup from django.core.management.base import BaseCommand, CommandError class InstanceNotFound(Exception): def __init__(self, m...
apache-2.0
-6,249,651,683,389,665,000
39.930233
128
0.607955
false
4.154209
false
false
false
WhiteBearSolutions/WBSAirback
packages/wbsairback-mongodb/wbsairback-mongodb-1.4.4/buildscripts/utils.py
1
1038
import re import socket import time # various utilities that are handy def execsys( args ): import subprocess if isinstance( args , str ): r = re.compile( "\s+" ) args = r.split( args ) p = subprocess.Popen( args , stdout=subprocess.PIPE , stderr=subprocess.PIPE ) r = p.communicate() ...
apache-2.0
-4,820,103,752,183,066,000
21.085106
82
0.575145
false
3.56701
false
false
false
chairmanK/eulerian-audio-magnification
clip.py
1
3113
from scipy.io import wavfile import numpy as np from scipy.signal import firwin, lfilter, hamming def _num_windows(length, window, step): return max(0, int((length - window + step) / step)) def window_slice_iterator(length, window, step): """Generate slices into a 1-dimensional array of specified *length* ...
mit
7,769,174,122,267,790,000
31.427083
77
0.585609
false
3.710369
false
false
false
desecho/applications
applications_project/applications/models.py
1
3090
# -*- coding: utf8 -*- from django.db import models from django.contrib.auth.models import User class Type(models.Model): name = models.CharField('название', max_length=255) class Meta: verbose_name = 'тип заявки' verbose_name_plural = 'типы заявок' def __unicode__(self): return...
mit
139,486,244,587,423,100
33.207317
80
0.623886
false
3.194761
false
false
false
eduardoedson/scp
usuarios/views.py
1
5292
from braces.views import GroupRequiredMixin from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import render from django.views.generic import DetailView from django_filters.views import FilterV...
mit
8,925,708,689,923,606,000
30.658683
76
0.624362
false
3.741684
false
false
false
GeoLabs/QgsWPSClient
wpslib/executionrequest.py
1
16627
# -*- coding: utf-8 -*- """ /*************************************************************************** QGIS Web Processing Service Plugin ------------------------------------------------------------------- Date : 09 November 2009 Copyright : (C) 2009 by Dr. Horst Duester email ...
gpl-2.0
-3,046,851,316,049,285,000
41.742931
214
0.585012
false
3.660722
false
false
false
dunkenj/smpy
scripts/Misc/Dust Extinction Curves.py
1
1936
# coding: utf-8 # In[1]: get_ipython().magic('pylab inline') from pylab import * from mkCSPs import * # In[18]: # In[2]: SHARDS = FilterSet('../../HFF/transmCurves_SHARDS/shards_f*.res') gs = glob('../smpy-fit/GOODS-S_18_FilterCurves/Filter*.txt') print(gs) #for filt in gs: # SHARDS.addFileFilter(filt) # In...
mit
299,103,836,339,352,800
22.047619
82
0.657541
false
2.050847
false
false
false
scoder/fastrlock
setup.py
1
3001
import sys import os import re from setuptools import setup, Extension with open('fastrlock/__init__.py') as f: VERSION = re.search( r'^__version__ \s* = \s* ["\'] ([0-9ab.]+) ["\']', f.read(), re.MULTILINE|re.VERBOSE).group(1) BASEDIR = os.path.dirname(__file__) PKGNAME = 'fastrlock' PKGDIR = os...
mit
-8,977,742,498,510,293,000
26.281818
78
0.626458
false
3.650852
false
false
false
lyra833/Stufts2
Concurrent Systems/Homework/Misc/list2.py
1
1907
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Additional basic list exercises # D. Given a list of numbers, return a list where # al...
mit
-2,559,219,898,857,914,000
29.758065
79
0.630309
false
3.095779
true
false
false
PennyDreadfulMTG/Penny-Dreadful-Tools
decksite/scrapers/tappedout.py
1
5071
import re import urllib from typing import Dict, List, Optional, Set import requests from bs4 import BeautifulSoup from decksite import translation from decksite.data import deck from magic import decklist, legality from shared import configuration, fetch_tools, logger from shared.pd_exception import InvalidDataExcep...
gpl-3.0
-7,790,660,813,511,716,000
38.617188
144
0.649773
false
3.459072
false
false
false
potzenheimer/xdash
src/xpose.seotool/xpose/seotool/usermanager.py
1
6798
# -*- coding: utf-8 -*- """Module for user management and dashboard asignment""" from Acquisition import aq_inner from AccessControl import Unauthorized from five import grok from plone import api from zope.component import getMultiAdapter from zope.schema.vocabulary import SimpleVocabulary from Products.CMFPlone.ut...
mit
-6,198,129,096,906,023,000
33.683673
75
0.570021
false
4.227612
false
false
false
mheap/ansible
lib/ansible/modules/cloud/openstack/os_subnet.py
1
12218
#!/usr/bin/python # coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # 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', ...
gpl-3.0
-5,181,583,544,896,444,000
34.517442
125
0.595106
false
3.95917
false
false
false
Puddim/ScottPilgrim
Scott Pilgrim v05.py
1
6181
# ----------------------- # Game Test # Using Scott Pilgrim # By Puddim # https://github.com/Puddim # ----------------------- # IMPORT import pygame import os import time import random import math # ...
unlicense
2,857,754,772,491,994,600
24.757576
101
0.464164
false
3.321333
false
false
false