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
bkolada/koalocleaner
uis/compiled/mainwindow_ui.py
1
11113
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main_TEM.ui' # # Created: Sun Apr 06 23:25:46 2014 # by: PyQt4 UI code generator 4.8.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attrib...
gpl-3.0
-3,992,711,767,065,595,000
58.747312
154
0.714479
false
3.908899
false
false
false
daviessm/heating
temp_sensor.py
1
6139
import struct, time, logging, threading import dbus from bluepy.btle import Scanner, DefaultDelegate, Peripheral, BTLEException from bluepy import btle logger = logging.getLogger('heating') class TempSensor(object): _scanning_lock = threading.Lock() def __init__(self, peripheral): self.mac = peripheral.addr...
gpl-3.0
-601,084,842,485,565,200
30.005051
137
0.633654
false
3.443073
false
false
false
timbalam/GroopM
groopm/tests/db_upgrade_data/run_db_upgrade.py
1
2599
#!/usr/bin/env python ############################################################################### # # # This library is free software; you can redistribute it and/or # # modify it under the terms of the GNU Lesser General P...
gpl-3.0
6,770,974,434,482,290,000
48.980769
79
0.333975
false
6.401478
false
false
false
TitanEmbeds/Titan
webapp/titanembeds/database/guilds.py
1
3023
from titanembeds.database import db class Guilds(db.Model): __tablename__ = "guilds" guild_id = db.Column(db.BigInteger, nullable=False, primary_key=True) # Discord guild id unauth_users = db.Column(db.Boolean(), nullable=False, default=1) # If allowed unauth users visitor_view = db.Col...
agpl-3.0
7,627,332,055,170,403,000
72.731707
157
0.677473
false
3.718327
false
false
false
mayhem/led-chandelier
software/tbd/filter.py
1
3645
#!/usr/bin/python import abc import math import common from color import Color class Filter(common.ChainLink): def __init__(self): self.next = None super(Filter, self).__init__() def call_filter(self, t, col): if self.next: return self.next.filter(t, col) return co...
mit
-1,335,183,906,565,119,500
33.386792
122
0.576955
false
3.248663
false
false
false
sirmmo/django-webdav
setup.py
1
1864
#!/usr/bin/env python # # Copyright (c) 2011, SmartFile <btimby@smartfile.com> # All rights reserved. # # This file is part of django-webdav. # # Foobar 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, e...
agpl-3.0
-7,929,439,825,193,218,000
36.28
83
0.703326
false
4.052174
false
false
false
lwalstad-pivotal/unified-demonstration-sentiment_01
twitter-nlp/app.py
1
3000
""" twitter nlp ~~~~~~~~~~~ Serves the web application and sends tweets and tweet data using Server Side Events (SSE) """ import json import os import time import redis from flask import Flask, request, Response, render_template from gevent import monkey, sleep, socket from gevent.pywsgi import WSGIServer import h...
mit
-6,753,234,470,440,190,000
33.494253
107
0.604
false
3.597122
false
false
false
liftoff/pyminifier
pyminifier/__main__.py
1
5284
from optparse import OptionParser import sys from . import pyminify from . import __version__ py3 = False lzma = False if not isinstance(sys.version_info, tuple): if sys.version_info.major == 3: py3 = True try: import lzma except ImportError: pass def main(): "...
gpl-3.0
-5,764,630,278,049,702,000
29.194286
83
0.554883
false
4.052147
false
false
false
Harvard-ATG/HarvardCards
flash/management/commands/convert_media_store.py
1
1968
"""This command is intended for one-time use to migrate previously uploaded files (images, audio, etc) to the new MediaStore model.""" from django.core.management.base import BaseCommand, CommandError from harvardcards.settings.common import MEDIA_ROOT from flash.services import handle_uploaded_media_file from flash...
bsd-3-clause
-1,941,675,224,798,410,000
39.163265
100
0.612805
false
3.991886
false
false
false
ThiefMaster/logstapo
tests/test_util.py
1
2754
import itertools import re import pytest from logstapo import util @pytest.mark.parametrize(('regexps', 'string', 'expected'), ( ('foo', 'bar', False), ('f.o', 'foo', True), (['foo', 'bar'], 'bar', True), (['foo', 'baz'], 'bar', False), (['foo', '(b)ar', 'b(a)r'], 'bar', 'b'), )) def test_try_ma...
mit
-3,326,630,402,476,973,600
31.023256
110
0.611474
false
3.310096
true
false
false
metno/EVA
eva/executor/grid_engine.py
1
19396
import os import re import time import dateutil.parser import paramiko import paramiko.agent import paramiko.ssh_exception import eva import eva.base.executor import eva.job QACCT_CHECK_INTERVAL_MSECS = 2000 SSH_RECV_BUFFER = 4096 SSH_TIMEOUT = 5 SSH_RETRY_EXCEPTIONS = (paramiko.ssh_exception.NoValidConnectionsErr...
gpl-2.0
-2,740,359,030,533,016,600
35.874525
165
0.554908
false
4.070514
true
false
false
cleverhans-lab/cleverhans
cleverhans/tf2/attacks/spsa.py
1
17227
# pylint: disable=missing-docstring import tensorflow as tf tf_dtype = tf.as_dtype("float32") def spsa( model_fn, x, y, eps, nb_iter, clip_min=None, clip_max=None, targeted=False, early_stop_loss_threshold=None, learning_rate=0.01, delta=0.01, spsa_samples=128, sp...
mit
5,910,435,422,267,267,000
38.693548
120
0.605039
false
3.758072
false
false
false
MrLeeh/jsonwatchqt
jsonwatchqt/objectexplorer.py
1
15214
""" Copyright (c) 2015 by Stefan Lehmann """ import os import sys import re import logging from qtpy.QtCore import QModelIndex, Qt, QAbstractItemModel, QMimeData, \ QByteArray, QDataStream, QIODevice, QPoint from qtpy.QtGui import QIcon from qtpy.QtWidgets import QTreeView, QItemDelegate, QSpinBox, \ QDou...
mit
-7,191,704,010,720,514,000
32.073913
79
0.577034
false
4.234345
false
false
false
Remiii/remiii-ffmpeg-filters
titles.py
1
1998
#! /usr/bin/env python3 import json import os import sys import time from urllib import request from filter import Filter, FilterChain, Position, TimeRange from filters import DrawBox, DrawText, Overlay from resource import Resource, Resources TMP_DIR = '/tmp' FILTER_TYPES = { 'box': DrawBox, 'text': DrawTex...
mit
4,597,829,575,260,255,700
24.948052
80
0.603103
false
3.386441
false
false
false
borjam/exabgp
src/exabgp/logger/option.py
2
4081
import os import sys import time import logging from exabgp.logger.handler import getLogger from exabgp.logger.format import formater def echo(_): return _ class option(object): logger = None formater = echo short = False level = 'WARNING' logit = {} cwd = '' # where the log shou...
bsd-3-clause
-9,054,028,878,139,946,000
30.152672
87
0.549865
false
3.924038
false
false
false
javiercantero/streamlink
src/streamlink/plugins/raiplay.py
1
1110
from __future__ import print_function import re from streamlink.plugin import Plugin from streamlink.plugin.api import http, useragents from streamlink.plugin.api import validate from streamlink.stream import HLSStream class RaiPlay(Plugin): url_re = re.compile(r"https?://(?:www\.)?raiplay\.it/dirette/(\w+)/?") ...
bsd-2-clause
11,858,274,827,813,140
30.714286
120
0.625225
false
3.569132
false
false
false
arruda/wowa
wowa/tracker/migrations/0004_copy_item_to_characteritem.py
1
1326
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.db import models, migrations def itemCharacterToCharacterItemModel(apps, schema_editor): "copy the data of all M2M (Item x Character) in the CharacterItem Model" Item = apps.get_...
mit
-8,234,429,749,966,386,000
31.341463
90
0.668175
false
4.291262
false
false
false
atados/atados-ovp
api/channels/gm/tests/test_tasks.py
1
4525
from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.core import mail from ovp.apps.users.tests.fixture import UserFactory from ovp.apps.organizations.tests.fixture import OrganizationFactory from ovp.apps.projects.models import Project, Apply...
agpl-3.0
2,517,957,798,256,695,300
38.640351
107
0.646825
false
3.922743
true
false
false
domoinc/domo-python-sdk
pydomo/__init__.py
1
26888
from pydomo.Transport import DomoAPITransport from pydomo.datasets import DataSetClient from pydomo.datasets import DataSetRequest from pydomo.datasets import Schema from pydomo.datasets import Column from pydomo.datasets import ColumnType from pydomo.groups import GroupClient from pydomo.pages import PageClient from p...
mit
4,001,018,997,861,756,000
38.195335
121
0.449643
false
4.461258
false
false
false
mupif/mupif
mupif/examples/obsolete/Example11-stacTM/Example11-stacTM/mechanicalServer.py
1
1781
import os,sys sys.path.extend(['..','../../..','../Example10-stacTM-local','../Example11-thermoMechanical' ])#Path to demoapp from mupif import * import demoapp import logging log = logging.getLogger() ## Local setup - nameserver, thermal server, mechanical server, steering script. ## All runs on a local machine ## #i...
lgpl-3.0
7,215,321,499,257,930,000
44.666667
208
0.773723
false
3.108202
false
false
false
tiarno/odspdfcrop
odspdfcrop.py
1
12583
""" :platform: Unix, Windows :synopsis: Given a directory of numbered PDF files, optionally split them into one-page PDFs while retaining the numeric order, and crop white space on all sides of each PDF. :requirements: pyPdf package and access to Ghostscript executable (for finding the bounding b...
mit
-8,395,881,128,080,925,000
34.44507
99
0.589128
false
4.04468
false
false
false
nemesiscodex/JukyOS-sugar
src/jarabe/controlpanel/inlinealert.py
1
2747
# Copyright (C) 2008, OLPC # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope...
gpl-2.0
-3,075,420,153,367,084,000
32.91358
77
0.624681
false
3.768176
false
false
false
FlintHill/SUAS-Competition
tests/unit_tests/test_sda_waypoint_holder.py
1
1806
import unittest from SDA import * import numpy class WaypoinHolderTestCase(unittest.TestCase): def setUp(self): self.waypoints = numpy.array([[1,2,3],[4,5,6]]) #Must remain a 2D array def test_add_waypoint(self): single_waypoint = numpy.array([7,8,9]) test_waypoint_holder = WaypointHo...
mit
8,292,292,180,833,046,000
40.045455
106
0.699336
false
3.325967
true
false
false
boehlke/OpenSlides
openslides/utils/main.py
1
11990
import argparse import ctypes import os import sys import tempfile import threading import time import webbrowser from typing import Dict, Optional from django.conf import ENVIRONMENT_VARIABLE from django.core.exceptions import ImproperlyConfigured from django.utils.crypto import get_random_string from mypy_extensions...
mit
8,656,421,167,624,361,000
31.849315
88
0.654879
false
3.808767
false
false
false
kupospelov/classify
classify/model.py
1
6467
import tensorflow as tf import numpy as np from classify.lookup import Lookup from classify.util.logger import Logger from classify.util.timer import Timer class Model: """The neural network model.""" SCOPE_NAME = 'model' DEFAULT_PATH = './model/model.ckpt' def __init__(self, indexer, params, save_p...
mit
-8,851,315,992,157,304,000
34.338798
79
0.529303
false
4.01677
false
false
false
masscaptcha/masscaptcha
masscaptcha.py
1
1051
import requests import random import subprocess import sys def random_line(filename): with open(filename) as f: lines = [x.rstrip() for x in f.readlines()] return random.choice(lines) with open("users.txt") as usersfile: users = [x.rstrip().split(" ") for x in usersfile.readlines()] captcha = sy...
mit
7,955,093,874,446,160,000
28.194444
130
0.704091
false
3.347134
false
false
false
3ll34ndr0/10cur4
dbapi.py
1
33524
#!/usr/bin/python # coding: utf-8 import sqlite3 import json from horario import Horario # Handle hours and date from datetime import datetime, timedelta,date from datetime import time as tm from pytz import timezone import pytz import locale from time import time,localtime,strftime # This should be tied to a configura...
gpl-3.0
-3,729,589,565,397,309,400
40.734745
167
0.636052
false
3.837074
false
false
false
team-xue/xue
xue/accounts/migrations/0005_auto__add_field_dmuserprofile_location.py
1
5137
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DMUserProfile.location' db.add_column('accounts_dmuserprofile', 'location', sel...
bsd-3-clause
-5,484,120,963,883,985,000
65.592105
182
0.550127
false
3.802369
false
false
false
lonelyandrew/IRC
proj_1/iitable/iitable.py
1
8329
#! /usr/bin/env python3 import re import os class WordChain: '''The element in inverted index table that hold a word. Attributes: word: The word of the chain. freq: How many docs that the word appear, namely frequence. head: The first node in the Chain. ''' def __init__(self...
mit
-9,006,407,240,480,431,000
28.327465
78
0.541001
false
3.877561
false
false
false
mllnd/iot-sample
main.py
1
1302
import socket from machine import Pin led_pin = Pin(5, Pin.OUT) CONTENT = """\ HTTP/1.0 200 OK Content-Type: text/html <html> <head> </head> <body> <p>Hello #%d from MicroPython!</p> <a href="/toggle">Click here to toggle LED hooked to pin 5</a> </body> </html> """ def main(): s = socket.socket()...
mit
-9,214,082,512,754,436,000
24.038462
76
0.548387
false
3.453581
false
false
false
stephenliu1989/msmbuilder
msmbuilder/featurizer/subset.py
1
6212
import mdtraj as md import numpy as np from . import Featurizer, TrajFeatureUnion class BaseSubsetFeaturizer(Featurizer): """Base class for featurizers that have a subset of active features. n_features refers to the number of active features. n_max refers to the number of possible features. Paramet...
lgpl-2.1
-6,473,830,598,958,164,000
28.865385
118
0.661301
false
3.783191
false
false
false
cornell-zhang/datuner
src/datuner.py
1
15807
#!/usr/bin/python #================================================== # run DATUNER #=================================================== import uuid, platform import sys, os, argparse, socket, pickle, subprocess, sqlite3, dispy, time from threading import Thread from datetime import datetime DATUNER_HOME = os.enviro...
bsd-3-clause
382,880,850,861,905,300
35.505774
154
0.621687
false
3.329893
false
false
false
bnose/cli
bnose.py
1
2755
import stat import os import click import requests BOTTLENOSE_API_URL = 'http://127.0.0.1:8000/api/' def has_valid_permissions(path): perm = oct(stat.S_IMODE(os.lstat(path).st_mode)) return perm == oct(0o600) def get_token(): try: tokenfile = os.path.join(os.environ['HOME'], '.bnose') ...
apache-2.0
-9,016,452,144,250,770,000
22.347458
112
0.598185
false
3.564036
false
false
false
lol/BCI-BO-old
test2.py
1
2067
# import os # # delete jobs on westgrid # command = 'qdel ' # for i in range(16878874, 16880029): # print command + str(i) + '.b0' # # os.system(command + str(i) + '.b0') # file_list = os.listdir('F:/results') # for file in file_list: # print 'java Friedman F:/results/'+file +' > F:/results/' + file[:-4]+'...
gpl-3.0
4,893,311,164,411,763,000
30.318182
96
0.602322
false
2.767068
false
false
false
vlegoff/tsunami
src/secondaires/navigation/editeurs/eltedit/__init__.py
1
4581
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this ...
bsd-3-clause
-7,056,274,713,615,746,000
38.95614
79
0.653128
false
3.74281
false
false
false
maas/maas
src/maasserver/migrations/maasserver/0107_chassis_to_pods.py
1
4048
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models import maasserver.models.cleansave class Migration(migrations.Migration): dependencies = [("maasserver", "0106_testing_status")] operations = [ migrations....
agpl-3.0
-1,416,959,160,371,569,200
30.379845
75
0.467638
false
4.877108
false
false
false
indexofire/gork
src/gork/contrib/gauth/templatetags/patch.py
1
3642
# -*- coding: utf-8 -*- from distutils.version import StrictVersion from django import get_version if StrictVersion(get_version()) < '1.4': from django.template import Node from django.template import NodeList from django.template import VariableDoesNotExist from django.template import TemplateSyntaxE...
mit
-6,789,246,199,401,640,000
41.847059
99
0.546952
false
5.037344
false
false
false
hiteshagrawal/python
my-object.py
1
1424
#!/usr/bin/python class PartyAnimal: #x = 0 #name = "" def __init__(self,nam): self.x = 0 self.name = nam print self.name, "I am constructed" def party(self): self.x += 1 print self.name,"So far", self.x def __del__(self): print self.name, "I am destructed", self.x an = PartyAnimal("Hitesh") an....
gpl-2.0
3,900,743,497,929,278,500
19.342857
93
0.672753
false
2.57971
false
false
false
dknlght/dkodi
src/script.module.urlresolver/lib/urlresolver/plugins/thevid.py
1
2253
""" Plugin for UrlResolver Copyright (C) 2017 tknorris 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. ...
gpl-2.0
-7,828,071,276,280,572,000
41.509434
134
0.683977
false
3.610577
false
false
false
trabucayre/gnuradio
gr-analog/examples/fmtest.py
1
7223
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr from gnuradio import blocks from gnuradio import filter from gnuradio import analog from gnuradio import channels import sys, ma...
gpl-3.0
2,754,687,838,082,040,000
33.070755
89
0.524574
false
3.081485
false
false
false
esdalmaijer/PyGaze
pygaze/_sound/basesound.py
1
5113
# -*- coding: utf-8 -*- # # This file is part of PyGaze - the open-source toolbox for eye tracking # # PyGaze is a Python module for easily creating gaze contingent experiments # or other software (as well as non-gaze contingent experiments/software) # Copyright (C) 2012-2013 Edwin S. Dalmaijer # # ...
gpl-3.0
4,793,895,376,749,514,000
27.228571
78
0.539409
false
4.520778
false
false
false
makokal/crowdsim
entities/agents.py
1
11997
from random import randint, choice from math import sin, cos, radians, exp, sqrt, fabs import pygame from pygame.sprite import Sprite # from pygame.math import vec2d from utils import SIM_COLORS, SCALE, SIGN from utils import euclidean_distance, vec2d, Rotate2D import numpy as np class Agent(Sprite): """ A agent...
bsd-3-clause
6,701,376,794,375,503,000
33.875
134
0.563141
false
3.89134
false
false
false
imanolarrieta/RL
examples/tutorial/ChainMDPTut_example.py
1
1953
#!/usr/bin/env python """ Domain Tutorial for RLPy ================================= Assumes you have created the ChainMDPTut.py domain according to the tutorial and placed it in the Domains/ directory. Tests the agent using SARSA with a tabular representation. """ __author__ = "Robert H. Klein" from rlpy.Domains impo...
bsd-3-clause
1,422,288,029,209,603,600
31.016393
81
0.674859
false
3.977597
false
false
false
feranick/MultiFit
Archive/multifit_3/multifit.py
1
25354
#! /usr/bin/env python ###============================================================= ### Multifit 3 ### Nicola Ferralis <feranick@hotmail.com> ### The entire code is covered by GNU Public License (GPL) v.3 ###============================================================= ### Uncomment this if for headless servers. ...
gpl-3.0
4,940,404,559,458,342,000
36.121523
132
0.450974
false
3.536123
false
false
false
lzamparo/SdA_reduce
plot_scripts/plot_finetuning_gg.py
1
3249
""" Process all the model finetuning output files in the given directory and produce a lineplot of the top 10 models based on reconstruction error. Fine-tuning file names look like this: finetune_sda_900_500_100_50.2013-06-16.02:25:26.981658 The average training error for each epoch and batch is reported: e.g epoch 1...
bsd-3-clause
-877,238,559,156,923,100
31.168317
95
0.664512
false
3.504854
false
false
false
vasily-v-ryabov/pywinauto-64
pywinauto/RemoteMemoryBlock.py
1
11194
from __future__ import absolute_import import ctypes, win32api, win32gui, win32con, pywintypes, win32process, sys, inspect, traceback from . import win32functions from . import win32defines from . import win32structures from . import sysinfo class AccessDenied(RuntimeError): "Raised when we cannot allocate memor...
lgpl-2.1
882,680,462,412,986,000
42.053846
160
0.541987
false
4.438541
false
false
false
Tong-Chen/scikit-learn
sklearn/metrics/metrics.py
1
75466
# -*- coding: utf-8 -*- """Utilities to evaluate the predictive performance of models Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandr...
bsd-3-clause
3,345,353,880,831,719,400
33.680607
79
0.594328
false
3.847115
false
false
false
open-machine-learning/mldata-utils
scripts/voc2005class.py
1
2445
""" Parser for voc 2005 images reads ImageSet directory and gets classes of images than writes it to arff file """ import re, os reg_rect = "\"(?P<name>.*)\" \(.*\) : \((?P<xmin>[0-9]*), (?P<ymin>[0-9]*)\) - \((?P<xmax>[0-9]*), (?P<ymax>[0-9]*)\)" reg_filename = "filename : \"(?P<filename>.*)\"" res = {} FILES = list...
gpl-3.0
7,142,772,437,603,581,000
26.166667
118
0.546012
false
3.014797
false
false
false
ohel/pyorbital-gizmod-tweaks
gizmod_modules/104-USB-Remote-mpv.py
1
3658
from GizmoDaemon import * from GizmoScriptDefault import * import os import ReadSymLink ENABLED = True VERSION_NEEDED = 3.2 INTERESTED_CLASSES = [GizmoEventClass.Standard] MP_CONTROL_FILE = "/dev/shm/mpvfifo" REMOTE_DEVICE = ReadSymLink.readlinkabs("/dev/input/remote") class USBRemoteMP(GizmoScriptDefault): """ US...
unlicense
4,115,400,300,158,171,600
36.326531
173
0.68152
false
2.896279
false
false
false
misdoro/python-ase
tools/_ase_bash_complete.py
1
2250
#!/usr/bin/env python """Bash completion for ase-db, ase-run, ase-build, ase-info and ase-gui. Put this in your .bashrc:: complete -o default -C _ase_bash_complete.py ase-db ase-run \ ase-build ase-info ase-gui """ import os import sys from glob import glob command, word, previous = sys.argv[1:] line = ...
gpl-2.0
4,504,443,122,918,439,400
31.142857
79
0.582222
false
3.472222
false
false
false
MicheleZini/lastTable
betterlastTable.py
1
2620
#!/usr/bin/env python # -*- coding:utf-8 -*- ## # Python function for reading linux utmp/wtmp file # http://www.likexian.com/ # # Copyright 2014, Kexian Li # Released under the Apache License, Version 2.0 # ## import struct XTMP_STRUCT = 'hi32s4s32s256shhiii4i20x' XTMP_STRUCT_SIZE = struct.calcsize(XTMP_STRUCT) de...
mit
-4,841,995,086,821,038,000
24.940594
118
0.558397
false
2.888644
false
false
false
clic-lab/blocks
BlockWorldRoboticAgent/model/q_network.py
1
5707
import embed_token_seq import image_preprocessing import embed_image import mix_and_gen_q_values import embed_previous_action as epa import tensorflow as tf import numpy as np class ActionValueFunctionNetwork: """ Creates policy Q(s,a) that approximates Q values over actions for a given observed state s. """ ...
gpl-3.0
-5,442,815,506,399,176,000
46.558333
109
0.622569
false
3.553549
false
false
false
BlackHole/enigma2-obh10
lib/python/PowerTimer.py
2
23520
import os from boxbranding import getMachineBrand, getMachineName import xml.etree.cElementTree from time import ctime, time from bisect import insort from enigma import eActionMap, quitMainloop from Components.config import config from Components.Harddisk import internalHDDNotSleeping from Components.TimerSanityChec...
gpl-2.0
710,529,559,156,328,200
34.853659
270
0.717092
false
3.206544
false
false
false
jacobdshimer/Bro-Log-Utility-Script
bro_utility.py
1
2766
#!/usr/bin/env python #Imports the different modules that the script uses import argparse import subprocess import textwrap import portslicer import fieldslicer import combiner import bro #Create the command-line capability parser = argparse.ArgumentParser(prog="Bro Log Utility Script", description=textwrap.ded...
mit
6,099,293,530,235,152,000
46.689655
119
0.690528
false
3.712752
false
false
false
jocelynj/weboob
weboob/backends/cragr/backend.py
1
4021
# -*- coding: utf-8 -*- # Copyright(C) 2010 Romain Bignon, Christophe Benz # # 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, version 3 of the License. # # This program is distributed in the ho...
gpl-3.0
7,785,403,536,850,628,000
39.08
105
0.635729
false
2.975501
false
false
false
gmist/gae-de-init
main/apps/user/views.py
1
7664
# coding: utf-8 import copy from google.appengine.ext import ndb import flask from apps import auth from apps.auth import helpers from core import task from core import util import config import forms import models bp = flask.Blueprint( 'user', __name__, url_prefix='/user', template_folder='templates...
mit
7,499,373,629,555,537,000
29.907258
81
0.652009
false
3.373239
false
false
false
manassolanki/erpnext
erpnext/stock/report/stock_ledger/stock_ledger.py
1
5637
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ def execute(filters=None): columns = get_columns() items = get_items(filters) sl_entries = get_stock_ledger_entri...
gpl-3.0
-2,148,252,826,371,442,200
34.904459
100
0.672166
false
3.025765
false
false
false
adregan/pnger
decoder.py
1
2027
from chunks import split_into_chunks, parse_header_and_data from pixels import PIXELS from scanlines import split_scanlines from filters import Filters def reconstructer(scanlines, bpp): reconstructed = [list(scanline.get('bytes')) for scanline in scanlines] def reconstruct_byte(filter_type, current_byte, y, ...
mit
-5,403,940,523,025,428,000
31.693548
79
0.607301
false
3.593972
false
false
false
mhrivnak/pulp
server/pulp/plugins/conduits/mixins.py
1
28436
from gettext import gettext as _ import logging import sys from pymongo.errors import DuplicateKeyError from pulp.plugins.model import Unit, PublishReport from pulp.plugins.types import database as types_db from pulp.server.async.tasks import get_current_task_id from pulp.server.db.model.dispatch import TaskStatus fr...
gpl-2.0
-6,392,641,655,943,696,000
38.994374
100
0.632578
false
4.389626
false
false
false
jmescuderojustel/codeyourblogin-python-django-1.7
src/blog/controllers/author_controller.py
1
1194
from django.shortcuts import render_to_response, render, redirect from ..models.author import Author def signupInSite(request): if request.method == 'GET': return render(request, 'users/signup.html', {}) elif request.method == 'POST': author = Author() author.name = request.POST['n...
mit
3,862,361,985,306,047,500
24.404255
85
0.620603
false
4.047458
false
false
false
lizardsystem/lizard-rijnmond
lizard_rijnmond/migrations/0007_auto__add_year.py
1
3097
# encoding: utf-8 import 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 'Year' db.create_table('lizard_rijnmond_year', ( ('id', self.gf('django.db.mode...
gpl-3.0
8,076,725,355,685,609,000
48.15873
149
0.534065
false
3.460335
false
false
false
gems-uff/noworkflow
capture/noworkflow/now/cmd/__init__.py
1
2147
# Copyright (c) 2016 Universidade Federal Fluminense (UFF) # Copyright (c) 2016 Polytechnic Institute of New York University. # This file is part of noWorkflow. # Please, consult the license terms in the LICENSE file. """Commands and argument parsers for 'now'""" from __future__ import (absolute_import, print_function,...
mit
8,874,603,974,914,559,000
23.397727
68
0.60503
false
3.961255
false
false
false
coin-or/oBB
obb/NAG/setup.py
1
2075
#!/usr/bin/env python # Setup script for oBB. from setuptools import setup #from numpy.distutils.core import setup, Extension from sys import version_info, exit # Make sure the correct version of Python is installed. if (version_info[:2] < (2,6))or(version_info[0] == 3): print "oBB requires Python 2.6 to 2.7. Pyth...
lgpl-3.0
-6,352,223,212,597,501,000
33.016393
90
0.568193
false
3.368506
false
false
false
smajda/django-nopassword
tests/test_models.py
1
2088
# -*- coding: utf8 -*- import time from django.contrib.auth import authenticate from django.test.utils import override_settings from django.utils import unittest from nopassword.models import LoginCode from nopassword.utils import get_user_model class TestLoginCodes(unittest.TestCase): def setUp(self): ...
mit
4,837,027,171,841,363,000
39.153846
98
0.706418
false
3.532995
true
false
false
google/active-qa
px/nmt/context_encoder.py
1
9795
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-7,441,171,265,858,019,000
34.48913
80
0.660031
false
3.703214
false
false
false
gracca/fits-for-roi
fits-for-roi.py
1
2686
#!/usr/bin/env python # -*- coding: utf-8 -*- # #-----------------------------------------------------------------------# # fits-for-roi.py # # # # Script to create FITS files from ROI observing o...
gpl-3.0
5,024,605,194,523,338,000
33.423077
73
0.512849
false
3.830243
false
false
false
xmnlab/minilab
ia/ocr/OpenANPR/experimental/exp4.py
1
2703
#!/usr/bin/env python # encoding: utf-8 """ exp4.py Experiment 4: playing around with brightness/contrast enhancement. Created by Oliver Smith on 2009-08-21. Copyright (c) 2009 Oliver Smith. All rights reserved. """ from getopt import getopt import sys from opencv.cv import * from opencv.highgui import * def quick...
gpl-3.0
4,285,612,254,806,092,300
23.351351
72
0.695893
false
2.760981
false
false
false
alexei38/gshell
src/broadcast.py
1
3310
# -*- coding: utf-8 -*- import gtk class GshellBroadcastDialog(gtk.Dialog): def __init__(self, main_window, *args): gtk.Dialog.__init__(self, *args) self.config = main_window.config self.main_window = main_window self.build_dialog() self.run_window() def build_dialog...
gpl-3.0
-1,497,308,856,532,478,200
36.191011
94
0.602417
false
3.80023
false
false
false
dfm/ketu
ketu/feature_extract.py
1
3169
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["FeatureExtract"] import os import h5py import numpy as np from .pipeline import Pipeline def check_orbits(p1, t1, p2, t2, tmn, tmx, tol): n1 = t1 + p1 * np.arange(np.floor((tmn-t1)/p1), np.ceil((tmx-t1)/p1)) n1 = n1[(tmn <...
mit
-7,606,553,224,304,413,000
33.075269
78
0.497949
false
3.364119
false
false
false
coxmediagroup/django-threadedcomments
threadedcomments/migrations/0001_initial.py
1
7099
# encoding: utf-8 import 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 'ThreadedComment' db.create_table('threadedcomments_comment', ( ('comment_ptr',...
bsd-3-clause
-6,179,495,202,345,432,000
72.185567
206
0.568953
false
3.738283
false
false
false
0xffea/keystone
keystone/token/backends/memcache.py
1
4868
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack 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 requ...
apache-2.0
8,416,145,999,367,778,000
36.160305
76
0.591413
false
3.91004
false
false
false
gypleon/DeepLearningProject
deprecated_codes/evaluate.py
1
5339
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import numpy as np import tensorflow as tf import model from data_reader import load_data, DataReader flags = tf.flags # data flags.DEFINE_string('data_dir', 'data', 'data directo...
apache-2.0
-3,196,438,457,534,124,500
37.410072
139
0.588687
false
3.767819
true
false
false
briancurtin/python-openstacksdk
openstack/identity/v3/user.py
1
3008
# 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, software # distributed under t...
apache-2.0
3,061,282,737,069,946,000
43.235294
79
0.705452
false
4.297143
false
false
false
rbuffat/pyepw
tests/test_ground_temperatures.py
1
7055
import os import tempfile import unittest from pyepw.epw import GroundTemperatures, GroundTemperature, EPW class TestGroundTemperatures(unittest.TestCase): def setUp(self): self.fd, self.path = tempfile.mkstemp() def tearDown(self): os.remove(self.path) def test_create_ground_temperatur...
apache-2.0
2,445,684,638,360,404,500
66.190476
141
0.743586
false
3.827998
false
false
false
a-detiste/game-data-packager
tools/check_gog.py
1
3135
#!/usr/bin/python3 # encoding=utf-8 # # Copyright © 2017 Alexandre Detiste <alexandre@detiste.be> # # 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...
gpl-2.0
8,912,646,860,192,819,000
37.219512
91
0.658264
false
3.687059
false
false
false
0xa/toomuchwin
toomuchwin/models/tx.py
1
4316
from datetime import datetime from sqlalchemy import ( Column, BigInteger, DateTime, ForeignKey, CheckConstraint ) from sqlalchemy.orm import relationship from sqlalchemy.sql import select from sqlalchemy.ext.hybrid import hybrid_property from .enum import DeclEnum from .base import Base class Tx(Base):...
mit
-6,688,397,405,071,409,000
35.268908
79
0.620714
false
3.657627
false
false
false
anchore/anchore
anchore/anchore-modules/analyzers/30_file_checksums.py
1
2870
#!/usr/bin/env python import sys import os import shutil import re import json import time import rpm import subprocess import stat import tarfile import time import hashlib import anchore.anchore_utils analyzer_name = "file_checksums" try: config = anchore.anchore_utils.init_analyzer_cmdline(sys.argv, analyzer...
apache-2.0
-8,097,181,110,161,826,000
26.333333
119
0.599652
false
3.206704
false
false
false
GuozhuHe/webspider
webspider/tasks/actor/lagou_jobs_count.py
1
1329
# coding=utf-8 import logging from datetime import datetime from webspider import crawlers from webspider.tasks.celery_app import celery_app from webspider.controllers import keyword_ctl, job_keyword_ctl from webspider.models import JobsCountModel logger = logging.getLogger(__name__) @celery_app.task() def crawl_la...
mit
-3,362,150,394,207,496,700
33.236842
102
0.641814
false
3.025581
false
false
false
our-city-app/oca-backend
tools/replace_branding.py
1
4088
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
2,168,557,505,359,513,600
35.828829
105
0.648239
false
3.682883
false
false
false
ruchee/vimrc
vimfiles/bundle/vim-rust-racer/rplugin/python3/deoplete/sources/racer.py
1
4535
#============================================================================= # FILE: racer.py # AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com> # License: MIT license {{{ # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation file...
mit
-6,456,718,800,528,790,000
40.227273
78
0.523925
false
4.339713
false
false
false
Micutio/ComplexAutomatonBase
cab/util/io_pygame.py
1
3477
""" This module contains a CAB io implementation in PyGame. """ import pygame import pygame.gfxdraw import pygame.locals import math import cab.abm.agent as cab_agent import cab.ca.cell as cab_cell import cab.util.io_pygame_input as cab_pygame_io import cab.util.io_interface as cab_io import cab.global_constants as c...
mit
3,222,788,372,253,354,000
34.121212
123
0.597066
false
3.340058
false
false
false
kinow-io/kinow-python-sdk
kinow_client/rest.py
1
12352
# coding: utf-8 """ Server API Reference for Server API (REST/Json) OpenAPI spec version: 1.4.41 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import io import json import ssl import certifi import logging import re # python 2 and...
apache-2.0
-1,410,129,561,356,911,400
40.589226
120
0.511253
false
4.847724
true
false
false
eugeneai/icc.studprogs
src/icc/studprogs/textloader.py
1
1198
from icc.studprogs.common import * class Loader(BaseLoader): """Loads text and divides it on [paragraph] lokens. """ def lines(self): """  • -  """ linequeue=[] for line in self.file: if self._skip>0: self._skip-...
gpl-3.0
1,462,403,996,640,601,300
26.72093
69
0.457215
false
4.414815
false
false
false
chrisgilmerproj/brewday
brew/yeasts.py
1
2678
# -*- coding: utf-8 -*- import json import sys import textwrap from .exceptions import YeastException from .validators import validate_optional_fields from .validators import validate_percentage from .validators import validate_required_fields __all__ = [u"Yeast"] class Yeast(object): """ A representation o...
mit
-5,421,846,657,522,095,000
30.139535
132
0.567588
false
4.033133
false
false
false
valentin-krasontovitsch/ansible
lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py
1
92306
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 ANS...
gpl-3.0
-8,855,567,878,221,242,000
46.33641
217
0.541406
false
4.622465
true
false
false
DBrianKimmel/PyHouse
Project/src/Modules/Computer/Web/web_irrigation.py
1
1855
""" @name: Modules/Computer/Web/web_irrigation.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2016-2020 by D. Brian Kimmel @note: Created on Aug 22, 2016 @license: MIT License @summary: """ __updated__ = '2019-12-30' # Import system type stuff import os # Import PyMh ...
mit
-6,909,008,324,557,919,000
28.919355
86
0.657682
false
3.056013
false
false
false
rossengeorgiev/aprs-python
aprslib/parsing/mice.py
1
6347
import re import math from aprslib import base91 from aprslib.exceptions import ParseError from aprslib.parsing.common import parse_dao from aprslib.parsing.telemetry import parse_comment_telemetry __all__ = [ 'parse_mice', ] # Mic-e message type table MTYPE_TABLE_STD = { "111": "M0: Off Duty", ...
gpl-2.0
1,449,387,845,157,458,200
27.85
88
0.55349
false
3.33001
false
false
false
zhaogaolong/oneFinger
storage/models.py
1
1362
from django.db import models from asset.models import Host # Create your models here. # ####ceph########## status_level = ( ("up", "up"), ("warning", "warning"), ("down", "down"), ) mode_status_level = ( ("up", "up"), ("warning", "warning"), ("critical", "critical"), ("down"...
apache-2.0
-2,960,812,635,545,907,000
25.705882
74
0.601322
false
3.804469
false
false
false
mjs7231/python-plexapi
plexapi/video.py
1
36601
# -*- coding: utf-8 -*- import os from urllib.parse import quote_plus, urlencode from plexapi import media, utils, settings, library from plexapi.base import Playable, PlexPartialObject from plexapi.exceptions import BadRequest, NotFound class Video(PlexPartialObject): """ Base class for all video objects includ...
bsd-3-clause
2,879,791,555,386,610,700
45.545802
118
0.616701
false
4.025195
false
false
false
MichSchli/QuestionAnsweringGCN
old_version/experiment_construction/experiment_runner_construction/experiment_runner.py
1
2844
from evaluation.python_evaluator import Evaluator from helpers.read_conll_files import ConllReader class ExperimentRunner: learner = None train_file_iterator = None kb_prefix = None max_elements_to_read = None def __init__(self, disambiguation=None, score_transform=None): self.kb_prefix ...
mit
2,841,240,547,594,646,000
40.838235
123
0.592124
false
4.57971
true
false
false
drednout/deploy_test
hello/settings.py
1
3337
""" Django settings for gettingstarted project, on Heroku. Fore more info, see: https://github.com/heroku/heroku-django-template For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/s...
bsd-2-clause
4,166,863,583,795,054,000
26.578512
75
0.697932
false
3.405102
false
false
false
ondrokrc/gramps
gramps/webapp/connection.py
1
1944
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2012 Douglas S. Blank <doug.blank@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Lice...
gpl-2.0
8,125,272,330,686,703,000
38.673469
89
0.649691
false
4.300885
false
false
false
GLolol/PyLink
plugins/servprotect.py
1
1953
# servprotect.py: Protects against KILL and nick collision floods import threading from pylinkirc import conf, utils from pylinkirc.log import log try: from cachetools import TTLCache except ImportError: log.warning('servprotect: expiringdict support is deprecated as of PyLink 3.0; consider installing cachet...
mpl-2.0
-1,154,787,156,643,393,300
33.263158
123
0.670763
false
3.684906
false
false
false
michaelkourlas/gini
frontend/src/gbuilder/Core/Connection.py
1
2255
"""The logical connection object that links two devices together""" from Devices.Bridge import * from Devices.Firewall import * from Devices.Hub import * from Devices.Mobile import * from Devices.Router import * from Devices.Subnet import * from Devices.Switch import * from Devices.UML import * from Devices....
mit
5,052,709,351,077,203,000
44.020408
171
0.735698
false
3.282387
false
false
false
robertdfrench/ghost-ci
cloud_init.py
1
1535
#!/usr/bin/python2.7 import subprocess import atexit import time import boto3 def shell(command): subprocess.call(command, shell=True) class MessageQueue(object): def __init__(self, name): self.q = boto3.resource("sqs"). get_queue_by_name(QueueName=queue_name) def __iter__(self): ...
mit
-7,347,001,797,388,041,000
22.615385
64
0.605863
false
3.594848
false
false
false
diamond-org/flask-diamond
flask_diamond/skels/app/+application.module+/migrations/versions/20f04b9598da_flask-diamond-020.py
1
1165
"""update to flask-diamond 0.2.0 Revision ID: 20f04b9598da Revises: cf0f5b45967 Create Date: 2015-02-07 22:54:24.608403 """ # revision identifiers, used by Alembic. revision = '20f04b9598da' down_revision = 'cf0f5b45967' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated...
mit
2,992,216,872,752,428,500
33.264706
94
0.675536
false
3.098404
false
false
false
dreibh/planetlab-lxc-plcapi
PLC/Accessor.py
1
4296
# # Thierry Parmentelat - INRIA # # # just a placeholder for storing accessor-related tag checkers # this is filled by the accessors factory # # NOTE. If you ever come to manually delete a TagType that was created # by the Factory, you need to restart your python instance / web server # as the cached information then b...
bsd-3-clause
-1,325,702,218,767,049,200
35.717949
84
0.575652
false
4.274627
false
false
false
Andr3iC/juriscraper
opinions/united_states/state/minn.py
1
3672
# Scraper for Minnesota Supreme Court #CourtID: minn #Court Short Name: MN #Author: Andrei Chelaru #Reviewer: mlr #Date: 2014-07-03 from datetime import date import time from juriscraper.OpinionSite import OpinionSite from juriscraper.lib.date_utils import quarter, is_first_month_in_quarter from lxml import html impo...
bsd-2-clause
-1,327,994,466,461,317,600
38.913043
109
0.517974
false
3.727919
false
false
false
wadester/wh_test_py
paramiko_test1.py
1
2480
#!/usr/bin/env python # Module: paramiko_test1.py # Purpose: test paramiko for SSH connections w/ keyless SSH and exceptions # Date: N/A # Notes: # 1) Paramiko home: # http://www.paramiko.org/ # 2) Multiple SSH discussions about Python # http://stackoverflow.com/questions/3586106/perform-commands-over-...
gpl-2.0
-9,143,382,518,831,262,000
26.555556
87
0.650806
false
3.208279
false
false
false
WeblateOrg/weblate
weblate/checks/management/commands/list_checks.py
1
2258
# # Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
-7,192,929,059,752,548,000
31.681159
73
0.629712
false
3.908146
false
false
false