repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
krafczyk/spack
var/spack/repos/builtin/packages/py-lazyarray/package.py
5
1820
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
-8,476,803,654,688,925,000
45.666667
83
0.675275
false
3.752577
false
false
false
GoogleCloudPlatform/PerfKitBenchmarker
tests/providers/gcp/bigquery_test.py
1
8239
# Copyright 2020 PerfKitBenchmarker 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 appli...
apache-2.0
-1,418,090,864,913,887,500
36.967742
81
0.704576
false
3.748408
true
false
false
lk-geimfari/mimesis
mimesis/data/int/finance.py
1
264187
# -*- coding: utf-8 -*- from typing import List """Provides all the generic data related to the business.""" CURRENCY_ISO_CODES: List[str] = [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF"...
mit
3,439,949,495,777,811,000
19.220623
78
0.547705
false
2.756734
false
false
false
sumedh123/debatify
venv/lib/python2.7/site-packages/flask_socketio/__init__.py
1
34245
import sys # make sure gevent-socketio is not installed, as it conflicts with # python-socketio gevent_socketio_found = True try: from socketio import socketio_manage except ImportError: gevent_socketio_found = False if gevent_socketio_found: print('The gevent-socketio package is incompatible with this ver...
mit
2,640,166,010,440,705,000
44.118577
82
0.579121
false
4.829361
false
false
false
iamarf/terminal-quest
linux_story/gtk3/Spellbook.py
1
4059
#!/usr/bin/env python # Spellbook.py # # Copyright (C) 2014 Kano Computing Ltd # License: GNU General Public License v2 http://www.gnu.org/licenses/gpl-2.0.txt # # Author: Caroline Clark <caroline@kano.me> import os import sys from gi.repository import Gtk, Gdk if __name__ == '__main__' and __package__ is None: ...
gpl-2.0
-828,757,298,218,543,200
27.584507
80
0.577482
false
3.663357
false
false
false
habi/GlobalDiagnostiX
GOTTHARD/Photon-Calculation.py
1
3166
# -*- coding: utf-8 -*- """ Plot Attenuation and transmission of GOTTHARD detector element """ from __future__ import division import matplotlib.pylab as plt import os import glob import numpy as np GOTTHARDArea = 1130 * (50 / 1000) * 2 # mm Distance = 163 # cm ScintillatorArea = 430 * 430 # mm print 'The area o...
unlicense
-3,744,348,821,068,173,300
35.77907
79
0.665191
false
2.774561
false
false
false
josuemontano/cms
spartan/spartan/factories/extra.py
1
1990
import os import uuid from .meta import * class HomeFactory(object): def __init__(self, request): self.request = request def index(self): from .security import User pages = DBSession.query(Page).order_by(Page.sort).all() site = DBSession.query(Site).first() users = ...
gpl-3.0
363,829,128,363,588,160
30.109375
92
0.523618
false
3.804971
false
false
false
nikitanovosibirsk/hiphip
hiphip/http/response.py
1
1229
import json from collections import OrderedDict import requests class Response(requests.Response): def __repr__(self): def _log_body(headers, body): r = "" request_content_type = headers.get("content-type", "text/plain").lower() if request_content_type.startswith("tex...
mit
-8,099,628,879,669,621,000
31.342105
95
0.534581
false
3.901587
false
false
false
joopert/home-assistant
homeassistant/components/mqtt/server.py
2
2808
"""Support for a local MQTT broker.""" import asyncio import logging import tempfile import voluptuous as vol from hbmqtt.broker import Broker, BrokerException from passlib.apps import custom_app_context from homeassistant.const import EVENT_HOMEASSISTANT_STOP import homeassistant.helpers.config_validation as cv fro...
apache-2.0
1,489,471,780,592,490,500
27.08
85
0.606125
false
4.028694
true
false
false
shibu/pyspec
pyspec/reloader.py
1
10404
# -*- coding: ascii -*- __pyspec = 1 __all__ = ("ModuleObserver", "ModuleReloader") import linecache, os, sys, time class ModuleReloader(object): def __init__(self): self.modules = {} self.observer_class = ModuleObserver self.category = MethodCategorizer() def check_modification(self...
mit
1,957,949,977,454,918,700
35.633803
122
0.541234
false
4.408475
false
false
false
CountZer0/PipelineConstructionSet
python/maya/site-packages/pymel-1.0.5/extras/completion/py/maya/OpenMayaUI.py
3
56653
from . import OpenMayaRender from . import OpenMaya import _OpenMayaUI import weakref from __builtin__ import object as _object from __builtin__ import property as _swig_property class MDeviceState(_object): def __init__(self, *args, **kwargs): pass def __repr__(self): pass ...
bsd-3-clause
7,938,223,139,684,012,000
13.822868
73
0.506963
false
4.403996
false
false
false
pymanopt/pymanopt
examples/dominant_eigenvector.py
1
3073
import os import autograd.numpy as np import tensorflow as tf import theano.tensor as T import torch from examples._tools import ExampleRunner from numpy import linalg as la, random as rnd import pymanopt from pymanopt.manifolds import Sphere from pymanopt.solvers import SteepestDescent os.environ["TF_CPP_MIN_LOG_L...
bsd-3-clause
-3,975,183,999,994,145,000
28.548077
79
0.635861
false
3.403101
false
false
false
markovmodel/thermotools
test/test_bar.py
1
1657
# This file is part of thermotools. # # Copyright 2015 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # thermotools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either versi...
lgpl-3.0
-2,925,888,970,545,269,000
36.659091
97
0.677731
false
2.808475
false
false
false
ProfMobius/ThinLauncher
surfaces/LeftMenu.py
1
1156
import pygame from Constants import * from Label import Label class LeftMenu(pygame.Surface): def __init__(self, w, h): super(LeftMenu, self).__init__((w, h), pygame.SRCALPHA) self.selected = 0 self.buttons = [] self.data = None def redraw(self, screen, x, y): self.fil...
apache-2.0
7,369,858,021,584,314,000
31.111111
118
0.596021
false
3.461078
false
false
false
cliffe/SecGen
modules/utilities/unix/audit_tools/ghidra/files/release/Ghidra/Features/Python/ghidra_scripts/jython_basics.py
2
1158
# Examples of Jython-specific functionality # @category: Examples.Python # Using Java data structures from Jython python_list = [1, 2, 3] java_list = java.util.LinkedList(java.util.Arrays.asList(1, 2, 3)) print str(type(python_list)) print str(type(java_list)) # Importing Java packages for simpler Java calls from jav...
gpl-3.0
-4,032,463,259,587,541,000
29.473684
66
0.753022
false
3.234637
false
false
false
braycarlson/viking
cogs/moderation.py
1
18252
import asyncio import discord import logging from asyncio import TimeoutError from database.model import HiddenCommands from discord.ext import commands from utilities.format import format_list from utilities.member import MemberError, get_member_by_id from utilities.time import midnight, timeout log = logging.getLog...
mit
-8,379,491,097,569,145,000
31.827338
80
0.56213
false
4.309799
false
false
false
fmartingr/uvepe8
converter/controller.py
1
2008
from objects import Frame, Diff #import diff_methods class Controller(object): current = -1 items = [] def get_current(self): if self.current >= 0: return self.items[self.current] def get_previous(self): if self.current > 0: return self.items[self.current - 1]...
gpl-2.0
8,406,440,875,016,979,000
25.421053
70
0.558267
false
3.952756
false
false
false
jesuscript/topo-mpi
topo/plotting/palette.py
1
13410
""" Palette class hierarchy, for constructing an RGB color out of a scalar value. $Id$ """ __version__='$Revision$' import param import plot # CEBALERT: is this file usable? # # topo/plotting/palette.py:10: 'plot' imported but unused # topo/plotting/palette.py:177: undefined name 'array' # topo/plotting/palette.py:...
bsd-3-clause
5,585,290,121,707,293,000
40.009174
106
0.643997
false
3.625304
false
false
false
AaronGeist/Llama
biz/ocr/putao.py
1
1855
import os from PIL import Image class PuTaoCaptchaParser: @classmethod def analyze(cls, image_path): # load image and convert to grey mode im = Image.open(image_path).convert("L") im_cropped = im.crop((10, 9, 54, 19)) pixel_matrix = im_cropped.load() # turn grey pi...
gpl-3.0
-1,480,584,969,521,980,200
30.982759
101
0.537466
false
3.755061
false
false
false
studentisgss/booking
news/urls.py
1
1370
"""activities URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
gpl-3.0
-3,035,935,102,196,703,700
40.515152
87
0.676642
false
3.246445
false
false
false
stxnext/intranet-open
src/intranet3/intranet3/subscribers.py
1
2359
import datetime from markupsafe import Markup from pyramid.httpexceptions import HTTPForbidden from pyramid.events import subscriber from pyramid.events import BeforeRender, ContextFound from intranet3.models import DBSession class PresenceTracking(object): def __init__(self, event): today = datetime.d...
mit
-7,764,728,680,976,918,000
32.225352
121
0.616363
false
3.750397
false
false
false
Submitty/AnalysisTools
commonAST/refMaps.py
1
9709
import context import eqTag ''' Hex values for colors of marked nodes ''' adlDetailColor = "#B0B0B0" adlStrColor = "#8b98ca" notMatchedColor = "#ff0000" ''' The tagEqlMap is a dictionary of nodes in the common AST, to their equivalent nodes in the full AST. This map is only used when the tags are not (case in-sensi...
bsd-3-clause
8,210,747,895,515,876,000
47.064356
129
0.657534
false
3.188506
false
false
false
slickqa/slickqaweb
slickqaweb/api/apidocs.py
1
13173
__author__ = 'jcorbett' from slickqaweb.app import app from .standardResponses import JsonResponse from mongoengine import * from flask import request import re import types #------------- For documenting other API endpoints --------------------------- resources = [] def standard_query_parameters(f): if not ha...
apache-2.0
8,642,785,155,971,280,000
36.31728
138
0.635239
false
4.268633
false
false
false
Tallefer/scons-for-symbian
arguments.py
2
15344
"""Reads and stores globals including the command line arguments""" __author__ = "Jussi Toivola" __license__ = "MIT License" from SCons.Script import ARGUMENTS, DefaultEnvironment, HelpFunction as Help from SCons.Variables import Variables, EnumVariable from config import * #IGNORE:W0611 from os.path import j...
mit
-937,099,424,023,850,500
33.354839
125
0.61946
false
3.395441
false
false
false
CFStorm/FCLI2
master.py
1
7392
#Python 3 - Developed By Carter Fulcher #Hello Developers! """IMPORTANT NOTICE""" #The dev code is 584. You will need this if you wish to use the #interactive console. Thanks! logo = """ ______ _ _____ _ _____ | ____| | | / ____| | |_ ...
apache-2.0
-3,720,898,860,227,680,000
37.103093
430
0.580763
false
3.414319
false
false
false
rickpeters/mkdocs
mkdocs/tests/utils/ghp_import_tests.py
24
3809
#!/usr/bin/env python # coding: utf-8 from __future__ import unicode_literals import mock import os import subprocess import tempfile import unittest import shutil from mkdocs.utils import ghp_import class UtilsTests(unittest.TestCase): @mock.patch('subprocess.call', auto_spec=True) @mock.patch('subproces...
bsd-2-clause
-487,773,874,232,354,560
34.598131
78
0.62011
false
3.382771
true
false
false
akrherz/iem
scripts/dbutil/xcheck_nwsli_csv.py
1
1109
"""See if we have metadata in a local CSV file NOTE: I had to manually edit the .csv file to remove the first row """ import pandas as pd from pandas.io.sql import read_sql from pyiem.util import get_dbconn CSVFN = "/home/akrherz/Downloads/nwsli_database.csv" def dowork(df, nwsli): """do work!""" df2 = df[d...
mit
-974,580,413,722,915,000
23.644444
77
0.577998
false
2.997297
false
false
false
was4444/chromium.src
chrome/test/media_router/telemetry/benchmarks/media_router_benchmark.py
1
2143
# Copyright 2016 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 os from telemetry import benchmark from core import perf_benchmark from core import path_util from telemetry.timeline import tracing_category_filter f...
bsd-3-clause
-8,475,967,177,597,016,000
31.969231
80
0.747084
false
4.013109
false
false
false
carlossg/ninjacape-mqtt-bridge
ninjaCapeSerialMQTTBridge.py
1
3609
#!/usr/bin/python # # used to interface the NinjaCape to openHAB via MQTT # - reads data from serial port and publishes on MQTT client # - writes data to serial port from MQTT subscriptions # # - uses the Python MQTT client from the Mosquitto project http://mosquitto.org (now in Paho) # # https://github.com/perrin7/nin...
mit
-5,419,746,929,261,088,000
25.152174
106
0.707121
false
3.048142
false
false
false
LEX2016WoKaGru/pyClamster
pyclamster/image.py
1
16000
# -*- coding: utf-8 -*- """ Created on 23.05.16 Created for pyclamster Copyright (C) {2016} 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 (...
gpl-3.0
-5,782,873,232,737,171,000
33.858388
103
0.567813
false
4.49312
false
false
false
opennode/waldur-mastermind
src/waldur_rancher/migrations/0022_rancheruserprojectlink.py
2
1404
# Generated by Django 2.2.10 on 2020-06-11 09:49 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('waldur_rancher', '0021_rancher_user_uuid'), ] operations = [ migrations.CreateModel( name='Ran...
mit
4,729,473,016,516,208,000
30.2
77
0.418091
false
5.05036
false
false
false
buremba/django-simit
simit/templatetags/simit_tags.py
1
2940
import re from django import template from django.core.exceptions import ObjectDoesNotExist from django.template import Library from django.core.cache import cache from simit.models import CustomArea, Menu register = Library() CACHE_TIMEOUT = 60 * 60 * 24 class VariableTag(template.Node): def __init__(self, s...
mit
6,695,195,765,043,607,000
27.543689
99
0.611224
false
3.803364
false
false
false
Alphadelta14/python-servicediscovery
servicediscovery/methods/method.py
1
1951
""" Method Ways to detect the registry node Author: Alpha <alpha@projectpokemon.org> """ import socket from servicediscovery.client import ServiceRegistry __all__ = ['Method'] class Method(object): """A registry lookup method""" def register(self, client): """Register with a registry ...
mit
-8,475,473,471,174,790,000
23.3875
74
0.55305
false
4.865337
false
false
false
ctripcorp/tars
tars/deployment/models/targets.py
1
3910
from django.db import models from constance import config from rest_client.exceptions import SLBClientError from roll_engine.utils.log import get_logger from roll_engine.db import SoftDeleteManager from roll_engine.models import DeploymentTarget from tars.server.models import Server, Group from tars.deployment.fsm im...
apache-2.0
-6,586,950,096,270,718,000
30.031746
107
0.638875
false
3.989796
false
false
false
anjalisood/spark-tk
python/sparktk/graph/ops/connected_components.py
12
1907
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
apache-2.0
-4,965,774,323,346,621,000
31.660714
81
0.602515
false
3.254448
false
false
false
pymir3/pymir3
lessnoise_specs.py
1
1058
import glob import remove_random_noise as rrn import os filename, file_extension = os.path.splitext('/path/to/somefile.ext') if __name__ == "__main__": wavdir = "./links/" wavs = sorted(glob.glob(wavdir + "*.wav")) pngdir = "./pngs/" #print wavs for f in wavs: nome, ext = os.path.splitext(...
mit
8,582,541,661,980,047,000
34.3
97
0.524575
false
2.867209
false
false
false
ericd/redeem
redeem/gcodes/M557.py
2
1668
""" GCode M557 Example: M557 P1 X30 Y40.5 Set the points at which the bed will be probed to compensate for its plane being slightly out of horizontal. The P value is the index of the point (indices start at 0) and the X and Y values are the position to move extruder 0 to to probe the bed. An implementation should all...
gpl-3.0
2,417,622,945,245,787,600
31.076923
79
0.589928
false
3.467775
false
false
false
14rcole/MediaBin
app/audfprint/hash_table.py
1
15577
""" hash_table.py Python implementation of the very simple, fixed-array hash table used for the audfprint fingerprinter. 2014-05-25 Dan Ellis dpwe@ee.columbia.edu """ from __future__ import print_function import numpy as np import random import cPickle as pickle import os, gzip import scipy.io import math # Current...
apache-2.0
6,069,818,742,438,169,000
40.428191
79
0.557168
false
3.88357
false
false
false
procangroup/edx-platform
common/lib/xmodule/xmodule/mongo_utils.py
15
3402
""" Common MongoDB connection functions. """ import logging import pymongo from pymongo import ReadPreference from mongodb_proxy import MongoProxy logger = logging.getLogger(__name__) # pylint: disable=invalid-name # pylint: disable=bad-continuation def connect_to_mongodb( db, host, port=27017, tz_aware=Tr...
agpl-3.0
-2,350,356,380,146,777,600
34.810526
97
0.665785
false
4.093863
false
false
false
desbma/sacad
sacad/tqdm_logging.py
1
1439
""" Code to help using the logging module with tqdm progress bars. """ import contextlib import logging import threading logging_handlers_lock = threading.Lock() class TqdmLoggingHandler(logging.Handler): """ Logging handler sending messages to the tqdm write method (avoids overlap). """ def __init__(self...
mpl-2.0
-2,664,702,171,294,622,000
29.617021
107
0.646282
false
4.099715
false
false
false
ulope/django
tests/introspection/tests.py
13
7475
from __future__ import unicode_literals from django.db import connection from django.db.utils import DatabaseError from django.test import TestCase, skipUnlessDBFeature from .models import Reporter, Article class IntrospectionTests(TestCase): def test_table_names(self): tl = connection.introspection.tab...
bsd-3-clause
1,906,700,952,050,262,800
45.141975
112
0.637458
false
4.223164
true
false
false
Dekken/tick
tick/prox/prox_positive.py
2
1824
# License: BSD 3 clause # -*- coding: utf8 -*- import numpy as np from .base import Prox from .build.prox import ProxPositiveDouble as _ProxPositiveDouble from .build.prox import ProxPositiveFloat as _ProxPositiveFloat __author__ = 'Stephane Gaiffas' dtype_map = { np.dtype("float64"): _ProxPositiveDouble, ...
bsd-3-clause
5,046,152,692,943,984,000
27.061538
71
0.585526
false
3.864407
false
false
false
kapteyn-astro/kapteyn
doc/source/EXAMPLES/kmpfit_chi2landscape_gauss.py
1
5097
#!/usr/bin/env python #------------------------------------------------------------ # Script compares efficiency of automatic derivatives vs # analytical in mpfit.py # Vog, 31 okt 2011 #------------------------------------------------------------ import numpy from matplotlib.pyplot import figure, show, rc from mpl_too...
bsd-3-clause
258,418,599,411,153,250
31.259494
82
0.560133
false
3.023132
false
false
false
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/hplip/ui4/fabgrouptable.py
1
2090
# -*- coding: utf-8 -*- # # (c) Copyright 2003-2007 Hewlett-Packard Development Company, L.P. # # 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-3.0
3,965,829,788,877,723,000
26.866667
74
0.577512
false
4.163347
false
false
false
Azure/azure-sdk-for-python
sdk/cognitiveservices/azure-cognitiveservices-language-luis/azure/cognitiveservices/language/luis/authoring/operations/_train_operations.py
1
6694
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-3,799,172,750,404,512,000
41.367089
136
0.64879
false
4.57553
true
false
false
joshfriend/sqlalchemy-utils
sqlalchemy_utils/observer.py
2
10527
""" This module provides a decorator function for observing changes in given property. Internally the decorator is implemented using SQLAlchemy event listeners. Both column properties and relationship properties can be observed. Property observers can be used for pre-calculating aggregates and automatic real-time data...
bsd-3-clause
1,791,508,742,861,565,000
30.803625
79
0.604826
false
4.527742
false
false
false
danielballan/dataportal
dataportal/broker/pims_readers.py
1
1797
"""This module contains "PIMS readers" (see github.com/soft-matter/pims) that take in headers and detector aliases and return a sliceable generator of arrays.""" from pims import FramesSequence, Frame from . import get_events from filestore.api import retrieve def get_images(headers, name): """ Load images fr...
bsd-3-clause
1,673,965,228,306,933,800
26.227273
83
0.585977
false
4.150115
false
false
false
simon-weber/gpsoauth
gpsoauth/google.py
1
1618
"""Functions to work with Google authentication structures.""" from __future__ import annotations import base64 import hashlib from Cryptodome.Cipher import PKCS1_OAEP from Cryptodome.PublicKey import RSA from Cryptodome.PublicKey.RSA import RsaKey from .util import bytes_to_int, int_to_bytes def key_from_b64(b64_...
mit
5,425,258,570,688,854,000
25.096774
81
0.645241
false
3.172549
false
false
false
PaulMcMillan/2014_defcon_timing
hue/vis10.py
1
2970
import matplotlib.pyplot as plt from collections import defaultdict from itertools import combinations from pprint import pprint from scipy import stats, signal import random from itertools import chain class QueryResponse(object): """Class to make it easier to work with parsed data. Works with everything nat...
bsd-2-clause
-1,070,419,007,787,929,100
30.595745
99
0.590236
false
3.735849
false
false
false
mjwestcott/chatroulette
twistedchat.py
1
6644
""" twistedchat.py A TCP chat server in the style of 'Chatroulette' using Twisted. Part of a study in concurrency and networking in Python: https://github.com/mjwestcott/chatroulette in which I create versions of this server using asyncio, gevent, Tornado, and Twisted. Some 'features': - on connection, clients a...
mit
1,644,161,619,297,750,800
36.325843
103
0.613034
false
4.157697
false
false
false
aayushKumarJarvis/Algorithm-Implementations
Rabin_Karp/Python/shivam5992/rabin_karp.py
27
1502
''' Rabin Karp Algorithm for pattern matching.It is a string searching algorithm that uses hashing to find any one of a set of pattern strings in a text. ''' def rabin_karp(pat,txt): q = 19 # a random prime number to calcualte hash values d = 256 # number of input characters h = 1 # hash function ini...
mit
-6,190,843,875,669,887,000
27.884615
112
0.519973
false
3.567696
false
false
false
MobProgramming/MobTimer.Python
Infrastructure/TimeSettingsManager.py
1
1455
class TimeSettingsManager(object): def __init__(self): self.minutes = 10 self.seconds = 0 self.time_change_callbacks = [] def get_time_string(self): return "{0:0>2}:{1:0>2}".format(self.minutes, self.seconds) def increment_minutes(self): self.minutes += 1 se...
mit
-4,990,201,095,449,209,000
35.4
109
0.643299
false
3.789063
false
false
false
akhileshpillai/treeherder
treeherder/webapp/api/urls.py
2
5273
import copy from django.conf.urls import (include, url) from rest_framework import routers from treeherder.webapp.api import (artifact, bug, bugzilla, classifiedfailure, ...
mpl-2.0
-6,742,364,100,357,935,000
35.116438
87
0.638536
false
4.211661
false
false
false
pylada/pylada-light
src/pylada/misc/relativepath.py
1
10211
############################### # This file is part of PyLaDa. # # Copyright (C) 2013 National Renewable Energy Lab # # PyLaDa is a high throughput computational platform for Physics. It aims to make it easier to submit # large numbers of jobs on supercomputers. It provides a python interface to physical input, suc...
gpl-3.0
-7,389,663,857,729,356,000
36.40293
103
0.58956
false
4.420346
false
false
false
18F/regulations-parser
regparser/commands/versions.py
2
4244
import logging import re from collections import namedtuple from operator import attrgetter, itemgetter import click from regparser.federalregister import fetch_notice_json from regparser.history.versions import Version from regparser.index import dependency, entry logger = logging.getLogger(__name__) def fetch_ve...
cc0-1.0
2,874,768,007,242,297,300
38.663551
79
0.671065
false
3.66494
false
false
false
bbfamily/abu
abupy/AlphaBu/ABuPickStockExecute.py
1
1784
# -*- encoding:utf-8 -*- """ 包装选股worker进行,完善前后工作 """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from .ABuPickStockWorker import AbuPickStockWorker from ..CoreBu.ABuEnvProcess import add_process_env_sig from ..MarketBu.ABuMarket import split_k_marke...
gpl-3.0
3,025,747,498,661,473,300
31.392157
103
0.705206
false
2.848276
false
false
false
hmoco/osf.io
framework/auth/views.py
1
41778
# -*- coding: utf-8 -*- import furl import httplib as http import urllib import markupsafe from django.utils import timezone from flask import request import uuid from modularodm import Q from modularodm.exceptions import NoResultsFound from modularodm.exceptions import ValidationError from modularodm.exceptions impo...
apache-2.0
7,350,794,578,634,425,000
37.153425
132
0.626861
false
4.113222
false
false
false
porolakka/motioneye-jp
src/template.py
4
1811
# Copyright (c) 2013 Calin Crisan # This file is part of motionEye. # # motionEye 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,569,701,440,049,534,000
26.439394
72
0.690226
false
3.726337
false
false
false
luhn/johnhancock
johnhancock/__init__.py
1
10990
import re import hashlib import hmac import binascii from datetime import datetime as DateTime from urllib.parse import urlsplit, parse_qsl, urlencode from collections import namedtuple from collections.abc import MutableMapping, Mapping class Headers(MutableMapping): """ A case-insensitive dictionary-like ob...
mit
-2,921,721,250,942,728,000
28.702703
95
0.573157
false
4.003643
false
false
false
hycis/TensorGraph
examples/charcnn_text_classifier.py
1
3857
import tensorflow as tf import tensorgraph as tg from tensorgraph.layers import Reshape, Embedding, Conv2D, RELU, Linear, Flatten, ReduceSum, Softmax from nltk.tokenize import RegexpTokenizer from nlpbox import CharNumberEncoder, CatNumberEncoder from tensorgraph.utils import valid, split_df, make_one_hot from tensorg...
apache-2.0
-2,544,405,861,138,603,500
37.188119
100
0.513871
false
3.830189
true
false
false
jparyani/Mailpile
mailpile/plugins/keylookup/nicknym.py
2
6296
#coding:utf-8 from mailpile.commands import Command from mailpile.conn_brokers import Master as ConnBroker from mailpile.plugins import PluginManager from mailpile.plugins.search import Search from mailpile.mailutils import Email # from mailpile.crypto.state import * from mailpile.crypto.gpgi import GnuPG import http...
apache-2.0
-4,400,018,473,072,059,400
29.862745
78
0.601493
false
3.930087
true
false
false
christhekeele/mal
python/step8_macros.py
42
4847
import sys, traceback import mal_readline import mal_types as types import reader, printer from env import Env import core # read def READ(str): return reader.read_str(str) # eval def is_pair(x): return types._sequential_Q(x) and len(x) > 0 def quasiquote(ast): if not is_pair(ast): return types._...
mpl-2.0
-5,848,804,980,285,082,000
30.888158
183
0.502373
false
3.193017
false
false
false
facebook/chisel
commands/FBCounterCommands.py
1
3920
#!/usr/bin/python # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # These set of commands provide a way to use counters in debug time. By using these counters, # you can...
mit
5,923,686,988,107,759,000
27.613139
106
0.683418
false
3.862069
false
false
false
wt52571314/MyAutoTest
test_room/tools.py
1
2296
# -*- coding: utf-8 -*- # =============================================================================== # @ Creator:Hainnan.Zhang # @ Date:2016-3-24 # 模拟浏览器 # =============================================================================== from Stock_Interface_test.old.interface_test import * from Stock_Interface_test...
gpl-2.0
-6,695,613,872,900,800,000
31.043478
103
0.534389
false
3.426357
false
false
false
kingmotley/SickRage
lib/hachoir_parser/image/photoshop_metadata.py
84
7658
""" Photoshop metadata parser. References: - http://www.scribd.com/doc/32900475/Photoshop-File-Formats """ from hachoir_core.field import (FieldSet, ParserError, UInt8, UInt16, UInt32, Float32, Enum, SubFile, String, CString, PascalString8, NullBytes, RawBytes) from hachoir_core.text_handler import textHa...
gpl-3.0
5,261,888,109,530,542,000
43.783626
120
0.61883
false
3.474592
false
false
false
crccheck/vaulty
vaulty.py
1
4556
import logging import os import readline import shlex import sys import hvac LOG_FILENAME = '/tmp/vaulty-completer.log' logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG) class REPLState: """ Stores state for the user's session and also wraps `hvac`. """ _pwd = 'secret/' # pwd is wrap...
apache-2.0
-8,308,577,338,291,436,000
25.8
87
0.552458
false
3.540016
false
false
false
mxOBS/deb-pkg_trusty_chromium-browser
third_party/chromite/lib/commandline_unittest.py
1
12676
#!/usr/bin/python # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Test the commandline module.""" from __future__ import print_function import cPickle import signal import os import sys sys.pat...
bsd-3-clause
2,313,851,678,898,716,700
33.63388
78
0.655491
false
3.563677
true
false
false
whaleygeek/pyenergenie
setup.py
1
1105
import os from setuptools import setup here = lambda *a: os.path.join(os.path.dirname(__file__), *a) # read the long description with open(here('README.md'), 'r') as readme_file: long_description = readme_file.read() # read the requirements.txt with open(here('requirements.txt'), 'r') as requirements_file: ...
mit
-1,834,221,109,040,907,500
25.95122
71
0.61991
false
3.46395
false
false
false
jcrocholl/nxdom
languages/utils.py
1
1313
VOWELS = 'aeiouy' TRIPLE_SCORES = {} def word_groups(word): """ >>> list(word_groups('weight')) ['w', 'ei', 'ght'] >>> list(word_groups('Eightyfive')) ['ei', 'ght', 'y', 'f', 'i', 'v', 'e'] """ index = 0 word = word.lower() while index < len(word): # Find some consonants. ...
mit
-5,848,024,604,033,005,000
24.745098
62
0.523991
false
3.179177
false
false
false
abhinavmoudgil95/root
interpreter/llvm/src/tools/clang/tools/scan-build-py/libscanbuild/shell.py
53
2157
# -*- coding: utf-8 -*- # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. """ This module implements basic shell escaping/unescaping methods. """ import re import shlex __all__ = ['encode', 'decode']...
lgpl-2.1
4,758,712,418,784,437,000
31.681818
79
0.491887
false
4.164093
false
false
false
yujikato/DIRAC
src/DIRAC/ResourceStatusSystem/Utilities/RSSCacheNoThread.py
2
14414
""" Cache This module provides a generic Cache extended to be used on RSS, RSSCache. This cache features a lazy update method. It will only be updated if it is empty and there is a new query. If not, it will remain in its previous state. However, Cache class internal cache: DictCache sets a validity to its entries. Af...
gpl-3.0
-3,477,067,965,024,068,600
31.61086
112
0.661024
false
4.000555
false
false
false
duaneloh/Dragonfly
utils/py_src/reademc.py
1
8773
'''Module containing EMCReader class to parse .emc files''' from __future__ import print_function import sys import numpy as np try: import h5py HDF5_MODE = True except ImportError: HDF5_MODE = False class EMCReader(object): """EMC file reader Provides access to assembled or raw frames given a li...
gpl-3.0
-5,664,773,635,451,429,000
40.578199
96
0.556138
false
3.479968
false
false
false
AakashRaina/radpress
radpress/templatetags/radpress_tags.py
2
2295
from django import template from django.conf import settings from django.core.urlresolvers import reverse, NoReverseMatch from radpress import settings as radpress_settings, get_version from radpress.compat import get_user_model from radpress.models import Article from radpress.readers import get_markup_choices, get_re...
mit
718,730,108,097,464,800
23.425532
75
0.656209
false
3.818636
false
false
false
DiegoCorrea/ouvidoMusical
apps/data/userSongRecommendation/migrations/0001_initial.py
1
1313
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-01-28 22:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('users', '0001_initial'), ('song...
mit
-318,944,554,887,429,250
35.472222
114
0.587966
false
4.155063
false
false
false
TheImagingSource/tiscamera
examples/python/03-live-stream.py
1
2095
#!/usr/bin/env python3 # Copyright 2019 The Imaging Source Europe GmbH # # 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 a...
apache-2.0
9,140,207,896,390,596,000
27.310811
94
0.680668
false
3.901304
false
false
false
ESRF-BCU/emotion
emotion/controllers/PI_E517.py
1
15654
import time from emotion import Controller from emotion import log as elog from emotion.controller import add_axis_method from emotion.axis import AxisState import pi_gcs from emotion.comm import tcp from emotion import event """ Emotion controller for ethernet PI E517 piezo controller. Cyril Guilloud ESRF BLISS Thu...
gpl-2.0
-8,448,193,370,937,811,000
30.183267
115
0.499744
false
3.681562
true
false
false
Yepoleb/gogdb
gogdb/updater/dataextractors.py
1
7686
import dateutil.parser import collections import re import gogdb.core.model as model from gogdb.core.normalization import normalize_system def parse_datetime(date_str): if date_str is None: return None else: return dateutil.parser.isoparse(date_str) IMAGE_RE = re.compile(r"\w{64}") def ext...
agpl-3.0
4,909,974,780,406,582,000
33.00885
97
0.583268
false
3.498407
false
false
false
jiady/htdb
crawler/crawler/offlineTask/myTask.py
1
3854
import abc import redis import time class Task: redisTaskOngoing = "task-meta/ongoing" rclient = redis.StrictRedis(host="localhost", port=6379, db=0) task_sleep = 0 def __init__(self, name, logger, mail, retryFail=False, pipeline_key=[]): self.taskName = name self.mail = mail s...
mit
-146,764,696,304,721,820
34.357798
92
0.571354
false
3.778431
false
false
false
jjdmol/LOFAR
LCU/checkhardware/rtsm.py
1
30018
#!/usr/bin/python check_version = '0714' from threading import Thread import sys import traceback import os import numpy as np import time #import datetime import logging mainPath = r'/opt/stationtest' mainDataPath = r'/localhome/stationtest' observationsPath = r'/opt/lofar/var/run' beamletPath = r'/localhome/data/...
gpl-3.0
-7,804,538,025,338,516,000
35.652015
146
0.523486
false
3.430237
false
false
false
UManPychron/pychron
pychron/dashboard/tasks/server/task.py
2
1814
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
apache-2.0
-4,264,338,825,760,189,000
39.311111
90
0.613561
false
4.523691
false
false
false
jbornschein/mca-genmodel
preproc/preproc-dog.py
1
4641
#!/usr/bin/env python # # Author: Jorg Bornschein <bornschein@fias.uni-frankfurt.de) # Lincense: Academic Free License (AFL) v3.0 # from __future__ import division import sys sys.path.insert(0, "lib/") import numpy as np import tables from optparse import OptionParser from scipy.signal import convolve2d from pu...
agpl-3.0
2,671,833,618,587,717,000
29.94
90
0.545357
false
3.213989
false
false
false
dataversioncontrol/dvc
dvc/system.py
1
8636
from __future__ import unicode_literals from dvc.utils.compat import str, open import os import errno class System(object): @staticmethod def is_unix(): return os.name != "nt" @staticmethod def hardlink(source, link_name): import ctypes from dvc.exceptions import DvcExceptio...
apache-2.0
852,837,283,070,764,700
28.077441
103
0.546086
false
4.092891
false
false
false
whalerock/ella
test_ella/test_core/test_cache.py
2
17751
import time from datetime import date from django.core.cache import get_cache from ella.core.cache.utils import normalize_key from hashlib import md5 from test_ella.cases import RedisTestCase as TestCase from django.test.client import RequestFactory from django.contrib.sites.models import Site from django.contrib.cont...
bsd-3-clause
-2,129,175,163,393,120,300
42.507353
161
0.607966
false
3.131793
true
false
false
quandyfactory/sobidata
setup.py
1
1079
from distutils.core import setup version = '0.5' long_description = '' try: with open('README.md') as readme: # load long_description into memory long_description = readme.read() # save README (no extension) for pypi with open('README', 'w') as myfile: myfile.write(long...
gpl-2.0
1,312,043,398,835,676,400
27.394737
112
0.626506
false
3.491909
false
false
false
spivachuk/sovrin-node
indy_client/anon_creds/indy_issuer.py
2
2173
from anoncreds.protocol.issuer import Issuer from anoncreds.protocol.repo.attributes_repo import AttributeRepo from anoncreds.protocol.repo.public_repo import PublicRepo from anoncreds.protocol.wallet.issuer_wallet import IssuerWalletInMemory from indy_client.anon_creds.indy_public_repo import IndyPublicRepo from indy_...
apache-2.0
-3,514,978,543,121,759,000
40
78
0.698113
false
4.009225
false
false
false
openspending/gobble
gobble/snapshot.py
1
6331
"""This module has good intentions, like helping you debug API calls""" from collections import OrderedDict from copy import deepcopy from datetime import datetime from json import loads, dumps from os import listdir from os.path import join, isdir from re import search from click import command import io from json i...
mit
-5,760,641,882,880,226,000
30.187192
74
0.569578
false
4.129811
false
false
false
clone1612/appstore
nextcloudappstore/core/permissions.py
2
1054
from rest_framework.permissions import BasePermission DELETE_METHODS = ('DELETE',) UPDATE_METHODS = ('PUT', 'PATCH', 'POST') READ_METHODS = ('GET', 'HEAD', 'OPTIONS') class UpdateDeletePermission(BasePermission): """ Base permission which allows anyone to read the resources but allows to set different me...
agpl-3.0
-806,280,233,992,908,400
31.9375
72
0.655598
false
4.337449
false
false
false
ahmad88me/tada
tadacode/explore/explore.py
1
3550
import os import pandas as pd import numpy as np import random import matplotlib.pyplot as plt import matplotlib.cm from matplotlib.colors import rgb2hex from matplotlib import colors as matplot_colors import six colors = list(six.iteritems(matplot_colors.cnames)) colors_hex = zip(*colors)[1] #cmap = matplotlib.cm.g...
mit
5,235,105,585,080,472,000
34.5
129
0.552958
false
2.890879
false
false
false
CityGrid/arsenal
client/arsenalclient/interface/tags.py
1
6469
'''Arsenal client Tags class.''' import logging from arsenalclient.interface.arsenal_interface import ArsenalInterface from arsenalclient.exceptions import NoResultFound LOG = logging.getLogger(__name__) class Tags(ArsenalInterface): '''The arsenal client Tags class.''' def __init__(self, **kwargs): ...
apache-2.0
6,039,443,982,611,251,000
29.804762
88
0.529448
false
4.157455
false
false
false
vvoland/py3status
py3status/modules/thunderbird_calendar.py
1
2920
# -*- coding: utf-8 -*- """ Display tasks in thunderbird calendar. Configuration parameters: cache_timeout: how often we refresh usage in seconds (default 120) err_exception: error message when an exception is raised (default 'error: calendar parsing failed') err_profile: error message regarding pr...
bsd-3-clause
-2,663,873,493,278,860,300
30.73913
76
0.618151
false
4.010989
true
false
false
dcolombo/FilFinder
examples/paper_figures/ks_plots.py
3
1672
# Licensed under an MIT open source license - see LICENSE ''' KS p-values for different properties. ''' import numpy as np from pandas import read_csv import matplotlib.pyplot as p import numpy as np import seaborn as sn sn.set_context('talk') sn.set_style('ticks') # sn.mpl.rc("figure", figsize=(7, 9)) # Widths wid...
mit
9,140,832,659,395,175,000
21.90411
77
0.667464
false
2.518072
false
false
false
leprikon-cz/leprikon
leprikon/models/question.py
1
2000
from json import loads from django.core.exceptions import ValidationError from django.db import models from django.utils.functional import cached_property from django.utils.module_loading import import_string from django.utils.translation import ugettext_lazy as _ from ..conf import settings from ..utils import first...
bsd-3-clause
3,681,449,588,112,500,000
31.258065
119
0.6485
false
4.07332
false
false
false
jtraver/dev
python3/char/alt1.py
1
1140
#!/usr/local/bin/python3.7 # for mac? #!/usr/bin/env python3 #!/usr/bin/python3 # https://en.wikipedia.org/wiki/Alt_key alt_a = "å" ord_alt_a = ord(alt_a) ord_a = ord("a") alt_diff = ord_alt_a - ord_a print("alt_a = %s, ord_a = %s, ord_alt_a = %s, alt_diff = %s" % (str(alt_a), str(ord_a), str(ord_alt_a), str(alt_d...
mit
4,733,199,907,475,030,000
19.431373
120
0.537428
false
1.672552
false
false
false
ahmedaljazzar/edx-platform
openedx/core/djangoapps/user_authn/views/tests/test_views.py
2
39023
# -*- coding: utf-8 -*- """ Tests for user authn views. """ from http.cookies import SimpleCookie import logging import re from unittest import skipUnless from urllib import urlencode import ddt import mock from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_m...
agpl-3.0
4,609,709,022,389,832,000
40.970936
119
0.633403
false
3.988441
true
false
false
cjneasbi/mitmextract
pcaptomitm/extract.py
1
12783
import sys import re import nids from . import regex DEBUG = False #initialize on every call of extract_flows ts = None # request timestamp requestdata = None # buffer for requests from open connections responsedata = None # buffer for responses from open connections requestcounter = None http_req = None # contains...
gpl-3.0
-3,504,836,389,444,445,000
33.273458
109
0.55785
false
3.5867
false
false
false
247687009/mcrouter
mcrouter/test/test_wch3.py
2
3091
# Copyright (c) 2014, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from __future__ import absolute...
bsd-3-clause
7,331,603,049,058,234,000
34.125
78
0.563572
false
3.801968
true
false
false
xapple/seqenv
seqenv/common/color.py
3
2374
################################################################################ class Color: """Shortcuts for the ANSI escape sequences to control formatting, color, etc. on text terminals. Use it like this: print Color.red + "Hello world" + Color.end """ # Special # end = '\033[0m'...
mit
-4,178,673,585,366,318,600
29.844156
80
0.466302
false
2.307094
false
false
false
phufbv/journal-stats
script.py
1
1445
import sys import parameters as pars import html from article import Article from file_writer import FileWriter def run(journal, num_articles): # Setup output file, get input parameters, and use brief run if testing writer = FileWriter(pars.filename) journal = journal # journal name num_articles = num_articles ...
mit
2,807,207,387,406,766,000
24.350877
101
0.680969
false
3.048523
false
false
false
steny138/ShyGiProg
webapi/prog_api.py
1
4041
#coding=utf-8 from flask import Flask, request, jsonify from flask import g, Response from flask_restful.reqparse import RequestParser from flask.views import MethodView import time, datetime from Crypto.Cipher import AES from Crypto import Random import base64 app = Flask(__name__) ENCRYPT_KEY = "AUJJSLSPDVMDSSJSO...
apache-2.0
2,760,284,153,073,627,600
27.871429
116
0.542935
false
3.657014
false
false
false
pymfony/pymfony
src/pymfony/component/system/reflection.py
2
11433
# -*- coding: utf-8 -*- # This file is part of the pymfony package. # # (c) Alexandre Quercia <alquerci@email.com> # # For the full copyright and license information, please view the LICENSE # file that was distributed with this source code. from __future__ import absolute_import; import sys; import inspect; from py...
mit
7,362,900,226,967,280,000
29.733871
94
0.581037
false
4.562251
false
false
false