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
yoe/veyepar
dj/scripts/enc.py
1
23477
#!/usr/bin/python """ assembles raw cuts into final, titles, tweaks audio, encodes to format for upload. """ import re import os import sys import subprocess import xml.etree.ElementTree from mk_mlt import mk_mlt import pprint from process import process from main.models import Client, Show, Location, Episode, Raw_...
mit
2,883,326,822,299,327,000
35.06298
226
0.481407
false
4.092922
false
false
false
GoodCloud/johnny-cache
johnny/backends/memcached.py
1
1842
#!/usr/bin/env python # -*- coding: utf-8 -*- """Infinite caching memcached class. Caches forever when passed a timeout of 0. For Django >= 1.3, this module also provides ``MemcachedCache`` and ``PyLibMCCache``, which use the backends of their respective analogs in django's default backend modules. """ from django....
mit
-7,832,698,847,422,093,000
46.230769
93
0.701412
false
3.978402
false
false
false
freifunk-darmstadt/tools
update-telemetry.py
1
8987
#!/usr/bin/env python3 import psutil import os import json import re import itertools from contextlib import contextmanager import pprint import time import socket import subprocess import logging logger = logging.getLogger(__name__) def pairwise(iterable): "s -> (s0,s1), (s2,s3), (s4, s5), ..." a = iter(ite...
agpl-3.0
6,942,988,969,528,593,000
31.327338
182
0.516858
false
3.766555
false
false
false
maferelo/saleor
saleor/account/migrations/0001_initial.py
3
19366
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("auth", "0006_require_contenttypes_0002")] replaces = [("userprofile", "0001_initial...
bsd-3-clause
2,425,811,758,527,500,300
42.617117
86
0.291748
false
5.11381
false
false
false
ag-sc/QALD
4/scripts/Evaluation.py
1
26257
#!/usr/bin/env python # -*- coding: utf-8 -*- import xml.dom.minidom as dom import xml.dom from decimal import * import sys import os import datetime #from Numeric import * # Dokument erzeugen implement = xml.dom.getDOMImplementation() ###################Globale Variablen################### task=None choosen_tag={}...
mit
-724,464,349,123,768,700
42.688852
235
0.473778
false
3.872143
false
false
false
Re4son/Kali-Pi
Menus/menu_pause.py
1
1785
#!/usr/bin/env python import pygame, os, sys, subprocess, time import RPi.GPIO as GPIO from pygame.locals import * from subprocess import * if "TFT" in os.environ and os.environ["TFT"] == "0": # No TFT screen SCREEN=0 pass elif "TFT" in os.environ and os.environ["TFT"] == "2": # TFT screen with mouse ...
gpl-3.0
3,545,909,162,319,380,500
28.262295
87
0.614566
false
3.142606
false
false
false
foobarbazblarg/stayclean
stayclean-2016-april/serve-signups-with-flask.py
1
8086
#!/usr/bin/python import subprocess import praw from hashlib import sha1 from flask import Flask from flask import Response from flask import request from cStringIO import StringIO from base64 import b64encode from base64 import b64decode from ConfigParser import ConfigParser import OAuth2Util import os import markdow...
mit
8,488,130,493,691,722,000
40.255102
129
0.67351
false
3.771455
true
false
false
zhibolau/webApp
www/models.py
1
1589
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Zhibo Liu' import time,uuid from transwarp.db import next_id # 直接from Import会出错 必须在那个目录下建立__init__.py 文件!!!!!!!! from transwarp.orm import Model, StringField, BooleanField, FloatField, TextField class User(Model): __table__ = 'users' id = StringF...
gpl-2.0
-8,860,960,697,945,917,000
35.162791
86
0.67717
false
3.206186
false
false
false
thomaserlang/XenBackup
src/xenbackup/XenAPI.py
1
9750
# Copyright (c) Citrix Systems, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1) Redistributions of source code must retain the above copyright # notice, this list of conditions ...
mit
-7,467,321,875,946,531,000
38.156627
101
0.628205
false
4.263227
false
false
false
mohseniaref/PySAR-1
pysar/pysarApp.py
1
21751
#! /usr/bin/env python ############################################################################### # # Project: PySAR # Purpose: Python Module for InSAR Time-series Analysis # Author: Heresh Fattahi # Created: July 2013 # Modified: Yunjun Zhang, Feb 2015 ###########################################################...
mit
6,423,405,613,165,199,000
37.841071
157
0.507379
false
3.978599
false
false
false
qbuat/rootpy
rootpy/tree/model.py
1
5162
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import import inspect from cStringIO import StringIO import types import ROOT from .. import log; log = log[__name__] from .treetypes import Column from .treebuffer import TreeBuffer...
gpl-3.0
1,867,577,259,396,475,100
31.465409
79
0.518016
false
4.45
false
false
false
jolid/script.module.donnie
lib/donnie/furk.py
1
6496
import urllib2, urllib, sys, os, re, random, copy from BeautifulSoup import BeautifulSoup, Tag, NavigableString import xbmc,xbmcplugin,xbmcgui,xbmcaddon from t0mm0.common.net import Net from t0mm0.common.addon import Addon from scrapers import CommonScraper net = Net() try: import json except: # pre-frodo and python...
gpl-2.0
5,660,529,019,860,364,000
28.935484
167
0.622229
false
2.852877
false
false
false
twitterdev/twitter-leaderboard
services/migrations/0001_initial.py
1
1248
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-01-28 08:34 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): initial = True dependencies = [ migration...
mit
-8,509,788,362,144,956,000
39.258065
145
0.63141
false
3.961905
false
false
false
jayrumi/walmart-reviews
setup.py
1
1197
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name = 'walmart-reviews',...
mit
8,552,747,381,099,799,000
34.205882
211
0.634085
false
3.5
false
false
false
harrylewis/python-uinames
uinames/models.py
1
1384
from utils import PropertyUnavailable class People(object): """ A collection of people, represented by the Person class. """ def __init__(self, json=None): self._json = json or {} self.data = [Person(identity) for identity in self._json] def __str__(self): return self.__u...
mit
8,602,743,123,588,186,000
26.68
79
0.510116
false
4.644295
false
false
false
digwanderlust/pants
tests/python/pants_test/base/test_payload_field.py
1
10723
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from hashlib import ...
apache-2.0
7,316,399,254,146,659,000
32.61442
98
0.633498
false
3.665983
true
false
false
pinax/pinax-eventlog
pinax/eventlog/migrations/0001_initial.py
1
1443
# Generated by Django 3.1 on 2020-08-15 10:08 from django.conf import settings import django.core.serializers.json from django.db import migrations, models import django.db.models.deletion import django.utils.timezone from ..compat import JSONField class Migration(migrations.Migration): initial = True dep...
mit
8,742,902,873,296,838,000
38
152
0.634789
false
4.182609
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/express_route_circuit_sku.py
1
1525
# 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
-7,039,590,627,522,585,000
37.125
79
0.602623
false
3.950777
false
false
false
NitrousPG/forkbot
server_events.py
1
4992
# LICENSE # 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 distributed in the hope that it will be us...
gpl-3.0
-7,410,502,775,914,562,000
29.625767
80
0.527244
false
3.924528
false
false
false
Pragmatismo/TimelapsePi-EasyControl
webcamcap_show_numpy.py
1
8684
#!/usr/bin/python import time import os import sys import pygame import numpy from PIL import Image, ImageDraw, ImageChops print("") print("") print(" USE l=3 to take a photo every 3 somethings, try a 1000 or 2") print(" t to take triggered photos ") print(" cap=/home/pi/folder/ to set caps path other than c...
gpl-2.0
-2,106,105,906,145,419,300
30.23741
168
0.539843
false
2.838836
false
false
false
mbj4668/pyang
pyang/xpath.py
1
12087
from . import xpath_lexer from . import xpath_parser from .error import err_add from .util import prefix_to_module, search_data_node, data_node_up from .syntax import re_identifier core_functions = { 'last': ([], 'number'), 'position': ([], 'number'), 'count': (['node-set'], 'number'), 'id': (['object'...
isc
-2,654,624,637,892,220,000
41.410526
80
0.514933
false
3.653869
false
false
false
simone-campagna/zapper
lib/python/zapper/lock_file.py
1
1913
#!/usr/bin/env python3 # # Copyright 2013 Simone Campagna # # 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 ...
apache-2.0
7,631,584,786,992,049,000
27.132353
74
0.590173
false
3.833667
false
false
false
LinguList/server
app/settings/sound_classes/asjp/asjp.py
1
3293
#! /usr/bin/env python from __future__ import division,print_function from lingpy.data.derive import compile_model from scipy.spatial.distance import squareform from time import sleep from pickle import dump asjp = {} score = open('score','r').read() score = score.split('\n') del score[-1] dicto = {} for line in sco...
gpl-2.0
3,162,807,456,613,274,600
19.710692
66
0.54631
false
2.485283
false
false
false
wevoice/wesub
dev_settings_test.py
1
2112
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
-7,629,318,859,687,858,000
30.058824
78
0.69697
false
3.622642
true
false
false
robotican/ric
ric_board/scripts/RiCConfigurator/GUI/SimulationWindow.py
1
5700
import GUI.MainWindow __author__ = 'tom' from PyQt4.QtGui import * from GUI.Schemes.gazeboGui import Ui_gazebo_gui from BAL.Interface.DeviceFrame import SERVO, BATTERY, SWITCH, IMU, PPM, GPS, RELAY, URF, CLOSE_LOP_ONE, CLOSE_LOP_TWO, \ OPEN_LOP, DIFF_CLOSE, DIFF_OPEN, EX_DEV, HOKUYO, OPRNNI, USBCAM, DIFF_CLOSE_FOU...
bsd-3-clause
-2,762,979,084,064,864,000
35.538462
126
0.542632
false
3.490508
false
false
false
andrey-yemelyanov/competitive-programming
cp-book/ch1/adhoc/chess/10849_MoveTheBishop.py
1
1456
# Problem name: 10849 Move the bishop # Problem url: https://uva.onlinejudge.org/external/108/10849.pdf # Author: Andrey Yemelyanov import sys import math WHITE, BLACK = 0, 1 INFINITY = -1 def main(): n_test_cases = int(sys.stdin.readline().strip()) for i in range(n_test_cases): sys.stdin.readline() ...
mit
-4,838,296,833,532,812,000
27
95
0.56044
false
3.137931
false
false
false
zfrxiaxia/Code-zfr
计蒜客/比赛/2015/light.py
1
1148
# -*- coding: utf-8 -*- """ Created on Sat May 28 19:17:42 2016 @author: AtoZ """ N,M = raw_input().split() N,M = int(N),int(M) while(1): i0 = 0 while(i0<2**(M*N)): bit = [0]*M*N t_bit = bin(i0) lt_bit = len(t_bit) for j0 in range(lt_bit-2): bit[j0] = int(t_bit[j0+2]) i0 +=1 print ...
gpl-3.0
7,432,343,685,599,265,000
16.953125
47
0.419861
false
2.314516
false
false
false
linearb/mojo
rasppi/rasp.py
1
3195
#!/usr/bin/python """Sound an alarm if a raspberry pi hasn't been heard from lately To set an alarm for pi named 'pi', create a file in mmdata/pulse.d named pi.alarm """ import os.path import time pulse="/home/mojotronadmin/mmdata/pulse.d/" logfile="/home/mojotronadmin/mmdata/incoming.log" maxinterval = 15*60 # h...
mit
-2,364,741,625,820,722,000
37.035714
101
0.610329
false
3.803571
false
false
false
garrettr/securedrop
securedrop/journalist_app/col.py
1
3264
# -*- coding: utf-8 -*- from flask import (Blueprint, redirect, url_for, render_template, flash, request, abort, send_file, current_app) from flask_babel import gettext from sqlalchemy.orm.exc import NoResultFound import crypto_util import store from db import db_session, Submission from journalis...
agpl-3.0
-8,452,638,703,044,574,000
36.090909
78
0.594975
false
4.10566
false
false
false
Haizs/NEU-mathe
FILEtoCSV.py
1
1799
import os.path import csv import re headers = ['Id', 'KnowledgeId', 'Type', 'Src', 'Name', 'Count'] def doSubject(subject): idCount = 0 rows = [] for root, dirs, files in os.walk('ChoiceSource/' + subject): for name in files: if (name != '.DS_Store'): idCount += 1 ...
gpl-3.0
-2,962,789,084,758,935,600
35.645833
119
0.466742
false
3.251386
false
false
false
obulpathi/poppy
poppy/manager/base/driver.py
1
2204
# Copyright (c) 2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
6,152,679,558,350,396,000
23.21978
71
0.640653
false
4.886918
false
false
false
cheery/essence
essence3/renderer/patch9.py
1
2518
import pygame from texture import Texture def borders(surface): width, height = surface.get_size() y0 = 0 y1 = 0 x0 = 0 x1 = 0 i = 0 while i < height: r,g,b,a = surface.get_at((0,i)) if a > 0: y0 = i break i += 1 while i < height: ...
gpl-3.0
-2,208,417,184,195,690,200
32.573333
90
0.503971
false
2.867882
false
false
false
amitay/samba
source4/scripting/python/samba/samdb.py
1
31787
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2010 # Copyright (C) Matthias Dieter Wallnoefer 2009 # # Based on the original in EJS: # Copyright (C) Andrew Tridgell <tridge@samba.org> 2005 # Copyright (C) Giampaolo Lauria <lauria2@yahoo.com> 2011 # # This program is free softwa...
gpl-3.0
-3,569,424,283,100,842,500
36.091015
158
0.588542
false
3.887367
false
false
false
eayunstack/python-neutronclient
neutronclient/shell.py
1
41584
# Copyright 2012 OpenStack Foundation. # 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 requ...
apache-2.0
2,772,146,299,183,681,000
40.459621
79
0.645897
false
3.872241
false
false
false
mwrlabs/veripy
contrib/rfc3633/dr/renew_message.py
1
1596
from contrib.rfc3315.constants import * from contrib.rfc3633.dhcpv6_pd import DHCPv6PDHelper from scapy.all import * from veripy.assertions import * class RenewMessageTestCase(DHCPv6PDHelper): """ Requesting Router Initiated: Renew Message Verify that a device can properly interoperate while using DHCPv6...
gpl-3.0
802,280,280,625,709,000
41.026316
116
0.644737
false
3.270492
false
false
false
fr34kyn01535/PyForum
server.py
1
2451
# coding:utf-8 import os.path import cherrypy import sys if sys.version[0] == '2': reload(sys) sys.setdefaultencoding("utf-8") from app import themen,diskussionen,beitraege,login,logout,administration,templates def error_page(status, message, traceback, version): return templates.RenderTemplate("error.html"...
gpl-2.0
7,957,577,721,202,830,000
30.423077
130
0.684619
false
2.953012
true
false
false
CauldronDevelopmentLLC/buildbot
buildbot/status/web/slaves.py
1
6579
import time, urllib from twisted.python import log from twisted.web import html from twisted.web.util import Redirect from buildbot.status.web.base import HtmlResource, abbreviate_age, OneLineMixin, path_to_slave from buildbot import version, util # /buildslaves/$slavename class OneBuildSlaveResource(HtmlResource, O...
gpl-2.0
1,440,367,016,623,047,700
35.348066
98
0.495212
false
3.789747
false
false
false
chop-dbhi/varify-data-warehouse
vdw/assessments/migrations/0005_copy_categories.py
1
21123
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.core.management import call_command class Migration(DataMigration): def forwards(self, orm): call_command("loaddata", "assessment_categories.json") f...
bsd-2-clause
3,351,375,113,810,633,000
80.555985
192
0.546561
false
3.658929
false
false
false
watchtower/asynctest
asynctest/__init__.py
1
2295
import functools class TestStatus: # FIXME should really be an Enum pending = -1 failure = 0 success = 1 class Test: def __init__(self, func, description): self.func = func self.description = description self.status = TestStatus.pending self._callback = None sel...
mit
2,558,572,069,989,067,300
27.6875
97
0.578214
false
4.069149
true
false
false
linktlh/Toontown-journey
toontown/distributed/HoodMgr.py
1
13166
from direct.directnotify import DirectNotifyGlobal from direct.showbase import DirectObject from pandac.PandaModules import * import random from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals class HoodMgr(DirectObject.DirectObject): notify = DirectNotifyGlobal.directNotify.newCatego...
apache-2.0
-2,892,375,891,941,455,400
39.018237
228
0.478353
false
2.847318
false
false
false
shiquanwang/numba
numba/control_flow/cfstats.py
1
4105
# -*- coding: utf-8 -*- from __future__ import print_function, division, absolute_import from numba import nodes from numba.reporting import getpos class StatementDescr(object): is_assignment = False class LoopDescr(object): def __init__(self, next_block, loop_block): self.next_block = next_block ...
bsd-2-clause
-3,426,023,315,412,407,300
27.908451
81
0.607065
false
3.872642
false
false
false
pope/SublimeYetAnotherCodeSearch
tests/test_csearch.py
1
2481
import sublime import os.path import shutil import textwrap import time import uuid from YetAnotherCodeSearch.tests import CommandTestCase _NEEDLE_IN_HAYSTACK = 'cc5b252b-e7fb-5145-bf8a-ed272e3aa7bf' class CsearchCommandTest(CommandTestCase): def setUp(self): super(CsearchCommandTest, self).setUp() ...
mit
-3,462,537,003,884,839,400
32.527027
78
0.612253
false
3.616618
true
false
false
awong1900/platformio
platformio/builder/scripts/frameworks/mbed.py
1
7172
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ mbed The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down...
mit
-7,872,972,686,760,434,000
29.134454
79
0.591049
false
3.108799
false
false
false
cosmicAsymmetry/zulip
zerver/tests/test_signup.py
1
51499
# -*- coding: utf-8 -*- from __future__ import absolute_import import datetime from django.conf import settings from django.http import HttpResponse from django.test import TestCase from mock import patch from zerver.lib.test_helpers import MockLDAP from confirmation.models import Confirmation from zilencer.models i...
apache-2.0
-5,722,122,378,230,343,000
42.559222
114
0.574786
false
4.121268
true
false
false
rlpy/rlpy
rlpy/Representations/LocalBases.py
1
7491
""" Representations which use local bases function (e.g. kernels) distributed in the statespace according to some scheme (e.g. grid, random, on previous samples) """ from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from ...
bsd-3-clause
6,855,771,218,240,773,000
39.058824
80
0.606595
false
4.177914
false
false
false
kavigupta/61a-analysis
src/analytics.py
1
4920
""" A module containing a variety of functions for analyzing the data. This is supposed to be more data specific than statistics. """ import numpy as np from tools import cached_property def compensate_for_grader_means(evals, z_thresh=1): """ Compensates for grader means by subtracting each grader's avera...
gpl-3.0
-3,319,539,819,622,582,300
40.344538
100
0.607927
false
3.796296
false
false
false
Vishakha1990/Lambdas
testing/digitalocean/test.py
1
2597
#!/usr/bin/python import os, requests, time, json, argparse API = "https://api.digitalocean.com/v2/droplets" DROPLET_NAME = "ol-tester" HEADERS = { "Authorization": "Bearer "+os.environ['TOKEN'], "Content-Type": "application/json" } def post(args): r = requests.post(API, data=args, headers=HEADERS) re...
apache-2.0
2,783,647,885,308,764,000
24.97
85
0.560647
false
3.27904
true
false
false
yehudagale/fuzzyJoiner
old/TripletLossFacenetLSTM-angular.py
1
21847
import numpy as np import tensorflow as tf import random as random # import cntk as C # """ # The below is necessary in Python 3.2.3 onwards to # have reproducible behavior for certain hash-based operations. # See these references for further details: # https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSE...
epl-1.0
8,191,197,515,958,977,000
37.395431
167
0.663249
false
3.366256
true
false
false
samlaudev/LeetCode
Python/Insert Delete GetRandom O(1) - Duplicates allowed/Solution.py
1
2970
# Problem: Insert Delete GetRandom O(1) - Duplicates allowed # # Design a data structure that supports all following operations in average O(1) time. # # Note: Duplicate elements are allowed. # 1. insert(val): Inserts an item val to the collection. # 2. remove(val): Removes an item val from the collection if presen...
mit
-2,704,729,365,606,001,700
30.595745
199
0.624916
false
4.153846
false
false
false
egabancho/invenio
invenio/legacy/search_engine/__init__.py
1
332135
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 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 Found...
gpl-2.0
3,541,788,180,805,324,000
45.394049
268
0.549861
false
3.806749
false
false
false
mozman/ezdxf
tests/test_05_tools/test_510_byte_stream.py
1
1134
# Copyright (c) 2020, Manfred Moitzi # License: MIT License import pytest import struct from ezdxf.tools.binarydata import ByteStream def test_init(): bs = ByteStream(b'ABCDABC\x00') assert bs.index == 0 assert len(bs.buffer) == 8 def test_read_ps(): bs = ByteStream(b'ABCDABC\x00') s = bs.read_...
mit
846,370,826,801,595,800
21.235294
52
0.602293
false
2.793103
true
false
false
alindt/Cinnamon
files/usr/lib/cinnamon-settings/modules/cs_default.py
1
14784
#!/usr/bin/env python from SettingsWidgets import * PREF_MEDIA_AUTORUN_NEVER = "autorun-never" PREF_MEDIA_AUTORUN_X_CONTENT_START_APP = "autorun-x-content-start-app" PREF_MEDIA_AUTORUN_X_CONTENT_IGNORE = "autorun-x-content-ignore" PREF_MEDIA_AUTORUN_X_CONTENT_OPEN_FOLDER = "autorun-x-content-open-folder" CUSTOM_ITEM...
gpl-2.0
-4,939,759,339,208,699,000
39.952909
150
0.603084
false
3.595331
false
false
false
bugzPDX/airmozilla
airmozilla/manage/views/dashboard.py
1
5401
import datetime from django.contrib.auth.models import User from django.shortcuts import render from django.utils import timezone from django.db.models import Sum from jsonview.decorators import json_view from airmozilla.main.models import ( Event, SuggestedEvent, Picture, EventRevision, ) from airmo...
bsd-3-clause
-7,759,845,208,928,086,000
29.514124
78
0.578967
false
3.717137
false
false
false
matthewgall/dnsjson.com
app.py
1
5654
#!/usr/bin/env python3 import os, logging, argparse, json, datetime import requests import dns.resolver from bottle import route, request, response, redirect, hook, error, default_app, view, static_file, template def set_content_type(fn): def _return_type(*args, **kwargs): if request.headers.get('Accept') == "appl...
mit
-8,385,073,387,106,826,000
28.763158
150
0.67156
false
3.196156
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/offline_user_data_job_service/transports/base.py
1
5564
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
6,447,268,863,987,547,000
38.183099
83
0.651689
false
4.180316
false
false
false
harshadyeola/easyengine
ee/cli/plugins/stack_upgrade.py
1
12752
from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.core.logging import Log from ee.core.variables import EEVariables from ee.core.aptget import EEAptGet from ee.core.apt_repo import EERepo from ee.core.services import EEService from ee.core.fileutils import EEF...
mit
-3,016,983,847,023,325,700
44.870504
117
0.513018
false
3.983755
false
false
false
noba3/KoTos
addons/plugin.video.filmibynaturex-2.5.7/mymoves/movie/Metadata.py
1
2017
from common import XBMCInterfaceUtils, Logger from metahandler import metahandlers # @UnresolvedImport import sys def retieveMovieInfoAndAddItem(request_obj, response_obj): items = response_obj.get_item_list() XBMCInterfaceUtils.callBackDialogProgressBar(getattr(sys.modules[__name__], '__addMovieInfo_i...
gpl-2.0
-5,643,942,562,608,663,000
42.847826
202
0.608825
false
3.88632
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/soyuz/model/archivesubscriber.py
1
9106
# Copyright 2009-2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Database class for table ArchiveSubscriber.""" __metaclass__ = type __all__ = [ 'ArchiveSubscriber', ] from operator import itemgetter import pytz from storm.ex...
agpl-3.0
6,795,547,473,769,740,000
37.100418
78
0.639798
false
4.474693
false
false
false
pnasrat/puppet-codereview
rietveld.py
1
6634
#!/usr/bin/python # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
apache-2.0
-6,787,070,875,122,825,000
28.484444
80
0.641091
false
3.506342
false
false
false
F8LEFT/ART
KDE/share/ECM/find-modules/rules_engine.py
1
21090
#!/usr/bin/env python #============================================================================= # Copyright 2016 by Shaheed Haque (srhaque@theiet.org) # Copyright 2016 Stephen Kelly <steveire@gmail.com> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided th...
gpl-3.0
3,596,388,408,542,231,000
39.095057
144
0.600853
false
4.81947
false
false
false
bsmithyman/pymatsolver
pymatsolver/Tests/test_Triangle.py
1
1715
import unittest import numpy as np, scipy.sparse as sp TOL = 1e-12 class TestMumps(unittest.TestCase): def setUp(self): n = 50 nrhs = 20 self.A = sp.rand(n, n, 0.4) + sp.identity(n) self.sol = np.ones((n, nrhs)) self.rhsU = sp.triu(self.A) * self.sol self.rhsL = sp...
mit
-503,422,981,200,351,500
34
68
0.602915
false
2.936644
true
false
false
ric2b/Vivaldi-browser
chromium/components/policy/tools/make_policy_zip.py
1
2188
#!/usr/bin/env python # Copyright (c) 2011 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. """Creates a zip archive with policy template files. """ import optparse import sys import zipfile def add_files_to_zip(zip_file,...
bsd-3-clause
-7,656,171,030,158,575,000
31.656716
76
0.679159
false
3.523349
false
false
false
Solewer/vino-cave
vinocave/settings.py
1
3114
""" Django settings for vinocave project. Generated by 'django-admin startproject' using Django 1.11.3. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import o...
mit
-9,186,155,754,209,220,000
24.735537
91
0.685613
false
3.475446
false
false
false
toothris/toothris
src/bprofile.py
1
5189
# Copyright 2008, 2015 Oleg Plakhotniuk # # This file is part of Toothris. # # Toothris 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-3.0
8,399,911,232,193,724,000
31.841772
99
0.56639
false
3.703783
false
false
false
bearops/ebzl
ebzl/modules/ecs.py
1
4547
from .. lib import ( ecs, format as fmt, parameters ) from . import ( version ) import os import json import argparse def get_argument_parser(): parser = argparse.ArgumentParser("ebzl ecs") parameters.add_profile(parse, required=False) parameters.add_region(parser, required=False) ...
bsd-3-clause
-6,729,863,579,245,356,000
26.72561
74
0.607653
false
3.687753
false
false
false
rjungbeck/rasterizer
mupdf12.py
1
2411
from mupdfbase import MuPdfBase, Matrix, Rect, BBox from ctypes import cdll,c_float, c_int, c_void_p, Structure, c_char_p,POINTER FZ_STORE_UNLIMITED=0 class MuPdf(MuPdfBase): def __init__(self): self.dll=cdll.libmupdf self.dll.fz_bound_page.argtypes=[c_void_p, c_void_p, POINTER(Rect)] self.dll...
agpl-3.0
-1,224,500,625,628,163,300
28.935897
94
0.68229
false
2.425553
false
false
false
MaisamArif/NEST
backend/tmp_markov_framework/markov_script.py
1
1912
import numpy as np import random def normalize(arr): s = sum(arr) if s == 0: s = 1 arr[0] = 1 for i, val in enumerate(arr): arr[i] = val/s def generate(width, height): matrix = [] for i in range(height): matrix.append([]) for j in range(width): ...
gpl-3.0
-5,248,547,207,103,633,000
23.202532
103
0.544979
false
2.708215
false
false
false
tbjoern/adventofcode
One/script.py
1
1159
file = open("input.txt", "r") input = file.next() sequence = input.split(", ") class walker: def __init__(self): self.east = 0 self.south = 0 self.facing = 0 self.tiles = {} def turnL(self): if self.facing == 0: self.facing = 3 else: self.facing -= 1 def turnR(self): i...
mit
5,358,361,581,108,001,000
15.328358
42
0.559103
false
2.670507
false
false
false
CLVsol/odoo_addons
clv_seedling/batch_history/clv_seedling_batch_history.py
1
2387
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # ...
agpl-3.0
3,222,787,404,884,915,000
53.25
116
0.514872
false
4.564054
false
false
false
what-studio/profiling
test/test_tracing.py
1
1802
# -*- coding: utf-8 -*- import sys import pytest from _utils import factorial, find_stats, foo from profiling.stats import RecordingStatistics from profiling.tracing import TracingProfiler def test_setprofile(): profiler = TracingProfiler() assert sys.getprofile() is None with profiler: assert s...
bsd-3-clause
2,869,637,923,411,800,600
30.614035
75
0.671476
false
3.575397
false
false
false
AstroHuntsman/POCS
pocs/focuser/birger.py
1
16549
import io import re import serial import time import glob from pocs.focuser.focuser import AbstractFocuser # Birger adaptor serial numbers should be 5 digits serial_number_pattern = re.compile('^\d{5}$') # Error codes should be 'ERR' followed by 1-2 digits error_pattern = re.compile('(?<=ERR)\d{1,2}') error_message...
mit
46,177,568,672,669,770
40.580402
117
0.563236
false
4.38268
false
false
false
linuxmidhun/0install
zeroinstall/cmd/remove_feed.py
1
1066
""" The B{0install remove-feed} command-line interface. """ # Copyright (C) 2011, Thomas Leonard # See the README file for details, or visit http://0install.net. syntax = "[INTERFACE] FEED" from zeroinstall import SafeException, _ from zeroinstall.injector import model, writer from zeroinstall.cmd import add_feed, U...
lgpl-2.1
7,947,182,784,579,347,000
30.352941
78
0.707317
false
3.072046
false
false
false
catapult-project/catapult-csm
telemetry/telemetry/internal/browser/browser_unittest.py
1
11913
# Copyright 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. import logging import os import re import shutil import tempfile import unittest from telemetry.core import exceptions from telemetry import decorators from...
bsd-3-clause
-8,673,220,361,794,257,000
37.553398
80
0.732645
false
3.784307
true
false
false
helixyte/TheLMA
thelma/repositories/rdb/mappers/experimentjob.py
1
1080
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Experiment job mapper. """ from sqlalchemy.orm import relationship from everest.repositories.rdb.utils import mapper from thelma.entities.experiment import ...
mit
-7,348,472,988,197,110,000
32.75
80
0.607407
false
4.576271
false
false
false
SeanEstey/Bravo
app/notify/tasks.py
1
7873
'''app.notify.tasks''' import json, os, pytz from os import environ as env from datetime import datetime, date, time, timedelta from dateutil.parser import parse from bson import ObjectId as oid from flask import g, render_template from app import get_keys, celery #, smart_emit from app.lib.dt import to_local from app....
gpl-2.0
-6,240,724,140,937,675,000
32.7897
104
0.526737
false
3.61977
false
false
false
tuxofil/Gps2Udp
misc/server/gps2udp.py
1
5891
#!/usr/bin/env python """ Receive Geo location data from the Gps2Udp Android application via UDP/IP and forward them to the stdout line by line. There is some requirements to a valid incoming packet: - it must be of form: TIMESTAMP LATITUDE LONGITUDE ACCURACY [other fields]; - TIMESTAMP is a Unix timestamp (seconds s...
bsd-2-clause
-6,502,868,409,911,242,000
31.016304
76
0.647938
false
3.983097
false
false
false
Puppet-Finland/trac
files/spam-filter/tracspamfilter/captcha/keycaptcha.py
1
4322
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Dirk Stöcker <trac@dstoecker.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.com/license.html. # # This software...
bsd-2-clause
-6,845,159,761,740,019,000
37.580357
82
0.588753
false
3.823894
false
false
false
thiagopena/PySIGNFe
pysignfe/nfse/bhiss/v10/SubstituicaoNfse.py
1
1459
# -*- coding: utf-8 -*- from pysignfe.xml_sped import * class InfSubstituicaoNfse(XMLNFe): def __init__(self): super(InfSubstituicaoNfse, self).__init__() self.Id = TagCaracter(nome=u'InfSubstituicaoNfse', propriedade=u'Id', raiz=u'/') self.NfseSubstituidora = TagInteiro(nome=u'NfseSubstit...
lgpl-2.1
7,768,406,906,340,372,000
31.444444
97
0.601782
false
2.844055
false
false
false
panyam/libgraph
libgraph/graphs.py
1
2606
class Edge(object): def __init__(self, source, target, data = None): self._source, self._target, self.data = source, target, data def __repr__(self): return "Edge<%s <-> %s>" % (repr(self.source), repr(self.target)) @property def source(self): return self._source @property de...
apache-2.0
1,825,467,902,488,189,400
33.746667
96
0.608212
false
3.809942
false
false
false
akarol/cfme_tests
cfme/tests/cloud_infra_common/test_html5_vm_console.py
1
8156
# -*- coding: utf-8 -*- """Test for HTML5 Remote Consoles of VMware/RHEV/RHOSP Providers.""" import pytest import imghdr import time import re from cfme.cloud.provider.openstack import OpenStackProvider from cfme.common.provider import CloudInfraProvider from cfme.infrastructure.provider.virtualcenter import VMwarePro...
gpl-2.0
-2,640,400,068,133,238,300
43.813187
100
0.643943
false
4.073926
true
false
false
adsabs/citation_helper_service
citation_helper_service/citation_helper.py
1
1894
''' Created on Nov 1, 2014 @author: ehenneken ''' from __future__ import absolute_import # general module imports import sys import os import operator from itertools import groupby from flask import current_app from .utils import get_data from .utils import get_meta_data __all__ = ['get_suggestions'] def get_sugge...
mit
-4,987,392,031,141,406,000
33.436364
79
0.67265
false
3.546816
false
false
false
fenimore/freeebot
freeebot.py
1
5664
#!/usr/bin/env python """Twitter Bot for posting craigslist postings of Free Stuff Currently set up for New York. Example usage: python tweetstuffs.py Attributes: - NO_IMAGE -- link for when there is no image found - FILE -- path to tmp file - PATH -- current directory - C_KEY, C_SECRET, A_TOKEN,...
mit
6,432,309,924,595,103,000
35.307692
103
0.570798
false
3.644788
false
false
false
embray/numpy
numpy/lib/npyio.py
1
66490
from __future__ import division, absolute_import, print_function import sys import os import re import itertools import warnings import weakref from operator import itemgetter import numpy as np from . import format from ._datasource import DataSource from ._compiled_base import packbits, unpackbits from ._iotools im...
bsd-3-clause
-2,169,429,861,298,942,200
33.957939
89
0.559107
false
4.12597
false
false
false
StudyBlue/sblibs
sblibs/display/general.py
1
1801
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright © Manoel Vilela 2016 # # @project: Decorating # @author: Manoel Vilela # @email: manoel_vilela@engineer.com # # pylint: disable=redefined-builtin # pylint: disable=invalid-name """ An collection of usefull decorators for debug and time...
bsd-2-clause
1,671,279,908,194,633,700
23
78
0.622222
false
3.797468
false
false
false
microelly2/geodata
geodat/import_aster.py
1
5208
''' geodat import AST (gdal)''' # -*- coding: utf-8 -*- #------------------------------------------------- #-- geodat import AST (gdal) #-- #-- microelly 2016 v 0.1 #-- #-- GNU Lesser General Public License (LGPL) #------------------------------------------------- #http://geoinformaticstutorial.blogspot.de/2012/09/rea...
lgpl-3.0
-4,922,200,730,300,529,000
20.520661
256
0.679724
false
2.493059
false
false
false
flavoso/gerencex
gerencex/core/tests/test_view_office_tickets.py
1
1342
import datetime from django.contrib.auth.models import User from django.shortcuts import resolve_url as r from django.test import TestCase from django.utils import timezone from gerencex.core.models import Restday, Office class OfficeTicketsViewTest(TestCase): def setUp(self): self.office = Office.objec...
gpl-3.0
6,811,396,555,601,649,000
30.952381
73
0.629657
false
3.738162
true
false
false
sloede/modm
modfileparser.py
1
6189
#!/usr/bin/env python # Modm - Modules iMproved # Copyright (C) 2013-2014 Michael Schlottke # # 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 opt...
gpl-2.0
8,359,449,882,160,916,000
34.774566
80
0.604944
false
4.21594
false
false
false
cp16net/trove
trove/tests/unittests/guestagent/test_dbaas.py
1
144181
# Copyright 2012 OpenStack Foundation # # 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 l...
apache-2.0
275,580,507,818,071,580
42.310604
79
0.602201
false
3.921372
true
false
false
omegachysis/arche-engine
arche/image.py
1
11087
_panda = False try: import pygame from pygame import locals except: _panda = True import logging log = logging.getLogger("R.Surface") def scaleImage(surface, width, height): """ Return surface scaled to fit width and height. """ #log.debug("scaled image %s" % repr(surface)) return pygame.tr...
apache-2.0
5,942,455,946,340,129,000
29.378082
93
0.590872
false
4.08361
false
false
false
silly-wacky-3-town-toon/SOURCE-COD
toontown/battle/DistributedBattleFinal.py
1
7784
from panda3d.core import * from panda3d.direct import * from direct.interval.IntervalGlobal import * from BattleBase import * from direct.actor import Actor from toontown.distributed import DelayDelete from direct.directnotify import DirectNotifyGlobal import DistributedBattleBase import MovieUtil from toontown.suit im...
apache-2.0
-5,185,984,711,244,480,000
37.534653
223
0.656475
false
3.53176
false
false
false
atmtools/typhon
doc/example_google.py
1
8646
# -*- coding: utf-8 -*- """Example Google style docstrings. This module demonstrates documentation as specified by the `Google Python Style Guide`_. Docstrings may extend over multiple lines. Sections are created with a section header and a colon followed by a block of indented text. Example: Examples can be give...
mit
-1,395,894,020,954,367,700
30.67033
79
0.64978
false
4.616124
false
false
false
rjenc29/numerical
course/matplotlib/examples/fill_example.py
1
2229
""" Illustrate different ways of using the various fill functions. """ import numpy as np import matplotlib.pyplot as plt import example_utils def main(): fig, axes = example_utils.setup_axes() fill_example(axes[0]) fill_between_example(axes[1]) stackplot_example(axes[2]) example_utils.title(fig...
mit
-5,428,542,155,974,001,000
27.948052
76
0.623598
false
2.909922
false
false
false
seninp/saxpy
saxpy/hotsax.py
1
4860
"""Implements HOT-SAX.""" import numpy as np from saxpy.znorm import znorm from saxpy.sax import sax_via_window from saxpy.distance import euclidean def find_discords_hotsax(series, win_size=100, num_discords=2, alphabet_size=3, paa_size=3, znorm_threshold=0.01, sax_type='unidim'): """HOT...
gpl-2.0
5,871,183,956,478,835,000
33.721429
121
0.531893
false
3.755796
false
false
false
sighill/shade_app
apis/raw/017_raw/017_cleaner.py
1
1278
# -*- coding: utf-8 -*- # 017_cleaner.py # CODED TO BE EXECUTED SERVER SIDE : # cd /home/common/shade # python3 manage.py shell import sys from apis.voca import * ################################## # Init des paths et noms de fichiers AddLog('title' , 'Début du nettoyage du fichier') work_dir = '/home/com...
mit
-8,009,218,853,207,783,000
30.641026
112
0.605822
false
3.011848
false
false
false
reprah/shy
shy.py
1
2992
#!/usr/bin/env python import sys, os, re, subprocess # begin loop: # - reading from stdin # - forking a child # - executing a new process in the child def main(): while True: sys.stdout.write(os.environ['PROMPT']) line = sys.stdin.readline() commands = split_on_pipes(line) placeholder_in = sys.stdin plac...
mit
7,146,024,717,470,157,000
22.559055
78
0.642714
false
2.941986
false
false
false
csiro-rds/casda-samples
cutouts_by_proj.py
1
7634
############################################################################################# # # Python script to demonstrate interacting with CASDA's SODA implementation to # retrieve cutout images around a list of sources. # # This script creates a job to produce and download cutouts from the specified image at # t...
apache-2.0
4,055,497,068,719,523,000
44.712575
184
0.61344
false
3.91688
false
false
false
tjhunter/phd-thesis-tjhunter
python/kdd/plot_network.py
1
1065
__author__ = 'tjhunter' import build import json import pylab as pl from matplotlib.collections import LineCollection # Draws the network as a pdf and SVG file. def draw_network(ax, fd, link_style): def decode_line(l): #print l dct = json.loads(l) lats = dct['lats'] lons = dct['lons'] return zi...
apache-2.0
-1,207,750,359,825,550,300
26.307692
68
0.656338
false
2.744845
false
false
false
interalia/cmsplugin_availablejobs
availablejob/views.py
1
3330
from django.views.generic.simple import direct_to_template from django.views.generic.list_detail import object_detail from django.contrib.sites.models import Site from django.shortcuts import get_object_or_404 from django.contrib import messages from models import EnableOpening, Opening, Candidate from forms import Ap...
bsd-3-clause
7,716,668,419,080,434,000
30.415094
95
0.63033
false
3.679558
false
false
false
calio/cflow2dot
cflow2dot.py
1
9602
#!/usr/bin/env python import os.path import sys import subprocess import re import argparse import json from sys import exit from os import system cflow_path = "/usr/local/bin/cflow" dot_path = "/usr/local/bin/dot" color = ["#eecc80", "#ccee80", "#80ccee", "#eecc80", "#80eecc"]; shape =["box", "ellipse", "octagon", ...
mit
-4,698,164,425,426,742,000
39.686441
204
0.613622
false
3.215673
false
false
false
kokosowy/vuadek
vuadek.py
1
1180
#!/usr/bin/python3.4 import sys import os import subprocess zm_home = os.path.expanduser("~") zm_pth_workdir = zm_home+"/.vuadek/" if not os.path.exists(zm_pth_workdir): os.makedirs(zm_pth_workdir) zm_fl_remains = zm_pth_workdir+"remains" pathname = os.path.dirname(sys.argv[1]) if not os.path.isfile(zm_fl_rema...
gpl-2.0
-4,554,903,689,397,167,600
29.25641
170
0.65678
false
2.593407
false
false
false