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
segfaulthunter/burrahobbit
burrahobbit/_tree.py
1
18549
# Copyright (C) 2011 by Florian Mayer <florian.mayer@bitsrc.org> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
mit
6,906,283,877,320,247,000
31.485114
81
0.580247
false
4.045583
false
false
false
udit-gupta/socialmaps
mobileproject/Social Maps.py
1
2920
import appuifw, e32, time, graphics, base64, location, urllib app_lock = e32.Ao_lock() def quit(): app_lock.signal() appuifw.app.exit_key_handler = quit appuifw.app.screen = 'full' # Splash Image def handle_redraw(rect): canvas.blit(img) img = graphics.Image.open("E:\\Data\\python\\splash.jpg") canvas = app...
gpl-2.0
-8,775,820,989,170,935,000
27.076923
113
0.675685
false
2.78626
false
false
false
erigones/esdc-ce
api/dc/template/views.py
1
3164
from api.decorators import api_view, request_data from api.permissions import IsAdmin, IsSuperAdminOrReadOnly from api.dc.template.api_views import DcTemplateView __all__ = ('dc_template_list', 'dc_template') @api_view(('GET',)) @request_data(permissions=(IsAdmin, IsSuperAdminOrReadOnly)) def dc_template_list(reque...
apache-2.0
-4,239,256,157,112,182,300
31.618557
104
0.58818
false
3.835152
false
false
false
nakagami/reportlab
src/reportlab/graphics/renderPM.py
1
26714
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history www.reportlab.co.uk/rl-cgi/viewcvs.cgi/rlextra/graphics/Csrc/renderPM/renderP.py __version__=''' $Id: renderPM.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__="""Render drawing objects in common bitmap formats Usage:: from r...
bsd-3-clause
3,169,738,391,419,631,000
34.809651
133
0.560605
false
3.375537
true
false
false
DataViva/dataviva-site
scripts/data_download/rais/download_manager_rais.py
1
1335
import os import commands import time import logging import sys if len(sys.argv) != 5 or (sys.argv[1:][0] not in ['pt', 'en']): print "ERROR! use :\n python scripts/data_download/rais/download_manager_rais.py en/pt output_path year time(seconds)\n" exit() files = ["i", "lo", "lio"] type_location = ["regions",...
mit
5,836,222,867,711,838,000
38.264706
158
0.698127
false
2.76971
false
false
false
google/makani
avionics/network/generate_switch_links.py
1
6998
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
5,392,849,640,673,062,000
31.398148
79
0.625607
false
3.652401
true
false
false
philrhinehart/waterlogged
logger/charts.py
1
3662
import datetime import gviz_api from logger.models import Log from logger.heatmaps import moving_average # TODO NEED TO CLEAN THIS CODE def fountains_current(fountains): description = [ ('Fountain Name', 'string'), ('Latest Reading', 'number'), ('Daily Rate', 'number')] data_table = gviz_api....
mit
1,098,674,748,919,319,700
36.367347
99
0.631895
false
3.406512
false
false
false
stevensmedia/GrabTwitch
GrabTwitch.py
1
1962
#! /usr/bin/env python isMac = True try: import Foundation except ImportError: isMac = False import Twitch import Tkinter import os def setButtons(s): copyButton.config(state=s) qtpButton.config(state=s) vlcmacButton.config(state=s) def submit(): try: channel = channelEntry.get() data = Twitch.grab(channe...
mit
-5,978,090,247,337,342,000
25.513514
86
0.75739
false
2.99542
false
false
false
rwl/PyCIM
CIM15/IEC61970/Informative/InfAssets/MountingConnection.py
1
4751
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
mit
2,679,059,002,337,368,600
46.039604
897
0.696274
false
4.338813
false
false
false
sssllliang/edx-analytics-pipeline
edx/analytics/tasks/tests/acceptance/services/db.py
1
2440
import json from contextlib import closing from contextlib import contextmanager import mysql.connector from edx.analytics.tasks.url import get_target_from_url # TODO: use a database that is unique to this particular test run to isolate it. class DatabaseService(object): def __init__(self, config, database_n...
agpl-3.0
-2,513,281,604,018,603,500
32.424658
117
0.602049
false
4.518519
false
false
false
bit2pixel/quickformat
src/code/quickformat/notifier.py
1
6870
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2011 TUBITAK/BILGEM # Renan Çakırerk <renan at pardus.org.tr> # # 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 ...
gpl-2.0
2,642,838,459,742,924,000
37.80226
150
0.674287
false
3.906712
false
false
false
tempbottle/Nuitka
tests/programs/run_all.py
1
4779
#!/usr/bin/env python # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except i...
apache-2.0
-6,503,902,647,717,657,000
29.832258
80
0.592802
false
4.053435
false
false
false
simone-campagna/py-structparser
structparser/connect.py
1
5847
#!/usr/bin/env python # # 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 l...
apache-2.0
4,727,029,417,521,289,000
30.777174
125
0.605781
false
4.088811
false
false
false
mdavid/cherokee-webserver-svnclone
admin/plugins/extensions.py
1
2529
# Cheroke Admin # # Authors: # Alvaro Lopez Ortega <alvaro@alobbs.com> # # Copyright (C) 2010 Alvaro Lopez Ortega # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License as published by the Free Software Foundation. # # This pro...
gpl-2.0
-4,247,617,482,505,685,000
32.276316
106
0.637011
false
3.517385
false
false
false
GajovskiMaxime/stuart
stuart/commands.py
1
4976
# -*- coding: utf-8 -*- """Click commands.""" import os from glob import glob from subprocess import call import click from flask import current_app from flask.cli import with_appcontext from werkzeug.exceptions import MethodNotAllowed, NotFound from stuart.extensions import salt_client from stuart.models.salt_module ...
bsd-3-clause
7,636,556,050,582,792,000
33.317241
78
0.60832
false
3.727341
true
false
false
hughdbrown/QSTK-nohist
Bin/csv2fund.py
1
17297
''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on October, 2, 2012 @author: Sourabh Bajaj @contact: sourabhbajaj@gatech.edu @summary: Contains converter fo...
bsd-3-clause
-1,009,580,934,210,948,600
39.988152
146
0.559692
false
3.569336
false
false
false
jorik041/plaso
plaso/parsers/bsm.py
1
40988
# -*- coding: utf-8 -*- """Basic Security Module Parser.""" import binascii import construct import logging import os import socket from plaso.lib import errors from plaso.lib import event from plaso.lib import eventdata from plaso.lib import timelib from plaso.unix import bsmtoken from plaso.parsers import interface...
apache-2.0
-6,550,947,276,111,433,000
35.859712
80
0.639943
false
3.222074
false
false
false
moonfruit/yyfeed
lib/yyfeed/app/fetcher.py
1
4151
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from re import sub from bottle import Bottle, default_app, redirect, request, route from ..db import Feed, FeedItem from ..util.web import urlfor __all__ = ['app'] app = Bottle() with app: assert app is default_app() JANDAN_PAGE...
apache-2.0
-8,709,087,652,011,297,000
24.166667
67
0.503311
false
3.369421
false
false
false
charanpald/sandbox
sandbox/misc/IterativeSpectralClustering.py
1
11919
""" A new approach to spectral clustering based on iterative eigen decomposition. """ import sys import logging import time import scipy.sparse import scipy.sparse.linalg import numpy import scipy.cluster.vq as vq from sandbox.misc.EigenUpdater import EigenUpdater from sandbox.misc.Nystrom import Nystrom from sandbox...
gpl-3.0
9,199,640,611,893,376,000
41.874101
150
0.553654
false
3.735193
false
false
false
osantana/pactum
tests/test_version.py
1
1677
import pytest from pactum import verbs from pactum.action import Action from pactum.route import Route from pactum.request import Request from pactum.version import Version def test_basic_version_with_routes(): version = Version( name="1.0", routes=[], ) assert version.name == "1.0" ...
gpl-3.0
-7,064,114,382,738,105,000
22.619718
61
0.641622
false
3.645652
true
false
false
dslackw/slpkg
slpkg/pkg_find.py
1
3245
#!/usr/bin/python3 # -*- coding: utf-8 -*- # pkg_find.py file is part of slpkg. # Copyright 2014-2021 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # All rights reserved. # Slpkg is a user-friendly package manager for Slackware installations # https://gitlab.com/dslackw/slpkg # Slpkg is free software: you can redis...
gpl-3.0
-1,225,744,107,047,242,200
37.176471
100
0.557165
false
3.858502
false
false
false
Tailszefox/scrabblesolve
scrabblesolv.py
1
28615
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os.path import time # Classe Arbre utilisée pour le dictionnaire from binaire import Arbre # Module colorama utilisé pour l'affichage de la grille from colorama import init from colorama import Fore, Back, Style ### # Classe Lettre : représente une lettre ...
cc0-1.0
1,237,180,021,429,037,000
30.934758
156
0.664213
false
2.583258
false
false
false
MG-RAST/kmerspectrumanalyzer
scripts/rarify.py
1
4529
#!/usr/bin/env python '''Tool to generate computationally-rarefied graphs kmer spectra''' import sys import os import argparse import matplotlib as mpl import numpy as np import scipy.stats from ksatools.rare import fract, rich, calc_resampled_fraction, calc_resampled_richness, plotme from ksatools.ksatools import l...
bsd-2-clause
-6,077,513,637,235,642,000
40.935185
105
0.540075
false
3.777314
false
false
false
mazaclub/tate
lib/util.py
1
10057
import os, sys, re, json import platform import shutil from datetime import datetime is_verbose = False class MyEncoder(json.JSONEncoder): def default(self, obj): from transaction import Transaction if isinstance(obj, Transaction): return obj.as_dict() return super(MyEncoder, s...
gpl-3.0
1,473,999,753,878,316,000
27.329577
99
0.558119
false
3.749814
false
false
false
jeremykid/FunAlgorithm
python_practice/leetCode/leetcode-12.py
1
1289
class Solution: def intToRoman(self, num): """ :type num: int :rtype: str """ res = "" while num: if num >= 1000: res += (num//1000) * 'M' num = num%1000 elif num >= 900: res += 'CM' ...
mit
1,193,207,697,748,988,000
25.306122
40
0.266874
false
4.603571
false
false
false
ReuthMirsky/SPR
Source/Rule.py
1
5530
class Rule(object): ''' classdocs ''' def __init__(self, A, alpha=[], order=[], paramConst=[], prob=0.1, pid=False): ''' Constructor ''' self._A=A #this item is either of type Sigma or NT self._alpha=alpha #this is a list of NTs and Sigmas ...
gpl-3.0
-6,159,481,930,148,192,000
36.416667
151
0.470524
false
4.32369
false
false
false
VillanCh/g3ar
g3ar/dict_parser/dict_parser_mixer.py
1
3267
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: Mixer for multiparser! Created: 03/09/17 """ import unittest from .dict_parser import DictParser from ..utils.iter_utils import iter_mix #DictParser(filename) DEFAULT_SESSION_ID = 'default_session_id_{index}' DEFAULT_SESSION_FILENAME = 'se...
bsd-2-clause
-8,238,487,068,791,797,000
29.830189
109
0.360269
false
5.235577
false
false
false
johnwunder/johnwunder.github.io
documentation/idioms/malicious-email-attachment/malicious-email-indicator-with-attachment_consumer.py
1
1657
#!/usr/bin/env python # Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import sys from stix.core import STIXPackage, STIXHeader def parse_stix( pkg ): print "== EMAIL ==" for ind in pkg.indicators: print "---" print "Title : " + ind.title...
bsd-3-clause
2,026,439,897,868,656,400
36.659091
115
0.582981
false
3.783105
false
false
false
oilboy/oilboy
apps/db_insert.py
1
1754
# coding: utf-8 import sqlite3 import datetime import requests from bs4 import BeautifulSoup def price(): r = requests.get("http://www.opinet.co.kr/user/main/mainLineChartAjax.do?DIV_CD=M&SIDO_CD=01&KNOC_PD_CD=B027") gas_today = r.json()['result']['chartData'][-1] r = requests.get("http://www.opinet.co....
mit
5,375,757,470,726,370,000
35.416667
207
0.629863
false
2.814815
false
false
false
pferreir/indico-backup
indico/modules/rb/api.py
1
16525
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico ## Copyright (C) 2002 - 2013 European Organization for Nuclear Research (CERN) ## ## Indico 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...
gpl-3.0
5,102,330,266,305,822,000
40.106965
118
0.644175
false
3.643078
false
false
false
javiergarridomellado/proyectodai
restaurante/urls.py
1
1474
from django.conf.urls import patterns, url from restaurante import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^about/', views.about, name='about'), url(r'^menu/', views.menu, name='menu'), #url(r'^login/', views.login, name='auth_login'), #url(r'^bar/add_tapa/$', view...
apache-2.0
360,224,192,045,124,300
39.944444
86
0.648575
false
3.039175
false
true
false
doclements/python-rasterstats
src/rasterstats/main.py
1
10843
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import numpy as np import warnings from affine import Affine from shapely.geometry import shape from .io import read_features, Raster from .utils import (rasterize_geom, get_percentile, check_stats, remap_...
bsd-3-clause
-6,873,745,043,066,212,000
37.450355
94
0.558333
false
4.52924
false
false
false
marklee77/vcsh-homedir-uzbl
.config/uzbl/scripts/auth_handler.py
1
4679
#!/usr/bin/env python # FIXME: pass default key through uzbl? # FIXME: save checkbox? import gtk import os import re import sys import yaml from argparse import ArgumentParser from gnupg import GPG from xdg.BaseDirectory import xdg_data_home default_recipients = ['0xCB8FE39384C1D3F4'] gpg = GPG() uzbl_site_data_dir ...
gpl-2.0
2,131,489,013,857,529,000
25.435028
77
0.634537
false
3.528658
false
false
false
ndtran/l10n-switzerland
l10n_ch_fds_upload_sepa/model/fds_postfinance_historical_sepa.py
1
2263
# -*- coding: utf-8 -*- ############################################################################## # # Swiss Postfinance File Delivery Services module for Odoo # Copyright (C) 2014 Compassion CH # @author: Nicolas Tran # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
5,202,114,170,889,815,000
33.920635
78
0.58418
false
4.190741
false
false
false
hoechenberger/psychopy
psychopy/tests/test_iohub/test_computer.py
1
4475
""" Test starting and stopping iohub server """ from builtins import object from psychopy.tests.utils import skip_under_travis from psychopy.tests.test_iohub.testutil import startHubProcess, stopHubProcess, skip_not_completed from psychopy.iohub import Computer from psychopy.core import getTime @skip_under_travis clas...
gpl-3.0
-818,944,928,391,043,700
34.515873
98
0.647598
false
3.974245
true
false
false
lebabouin/CouchPotatoServer-develop
couchpotato/core/providers/trailer/vftrailers/main.py
1
3065
from pygoogle import pygoogle import subprocess import time import sys import os.path import unicodedata import glob import shutil from couchpotato.core.providers.trailer.base import VFTrailerProvider from couchpotato.core.helpers.variable import mergeDicts, getTitle from couchpotato.core.logger import CPLog log = CPLo...
gpl-3.0
-3,274,892,006,931,884,000
44.746269
185
0.53279
false
4.34136
false
false
false
marcomaccio/python-docs-samples
appengine/app_identity/signing/main.py
1
2714
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-5,956,636,207,313,268,000
31.309524
78
0.710759
false
3.748619
false
false
false
plumer/codana
bugdigger_html.py
1
3876
import urllib import urllib2 import cookielib import re #bugurl = r"https://bugzilla.kernel.org/show_bug.cgi?id=%d" #fixedurl = r'https://bugzilla.kernel.org/show_activity.cgi?id=%d' bugurl = r'https://bz.apache.org/bugzilla/show_bug.cgi?id=%d' fixedurl = r'https://bz.apache.org/bugzilla/show_activity.cgi?id=%d' titl...
mit
844,519,824,847,567,600
44.6
111
0.587203
false
2.808696
false
false
false
teamfx/openjfx-9-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py
1
2349
# Copyright (C) 2016 Igalia S.L. 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 list of conditions and the ...
gpl-2.0
2,660,645,250,509,310,000
44.173077
99
0.742018
false
4.106643
false
false
false
istresearch/scrapy-cluster
docker/redis-monitor/settings.py
1
2075
# THIS FILE SHOULD STAY IN SYNC WITH /redis-monitor/settings.py # This file houses all default settings for the Redis Monitor # to override please use a custom localsettings.py file import os def str2bool(v): return str(v).lower() in ('true', '1') if type(v) == str else bool(v) # Redis host configuration REDIS_HO...
mit
7,310,123,248,342,952,000
29.072464
84
0.70506
false
2.792732
false
false
false
nyu-mll/spinn
python/spinn/data/listops/make_data.py
1
1903
import random import numpy as np MIN = "[MIN" MAX = "[MAX" MED = "[MED" FIRST = "[FIRST" LAST = "[LAST" SUM_MOD = "[SM" END = "]" OPERATORS = [MIN, MAX, MED, SUM_MOD] # , FIRST, LAST] VALUES = range(10) VALUE_P = 0.25 MAX_ARGS = 5 MAX_DEPTH = 20 DATA_POINTS = 1000000 def generate_tree(depth): if depth < MAX_...
mit
-1,541,439,583,295,898,600
21.666667
84
0.515502
false
3.015848
false
false
false
yanggg1133/rma
product_warranty/__openerp__.py
2
2438
# -*- coding: utf-8 -*- ######################################################################### # # # # ######################################################################### ...
agpl-3.0
-1,800,316,015,222,787,000
41.034483
92
0.463084
false
4.965377
false
false
false
yyao007/BiggerPockets
BiggerPockets/spiders/forum.py
1
6604
# -*- coding: utf-8 -*- import scrapy from BiggerPockets.items import postItem, userItem from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta import json class ForumSpider(scrapy.Spider): name = "forum" allowed_domains = ["https://www.biggerpockets.com/"] # Starting fro...
gpl-3.0
-2,010,257,481,238,864,100
41.070064
137
0.539522
false
3.773714
false
false
false
xju2/hzzws
scripts/compare_highmass.py
1
1551
#!/usr/bin/env python import ROOT import common import high_mass import os cats = high_mass.categories.keys() def get_m4l(file_name): res = [] f1 = ROOT.TFile.Open(file_name, "read") for cat in cats: hist_name = "m4l_"+cat h1 = f1.Get(hist_name) h1.SetDirectory(0) h1.Scale(...
mit
-4,053,984,017,592,205,000
25.741379
56
0.522244
false
3.24477
false
false
false
mediafactory/tryton_core_daemon
trytond/ir/cron.py
1
7008
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. import contextlib import datetime from dateutil.relativedelta import relativedelta import traceback import sys import logging from ..config import CONFIG from ..model import Mode...
gpl-3.0
-1,721,214,915,689,503,000
35.5
77
0.550942
false
4.29675
false
false
false
mabhub/Geotrek
geotrek/common/mixins.py
1
13661
import os import logging import shutil import datetime from django.conf import settings from django.db.models import Manager as DefaultManager from django.db import models from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import slugify from easy_thumbnails.alias import alias...
bsd-2-clause
-4,268,605,940,683,112,400
33.938619
133
0.599004
false
4.230722
false
false
false
maas/maas
src/maasserver/models/dhcpsnippet.py
1
3862
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). from django.core.exceptions import ValidationError from django.db.models import ( BooleanField, CASCADE, CharField, ForeignKey, Manager, QuerySet, Text...
agpl-3.0
-5,493,245,271,974,103,000
32.877193
79
0.664423
false
4.286349
false
false
false
chaluemwut/filter01
merage_file.py
1
1127
from filter01 import read_line from sets import Set import pickle def merage_process_measure(): data_new = Set([int(x) for x in read_line('data/new/new_measurement.txt')]) data_old = Set([int(x) for x in read_line('data/measurement.txt')]) data_new.update(data_old) lst = sorted(list(data_new)) pick...
mit
7,727,632,045,242,674,000
39.285714
132
0.645075
false
2.769042
false
false
false
renqianluo/DLT2T
DLT2T/models/attention_lm_moe.py
1
26181
# coding=utf-8 # Copyright 2017 The DLT2T Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
7,064,686,375,711,698,000
32.565385
80
0.66426
false
3.388688
false
false
false
croxis/SpaceDrive
spacedrive/renderpipeline/rpcore/gui/render_mode_selector.py
1
5127
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the right...
mit
2,341,007,481,043,905,500
37.744186
100
0.627072
false
4.216283
false
false
false
GNOME/pygtkimageview
tests/demo05.py
1
1504
''' This example demonstrates how to progressively load images and animations into an AnimView using a PixbufLoader. ''' import gobject import gtk from gtk import gdk import gtkimageview import sys if __name__ == '__main__': try: file = open(sys.argv[1]) except IndexError: print 'Usage: %s imag...
lgpl-2.1
3,678,537,001,173,497,300
24.931034
62
0.633644
false
3.473441
false
false
false
homeworkprod/byceps
byceps/util/framework/flash.py
1
1254
""" byceps.util.framework.flash ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Flash message utilities :Copyright: 2006-2019 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from collections import namedtuple from flask import flash FlashMessage = namedtuple('FlashMessage', ['text'...
bsd-3-clause
2,910,867,772,397,904,400
28.162791
75
0.652313
false
3.603448
false
false
false
sknepneklab/SAMoS
configurations/filaments_on_plane/make_filaments.py
1
2429
# * ************************************************************* # * # * Soft Active Mater on Surfaces (SAMoS) # * # * Author: Rastko Sknepnek # * # * Division of Physics # * School of Engineering, Physics and Mathematics # * University of Dundee # * # * (c) 2013, 2014 # * # * School of Science and Engin...
gpl-3.0
5,429,665,083,915,058,000
25.402174
95
0.578016
false
2.689922
false
false
false
thedarkman/ttleagueterminal
terminal.py
1
15902
#!/usr/bin/python import json import signal import subprocess import socket import logging from time import sleep from datetime import datetime import RPi.GPIO as GPIO from socketIO_client import SocketIO import MFRC522 from TTLeague import Player, Match, Game from Adafruit_CharLCD import Adafruit_CharLCD from ev...
mit
5,582,170,964,947,551,000
33.051392
136
0.533644
false
3.377655
true
false
false
brentp/gemini
gemini/ped.py
1
1978
"""Parse input PED files for loading into GEMINI sample table. Tries to parse as tab-delimited if files contain tabs, otherwise splits on whitespace. """ default_ped_fields = ["family_id", "name", "paternal_id", "maternal_id", "sex", "phenotype"] missing_member = set(["None", None, "0", "-9"]) ...
mit
7,390,111,456,890,982,000
31.966667
83
0.597068
false
3.476274
false
false
false
SeneCameras/qr-w100s
qr-w100s/vision/common.py
1
8163
#!/usr/bin/env python ''' This module contains some common routines used by cv2 samples and an abstract multiprocessing class ''' import numpy as np import cv2 # built-in modules import os import itertools as it from contextlib import contextmanager import multiprocessing import Queue #needed separately for the Em...
mit
517,474,451,315,873,000
27.051546
108
0.524562
false
3.028942
false
false
false
xbed/Mixly_Arduino
mixly_arduino/mixpyBuild/aip/speech.py
1
2108
# -*- coding: utf-8 -*- """ Speech """ from .base import AipBase from .base import base64 from .base import hashlib from .base import json class AipSpeech(AipBase): """ Aip Speech """ __asrUrl = 'http://vop.baidu.com/server_api' __ttsUrl = 'http://tsn.baidu.com/text2audio' def _isP...
apache-2.0
5,623,765,372,815,805,000
19.84
71
0.491843
false
3.741472
false
false
false
TravisDart/tictactoe
TicTacToeBoard.py
1
6954
import os class TicTacToeBoard: """ Since the value for X and O is arbitrary. It behooves us to make an effort to never hardcode these values. """ X = True O = False _ = None _d8 = [ lambda x: TicTacToeBoard._rotation(x, 0), lambda x: TicTacToeBoard._rotation(x, 1), ...
mit
2,891,145,858,310,763,000
27.268293
77
0.509635
false
3.473526
false
false
false
mreithub/rocker
rocker/image.py
1
6336
from io import BytesIO from rocker.rocker import Rocker from rocker.restclient import HttpResponseError import json import os import sys import tarfile # Data class representing a Docker image class Image: def __init__(self, json): self.config = Image._getValue(json, 'ContainerConfig') self.created = Image._get...
apache-2.0
2,023,929,477,595,800,600
28.751174
112
0.708491
false
3.172759
false
false
false
tomerghelber/pyplayer
setup.py
1
1612
from setuptools import setup, find_packages from pip.req import parse_requirements import playlist as package def get_requirements(path): # parse_requirements() returns generator of pip.req.InstallRequirement objects return map(lambda ir: str(ir.req), parse_requirements(path, session=False)) keywords = ["me...
apache-2.0
-2,510,058,319,571,000,300
28.309091
82
0.627171
false
4.453039
false
false
false
m00dawg/holland
plugins/holland.lib.mysql/holland/lib/mysql/client/legacy.py
1
14097
import re import textwrap import logging import MySQLdb from MySQLdb import OperationalError from MySQLdb.constants.CLIENT import INTERACTIVE __all__ = [ 'connect', 'MySQLClient', 'OperationalError', 'ProgrammingError', 'DatabaseError' ] LOGGER = logging.getLogger(__name__) class MySQLClient(obje...
bsd-3-clause
489,221,689,627,134,460
32.405213
82
0.540328
false
4.284802
false
false
false
shmir/PyTestCenter
testcenter/api/stc_python.py
1
3533
""" :author: yoram@ignissoft.com """ import os import posixpath import imp from sys import platform if platform == 'win32': app_subdir = 'Spirent TestCenter Application' else: app_subdir = 'Spirent_TestCenter_Application_Linux' class StcPythonWrapper(object): def __init__(self, logger, stc_install_dir)...
apache-2.0
-7,288,043,121,112,859,000
31.412844
100
0.643929
false
4.205952
false
false
false
MERegistro/meregistro
meregistro/apps/titulos/views/cohorte.py
1
17591
# -*- coding: UTF-8 -*- from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from meregistro.shortcuts import my_render from apps.seguridad.decorators import login_required, credential_required from apps.titulos.models import CarreraJurisdiccional, Cohorte, CohorteEstablecimiento, ...
bsd-3-clause
-7,265,680,962,534,900,000
36.048523
148
0.676442
false
3.093904
false
false
false
sauloal/ncbi_taxonomy
filler.py
1
13446
#!/usr/bin/python import os import sys import operator from collections import defaultdict import parser_SQL_struct #./filler.py query "Solanum lycopersicu" #./filler.py query "Solanum lycopersicum" #./filler.py list #./filler.py fill classes.csv col_names = "species|species subgroup|species group|subgenus|genus|s...
mit
4,848,601,086,838,908,000
35.145161
258
0.505801
false
3.416159
false
false
false
muthujothi/Kaggle-schizophrenia-classification
benchmark.py
1
2731
import pandas as pd import numpy as np from sklearn import linear_model from sklearn.grid_search import GridSearchCV from sklearn.ensemble import RandomForestClassifier # random forest import cPickle as pickle output_model_file = 'C:/LearningMaterials/Kaggle/Mlsp/rf_1.pkl' #Load the FNC train data as a dataframe df_1...
mit
-8,482,586,555,378,623,000
33.56962
110
0.719517
false
2.712016
true
false
false
nakagami/reportlab
src/reportlab/graphics/charts/legends.py
1
27104
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/charts/legends.py __version__=''' $Id: legends.py 3959 2012-09-27 14:39:39Z robin $ ''' __doc__="""This will be a collection of legends to be...
bsd-3-clause
-901,969,100,361,587,100
37.067416
164
0.577553
false
3.645461
false
false
false
heromod/migrid
mig/shared/useradm.py
1
51289
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # useradm - user administration functions # Copyright (C) 2003-2015 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-2.0
-4,317,858,199,562,272,300
35.119014
90
0.570122
false
4.052224
true
false
false
bitoffdev/perkins-blues
src/fade_animation.py
1
2044
import animation, colorsys def colorunpack(color): color = int(color) return ((color >> 16) / 255, ((color >> 8) & 255) / 0xff, (color & 0xff) / 0xff) def colorpack(color): return sum(int(color[i] * 0xff) << (16 - 8*i) for i in range(3)) class FadeAnimation(animation.Animation): ...
mit
-1,477,127,641,552,904,400
39.88
92
0.59638
false
3.400998
false
false
false
ccowmu/botler
commands/topic.py
1
1934
@command("topic") def topic(nick, user, channel, message): try: import os file = open("topic.txt", "r+") topic = file.read() tempfile = file.read() topic = topic.split("\n") if message.split()[0] == "add": add = str.join(' ', (message.split()[1:])) ...
unlicense
-6,651,675,617,142,042,000
38.469388
59
0.455016
false
3.9389
false
false
false
bcattle/twitarian
twitarian.py
1
3471
#!/usr/bin/env python from openpyxl import Workbook __version__ = '0.3.0' import datetime from twitter import Twitter, OAuth, oauth_dance from tweetlist import TweetList from ux import write_and_flush, get_screenname, get_start_date, \ prompt_to_open_file, print_copyright from output import save_to_csv, write_to_...
mit
1,718,616,730,763,447,000
24.711111
79
0.711899
false
3.146872
false
false
false
salceson/iwium
autoencoder.py
1
1153
#!/usr/bin/env python # coding: utf-8 import numpy as np from keras import Input from keras.engine import Model from keras.layers import Dense from sklearn.externals import joblib from sklearn.preprocessing import MinMaxScaler window_size = 32 def build_model(): encoder_input = Input(shape=(window_size,)) ...
mit
-3,705,019,433,563,129,000
29.342105
74
0.705984
false
3.515244
false
false
false
kusm/dnschecker
parser.py
1
9679
#! /usr/bin/env python # coding:utf-8 """ This module parses zones files which include A and PTR records. :copyright: (c) 2015 by the KUSM Admin Team :license: MIT, see LICENSE for more details. """ import re from record import ARecord, PTRRecord, RecordInfo try: import ipaddress except ImportError: import ...
mit
-2,288,011,389,959,088,400
25.390173
79
0.457891
false
3.291637
false
false
false
vdloo/raptiformica
tests/unit/raptiformica/actions/prune/test_check_if_instance_is_stale.py
1
2636
from raptiformica.actions.prune import check_if_instance_is_stale from raptiformica.shell.execute import COMMAND_TIMEOUT from tests.testcase import TestCase class TestCheckIfInstanceIsStale(TestCase): def setUp(self): self.log = self.set_up_patch('raptiformica.actions.prune.log') self.compute_chec...
mit
-6,668,769,292,190,544,000
39.553846
115
0.628604
false
3.739007
true
false
false
stub42/pytz
src/setup.py
1
2260
''' pytz setup script ''' import pytz import os import os.path try: from setuptools import setup except ImportError: from distutils.core import setup me = 'Stuart Bishop' memail = 'stuart@stuartbishop.net' packages = ['pytz'] resources = ['zone.tab', 'locales/pytz.pot'] for dirpath, dirnames, filenames in os...
mit
-149,708,437,901,742,600
32.731343
82
0.623894
false
3.951049
false
false
false
cyberbikepunk/m5.legacy
m5/statistics.py
1
1107
""" The module that produces statistics, maps and plots. """ from m5.model import Order, Checkin, Checkpoint, Client from sqlalchemy.orm.session import Session as DatabaseSession from m5.user import User class Stats(): def __init__(self, database_session: DatabaseSession): self.session = database_sess...
lgpl-3.0
1,109,383,226,760,806,100
30.657143
96
0.665763
false
3.817241
false
false
false
fperez/sympy
sympy/mpmath/linalg.py
1
15370
""" Linear algebra -------------- Linear equations ................ Basic linear algebra is implemented; you can for example solve the linear equation system:: x + 2*y = -10 3*x + 4*y = 10 using ``lu_solve``:: >>> A = matrix([[1, 2], [3, 4]]) >>> b = matrix([-10, 10]) >>> x = lu_solve(A, b) ...
bsd-3-clause
-290,428,717,139,172,700
28.05482
85
0.556278
false
3.215481
false
false
false
opennode/nodeconductor-assembly-waldur
src/waldur_openstack/openstack_tenant/backend.py
1
77184
import logging import re from cinderclient import exceptions as cinder_exceptions from cinderclient.v2.contrib import list_extensions from django.db import IntegrityError, transaction from django.utils import dateparse, timezone from django.utils.functional import cached_property from keystoneclient import exceptions ...
mit
6,630,885,379,357,657,000
38.744593
132
0.56995
false
4.578207
false
false
false
ajslater/magritte
magritte/cli.py
1
3013
#!/usr/bin/env python3 """CLI for copying photos from macOS Photos to the filesystem.""" import argparse from magritte.settings import Settings from magritte.db import load_data from magritte.build import build from magritte.copy_files import copy_folders from magritte import __version__ def get_arguments(): """...
gpl-2.0
1,006,284,673,275,162,200
40.847222
74
0.571855
false
4.463704
false
false
false
QISKit/qiskit-sdk-py
qiskit/circuit/bit.py
1
2309
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2019. # # 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
-6,470,781,906,390,951,000
32.955882
95
0.60589
false
4.268022
false
false
false
alanwill/aws-tailor
sam/functions/talr-ops-slack-notifications/handler.py
1
6841
# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import json import logging import boto3 import os import sys from base64 import b64decode # Path to modules needed to package local lambda function for upload currentdir = os.path.dirname(os.path.realpath(__file__)) s...
gpl-3.0
1,471,022,154,938,109,000
37.217877
114
0.519953
false
4.858665
false
false
false
whitehorse-io/encarnia
Encarnia/world/batchcode_world.py
1
2760
# -*- coding: utf-8 -*- # mygame/world/batchcode_world.py from evennia import create_object, search_object from typeclasses import rooms, exits from evennia.utils import evtable from world import map_module # We begin by creating our rooms so we can detail them later. centre = create_object(rooms.Room, k...
mit
4,044,096,912,850,828,300
35.835616
76
0.639855
false
3.289631
false
false
false
joedeller/pymine
fireworkV4.py
1
8696
#! /usr/bin/python # Joe Deller 2014 # Advanced Coding Example, Threads ! Classes! # Level : Advanced # Uses : Libraries, classes, threads, variables, operators, loops # For many years most personal computers (well ones you could afford) # were really only capable of doing one thing at a time # but they were still ...
mit
2,917,077,487,156,455,000
36.162393
115
0.61856
false
3.54794
false
false
false
ibis-project/ibis
ibis/backends/sqlite/registry.py
1
8113
import sqlalchemy as sa import toolz import ibis import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.types as ir from ibis.backends.base.sql.alchemy import ( fixed_arity, sqlalchemy_operation_registry, sqlalchemy_window_functions_registr...
apache-2.0
828,207,557,005,851,000
27.769504
79
0.601627
false
3.181569
false
false
false
aarcro/helga-versionone
helga_versionone/__init__.py
1
19815
import re from functools import wraps, partial from collections import defaultdict from oauth2client.client import OAuth2Credentials, OAuth2WebServerFlow, FlowExchangeError from twisted.internet import reactor, task from twisted.internet.defer import Deferred from urllib2 import HTTPError from helga import log, setti...
mit
-5,933,286,407,558,229,000
31.219512
105
0.59031
false
3.649843
false
false
false
MTG/freesound-datasets
datasets/management/commands/load_sounds_for_dataset.py
1
3202
from django.core.management.base import BaseCommand from datasets.models import * from django.db import transaction import sys import json from datasets.utils import stem def chunks(l, n): """Yield successive ``n``-sized chunks from ``l``. Examples: >>> chunks([1, 2, 3, 4, 5], 2) #doctest: +ELLIPSIS ...
agpl-3.0
-9,018,931,463,162,898,000
42.27027
106
0.497189
false
4.45961
false
false
false
anttivs/bakthat
bakthat/__init__.py
1
24542
# -*- encoding: utf-8 -*- import tarfile import tempfile import os from datetime import datetime from getpass import getpass import logging import hashlib import uuid import socket import re import fnmatch import mimetypes import calendar import functools from contextlib import closing # for Python2.6 compatibility fr...
mit
2,452,640,083,567,027,000
35.412463
200
0.650151
false
3.763533
true
false
false
sogapalag/problems
google-apac/Google-APAC-2017-University-Test/Round-A-APAC-Test-2017/B.Rain.py
1
1101
import heapq def solution(): T = int(input()) for t in range(1, T+1): solve(t) xx = [0, 1, 0, -1] yy = [1, 0, -1, 0] def solve(t): r, c = map(int, input().split(' ')) h = [] for i in range(r): h.append(list(map(int, input().split(' ')))) measured = [[False,]*c for i in range(r)] ...
mit
-7,570,086,036,367,014,000
27.973684
60
0.443233
false
2.882199
false
false
false
physicalattraction/kerstpuzzel
src/Conundrum/key_cipher.py
1
1285
import math import string from Conundrum.utils import sanitize letter_to_value = dict(zip('z' + string.ascii_lowercase, range(0, 27))) value_to_letter = dict(zip(range(0, 27), 'z' + string.ascii_lowercase)) def encrypt(msg: str, key: str) -> str: msg = sanitize(msg) key = sanitize(key) repeat = int(math...
mit
-9,072,666,781,883,527,000
31.974359
71
0.596109
false
3.253165
false
false
false
yanigisawa/coffee-scale
pubsub/animation/scanning-pixel.py
1
1955
#!/usr/bin/env python from samplebase import SampleBase class SimpleSquare(SampleBase): def __init__(self, *args, **kwargs): super(SimpleSquare, self).__init__(*args, **kwargs) def run(self): offset_canvas = self.matrix.CreateFrameCanvas() x, y = 0, 0 min_x, max_x = 0, offset_...
mit
3,935,416,152,031,967,700
34.545455
92
0.500767
false
3.491071
false
false
false
li-ch/mind
scripts/RL.py
1
5183
import numpy as np import MDP class RL: def __init__(self,mdp,sampleReward): '''Constructor for the RL class Inputs: mdp -- Markov decision process (T, R, discount) sampleReward -- Function to sample rewards (e.g., bernoulli, Gaussian). This function takes one argument: the...
mit
-7,778,378,612,526,674,000
36.832117
112
0.572834
false
4.116759
false
false
false
geomf/omf-fork
omf/models/solarSunda.py
1
35760
# Portions Copyrights (C) 2015 Intel Corporation ''' Calculate solar photovoltaic system output using our special financial model. ''' import json import os import sys import shutil import math import datetime as dt import __metaModel__ import logging import traceback from numpy import npv, pmt, ppmt, ipmt, irr from j...
gpl-2.0
2,689,099,000,793,988,600
44.094578
231
0.556711
false
3.452737
false
false
false
philbull/ghost
pub_atten_amplitude.py
1
4215
#!/usr/bin/python """ Plot best-fit """ import numpy as np import pylab as P import scipy.interpolate import scipy.integrate import scipy.optimize # Peak wavelengths (ugriz) in Angstrom l = [3543., 4770., 6231., 7625., 9134.] BANDS = ['u', 'g', 'r', 'i', 'z'] colours = ['#DA49DA', '#00a5ff', '#ff8200', '#F34334', '#9...
mit
2,021,774,296,719,694,600
32.991935
81
0.592408
false
2.442063
false
false
false
Swimlane/sw-python-client
swimlane/core/resources/base.py
1
1831
import six from swimlane.core.resolver import SwimlaneResolver class APIResourceMetaclass(type): """Metaclass for all APIResource classes""" def __call__(cls, *args, **kwargs): """Hook __init__ call to push resource instance into Swimlane client ResourceCache after instantiation""" resource_...
mit
7,108,540,010,368,214,000
32.290909
116
0.629711
false
4.041943
false
false
false
wimac/home
Dropbox/skel/bin/sick-beard/sickbeard/image_cache (MOU-CDQT5R1's conflicted copy 2012-04-11).py
1
7010
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-2.0
6,674,389,443,212,536,000
41.271605
172
0.603281
false
3.726741
false
false
false
Si-elegans/Web-based_GUI_Tools
registration/models.py
1
10512
import datetime import hashlib import random import re from django.conf import settings #try: from django.contrib.auth import get_user_model #except ImportError: # django < 1.5 # from django.contrib.auth.models import User #else: User = settings.AUTH_USER_MODEL from django.db import models from django.db import tra...
apache-2.0
7,382,309,962,723,942,000
37.647059
83
0.630898
false
4.864415
false
false
false
tias/capita_CPmeetsML
mzn-prototype.py
1
6758
#!/usr/bin/env python MZNSOLUTIONBASENAME = "minizinc.out" import sys import os import shutil import argparse import random import subprocess import tempfile import time as ttime import glob import datetime runcheck = __import__('mzn-runcheck') cwd=os.path.dirname(os.path.realpath(__file__)) sys.path.append(os.path....
mit
5,121,808,685,668,698,000
40.460123
235
0.644125
false
3.460317
false
false
false
jensadne/brixdb
brixdb/models.py
1
11274
from django.conf import settings from django.contrib.auth.models import AbstractBaseUser, UserManager from django.contrib.postgres import fields as pgfields from django.db import models from django.template.defaultfilters import slugify from django.utils.translation import gettext, gettext_lazy as _ from model_utils i...
mit
-2,598,213,840,191,704,000
36.45515
118
0.683697
false
3.822991
false
false
false
asoliveira/NumShip
scripts/plot/r-ace-r-cg-plt.py
1
2084
#!/usr/bin/env python # -*- coding: utf-8 -*- #É adimensional? adi = False #É para salvar as figuras(True|False)? save = True #Caso seja para salvar, qual é o formato desejado? formato = 'jpg' #Caso seja para salvar, qual é o diretório que devo salvar? dircg = 'fig-sen' #Caso seja para salvar, qual é o nome do arquivo...
gpl-3.0
3,705,263,611,752,222,000
26.289474
69
0.624879
false
2.322508
false
true
false
ashwyn/eden-message_parser
controllers/default.py
1
32534
# -*- coding: utf-8 -*- """ Default Controllers """ module = "default" # ----------------------------------------------------------------------------- def call(): "Call an XMLRPC, JSONRPC or RSS service" # If webservices don't use sessions, avoid cluttering up the storage #session.forget() return...
mit
1,082,668,242,196,069,200
39.364764
225
0.495574
false
4.255592
false
false
false
shundezhang/reporting-producers
reporting/parsers.py
1
3918
#!/usr/bin/env python # pylint: disable=broad-except import re import json import time from reporting.utilities import getLogger, get_hostname from reporting.exceptions import InputDataError log = getLogger(__name__) class IParser(object): def parse(self): assert 0, "This method must be defined." clas...
apache-2.0
1,993,956,432,497,593,300
33.672566
112
0.547728
false
4.035015
false
false
false