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
kennethreitz/pipenv
pipenv/vendor/requirementslib/utils.py
1
25567
# -*- coding=utf-8 -*- from __future__ import absolute_import, print_function import logging import os import sys import pip_shims.shims import six import six.moves import tomlkit import vistir from six.moves.urllib.parse import urlparse, urlsplit, urlunparse from vistir.compat import Path, fs_decode from vistir.path...
mit
6,469,714,402,878,080,000
37.102832
93
0.616146
false
3.900381
false
false
false
ivanalejandro0/spotimute
spotimute/test_spotimute.py
1
1083
#!/usr/bin/env python # encoding: utf-8 from audiomanager import AudioManager from spotify import Spotify def status(audio, spotify): print '-' * 50 print "Sink name:", audio._sink_name print "Sink id:", audio._sink_id print "is muted:", audio.is_muted() print "volume:", audio.get_volume() pr...
gpl-2.0
-7,367,753,314,312,036,000
23.613636
68
0.574331
false
3.482315
false
false
false
deepmind/dm_control
dm_control/locomotion/walkers/base.py
1
6682
# Copyright 2019 The dm_control Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
apache-2.0
2,419,647,580,086,868,000
32.747475
80
0.673152
false
3.681543
false
false
false
pyroscope/pyrobase
src/pyrobase/bencode.py
1
7221
# -*- coding: utf-8 -*- # pylint: disable=too-few-public-methods,invalid-name """ Bencode support. Copyright (c) 2009-2017 The PyroScope Project <pyroscope.project@gmail.com> See http://en.wikipedia.org/wiki/Bencode """ # This program is free software; you can redistribute it and/or modify # it under the term...
gpl-2.0
1,536,549,421,344,492,800
33.884058
91
0.549924
false
4.038591
false
false
false
Jumpscale/jumpscale6_core
lib/JumpScale/grid/messagehandling/test/test_performance.py
1
2017
import time from JumpScale import j if not q._init_called: from JumpScale.core.InitBaseCore import q def logtest(total, interval, message, format=False): j.core.messagehandler3.connect2localLogserver() start = time.time() result = [] for n in xrange(1, total + 1): if n % interval == 0:...
bsd-2-clause
-4,300,191,139,590,101,000
33.186441
96
0.540407
false
4.282378
false
false
false
AASHE/iss
run_tests.py
1
1459
#!/usr/bin/env python import logging import os import sys BASE_PATH = os.path.dirname(__file__) logging.basicConfig() def main(): """ Standalone django model test with a 'memory-only-django-installation'. You can play with a django model without a complete django app installation. http://www.dja...
mit
-1,009,402,497,536,099,600
22.918033
74
0.604524
false
3.584767
true
false
false
muffinresearch/amo-validator
validator/testcases/scripting.py
7
1914
from validator.constants import PACKAGE_THEME from validator.contextgenerator import ContextGenerator from validator.testcases.javascript import traverser from validator.testcases.javascript.jsshell import get_tree def test_js_file(err, filename, data, line=0, context=None, pollutable=False): 'Test a JS file by p...
bsd-3-clause
2,682,991,133,804,893,700
32.578947
78
0.621735
false
4.055085
true
false
false
bgris/ODL_bgris
lib/python3.5/idlelib/idle_test/test_config_help.py
2
3566
"""Unittests for idlelib.configHelpSourceEdit""" import unittest from idlelib.idle_test.mock_tk import Var, Mbox, Entry from idlelib import configHelpSourceEdit as help_dialog_module help_dialog = help_dialog_module.GetHelpSourceDialog class Dummy_help_dialog: # Mock for testing the following methods of help_dia...
gpl-3.0
-2,845,700,318,091,803,600
32.641509
73
0.650589
false
3.722338
true
false
false
coderjames/pascal
quex-0.63.1/quex-exe.py
1
2473
#! /usr/bin/env python # # Quex 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 version 2.1 of the License, or (at your option) # any later version. # # This software is distribu...
bsd-2-clause
-2,426,523,884,556,605,400
32.876712
80
0.597655
false
4.067434
false
false
false
jaustinpage/frc_rekt
data/vex/download_curves.py
1
2867
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import logging import os import re import requests import zipfile from pathlib import Path from urllib.parse import urlparse # yapf: disable files = {'cim': ['https://content.vexrobotics.com/motors/217-2000-cim/cim-motor-curve-data-20151104.csv', ...
mit
-599,580,394,822,621,800
35.291139
124
0.622951
false
3.147091
false
false
false
pyfarm/pyfarm-agent
pyfarm/agent/logger/python.py
2
3495
# No shebang line, this module is meant to be imported # # Copyright 2014 Oliver Palmer # # 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 # # Unle...
apache-2.0
-4,971,633,859,256,521,000
28.880342
77
0.643491
false
4.106933
false
false
false
glorpen/webassets
src/webassets/filter/jinja2.py
21
1267
from __future__ import absolute_import from webassets.filter import Filter __all__ = ('Jinja2',) class Jinja2(Filter): """Process a file through the Jinja2 templating engine. Requires the ``jinja2`` package (https://github.com/mitsuhiko/jinja2). The Jinja2 context can be specified with the `JINJA2_CON...
bsd-2-clause
-1,223,482,834,556,889,900
29.166667
94
0.636148
false
3.759644
false
false
false
churchlab/millstone
genome_designer/genome_finish/millstone_de_novo_fns.py
1
11684
import subprocess import os from django.conf import settings import numpy as np import pysam from genome_finish import __path__ as gf_path_list from genome_finish.insertion_placement_read_trkg import extract_left_and_right_clipped_read_dicts from main.models import Dataset from main.models import Variant from main.mo...
mit
647,521,577,785,154,200
32.768786
100
0.642759
false
3.547055
false
false
false
jmichelsen/horrorbox
music.py
1
1187
import logging import random import time import vlc import constants log = logging.getLogger(__file__) class HorrorsEar(object): def __init__(self): self.background_instance = vlc.Instance() self.background_tracks = self.background_instance.media_list_new() self.background_player = self...
gpl-3.0
5,873,880,076,083,507,000
29.435897
84
0.662174
false
3.804487
false
false
false
zachgates/jugg
jugg/core.py
1
6323
import asyncio import base64 import json import pyarchy import socket import struct import time from . import constants, security class Datagram(object): @classmethod def from_string(cls, str_: str): dg = cls(**json.loads(str_)) # Verify timestamp if dg.timestamp >= time.time(): ...
mit
-8,457,216,418,216,259,000
24.913934
78
0.541357
false
4.283875
false
false
false
8BitJosh/JukeBot
JukeBot/mainNamespace.py
1
9499
import socketio class mainNamespace(socketio.AsyncNamespace): def __init__(self, _playlist, _player, _playlistlist, _config, _loop, _users, _namespace): self.playlist = _playlist self.player = _player self.playlistlist = _playlistlist self.config = _config self.loop = _loop...
mit
-4,696,739,627,191,824,000
45.563725
139
0.570165
false
3.98114
true
false
false
tderensis/digital_control
control_eval.py
1
13704
""" Functions used to evaluate the quality of control systems. Includes measures such as stability margins and settling time. Requires numpy """ import numpy as np from numpy import linalg as LA import math import cmath def upper_gain_margin(A, B, C, discrete=True, tol=1e-3, max_gain_dB=60, output_dB=True): """ ...
mit
5,929,957,209,731,719,000
36.037838
103
0.601211
false
3.610116
false
false
false
uw-it-aca/myuw
myuw/views/api/textbook.py
1
3640
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 import logging import traceback from restclients_core.exceptions import DataFailureException from myuw.dao.registration import get_schedule_by_term from myuw.dao.instructor_schedule import get_instructor_schedule_by_term from myuw.d...
apache-2.0
-6,605,194,879,796,673,000
34
79
0.603571
false
3.935135
false
false
false
jmanday/Master
TFM/library/opencv-3.2.0/modules/python/test/test_feature_homography.py
2
5542
#!/usr/bin/env python ''' Feature homography ================== Example of using features2d framework for interactive video homography matching. ORB features and FLANN matcher are used. The actual tracking is implemented by PlaneTracker class in plane_tracker.py ''' # Python 2/3 compatibility from __future__ import ...
apache-2.0
-3,554,900,885,808,585,000
33.64375
111
0.601047
false
3.4
true
false
false
google-research/falken
service/api/model_selector.py
1
21573
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-6,392,412,219,479,050,000
41.718812
80
0.65225
false
3.931657
false
false
false
JoaquimPatriarca/senpy-for-gis
gasp/oss/utils.py
1
1759
""" Manage data in folders """ def identify_groups(folder, splitStr, groupPos, outFolder): """ Identifica o grupo a que um ficheiro pertence e envia-o para uma nova pasta com os ficheiros que pertecem a esse grupo. Como e que o grupo e identificado? * O nome do ficheiro e partido em dois em fu...
gpl-3.0
5,643,578,438,477,932,000
32.188679
79
0.582717
false
3.718816
false
false
false
cactaur/astropy-utils
astropy_util.py
1
26719
"""A set of helper functions to work with the astropy module.""" import functools import random import string import tempfile import subprocess import collections from itertools import cycle, islice, chain, combinations, zip_longest import scipy import numpy as np from astropy.table import Table, join from astropy.coo...
bsd-3-clause
-1,405,172,378,491,564,800
37.77939
82
0.630563
false
4.01367
false
false
false
MehranMirkhan/ai_system
models/model.py
1
5838
import tqdm import numpy as np import tensorflow as tf import matplotlib.pyplot as plt import utils.filesys as fs import utils.utils as ut import utils.tfw as tfw import utils.printer as pr import utils.datasets as ds """ A combination of modules that interacts with environment """ class Model: def __init__(self,...
mit
-2,729,038,854,251,442,700
26.933014
87
0.617506
false
3.042209
true
false
false
LethusTI/supportcenter
vendor/lethusbox/lethusbox/fs/models.py
1
7782
# -*- coding: utf-8 -*- __all__ = ('Folder', 'FileFolder', 'Album', 'PhotoAlbum') import datetime from mongoengine import * from bson import ObjectId from django.http import HttpResponse from django.core.servers.basehttp import FileWrapper from filesize import size PHOTO_MIMETYPES = { 'PNG': 'image/png', '...
gpl-3.0
99,696,159,870,371,710
25.02349
93
0.554997
false
3.797747
false
false
false
onlynone/pysyscmd
syscmd/cmds.py
1
2333
# -*- coding: utf-8 -*- class Syscmd(object): def _cmd(self, cmd, *args, **kwargs): """Execute system commands Args: *args: The positional arguments are used as arguments to the command. For example, the following python code: _cmd("git, "commit", "--help")...
bsd-3-clause
-7,051,081,000,597,903,000
27.108434
102
0.545221
false
4.211191
false
false
false
YunoHost/yunohost
doc/generate_manpages.py
1
2344
""" Inspired by yunohost_completion.py (author: Christophe Vuillot) ======= This script generates man pages for yunohost. Pages are stored in OUTPUT_DIR """ import os import yaml import gzip import argparse from datetime import date from collections import OrderedDict from jinja2 import Template base_path = os.pat...
agpl-3.0
4,693,860,435,264,777,000
26.576471
101
0.638225
false
3.679749
false
false
false
eyedeeemm/nitrogen
win/pywin.py
1
4849
#!/usr/bin/env python3 import math, os, ctypes import sdl2, sdl2.sdlmixer, sdl2.sdlimage class Win: # s, w, h, rect_ref # run_fps, run_t_end, run_t_begin, run_frame_t, run_frame_t_ms # window, windowsurface # event, event_ref # on_key, on_click, on_declick, on_move # draw def __init__ (se...
unlicense
2,487,375,818,377,089,000
33.635714
79
0.516601
false
3.247823
false
false
false
bluedynamics/bda.disclaimer
src/bda/disclaimer/browser/disclaimer.py
1
1932
from zExceptions import Redirect from zope.component import ComponentLookupError from plone.app.layout.viewlets.common import ViewletBase from Products.Five import BrowserView from Products.CMFPlone.utils import getToolByName from bda.disclaimer.interfaces import IDisclaimerText class DisclaimerViewlet(ViewletBase): ...
bsd-3-clause
66,484,574,228,338,460
32.894737
71
0.628364
false
3.90303
false
false
false
aerospike/aerospike-admin
test/e2e/util.py
1
5905
# Copyright 2013-2021 Aerospike, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
3,042,231,427,992,210,000
30.243386
84
0.537341
false
4.038988
false
false
false
phalcon/readthedocs.org
readthedocs/core/forms.py
5
3165
import logging from haystack.forms import SearchForm from haystack.query import SearchQuerySet from django import forms from django.forms.fields import CharField from django.utils.translation import ugettext_lazy as _ from models import UserProfile log = logging.getLogger(__name__) class UserProfileForm(forms.Model...
mit
4,467,745,558,170,281,000
31.628866
77
0.618009
false
4.131854
false
false
false
kogotko/carburetor
openstack_dashboard/api/neutron.py
1
48951
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Cisco Systems, Inc. # Copyright 2012 NEC Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use...
apache-2.0
-2,239,316,490,903,056,400
35.944151
79
0.605258
false
3.978786
true
false
false
ScalaInc/exp-python2-sdk
exp_sdk/exceptions.py
1
1083
import traceback import logging logger = logging.getLogger('exp') class ExpError (Exception): def __init__ (self, message): self.message = message def __str__ (self): return self.message class AuthenticationError (ExpError): pass class UnexpectedError (ExpError): def __init__ (self, *args, **k...
mit
-8,175,853,205,968,226,000
21.102041
78
0.674977
false
3.634228
false
false
false
PyAbel/PyAbel
doc/transform_methods/rbasex-SVD.py
1
1324
from __future__ import division, print_function import numpy as np from scipy.linalg import inv, svd import matplotlib.pyplot as plt from abel.rbasex import _bs_rbasex Rmax = 40 # SVD for 0th-order inverse Abel transform P, = _bs_rbasex(Rmax, 0, False) A = inv(P.T) V, s, UT = svd(A) # setup x axis def setx(): pl...
mit
8,835,070,110,759,134,000
20.015873
59
0.590634
false
2.339223
false
false
false
nolram/NewsReader-Django
Crawler/migrations/0001_initial.py
1
5262
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import sorl.thumbnail.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Categorias', fields=[ ...
mit
-1,881,030,294,619,357,200
43.974359
110
0.549221
false
4.107728
false
false
false
deathmetalland/IkaLog
ikalog/outputs/webserver/preview.py
3
2324
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
apache-2.0
7,743,394,388,451,449,000
30.405405
83
0.609294
false
3.912458
false
false
false
juggernate/pymel
pymel/util/conditions.py
3
2066
#------------------------------------------------------------------------------ # Condition objects - used for chaining together tests that yield True/False results #------------------------------------------------------------------------------ class Condition(object): """ Used to chain together objects for c...
bsd-3-clause
-2,844,658,792,059,718,700
23.595238
84
0.518877
false
4.02729
false
false
false
javgh/greenaddress-pos-tools
nfc/tag/tt1.py
1
10645
# -*- coding: latin-1 -*- # ----------------------------------------------------------------------------- # Copyright 2011-2013 # Stephen Tiedemann <stephen.tiedemann@googlemail.com>, # Alexander Knaub <sanyok.og@googlemail.com> # # Licensed under the EUPL, Version 1.1 or - as soon they # will be approved by the ...
mit
-6,768,400,176,963,971,000
34.841751
79
0.543166
false
3.651801
false
false
false
hodgestar/overalls
overalls/core.py
1
2481
# -*- coding: utf-8 -*- """Core classes for overalls.""" class FileCoverage(object): """Coverage result for a single file. :param str filename: Name of the filename the results are for. :param str source: Source code (newline separated). :param list coverage: List of coverage...
bsd-3-clause
4,973,367,806,479,127,000
26.876404
78
0.615075
false
4.620112
false
false
false
ShadowApex/pygame-sdl2
pygame2/display/__init__.py
1
13684
#!/usr/bin/python """Window handling module.""" import sdl2.ext import pygame2 from sdl2 import rect, render from sdl2.ext.compat import isiterable try: import sdl2.sdlgfx except: pass window = None class Window(object): def __init__(self, title="Pygame2", size=(800, 600), type="hardware", fullscreen=...
gpl-2.0
-5,348,630,576,886,839,000
27.214433
100
0.57739
false
4.339994
false
false
false
SeMorgana/ctf
defcon2014/3dttt.py
1
5141
#5/17/2014 import telnetlib import random from utility import * tn = telnetlib.Telnet("3dttt_87277cd86e7cc53d2671888c417f62aa.2014.shallweplayaga.me",1234) X = 'X' O = 'O' def get_sym(coor): #sym => symmetric if coor == 0: return 2 if coor == 1: return 1 if coor == 2: return 0 d...
gpl-3.0
-4,251,141,648,086,245,400
26.345745
101
0.48298
false
3.076601
false
false
false
consbio/seedsource-core
seedsource_core/django/seedsource/ppt.py
1
14306
import datetime import os from io import BytesIO from PIL import Image from PIL.Image import isImageType from django.conf import settings from django.utils.translation import ugettext as _ from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE_TYPE from pptx.enum.text import PP_PARAGRAPH_ALIGNMENT from p...
bsd-3-clause
-6,586,210,890,521,238,000
39.070028
128
0.515414
false
4.057005
false
false
false
jrobeson/platformio
platformio/builder/scripts/frameworks/cmsis.py
7
1375
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ CMSIS The ARM Cortex Microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer for the Cortex-M processor series and specifies debugger interfaces. The CMSIS enables consistent and simple softwar...
mit
-2,500,168,662,549,293,000
25.442308
102
0.735273
false
3.552972
false
false
false
bq/bitbloq-offline
app/res/web2board/darwin/Web2Board.app/Contents/Resources/res/Scons/sconsFiles/SCons/Platform/darwin.py
5
2523
"""engine.SCons.Platform.darwin Platform-specific initialization for Mac OS X systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # Permissio...
gpl-3.0
-882,511,768,773,137,900
34.041667
109
0.692826
false
3.875576
false
false
false
NoBodyCam/TftpPxeBootBareMetal
nova/api/openstack/compute/contrib/security_groups.py
1
21571
# Copyright 2011 OpenStack LLC. # Copyright 2012 Justin Santa Barbara # 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/license...
apache-2.0
-4,588,146,646,452,176,000
36.191379
79
0.597283
false
4.256314
false
false
false
sihrc/indikitty
indikitty/process.py
1
1721
import base64 import logging from itertools import izip from cStringIO import StringIO import cv2 import numpy as np from skimage.io import imread import indicoio from .keys import INDICO_API_KEY indicoio.api_key = INDICO_API_KEY SERVER_URL = "http://localhost:3000/random" def get_faces_dimens(image_string, bounds)...
mit
1,366,001,676,076,868,400
27.213115
84
0.622313
false
2.987847
false
false
false
cloudkick/libcloud
libcloud/compute/drivers/gogrid.py
1
15600
# 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
6,769,058,029,211,202,000
32.191489
100
0.54641
false
4.25184
false
false
false
cah-rfelsburg/sflvault
server/sflvault/model/__init__.py
2
15281
# -=- encoding: utf-8 -=- # # SFLvault - Secure networked password store and credentials manager. # # Copyright (C) 2008 Savoir-faire Linux inc. # # Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
gpl-3.0
-5,143,276,163,699,025,000
36.24878
139
0.567313
false
4.23869
false
false
false
ntkurapati/navidile4
src/nameparser.py
1
14484
# -*- coding: utf-8 -*- """ A simple Python module for parsing human names into their individual components. Components:: * Title * First name * Middle names * Last names * Suffixes Works for a variety of common name formats for latin-based languages. Over 100 unit tests with example names. Shou...
gpl-3.0
-5,534,955,889,332,706,000
34.240876
156
0.501105
false
3.81962
false
false
false
nullzero/wpcgi
wpcgi/package/p_form/p_validators.py
1
1995
#!/data/project/nullzerobot/python/bin/python import wtforms.validators from wtforms.validators import * from wtforms.validators import ValidationError from messages import msg import re ############################## class _Required(Required): def __init__(self, *args, **kwargs): if not kwargs.get('mess...
mit
-3,647,347,863,538,057,700
25.6
84
0.56792
false
3.911765
false
false
false
fishcorn/pylearn2
pylearn2/scripts/plot_monitor.py
37
10204
#!/usr/bin/env python """ usage: plot_monitor.py model_1.pkl model_2.pkl ... model_n.pkl Loads any number of .pkl files produced by train.py. Extracts all of their monitoring channels and prompts the user to select a subset of them to be plotted. """ from __future__ import print_function __authors__ = "Ian Goodfell...
bsd-3-clause
-91,320,550,111,798,940
31.189274
123
0.492258
false
4.200906
false
false
false
npcoder2k14/HackInTheNorth-PYRAG
pyrag_sports/cricketAPI.py
1
5652
import requests import os import bs4 import sys try: from flask import Flask from flask import request from flask.ext.cors import CORS, cross_origin from datetime import timedelta from flask import make_response, request, current_app from functools import update_wrapper app = Flask(__name__...
mit
8,007,146,770,010,000,000
33.888889
132
0.564402
false
3.50838
false
false
false
IamRafy/numibot
plugins/timezone.py
2
1156
import re import yaml import time import datetime from libs import request import geocode config = yaml.load(open('config.yaml', 'r')) def matches(text): return re.search('time\s+(at|in)\s+(.+)', text, re.IGNORECASE) def decode(text): g = matches(text).groups() if g and g[1]: return [g[1]] ...
apache-2.0
-3,195,195,900,452,444,700
30.243243
243
0.634948
false
3.4
false
false
false
brianrodri/oppia
core/domain/subscription_services.py
2
9181
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
-4,500,942,579,873,539,000
33.003704
78
0.695676
false
4.023225
false
false
false
twchoi/Netmod_git
test/script/hit1.py
1
1416
#!/usr/bin/env python import sys, math from pylab import * def hitf(a): r = 0 if (a >= 1): r = 1 else: r = 0 return r def mean(b): return float(sum(b)) / float(len(b)) #infilename = "d2out" infilename = sys.argv[1] #alpha = float(sys.argv[2]) ifile = open(infilename, 'r') no_cache = 0 time = [] stab...
gpl-2.0
-8,745,007,664,037,984,000
19.823529
56
0.59887
false
2.728324
false
false
false
rebelact/mailsync-app
mailsync/models/setup.py
1
2889
import logging from mailsync.models.base import BaseModel from mailsync.models.adapter import adapter from mailsync.models.sqlite import details_table, columns_table, database_table, provider_table, lists_table class SetupModel(BaseModel): def __init__(self): super(SetupModel, self).__init__() d...
mit
-6,122,042,490,357,596,000
37.026316
127
0.571132
false
4.069014
false
false
false
zynthian/zynthian-ui
zynlibs/jackpeak/jackpeak.py
1
1763
#!/usr/bin/python3 # -*- coding: utf-8 -*- #******************************************************************** # ZYNTHIAN PROJECT: Jackpeak Python Wrapper # # A Python wrapper for jackpeak library # # Copyright (C) 2019 Brian Walton <brian@riban.co.uk> # #**************************************************************...
gpl-3.0
3,813,808,966,403,455,000
33.568627
84
0.557005
false
4.207637
false
false
false
kamyu104/LeetCode
Python/rotate-string.py
2
3103
# Time: O(n) # Space: O(1) # We are given two strings, A and B. # # A shift on A consists of taking string A and moving the leftmost character to the rightmost position. # For example, if A = 'abcde', then it will be 'bcdea' after one shift on A. Return True # if and only if A can become B after some number of shifts...
mit
-7,140,308,830,570,170,000
25.75
103
0.44183
false
3.447778
false
false
false
adiyoss/DeepVOT
post_process/analyze.py
1
3854
from sklearn.metrics import confusion_matrix, accuracy_score, precision_score, recall_score, f1_score def read_file(path): y = list() with open(path) as fid: for line in fid.readlines(): curr_y = list() vals = line.split() for val in vals: curr_y.app...
mit
-1,620,741,362,476,978,700
29.346457
103
0.525169
false
2.630717
false
false
false
wavesoft/creditpiggy
creditpiggy-server/creditpiggy/core/migrations/0006_piggyuser_uuid.py
1
1150
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import creditpiggy.core.models def generate_uuid(apps, schema_editor): PiggyUser = apps.get_model('core', 'PiggyUser') for user in PiggyUser.objects.all().iterator(): user.uuid = creditpiggy.core.m...
gpl-2.0
3,596,210,663,184,882,000
30.944444
168
0.623478
false
3.745928
false
false
false
isb-cgc/examples-Python
python/pairwise/archive/bq_filter_file.py
1
4469
''' Copyright 2015, Institute for Systems Biology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
apache-2.0
3,670,557,857,444,028,400
30.921429
94
0.631237
false
3.491406
false
false
false
AgnezIO/agnez
agnez/grid.py
2
7483
import numpy as np # from gaborfitting import * import theano import theano.tensor as T def scale_norm(X): X = X - X.min() scale = (X.max() - X.min()) return X / scale def img_grid(X, rows_cols=None, rescale=True): """Image Grid: modified from jbornschein/draw Parameters: =========== X ...
bsd-3-clause
1,772,152,492,622,840,300
33.325688
116
0.585327
false
3.614976
false
false
false
Thykof/SafeMyWork
cli/main.py
1
1975
import threading import asyncio import click from safer.safe import Safer nb_copies_done = 0 @click.command() @click.option('-d', '--delta', default=10, help='Number of minutes between copies.') @click.option('-s', '--safe_dir', default=None, help='Destination folder.') @click.option('-w', '--delicate_dirs', req...
gpl-3.0
4,522,782,964,535,768,600
33.051724
139
0.608608
false
3.610603
false
false
false
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/templates_py/operator_modal_view3d_raycast.py
4
3608
import bpy from bpy_extras import view3d_utils def main(context, event): """Run this function on left mouse, execute the ray cast""" # get the context arguments scene = context.scene region = context.region rv3d = context.region_data coord = event.mouse_region_x, event.mouse_region_y # ge...
gpl-3.0
-7,564,040,071,069,720,000
32.100917
95
0.594789
false
3.830149
false
false
false
drx/archfinch
wiki/views.py
1
2132
from archfinch.wiki.models import PageForm, Page, Revision, RevisionText from archfinch.main.models import Item from django.shortcuts import get_object_or_404 from archfinch.utils import render_to_response from django.core.urlresolvers import reverse from django.template import RequestContext from django.http import Ht...
mit
-2,634,413,105,738,084,400
33.95082
99
0.638368
false
4.060952
false
false
false
dave-tucker/spectrometer
spectrometer/processor/default_data_processor.py
3
8129
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
-3,398,933,526,875,077,600
34.810573
79
0.644975
false
3.940378
false
false
false
Netflix/security_monkey
security_monkey/auditors/s3.py
1
4689
# Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
4,173,267,436,874,948,600
45.89
182
0.662615
false
3.473333
false
false
false
miradel51/preprocess
chinese_norm.py
1
1235
#!/usr/bin/python #-*-coding:utf-8 -*- # author: mld # email: miradel51@126.com # date : 2017/9/30 # time : 23:42(pm) import sys import re # Remove the whitespace at the begining or ending of the sentence # Helps to convert full-width and half-width from chinese sentence # If there is any english characte...
mit
-8,588,381,024,596,045,000
19.293103
104
0.640486
false
2.940476
false
false
false
ganemone/ontheside
server/mod_auth/auth.py
1
1354
import flask from flask_login import login_user from server.models import User from server.login_manager import login_manager @login_manager.user_loader def load_user(user_id: int) -> User: """Returns a user from the database based on their id :param user_id: a users unique id :return: User object with c...
mit
8,787,244,667,091,010,000
29.088889
91
0.680945
false
4.10303
false
false
false
AlbanoCastroSousa/RESSPyLab
RESSPyLab/summary_tables_maker.py
1
9616
import pandas as pd import numpy as np from .uvc_model import calc_phi_total def summary_tables_maker_uvc(material_definition, x_file_paths, data, peeq='sat'): """ Prints to screen the summary tables for the material optimization in LaTeX format for the updated VC model. :param dict material_definition: Cont...
mit
-3,612,788,240,963,097,600
47.08
117
0.606073
false
3.312435
false
false
false
sbidoul/buildbot
master/buildbot/test/integration/test_customservices.py
6
3917
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
-1,451,463,372,495,509,500
32.478632
79
0.693388
false
4.088727
true
false
false
Digoss/funny_python
botNet.py
1
1137
import argparse import pxssh import sys class Client: def __init__(self, host, user, password): self.host = host self.user = user self.password = password self.session = self.connect() def connect(self): try: s = pxssh.pxssh() s.login(self.host, ...
bsd-3-clause
-1,686,618,998,251,673,000
20.471698
56
0.595427
false
3.644231
false
false
false
Jordy281/Tic_Tac_Toe_SuperComputer
TicTacToe.py
1
5041
import numpy as np import copy from random import randrange import game.py import arena.py import gym.py import winningPercent.py """ Piece State, 0 = Empty 1 = X 2 = O 0 | 1 | 2 --------------- 3 | 4 | 5 --------------- 6 | 7 | 8 """ """ This will check if the current state exists, I...
mit
2,689,065,188,618,646,500
22.018265
108
0.57687
false
3.349502
false
false
false
GNOME/pyclutter
examples/image-content.py
1
2894
# Clutter depends on Cogl 1.0 for public API, but Cogl ships with # introspection data for both 1.0 and 2.0; pygobject will prefer # the latter, so we need to load Clutter before Cogl from gi.repository import Clutter from gi.repository import Cogl from gi.repository import GdkPixbuf gravities = [ ( Clutter.Conten...
lgpl-2.1
3,622,187,896,764,888,600
33.047059
109
0.696959
false
3.318807
false
false
false
liulion/mayavi
docs/source/mayavi/auto/wigner.py
8
2866
""" An example in which 3 functions of x and y are displayed with a surf plot, while the z scaling is kept constant, to allow comparison between them. The important aspect of this example is that the 3 functions should not be displayed on top of each other, but side by side. For this we use the extent keyword argumen...
bsd-3-clause
8,597,588,439,283,360,000
33.53012
75
0.630495
false
2.636615
false
false
false
jordotech/sherri_satchmo
satchmo/projects/skeleton/local_settings.py
6
2241
# this is an extremely simple Satchmo standalone store. import logging import os, os.path LOCAL_DEV = True DEBUG = True TEMPLATE_DEBUG = DEBUG if LOCAL_DEV: INTERNAL_IPS = ('127.0.0.1',) DIRNAME = os.path.dirname(os.path.abspath(__file__)) SATCHMO_DIRNAME = DIRNAME gettext_noop = lambda s:s LANGUAGE_CODE...
bsd-3-clause
-4,597,215,638,158,019,600
28.88
96
0.636323
false
3.410959
false
false
false
artreven/pp_api
pp_api/extractor_utils.py
1
3365
""" Extractor-related utility functions. """ from collections import defaultdict def ppextract2matches(matches, tag=None, overlaps=True): """ Convert PP extractor API results to 4-tuples specifying annotations, usable for edit operations on the input file. Overlapping tuples may optionally be remove...
mit
2,559,736,327,515,930,600
29.315315
95
0.549777
false
4.41601
false
false
false
RedHatSatellite/satellite-sanity
satellite_sanity_lib/rules/sat5_taskomatic_running.py
2
1187
#!/usr/bin/env python # -*- coding: UTF-8 -*- tags = ['Satellite_5', 'Spacewalk'] name = 'Taskomatic service is running' from satellite_sanity_lib.util import get_days_uptime def find_taskomatic_process(data): """ Check the ps output to see if taskomatic is running """ for line in data['ps_auxcww']: ...
gpl-3.0
9,127,073,422,926,538,000
30.236842
77
0.634372
false
3.420749
false
false
false
saghul/python-asiri
asiri/i2c.py
1
2033
import smbus __all__ = ['I2C'] class I2C(object): def __init__(self, address, busnum, debug=False): self._address = address self._bus = smbus.SMBus(busnum) self._debug = debug @property def address(self): return self._address def _log_debug(self, msg): prin...
mit
3,518,061,532,595,636,000
28.463768
118
0.531235
false
3.535652
false
false
false
django-danceschool/django-danceschool
danceschool/financial/migrations/0018_auto_20190412_1528.py
1
2028
# Generated by Django 2.1.7 on 2019-04-12 19:28 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import filer.fields.file class Migration(migrations.Migration): dependencies = [ ('financial', '0016_auto_20190409_0033'), ] operations = [ ...
bsd-3-clause
6,035,019,398,571,092,000
48.463415
334
0.664694
false
3.9
false
false
false
SriHarshaGajavalli/SE2017
home/serializers.py
2
2622
from rest_framework import serializers from home.models import * from django.contrib.auth.models import User #serializer for User table class UserSerializer(serializers.ModelSerializer): class Meta: model=User fields=('id','username','first_name','last_name','email') #Serializer for Personnel table class Person...
mit
-3,519,195,429,173,635,600
30.590361
104
0.768879
false
3.5625
false
false
false
ojab/bnw
bnw/handlers/command_show.py
1
7775
# coding: utf-8 import time import pymongo from base import * import bnw.core.bnw_objects as objs def get_user_bl(request, use_bl=False): """Return authed user blacklist or simply an empty list if user not authed. :param use_bl: default False. Whether we should return actual blackli...
bsd-2-clause
6,002,972,927,831,207,000
36.349515
149
0.568365
false
3.839321
false
false
false
keithito/tacotron
util/audio.py
1
4673
import librosa import librosa.filters import math import numpy as np import tensorflow as tf import scipy from hparams import hparams def load_wav(path): return librosa.core.load(path, sr=hparams.sample_rate)[0] def save_wav(wav, path): wav *= 32767 / max(0.01, np.max(np.abs(wav))) scipy.io.wavfile.write(path...
mit
4,423,930,429,883,598,300
29.94702
94
0.693345
false
2.720023
false
false
false
Zir0ne/HolyCup
Lirael/subscriber.py
1
2764
""" 莉芮尔订阅坏狗发出的每一条tick信息 本模块基于zeromq实现, 通过创建一个socket到指定端口, 我们可以收取坏狗群发的每一条tick信息 用户还可以设置关键词来过滤我们不需要的tick信息(暂未实现) """ import zmq import threading class Subscriber: """ 订阅者 """ def __init__(self, context, address, tick_filter=""): """ 构造函数 @param context 通信上下文, 进程唯一 ...
gpl-2.0
2,270,383,124,890,988,300
29.815789
107
0.553373
false
2.676571
false
false
false
dilawar/moose-core
tests/rdesigneur/test_72_CICR.py
2
3935
# This example demonstrates insertion of endo-compartments into the # dendrite. Here endo_compartments are used for the endoplasmic reticulum # (ER) in a model of Calcium Induced Calcium Release through the # IP3 receptor. It generates a series of propagating waves of calcium. # Note that units of permeability in the C...
gpl-3.0
5,079,973,801,917,832,000
40.861702
78
0.637611
false
2.318798
false
false
false
toabctl/pymod2pkg
pymod2pkg.py
1
2628
import re __version__ = '0.2.1' class TranslationRule(object): pass class SingleRule(TranslationRule): def __init__(self, mod, pkg, distmap=None): self.mod = mod self.pkg = pkg self.distmap = distmap def __call__(self, mod, dist): if mod != self.mod: return...
apache-2.0
4,438,163,807,946,193,000
24.514563
79
0.584855
false
3.541779
false
false
false
DougBurke/astropy
astropy/io/votable/exceptions.py
2
46192
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ .. _warnings: Warnings -------- .. note:: Most of the following warnings indicate violations of the VOTable specification. They should be reported to the authors of the tools that produced the VOTable file. T...
bsd-3-clause
-7,840,791,556,070,667,000
30.80854
102
0.641731
false
3.50292
true
false
false
ZombieNinjaPirate/pypkg
FileProcessing/Read.py
2
1963
""" Copyright (c) 2014, Are Hansen - Honeypot Development. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditi...
gpl-3.0
5,917,760,030,639,987,000
39.895833
100
0.741722
false
4.362222
false
false
false
kennethreitz/dynamo
dynamo.py
1
3285
# -*- coding: utf-8 -*- import boto from numbers import Number from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError class Table(object): def __init__(self, table=None, eager=False): self.table = table self.is_eager = eager def __repr__(self): return '<table \'{0}\'>'.format(...
isc
425,078,682,580,047,700
24.866142
79
0.56347
false
3.860165
false
false
false
Teagan42/home-assistant
homeassistant/components/homekit_controller/alarm_control_panel.py
2
3958
"""Support for Homekit Alarm Control Panel.""" import logging from homekit.model.characteristics import CharacteristicsTypes from homeassistant.components.alarm_control_panel import AlarmControlPanel from homeassistant.components.alarm_control_panel.const import ( SUPPORT_ALARM_ARM_AWAY, SUPPORT_ALARM_ARM_HOM...
apache-2.0
-334,830,814,066,145,860
29.21374
88
0.645528
false
3.598182
false
false
false
eljost/pysisyphus
pysisyphus/intcoords/Rotation.py
1
5573
# [1] http://dx.doi.org/10.1063/1.4952956 # Lee-Ping Wang, 2016 import numpy as np from pysisyphus.intcoords.Primitive import Primitive from pysisyphus.linalg import eigvec_grad def compare_to_geometric(c3d, ref_c3d, dR, dF, dqdx, dvdx): from geometric.rotate import get_R_der, get_F_der, get_q_der, get_expm...
gpl-3.0
-2,486,767,611,384,018,000
31.573099
86
0.49228
false
2.786393
false
false
false
hugoruscitti/quickdiagrams
quickdiagrams/pac_parser.py
1
2076
# -*- coding: utf-8 -*- import re import StringIO # Licencia: GPLv3 # Author: Pablo Codeiro # Cambios de hugoruscitti: que simule crear un archivo .sc y la función # 'get_fakefile' que se llama desde quickdiagrams. # # por supuesto, aqui iria el autor, la fecha, la version # que es GPL v3.0 y ...
gpl-3.0
-8,969,478,843,600,902,000
24
77
0.575904
false
3.002894
false
false
false
pmoleri/memorize-accesible
accessibilitytoolbar.py
1
2689
# Copyright (C) 2010 ceibalJAM! ceibaljam.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Th...
gpl-2.0
7,435,342,468,607,826,000
33.474359
102
0.643734
false
3.760839
false
false
false
Inboxen/infrastructure
inboxen/tests/test_models.py
1
2962
## # Copyright (C) 2014 Jessica Tallon & Matt Molyneaux # # This file is part of Inboxen. # # Inboxen is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, o...
agpl-3.0
5,405,453,312,505,657,000
35.121951
89
0.671168
false
3.452214
true
false
false
dmpetrov/dataversioncontrol
dvc/command/params.py
1
3018
import argparse import logging from collections import OrderedDict from dvc.command.base import CmdBase, append_doc_link, fix_subparsers from dvc.exceptions import DvcException logger = logging.getLogger(__name__) def _show_diff(diff, markdown=False): from dvc.utils.diff import table rows = [] for fnam...
apache-2.0
-343,513,829,253,882,200
28.300971
79
0.59841
false
3.976285
false
false
false
justanr/Flask-Transfer
examples/JPEGr/JPEGr/app.py
1
1036
from .config import Config from .form import UploadForm from .transfer import PDFTransfer, pdf_saver from . import utils from flask import (Flask, render_template, redirect, abort, url_for, send_from_directory) from flask_bootstrap import Bootstrap import os app = Flask(__name__) app.config.from_ob...
mit
8,498,478,475,064,519,000
25.564103
77
0.668919
false
3.407895
false
false
false
bszcz/python
lorentz_system.py
1
1115
# Copyright (c) 2009, 2014 Bartosz Szczesny <bszcz@bszcz.org> # This program is free software under the MIT license. import time import visual class Lorentz(object): def __init__(self, beta, rho, sigma, x, y, z, dt): # parameters self.beta = beta self.rho = rho self.sigma = sigma # coordinates self.x = x...
mit
879,304,051,776,253,300
21.755102
61
0.593722
false
2.397849
false
false
false
njsmith/h11
h11/tests/test_events.py
1
3711
import pytest from .._util import LocalProtocolError from .. import _events from .._events import * def test_event_bundle(): class T(_events._EventBundle): _fields = ["a", "b"] _defaults = {"b": 1} def _validate(self): if self.a == 0: raise ValueError # ba...
mit
5,725,662,533,083,317,000
29.925
78
0.552142
false
3.547801
true
false
false
opennetworkinglab/spring-open
scripts/perf-scripts/generate_flows.py
1
2622
#! /usr/bin/env python # -*- Mode: python; py-indent-offset: 4; tab-width: 8; indent-tabs-mode: t; -*- # # A script for generating a number of flows. # # The output of the script should be saved to a file, and the flows from # that file should be added by the following command: # # web/add_flow.py -f filename # # N...
apache-2.0
-6,666,195,969,652,934,000
28.133333
133
0.644546
false
2.966063
false
false
false
ChawalitK/odoo
addons/purchase/res_config.py
1
3123
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv from openerp.tools.translate import _ class purchase_config_settings(osv.osv_memory): _name = 'purchase.config.settings' _inherit = 'res.config.settings' _columns = { ...
gpl-3.0
341,948,360,128,395,300
59.057692
161
0.634006
false
4.480631
false
false
false
Cloud-Elasticity-Services/as-libcloud
libcloud/autoscale/types.py
1
2263
# 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,319,478,700,418,232,000
34.359375
78
0.719399
false
3.970175
false
false
false