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
sunqm/pyscf
pyscf/pbc/gw/krgw_ac.py
1
25949
#!/usr/bin/env python # Copyright 2014-2021 The PySCF Developers. 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 # # U...
apache-2.0
-9,168,461,443,576,111,000
35.754958
120
0.541524
false
2.845285
false
false
false
USGM/suds
suds/sudsobject.py
1
11056
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 ...
lgpl-3.0
1,173,960,176,114,197,800
27.645078
84
0.510492
false
4.040936
false
false
false
tombstone/models
official/nlp/nhnet/optimizer.py
1
3030
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
7,990,494,737,155,448,000
35.95122
80
0.690099
false
4.034621
false
false
false
gem/oq-hazardlib
openquake/hmtk/sources/complex_fault_source.py
1
9353
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # LICENSE # # Copyright (c) 2010-2017, GEM Foundation, G. Weatherill, M. Pagani, # D. Monelli. # # The Hazard Modeller's Toolkit is free software: you can redistribute # it and/or modify it under the terms of the GNU Affero Gene...
agpl-3.0
-315,525,468,201,625,000
37.331967
79
0.63338
false
3.990188
false
false
false
AutoGentoo/AutoGentoo
autogentoo/portage/resolve.py
1
22795
import warnings from abc import ABC, abstractmethod from queue import Queue from typing import List, Optional, Dict, Generator, Tuple, Set from autogentoo.cportage import ( get_portage, Dependency, Atom, Ebuild, UseFlag, UseOperatorT, Portage, AtomUseT, AtomUseDefaultT, Required...
gpl-3.0
1,697,455,195,590,679,300
31.940751
88
0.567624
false
4.288805
false
false
false
rochacbruno/dynaconf
dynaconf/vendor/ruamel/yaml/scalarfloat.py
1
2326
from __future__ import print_function,absolute_import,division,unicode_literals _B=False _A=None import sys from .compat import no_limit_int from .anchor import Anchor if _B:from typing import Text,Any,Dict,List __all__=['ScalarFloat','ExponentialFloat','ExponentialCapsFloat'] class ScalarFloat(float): def __new__(D,*...
mit
-8,955,087,405,345,137,000
69.515152
311
0.677988
false
2.522777
false
false
false
Wen777/beets
beetsplug/freedesktop.py
1
2206
# This file is part of beets. # Copyright 2014, Matt Lichtenberg. # # 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
3,143,787,163,430,786,000
30.070423
72
0.677244
false
3.946333
false
false
false
dokipen/trac-announcer-plugin
announcer/util/mail.py
1
3241
# -*- coding: utf-8 -*- # # Copyright (c) 2009, Robert Corsaro # # 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 # ...
bsd-3-clause
-2,618,730,130,924,297,700
35.829545
79
0.685591
false
4.155128
false
false
false
HaroldMills/Vesper
vesper/signal/wave_audio_file.py
1
6118
"""Module containing class `WaveAudioFileType`.""" import os.path import wave import numpy as np from vesper.signal.audio_file_reader import AudioFileReader from vesper.signal.unsupported_audio_file_error import UnsupportedAudioFileError ''' audio_file_utils: read_audio_file(file_path) write_audio_file(fi...
mit
6,694,778,441,508,051,000
27.588785
80
0.52746
false
4.620846
false
false
false
asshinator/CodeScraps
utilities/timinator.py
1
1604
"""This module is used to time the execution of other modules, and is executed through tasks.json""" import sys import timeit import cProfile if len(sys.argv) < 2: raise AssertionError("NoScript specified to time!") elif ".py" not in sys.argv[1]: print(str(sys.argv[1])+ " is not a python Script!") exit(1) ...
mit
1,828,312,055,412,470,800
37.214286
93
0.696384
false
3.687356
false
true
false
rjw57/openni-skeleton-export
examples/labelbones.py
1
4166
#!/usr/bin/env python # # An example script for extracting labelled images by associating points with # their closest bone. """ Usage: labelbones.py (-h | --help) labelbones.py [--verbose] <logfile> <frame-prefix> Options: -h, --help Show a brief usage summary. -v, --verbose Increase verbosity o...
apache-2.0
-3,595,863,162,251,792,400
27.930556
78
0.56097
false
3.034232
false
false
false
malept/gmusicprocurator
docs/conf.py
1
12282
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import json ...
gpl-3.0
5,358,588,643,516,297,000
29.552239
82
0.693535
false
3.608108
false
false
false
micahflee/onionshare
desktop/src/onionshare/tab/mode/receive_mode/__init__.py
1
15632
# -*- coding: utf-8 -*- """ OnionShare | https://onionshare.org/ Copyright (C) 2014-2021 Micah Lee, et al. <micah@micahflee.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 3 of t...
gpl-3.0
5,165,836,029,262,839,000
35.269142
101
0.604273
false
4.061315
false
false
false
YingYang/STFT_R_git_repo
MNE_stft/mne_stft_regression_individual_G.py
1
12643
# -*- coding: utf-8 -*- """ Created on Tue Apr 1 12:55:06 2014 @author: ying """ import mne import numpy as np #import matplotlib.pyplot as plt from mne.minimum_norm.inverse import (apply_inverse, _check_method, _check_ori, prepare_inverse_operator, _pick_channels_inverse_operator, _check_ch_names, ...
gpl-3.0
9,214,749,064,001,478,000
42.450172
113
0.529779
false
3.4506
true
false
false
google-research/google-research
stacked_capsule_autoencoders/capsules/math_ops.py
1
4235
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
-4,903,853,938,586,949,000
26.322581
93
0.647934
false
3.174663
false
false
false
1fish2/the-blue-alliance
controllers/backup_controller.py
1
12856
import cloudstorage import csv import datetime import json import logging import os import StringIO import tba_config from google.appengine.api import taskqueue from google.appengine.api import urlfetch from google.appengine.ext import ndb from google.appengine.ext import webapp from google.appengine.ext.webapp import...
mit
3,481,643,148,437,116,000
44.588652
163
0.596842
false
3.739383
false
false
false
neingeist/azulejo
azulejo/WindowTools.py
1
3160
''' Created on Jul 12, 2012 @author: gillesB ''' from Window import Window from Workarea import Workarea class WindowTools(object): """ Some utilities for the windows """ @staticmethod def get_active_window(): """ Returns the active window :return: the active window ...
mit
-2,038,185,904,146,247,700
29.990196
139
0.592089
false
4.31105
false
false
false
HomeRad/TorCleaner
wc/dns/rdtypes/IN/PX.py
1
3823
# -*- coding: iso-8859-1 -*- # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. ...
gpl-2.0
-6,621,502,497,215,966,000
38.010204
79
0.63458
false
3.647901
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_05_01/models/_models_py3.py
1
64701
# 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 may ...
mit
8,620,681,322,227,704,000
39.012987
188
0.638676
false
3.89507
false
false
false
keen99/SickRage
sickbeard/dailysearcher.py
1
4533
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
gpl-3.0
-3,312,056,714,057,756,700
37.415254
182
0.62056
false
4.268362
false
false
false
trackmastersteve/alienfx
alienfx/core/controller_m17xr4.py
1
5637
# # controller_m17xr3.py # # Copyright (C) 2013-2014 Ashwin Menon <ashwin.menon@gmail.com> # Copyright (C) 2015-2021 Track Master Steve <trackmastersteve@gmail.com> # # Alienfx is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free So...
gpl-3.0
-5,833,071,122,726,631,000
38.697183
121
0.665247
false
3.339455
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-web/azure/mgmt/web/models/site_seal_request.py
1
1069
# 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
4,656,552,938,915,643,000
32.40625
76
0.571562
false
4.327935
false
false
false
brandicted/nefertari
nefertari/renderers.py
2
6370
import json import logging from datetime import date, datetime from nefertari import wrappers from nefertari.utils import get_json_encoder from nefertari.json_httpexceptions import JHTTPOk, JHTTPCreated from nefertari.events import trigger_after_events log = logging.getLogger(__name__) class _JSONEncoder(json.JSONE...
apache-2.0
-4,746,659,759,339,364,000
36.692308
79
0.610204
false
4.218543
false
false
false
redondomarco/useradm
src/models/gestionssl.py
1
1494
def obtener_certificado(usuario, perfil): """devuelvo certificado, si no existe lo creo en seguinf""" env.user = myconf.take('datos.seguinf_user') env.warn_only = True seguinf = FabricSupport() comando='sudo ls -la /root/Clientes_ssl/'+str(usuario)+'-'+str(perfil)+'.p12' seguinf.run(myconf.take('datos.seguinf_srv...
gpl-3.0
3,485,720,391,723,372,000
37.307692
120
0.718206
false
2.549488
false
false
false
pizzathief/scipy
scipy/linalg/tests/test_decomp_cossin.py
1
5753
import pytest import numpy as np from numpy.random import seed from numpy.testing import assert_allclose from scipy.linalg.lapack import _compute_lwork from scipy.stats import ortho_group, unitary_group from scipy.linalg import cossin, get_lapack_funcs REAL_DTYPES = (np.float32, np.float64) COMPLEX_DTYPES = (np.compl...
bsd-3-clause
-8,984,024,263,995,868,000
36.357143
78
0.530506
false
2.977743
true
false
false
ViciusChile/Scraper_Dealer
Metacritic.py
1
7087
from Scrapers.tools import tools class MetacriticInfo: """Model for each elements""" def __init__(self): self.name = None self.platform = None self.developer = None self.publisher = None self.esrb = None self.release = None self.tags = None self...
gpl-2.0
7,326,300,751,974,268,000
38.372222
240
0.550444
false
3.857921
false
false
false
pedrosacramento/inkscape-animation
spritesheet.py
1
1674
# This class handles sprite sheets # This was taken from www.scriptefun.com/transcript-2-using # sprite-sheets-and-drawing-the-background # I've added some code to fail if the file wasn't found.. # Note: When calling images_at the rect is the format: # (x, y, x + offset, y + offset) import pygame class spritesheet(...
mit
-8,077,948,598,029,545,000
43.052632
64
0.639785
false
3.711752
false
false
false
gaurav/phylo2owl
tests/test_shacl.py
1
1141
#!/usr/bin/env python """test_shacl.py: Test generated ontologies against SHACL shapes.""" import os import libshacl import pytest def test_execute_testShacl(): """ Can we execute testShacl at all? """ (rc, stdout, stderr) = libshacl.exec_testShacl(["--version"]) print stdout print stderr assert ...
mit
1,449,120,676,683,983,000
30.694444
94
0.659071
false
3.223164
true
false
false
coala/coala
coalib/processes/communication/LogMessage.py
1
1633
from datetime import datetime from coalib.output.printers.LOG_LEVEL import LOG_LEVEL class LogMessage: def __init__(self, log_level, *messages, delimiter=' ', timestamp=None): if log_level not in LOG_LEVEL.reverse: raise Val...
agpl-3.0
8,628,628,486,573,394,000
31.66
77
0.578077
false
4.343085
false
false
false
Larhard/tsp
tsp/solver.py
1
2482
# Copyright (c) 2015, Bartlomiej Puget <larhard@gmail.com> # 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
-8,710,665,200,263,397,000
39.688525
80
0.680097
false
4.129784
false
false
false
OmeGak/indico
indico/modules/attachments/models/folders_test.py
1
1890
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from indico.modules.attachments import AttachmentFolder def tes...
mit
6,373,904,373,456,727,000
40.086957
85
0.732275
false
3.962264
false
false
false
hsfzxjy/wisecitymbc
common/rest/decorators.py
1
1087
from django.utils.decorators import method_decorator from django.core.cache import cache from django.http import HttpResponse def cache_view_func(func): def wrapper(request, *args, **kwargs): key = request.method + request.META['PATH_INFO'] + request.META['QUERY_STRING'] content = cache.get(key) ...
gpl-2.0
774,915,620,516,630,300
31
87
0.624655
false
4.213178
false
false
false
andrew-lundgren/gwpy
gwpy/signal/filter.py
1
3049
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2016) # # This file is part of GWpy. # # GWpy 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 ...
gpl-3.0
2,693,603,008,467,231,000
31.43617
77
0.610692
false
3.278495
false
false
false
sharkykh/SickRage
sickbeard/providers/elitetorrent.py
1
7522
# coding=utf-8 # Author: CristianBB # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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...
gpl-3.0
-8,951,345,537,618,904,000
39.659459
149
0.539484
false
4.342956
false
false
false
mdklatt/serial-python
src/serial/core/sort.py
1
3047
""" Sorted input and output. """ from collections import deque from operator import itemgetter from .buffer import _ReaderBuffer from .buffer import _WriterBuffer __all__ = "SortReader", "SortWriter" class _Sorter(object): """ Abstract base class for SortReader and SortWriter. """ def __init__(se...
mit
-4,089,957,522,293,261,300
27.476636
80
0.54808
false
4.775862
false
false
false
jdeguire/pjcontroller
software/updatepage.py
1
4410
#! /usr/bin/env python # # Copyright 2011-2013 Jesse DeGuire # # This file is part of Projector Controller. # # Projector Controller 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 Lic...
gpl-3.0
-2,336,973,511,080,071,700
33.186047
93
0.66644
false
3.969397
false
false
false
1844144/django-blog-zinnia
zinnia/tests/implementations/settings.py
1
1200
"""Settings for testing zinnia""" import os from zinnia.xmlrpc import ZINNIA_XMLRPC_METHODS SITE_ID = 1 USE_TZ = True STATIC_URL = '/static/' SECRET_KEY = 'secret-key' ROOT_URLCONF = 'zinnia.tests.implementions.urls.default' LOCALE_PATHS = [os.path.join(os.path.dirname(__file__), 'locale')] PASSWORD_HASHERS = [ ...
bsd-3-clause
9,107,452,346,140,057,000
20.818182
66
0.694167
false
3.252033
false
false
false
benkirk/mpi_playground
mpi4py/tests/test_rma.py
1
15531
from mpi4py import MPI import mpiunittest as unittest import arrayimpl import sys pypy_lt_53 = (hasattr(sys, 'pypy_version_info') and sys.pypy_version_info < (5, 3)) def mkzeros(n): if pypy_lt_53: return b'\0' * n return bytearray(n) def memzero(m): try: m[:] = 0 except ...
gpl-3.0
4,210,494,767,471,415,000
34.86836
87
0.463203
false
3.88275
true
false
false
dragonrider7225/PythonGames
main.py
1
2439
#!py -3 from solitaire import * import sys def main(): opt = int(input("Which game would you like to play?\n\t0: Quit program\n" + "\t1: Klondike\n")) if not opt: sys.exit(0) if opt == 1: game = klondike args = [] game.set_up(*args) game.show_board() while Tr...
apache-2.0
-2,390,675,310,736,939,000
31.959459
79
0.373514
false
3.454674
false
false
false
jaredhasenklein/the-blue-alliance
tbans/models/notifications/event_schedule.py
1
2021
import calendar from tbans.models.notifications.notification import Notification class EventScheduleNotification(Notification): def __init__(self, event, next_match=None): self.event = event self._event_feed = event.key_name self._district_feed = event.event_district_abbrev if n...
mit
268,706,569,295,279,700
32.131148
94
0.642751
false
4.228033
false
false
false
SF-Zhou/quite
quite/deferred_function.py
1
3424
from . import deferred_define from . import Widget, QWidget from . import QMainWindow, QDockWidget from . import QHBoxLayout, SquareLayout from . import WidgetController from . import QSize, QSizeF, QPoint from . import QPicture, QPixmap from . import QPrinter, QPainter @deferred_define def set_central_widget(self: W...
mit
8,475,001,357,784,681,000
29.571429
102
0.669977
false
3.58534
false
false
false
strongrandom/awesome-fedora
generate.py
1
6196
# https://github.com/strongrandom/awesome-fedora # # This is a quick-and-dirty tool to convert packages.yml into README.md. It is not pretty. It is not efficient. It is # nowhere near my best work... but it works. # # Use Python 3. Install PyYAML. # import operator import textwrap import dnf import yaml def write_pa...
mit
2,793,258,951,590,367,000
33.614525
119
0.596191
false
3.764277
false
false
false
CiscoDevNet/netconf-examples
netconf-102/get_config_csr1000V.py
1
1234
#!/usr/bin/python # # Get configured interfaces using Netconf # # darien@sdnessentials.com # from ncclient import manager import sys import xml.dom.minidom # the variables below assume the user is requesting access # to a IOS-XE device running in the DevNet Always On SandBox # use the IP address or hostname of your ...
apache-2.0
4,805,675,626,811,635,000
27.045455
81
0.679092
false
3.587209
false
false
false
redixin/keyserver-ng
keyserver/key.py
1
1886
from datetime import datetime import gpgme from io import BytesIO class PublicKey: def __init__(self, fp): if isinstance(fp, str): fp = BytesIO(bytes(fp, "ascii")) elif isinstance(fp, bytes): fp = BytesIO(fp) self.ctx = gpgme.Context() self.ctx.armor = Fals...
apache-2.0
8,411,964,592,434,458,000
24.486486
77
0.560445
false
3.779559
false
false
false
maxis1314/pyutils
web/views/user.py
1
1484
# coding: utf-8 from flask import Flask,request,session,g,redirect,url_for,Blueprint from flask import abort,render_template,flash from helpers import getAvatar import config #from .base import BaseHandler import base config = config.rec() user = Blueprint('user', __name__) import pika #class LoginHandler(BaseHandl...
apache-2.0
-7,283,646,547,762,287,000
29.285714
69
0.644879
false
3.957333
false
false
false
respawner/peering-manager
peering/migrations/0050_auto_20190806_2159.py
1
3436
# Generated by Django 2.2.4 on 2019-08-06 19:59 import taggit.managers from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("taggit", "0003_taggeditem_add_unique_index"), ("peering", "0049_auto_20190731_1946"), ] operations = [ migrations.Add...
apache-2.0
1,025,210,879,864,040,000
31.72381
60
0.489814
false
4.655827
false
false
false
lquirosd/TFM
ILA/code/trainGMM.py
1
5034
from __future__ import division import sys, argparse #--- To handle console arguments import numpy as np #--- To handle math processing import scipy.ndimage as ndi #--- To handle image processing from scipy import misc import glob, os #--- To handle OS callbacks import utils from sklearn import mixture import time im...
apache-2.0
-933,522,224,188,337,200
36.288889
135
0.591577
false
3.212508
false
false
false
offlinehacker/flumotion
flumotion/test/test_wizard_save.py
1
43842
# -*- Mode: Python; test-case-name: flumotion.test.test_wizard_models -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modified under the terms of # the GNU General Public License v...
gpl-2.0
-6,053,539,841,310,184,000
42.92986
78
0.467543
false
4.172647
true
false
false
mikicaivosevic/flask-cassandra-sessions
tests/test_session.py
1
2092
import json from time import sleep from unittest import TestCase from cassandra.cluster import Cluster from flask import Flask, session from cassandra_flask_sessions import CassandraSessionInterface, AbstractConnectionProvider class ConnectionProvider(AbstractConnectionProvider): _connection = Cluster(['127.0....
mit
-7,179,838,590,307,754,000
26.168831
98
0.639101
false
3.769369
true
false
false
PapenfussLab/MHC-clogs
bin/fasta_rename_by_pos.py
1
1734
#!/usr/bin/env python """ fasta_rename_by_pos.py """ from argparse import ArgumentParser from mungolite.fasta import FastaFile from srt.intervals import GenomeIntersector def get_position(tokens): for token in tokens: if "Position" in token: for delim in ["=", ":", "(", ")"]: ...
artistic-2.0
-8,437,597,413,394,435,000
30.527273
158
0.643022
false
3.296578
false
false
false
ibab/tensorprob
tensorprob/utilities.py
1
1469
from collections import defaultdict, Iterable import itertools import numpy as np import tensorflow as tf from six.moves import zip_longest NAME_COUNTERS = defaultdict(lambda: 0) def generate_name(obj): """Generate a unique name for the object in question Returns a name of the form "{calling_class_name}_{...
mit
3,968,733,909,219,394,000
23.081967
76
0.639891
false
3.556901
false
false
false
rseedorff/pi-kiosk
helloWorld.py
1
5178
from flask import Flask, jsonify import datetime import time import atexit import RPi.GPIO as GPIO app = Flask(__name__) ##################################################### # Initialise GPIO Board and setup all pins # ##################################################### # Green LED at Pin 7 LED_GREEN = 7 ...
apache-2.0
-4,223,882,474,366,889,000
31.772152
91
0.556779
false
3.556319
false
false
false
Austriker/LuxLogger
tsl2561.py
1
10465
'''Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafruit Arduino library, comm...
mit
-6,918,371,752,110,139,000
32.758065
79
0.57592
false
3.522383
false
false
false
loaclhostjason/react-redux-admin
console/app/app.py
1
1394
# -*- coding: utf-8 -*- from flask import Flask from flask_bootstrap import Bootstrap from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_babel import Babel from flask_moment import Moment from .assets import assets_env, bundles from flask_caching import Cache from config import Con...
mit
5,873,634,761,814,845,000
24.62963
66
0.723988
false
3.521628
false
false
false
afajl/sy
docs/conf.py
1
6337
# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os...
bsd-3-clause
8,141,396,965,501,481,000
31.167513
80
0.709957
false
3.736439
false
false
false
erudit/zenon
eruditorg/apps/userspace/library/subscription_information/views.py
1
1593
# -*- coding: utf-8 -*- from django.contrib import messages from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import FormView from django.contrib.auth.mixins import LoginRequiredMixin from base.viewmixins import MenuItemMixin from ..viewmixins import Org...
gpl-3.0
-7,446,036,456,903,838,000
36.833333
95
0.735053
false
4.365385
false
false
false
jeffmahoney/supybot
src/commands.py
2
33100
### # Copyright (c) 2002-2005, Jeremiah Fincher # Copyright (c) 2009-2010, James McCoy # 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 ...
bsd-3-clause
4,640,401,204,701,421,000
32.1
84
0.593505
false
3.676144
false
false
false
akhileshpillai/treeherder
treeherder/webapp/api/runnable_jobs.py
1
5374
from django.conf import settings from django.core.exceptions import ValidationError from django.core.validators import URLValidator from rest_framework import viewsets from rest_framework.response import Response from rest_framework.status import HTTP_500_INTERNAL_SERVER_ERROR from treeherder.etl.common import fetch_j...
mpl-2.0
-607,443,222,029,147,600
42.691057
99
0.566617
false
4.351417
false
false
false
avanzosc/avanzosc6.1
avanzosc_tire_management/wizard/wizard_interchange.py
1
15211
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011-2012 Daniel (Avanzosc) <http://www.avanzosc.com> # 28/03/2012 # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
5,135,022,820,725,371,000
42.827089
156
0.460577
false
3.91026
false
false
false
spark8103/ops17
tools/test_init.py
1
18237
#!/bin/env python # coding: utf-8 from app import db from app.models import User, Role, Department, Idc, Server, Software, Project, Module, Environment import os if os.path.exists('.env'): print('Importing environment from .env...') for line in open('.env'): var = line.strip().split('=') if le...
mit
-3,189,856,236,642,584,000
46.867568
123
0.54085
false
2.921643
true
false
false
lexifdev/pyconkr-2015
pyconkr/views.py
1
12386
# -*- coding: utf-8 -*- import logging from django.conf import settings from django.contrib.auth import login as user_login, logout as user_logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.core.e...
mit
-7,112,165,041,920,347,000
30.098237
131
0.611291
false
3.957051
false
false
false
mgeorgehansen/FIFE_Technomage
engine/python/fife/extensions/pychan/widgets/scrollarea.py
1
4667
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2009 by the FIFE team # http://www.fifengine.de # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General P...
lgpl-2.1
-4,644,638,224,177,974,000
35.336
101
0.71952
false
3.671912
false
false
false
polera/rblwatch
rblwatch/rblwatch.py
1
6297
#!/usr/bin/env python import sys import socket import re from IPy import IP from dns.resolver import Resolver, NXDOMAIN, NoNameservers, Timeout, NoAnswer from threading import Thread RBLS = [ 'aspews.ext.sorbs.net', 'b.barracudacentral.org', 'bl.deadbeef.com', 'bl.emailbasura.org', 'bl.spamcanniba...
bsd-2-clause
-1,166,850,851,907,662,000
30.80303
89
0.532476
false
3.20458
false
false
false
tbunnyman/FAiler
FAiler/faile.py
1
2872
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os from datetime import datetime from FAiler.exceptions import FAError class FAile(): """ Represents a file downloaded from FurAffinity. The base parameters of this class are public access read safe by design FAile.directory: the directo...
bsd-3-clause
931,305,739,904,286,800
32.788235
78
0.612465
false
3.64467
false
false
false
academichero/jobs
modules/board/migrations/0003_auto_20160622_2034.py
1
1227
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-06-22 23:34 from __future__ import unicode_literals import datetime import django.core.validators from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('board', '...
mit
998,880,232,990,725,600
29.675
162
0.600652
false
4.305263
false
false
false
pavel-paulau/perfrunner
perfrunner/tests/kv.py
1
12499
from logger import logger from perfrunner.helpers.cbmonitor import timeit, with_stats from perfrunner.helpers.worker import ( pillowfight_data_load_task, pillowfight_task, ) from perfrunner.tests import PerfTest from perfrunner.workloads.pathoGen import PathoGen from perfrunner.workloads.tcmalloc import Workloa...
apache-2.0
-1,810,513,932,737,493,200
23.799603
96
0.587807
false
3.711105
true
false
false
guillempalou/scikit-cv
skcv/video/segmentation/region_tracking.py
1
3595
import networkx as nx import numpy as np def bipartite_region_tracking(partition, optical_flow, reliability, matching_th=0.1, reliability_th=0.2): """ Parameters ---------- partition: numpy array A 3D label array where each label represents a region optical_flow: numpy arra...
bsd-3-clause
868,079,825,263,690,500
31.107143
77
0.569124
false
4.01676
false
false
false
iradicek/clara
clara/modeltograph.py
1
1609
''' Converts Program model to a image (graph) ''' import pygraphviz as pgv def stmts_to_str(title, types, ss): l = [title] if types: l.append(', '.join(['%s: %s' % x for x in types])) for (v, e) in ss: ls = str(e) ls = ls.replace(r'\n', r'\\n') ls = ls.replace(r'\r', r'\\r...
gpl-3.0
-2,082,160,572,237,811,200
25.816667
77
0.444997
false
3.124272
false
false
false
willmcgugan/rich
rich/palette.py
1
3288
from math import sqrt from functools import lru_cache from typing import Sequence, Tuple, TYPE_CHECKING from .color_triplet import ColorTriplet if TYPE_CHECKING: from rich.table import Table class Palette: """A palette of available colors.""" def __init__(self, colors: Sequence[Tuple[int, int, int]]): ...
mit
1,800,412,422,958,308,600
31.86
82
0.532562
false
4.002436
false
false
false
liushuyu/DraftBin
pyscripts/acbs/lib/magic.py
1
8071
# coding: utf-8 ''' Python bindings for libmagic ''' import ctypes from collections import namedtuple from ctypes import * from ctypes.util import find_library def _init(): """ Loads the shared library through ctypes and returns a library L{ctypes.CDLL} instance """ return ctypes.cdll.LoadLibr...
lgpl-2.1
-4,565,356,466,739,291,600
28.137184
78
0.635237
false
3.653689
false
false
false
evansosenko/spin-lifetime-analysis
analysis/data.py
1
3319
import os import numpy import scipy_data_fitting class Fig4(scipy_data_fitting.Data): """ Use this to load the data from Figure 4 in PhysRevLett.105.167202. Should not be used directly, but only subclassed. """ def __init__(self, subfig): super().__init__() self.subfig = subfig ...
mit
4,957,334,593,424,651,000
30.018692
83
0.6047
false
3.450104
false
false
false
miguelinux/vbox
src/VBox/ValidationKit/common/utils.py
1
58323
# -*- coding: utf-8 -*- # $Id: utils.py $ # pylint: disable=C0302 """ Common Utility Functions. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute...
gpl-2.0
-3,673,735,913,334,923,000
31.87655
124
0.55815
false
3.655239
false
false
false
bright-sparks/wpull
wpull/url.py
1
20604
'''URL parsing based on WHATWG URL living standard.''' import collections import fnmatch import functools import gettext import logging import re import string import urllib.parse import posixpath from wpull.backport.logging import BraceMessage as __ import wpull.string _logger = logging.getLogger(__name__) _ = gett...
gpl-3.0
7,461,028,754,398,663,000
28.219858
86
0.597282
false
4.158256
false
false
false
GoogleCloudPlatform/sap-deployment-automation
third_party/github.com/ansible/awx/awxkit/awxkit/api/pages/roles.py
1
1150
import logging from awxkit.api.resources import resources from . import base from . import page log = logging.getLogger(__name__) class Role(base.Base): NATURAL_KEY = ('name',) def get_natural_key(self, cache=None): if cache is None: cache = page.PageCache() natural_key = su...
apache-2.0
3,697,434,702,690,880,500
24
89
0.595652
false
3.993056
false
false
false
nyergler/pythonslides
readthedocs/builds/models.py
1
11261
import re from django.core.urlresolvers import reverse from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _, ugettext from guardian.shortcuts import assign, get_objects_for_user from taggit.managers import TaggableManager from projects.models import Pr...
mit
4,639,291,233,820,865,000
34.749206
89
0.552704
false
4.181582
false
false
false
mghpcc-projects/user_level_slurm_reservations
commands/hil_slurmctld_prolog.py
1
14582
""" MassOpenCloud / Hardware Isolation Layer (HIL) Slurm Control Daemon - HIL Reservation Prolog May 2017, Tim Donahue tpd001@gmail.com """ import argparse import hostlist import inspect import logging import os import sys from datetime import datetime, timedelta from time import strftime libdir = os.path.realpath(...
mit
-5,637,913,810,003,291,000
37.885333
116
0.577904
false
3.81528
false
false
false
AlJohri/nucraigslist
listings/management/commands/download.py
1
2466
from django.core.management.base import BaseCommand, CommandError from listings.models import Listing, User, Comment, Group import os, sys from django.utils import timezone from optparse import make_option from listings.lib import save_obj, get_fb_graph_api, get_word_bank, filter_listing from dateutil.parser import pa...
gpl-3.0
-2,108,560,672,248,644,000
35.264706
126
0.564477
false
4.303665
false
false
false
Alymantara/maelstorm
tests/test_main.py
1
1272
from pytest import raises # The parametrize function is generated, so this doesn't work: # # from pytest.mark import parametrize # import pytest parametrize = pytest.mark.parametrize from maelstorm import metadata from maelstorm.main import main class TestMain(object): @parametrize('helparg', ['-h', '--help'...
mit
4,045,476,757,722,540,500
34.333333
76
0.643082
false
4
true
false
false
jbenden/ansible
lib/ansible/modules/cloud/amazon/efs_facts.py
1
11177
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], ...
gpl-3.0
-2,514,477,651,479,542,000
28.568783
156
0.585756
false
4.039393
false
false
false
pavolloffay/jaeger
plugin/storage/es/esCleaner.py
1
4828
#!/usr/bin/env python3 import curator import elasticsearch import os import ssl import sys TIMEOUT=120 def main(): if len(sys.argv) != 3: print('USAGE: [INDEX_PREFIX=(default "")] [ARCHIVE=(default false)] ... {} NUM_OF_DAYS http://HOSTNAME[:PORT]'.format(sys.argv[0])) print('NUM_OF_DAYS ... dele...
apache-2.0
3,711,925,970,792,277,000
42.107143
250
0.663422
false
3.542186
false
false
false
Lamelos/django-allauth-office365
allauth_office365/adapter.py
1
2506
from django.contrib import messages from django.dispatch import receiver from django.http import HttpResponseForbidden from allauth.account.signals import user_logged_in from allauth.exceptions import ImmediateHttpResponse from allauth.socialaccount.adapter import DefaultSocialAccountAdapter, get_adapter from allauth....
mit
1,764,432,020,011,735,000
44.563636
114
0.659218
false
4.328152
false
false
false
cyberang3l/sysdata-collector
libs/globalvars.py
1
2230
# Copyright (C) 2014 Vangelis Tasoulas <vangelis@tasoulas.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Th...
gpl-3.0
-8,446,234,026,580,170,000
26.875
71
0.685202
false
3.667763
true
false
false
dcsch/pyif
pyif/story.py
1
3162
''' Created on Nov 21, 2013 @author: david ''' from thing import Thing, Player import grammar import parser import action import glk class Story: def __init__(self, name, headline, delegate): self.name = name self.headline = headline self.release = 1 self.serial = 81001 s...
mit
-1,471,477,336,399,294,700
29.114286
67
0.550285
false
3.663963
false
false
false
HomeRad/TorCleaner
doc/bfknav.py
1
7157
# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2009 Bastian Kleineidam """ General navigation writer reading .nav file info. """ import sys import os import re from cStringIO import StringIO _slashes_ro = re.compile(r"/+") _thisdir_ro = re.compile(r"^\./") _samedir_ro = re.compile(r"/\./|/\.$") _parentdir_ro = re....
gpl-2.0
5,557,763,311,401,146,000
26.526923
99
0.551069
false
3.794804
false
false
false
EKiefer/edge-starter
py34env/Scripts/thresholder.py
1
1845
#!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe # # The Python Imaging Library # $Id$ # # this demo script illustrates how a 1-bit BitmapImage can be used # as a dynamically updated overlay # try: from tkinter import * except ImportError: from Tkinter import * from PIL import Image, Imag...
mit
5,243,874,531,555,993,000
23.932432
74
0.58916
false
3.534483
false
false
false
DimensionDataCBUSydney/plumbery
plumbery/infrastructure.py
1
66146
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
apache-2.0
-8,525,752,551,770,169,000
33.397296
88
0.515647
false
4.863676
false
false
false
ioos/catalog-ckan
ckanext/ioos_theme/controllers/feedback.py
1
3831
#!/usr/bin/env python ''' ckanext/ioos_theme/controllers/feedback.py IOOS Theme Feedback Controller ''' from ckan.lib.base import BaseController, render, _ from ckan.lib import helpers as h from ckan.common import request from ckanext.ioos_theme.lib import feedback from pylons import config import logging import urlli...
agpl-3.0
8,250,284,174,334,944,000
35.141509
90
0.577656
false
4.408516
false
false
false
ned14/Bugs-Everywhere-for-BEurtle
libbe/command/severity.py
1
4051
# Copyright (C) 2005-2012 Aaron Bentley <abentley@panoramicfeedback.com> # Chris Ball <cjb@laptop.org> # Gianluca Montecchi <gian@grys.it> # Marien Zwart <marien.zwart@gmail.com> # Thomas Gerigk <tgerigk@gmx.de> # ...
gpl-2.0
8,860,493,650,325,930,000
37.216981
79
0.596396
false
3.785981
false
false
false
rkomartin/user-recs-example
util/process_movielens.py
1
1215
import json import sys from os.path import join ''' Read movielens data into Veritable-ready json ''' def main(input_file, output_dir): data = {} columns = set() with open(input_file) as fd: for line in fd: tokens = line.split('\t') user_id = 'U{}'.format(tokens[0]).decode(...
mit
-8,084,242,574,354,765,000
29.375
72
0.549794
false
3.375
false
false
false
nosyndicate/pytorchrl
pytorchrl/distributions/diagonal_gaussian.py
1
4283
import numpy as np import torch from pytorchrl.distributions.base import Distribution from pytorchrl.misc.tensor_utils import constant class DiagonalGaussian(Distribution): """ Instead of a distribution, rather a collection of distribution. """ def __init__(self, means, log_stds): """ ...
mit
3,443,545,097,000,983,600
32.234375
147
0.547485
false
3.234981
false
false
false
quantumlib/OpenFermion
src/openfermion/utils/grid.py
1
11136
# 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 # distribu...
apache-2.0
-896,618,528,948,675,100
36.494949
80
0.592672
false
4.698734
false
false
false
abetusk/www.meowcad.com
cgi/picModLibSentry.py
1
1864
#!/usr/bin/python # import os import cgi import cgitb import sys import meowaux as mew import urllib import Cookie import json cgitb.enable(); #print "Content-Type: text/html" #print cookie = Cookie.SimpleCookie() cookie_hash = mew.getCookieHash( os.environ ) g_debug = False def log_line( l ): logf = open("/tmp/...
agpl-3.0
-7,365,819,750,410,541,000
20.929412
90
0.65397
false
2.954041
false
false
false
alphapigger/igetui
igetui/google/protobuf/message_factory.py
1
4235
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
mit
-3,856,056,638,776,542,700
35.477876
80
0.716883
false
4.34359
false
false
false
ama-jharrison/agdc
agdc/api/source/main/python/datacube/api/tool/retrieve_dataset_stack.py
1
12976
#!/usr/bin/env python # =============================================================================== # Copyright 2015 Geoscience Australia # # 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 ...
apache-2.0
1,836,849,953,270,979,000
38.560976
161
0.556412
false
4.21162
false
false
false
emmanvg/cti-stix-elevator
stix2elevator/convert_pattern.py
1
89308
import datetime import re import sys from cybox.objects.account_object import Account from cybox.objects.address_object import Address from cybox.objects.archive_file_object import ArchiveFile from cybox.objects.domain_name_object import DomainName from cybox.objects.email_message_object import EmailMessage from cybox...
bsd-3-clause
1,290,568,712,240,709,000
43.676338
142
0.613797
false
4.045113
false
false
false
Osthanes/appscan_static_analyzer
appscan_check.py
1
36174
#!/usr/bin/python #*************************************************************************** # Copyright 2015 IBM # # 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.a...
apache-2.0
-3,397,173,683,578,174,000
38.927152
268
0.565931
false
4.027837
false
false
false
braams/shtoom
shtoom/ui/tkui/popups.py
1
7401
from Tkinter import Toplevel, Tk if __name__ == "__main__": _ = lambda x:x class Popup(Toplevel): deferred = None parent = None def __init__(self, parent, addnl=None): Toplevel.__init__(self) self.initial_focus = self self.parent = parent self.addnl = addnl s...
lgpl-2.1
8,494,601,776,254,829,000
31.460526
79
0.563437
false
3.556463
false
false
false
shiaki/iterative-modelling
src/pcs_snap.py
1
3204
#!/usr/bin/python work_dir = '' import numpy as np from scipy.io import FortranFile as ufmt if __name__ == '__main__': import matplotlib.pyplot as plt from matplotlib.colors import LogNorm # See GALAXY 14.50 Manual, Sec. 9.2, P54 header_dtype = [('n1', '<i4'), ('n2', '<i4'), ('n3', '<i4'), ('nco...
bsd-3-clause
-3,170,242,807,777,087,500
25.92437
66
0.522784
false
2.577635
false
false
false
ParticulateSolutions/django-sofortueberweisung
setup.py
1
2687
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import re import os import sys def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() return re.match("__...
mit
-1,253,928,873,854,482,700
30.768293
100
0.605136
false
3.833096
false
false
false
olynch/dicebag
dicebag.py
1
3627
#!/usr/bin/env python3 import random, pickle, sys, cmd class Dice: """ Contains x dice with n sides, or a plain modifier """ def __init__(self, dice): """ Either takes in a string with a modifier, such as +4, or a dice description, such as 2d8 """ if dice[0] in ("+", "-"): self.mod = int(dice) self.num, se...
mit
1,283,960,359,057,703,400
29.225
102
0.632479
false
2.844706
false
false
false