repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
awlange/brainsparks
src/calrissian/layers/particle_vector_n.py
1
5252
from .layer import Layer from ..activation import Activation from ..potential import Potential import numpy as np class ParticleVectorNInput(object): def __init__(self, output_size, nr=3, nv=3, sr=1.0, sv=1.0, srl=None): self.output_size = output_size self.nv = nv self.nr = nr # ...
mit
7,763,458,446,197,868,000
30.638554
114
0.532178
false
3.235983
false
false
false
mackst/myRandomStuff
plugins/clothDemo.py
1
2915
import math from maya import cmds def clothDemo(): clothNode = cmds.createNode('ClothNode') sphere, polySphere = cmds.polySphere() # plane, polyPlane = cmds.polyPlane(h=20., w=20., sh=20, sw=20, ax=(1., 0., 0.)) plane, polyPlane = cmds.polyPlane(h=20., w=20., sh=100, sw=100, ax=(1., 0., 0.)) plane...
mit
-1,426,274,627,819,959,600
51.053571
107
0.674786
false
2.959391
false
false
false
PTSD-Syntaxing/PTSD_Syntax
Reddit/reddit_analysis.py
1
2450
#! bin/var/env from bs4 import BeautifulSoup import pandas as pd import re import reddit_scrapper import xgboost as xgb from nltk.corpus import stopwords from sklearn.feature_extraction.text import CountVectorizer import numpy as np from sklearn.ensemble import RandomForestClassifier from sklearn.naive_bayes import ...
gpl-3.0
8,960,440,355,752,706,000
29.625
120
0.674694
false
3.284182
false
false
false
tensorflow/federated
tensorflow_federated/python/core/impl/executors/thread_delegating_executor_test.py
1
6760
# Copyright 2019, The TensorFlow Federated 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 o...
apache-2.0
7,938,450,476,856,298,000
31.5
86
0.663462
false
3.787115
true
false
false
leighpauls/k2cro4
third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
1
8349
# Copyright (c) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
-6,038,108,816,670,173,000
38.014019
162
0.701162
false
3.78125
true
false
false
openprocurement/openprocurement.tender.esco
openprocurement/tender/esco/tests/tender_blanks.py
1
64232
# -*- coding: utf-8 -*- from copy import deepcopy from datetime import timedelta from openprocurement.api.constants import CPV_ITEMS_CLASS_FROM from openprocurement.api.utils import get_now from openprocurement.tender.core.constants import ( NOT_REQUIRED_ADDITIONAL_CLASSIFICATION_FROM ) from openprocurement.tend...
apache-2.0
-3,795,781,734,469,964,000
47.60747
156
0.632791
false
3.577126
false
false
false
compas-dev/compas
src/compas/geometry/offset/offset.py
1
5741
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas.geometry import scale_vector from compas.geometry import normalize_vector from compas.geometry import add_vectors from compas.geometry import subtract_vectors from compas.geometry import cross_vecto...
mit
-3,099,257,915,316,053,500
27.562189
108
0.652325
false
4.060113
false
false
false
kemalakyol48/python-for-android
python3-alpha/python3-src/Tools/demo/queens.py
113
2270
#!/usr/bin/env python3 """ N queens problem. The (well-known) problem is due to Niklaus Wirth. This solution is inspired by Dijkstra (Structured Programming). It is a classic recursive backtracking approach. """ N = 8 # Default; command line overrides class Queens: def __ini...
apache-2.0
2,278,472,016,379,315,200
25.705882
74
0.440529
false
3.313869
false
false
false
acrsilva/animated-zZz-machine
lib/panelSueno.py
1
9636
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys sys.path.insert(0, '../lib') import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas import matplotlib.dates as md import colores import clustering from scipy.cluster.hierarchy import den...
lgpl-3.0
9,133,100,842,020,829,000
39.616034
198
0.624519
false
3.099839
false
false
false
legacysurvey/legacypipe
py/legacyanalysis/depth-map-from-brick-summary.py
1
4877
import matplotlib matplotlib.use('Agg') matplotlib.rcParams['figure.figsize'] = (12,8) matplotlib.rcParams['figure.dpi'] = 200 import pylab as plt from astrometry.util.fits import * import numpy as np from astrometry.util.starutil_numpy import * from astrometry.util.util import * zoom = 1 W,H = 1000,500 #W,H = 2000,1...
bsd-3-clause
-65,020,408,113,726,040
33.588652
113
0.589502
false
2.490807
false
false
false
duoduo369/python-social-auth
social/actions.py
1
4625
from social.p3 import quote from social.utils import sanitize_redirect, user_is_authenticated, \ user_is_active, partial_pipeline_data, setting_url def do_auth(strategy, redirect_name='next'): # Save any defined next value into session data = strategy.request_data(merge=False) # ...
bsd-3-clause
5,097,235,264,823,498,000
39.929204
88
0.571676
false
4.354991
false
false
false
walafc0/soclib
soclib/iss/arm/decoder/op_decoder/codegen.py
1
3347
class CodeGenerator: def __init__(self, verbose): self.__decls = [] self.__verbose = verbose self.__size = {} def gen_table(self, ns, type, name, elems, sizeof): code = [] if sizeof not in self.__size: self.__size[sizeof] = 0 self.__size[sizeof] += le...
lgpl-2.1
6,291,072,546,782,677,000
28.619469
72
0.530027
false
3.40835
false
false
false
pudo/aleph
services/ingest-file/tests/support.py
1
2614
from __future__ import absolute_import import types import unittest from tempfile import mkdtemp from servicelayer.cache import get_fakeredis from servicelayer.archive import init_archive from servicelayer.jobs import Job, Stage from servicelayer.archive.util import ensure_path from servicelayer import settings as se...
mit
2,069,494,330,305,497,300
34.324324
88
0.658378
false
3.978691
true
false
false
fangdingjun/example1
python/myweb/settings.py
1
2930
# Django settings for myweb project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '/usr/local/www/apache22/data/test/myweb/...
gpl-3.0
7,049,805,432,271,635,000
34.731707
122
0.706826
false
3.430913
false
false
false
mmarti8895/NewmanCI
newmanci/ci/ci/settings.py
1
2834
""" Django settings for ci project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import ...
gpl-3.0
-5,250,771,246,188,122,000
25.990476
88
0.713126
false
3.141907
false
false
false
elanorigby/EndlessCapitalsQuiz
ccquiz/data.py
1
1146
from random import choice from tinydb import TinyDB class Data: db = TinyDB('ccquiz/db.json') def __init__(self): """ Pick a random capital and country pair from db """ pair_dict = choice(self.db.all()) self.country = pair_dict.get('country') self.capital = pair_dict.get('capi...
apache-2.0
1,257,746,657,485,203,700
27.675
103
0.578534
false
4.276119
false
false
false
RAPD/RAPD
src/database/mysql_adapter.py
1
361733
""" This is an adapter for RAPD to connect to the control database when it is a MySQL type database. """ __license__ = """ This file is part of RAPD Copyright (C) 2009-2018, Cornell University All rights reserved. RAPD is free software: you can redistribute it and/or modify it under the terms of the GNU Affero Gener...
agpl-3.0
-6,183,556,202,561,239,000
49.472025
371
0.377898
false
5.711965
false
false
false
haitaka/DroiTaka
bot.py
1
5108
from discord.ext import commands import discord from cogs.utils import checks import datetime, re import json, asyncio import copy import logging import os, sys from cogs.utils.api.yadisk import YaDisk from cogs.utils.api.vkaudio import VkAudio description = """ Hello! I am a bot written by Haitaka to provide some nic...
mit
-5,997,547,470,641,723,000
28.022727
101
0.633516
false
3.572028
false
false
false
cliftonmcintosh/openstates
openstates/ak/committees.py
2
1705
from billy.scrape.committees import CommitteeScraper, Committee import lxml.html class AKCommitteeScraper(CommitteeScraper): jurisdiction = 'ak' def scrape(self, chamber, term): url = ("http://www.legis.state.ak.us/basis/commbr_info.asp" "?session=%s" % term) page = self.get(...
gpl-3.0
-1,445,816,536,807,721,700
30.574074
69
0.568328
false
3.479592
false
false
false
SmartElect/SmartElect
subscriptions/migrations/0001_initial.py
1
1606
# Generated by Django 2.2 on 2019-05-03 14:06 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_...
apache-2.0
-3,401,737,389,566,096,400
44.885714
145
0.633873
false
4.523944
false
false
false
liqiangnlp/LiNMT
scripts/knowledge.aware/2_ner/LiNMT-postprocess-ner.py
2
3581
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: Qiang Li # Email: liqiangneu@gmail.compile # Time: 10:27, 03/30/2017 import re import sys import codecs import argparse import random from io import open argparse.open = open reload(sys) sys.setdefaultencoding('utf-8') if sys.version_info < (3, 0): sys.stderr...
mit
6,838,986,087,462,822,000
26.335878
80
0.592851
false
3.124782
false
false
false
beni55/rinohtype
rinoh/backend/pdf/xobject/jpeg.py
1
11073
# This file is part of RinohType, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. from io import SEEK_CUR from struct import Struct, unpack...
agpl-3.0
-80,256,368,943,655,550
37.314879
80
0.56263
false
3.535441
false
false
false
jhumphry/ukraildata_etl
extract_naptancsv.py
1
5066
# extract_naptancsv.py # Copyright 2013 - 2016, James Humphry # 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. # # ...
gpl-2.0
1,359,659,088,282,830,300
36.80597
78
0.602842
false
4.092084
false
false
false
indictools/grammar
api/grammar.py
1
17667
from config import * import requests from db.mydb import * from resources.types import * from resources.collections import * import json from pprint import pprint import sys, locale, os import re def _missing_args(reqd, args): x = filter(lambda a: a not in args, reqd) #print x if x: print 'input ar...
gpl-3.0
8,831,355,319,038,666,000
35.80625
159
0.502802
false
3.40077
false
false
false
ctmarinas/stgit
stgit/commands/files.py
1
3240
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from stgit import argparse from stgit.argparse import opt from stgit.commands.common import ( CmdException, DirectoryHasRepository, color_diff_flags, parse_rev, ) from stgit.out import out __copy...
gpl-2.0
-6,432,061,950,426,316,000
35.818182
88
0.650926
false
4.004944
false
false
false
leocnj/keras_attn_reader
app/utils/argumentparser.py
1
3336
from __future__ import print_function import argparse def ArgumentParser(): parser = argparse.ArgumentParser() parser.add_argument('--dataset', type=str, default='pun', help='dataset to run NN text classifier') parser.add_argument('--exp_name', type=str, default='cnn', ...
apache-2.0
122,687,352,799,941,840
59.654545
94
0.568345
false
4.406869
false
false
false
nvazquez/Turtlebots
plugins/pattern_detection/pattern_detection.py
1
3976
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path from plugins.plugin import Plugin from TurtleArt.tapalette import make_palette from TurtleArt.taconstants import CONSTANTS from TurtleArt.taconstants import MEDIA_SHAPES, NO_IMPORT, SKIN_PATHS, EXPAND_SKIN, BLOCKS_WITH_SKIN from TurtleArt.taprimitive import ...
mit
-6,487,078,331,732,574,000
34.5
101
0.556087
false
3.976
false
false
false
odoo-arg/odoo_l10n_ar
l10n_ar_bank_reconcile/wizard/bank_reconcile_wizard.py
1
6683
# - coding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # ...
agpl-3.0
683,331,317,276,837,900
48.503704
118
0.609158
false
4.087462
false
false
false
fridex/fabric8-analytics-worker
alembic/versions/f8bb0efac483_nuget_ecosystem.py
1
2927
"""nuget ecosystem Revision ID: f8bb0efac483 Revises: e2762a61d34c Create Date: 2017-08-03 13:55:04.065158 """ # revision identifiers, used by Alembic. revision = 'f8bb0efac483' down_revision = 'e2762a61d34c' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa from sqlalchemy.diale...
gpl-3.0
-153,594,358,212,300,670
44.030769
94
0.542193
false
3.846255
false
false
false
sunrize531/cherry-common
test/test_weights.py
1
1534
from cherrycommon.mathutils import Weights import unittest class WeightsTest(unittest.TestCase): ITERATIONS = 100000 def test_tough(self): values = {'a': 0, 'b': 0, 'c': 0} weights = Weights(a=1, b=1, c=5) delta = self.ITERATIONS * 0.05 for i in range(0, self.ITERATIONS): ...
mit
-9,056,963,398,448,671,000
32.347826
73
0.559974
false
3.478458
true
false
false
sebgoa/kubeless
vendor/github.com/google/go-jsonnet/cpp-jsonnet/case_studies/micromanage/micromanage.py
5
19517
# Copyright 2015 Google Inc. 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 applicable law or ag...
apache-2.0
-7,728,460,495,454,104,000
34.102518
168
0.606036
false
3.702011
true
false
false
mckinziebrandon/DeepChatModels
chatbot/components/embedder.py
1
9211
import tensorflow as tf import logging import numpy as np from chatbot._models import Model from utils import io_utils import time class Embedder: """Acts on tensors with integer elements, embedding them in a higher-dimensional vector space. A single Embedder instance can embed both encoder and decoder by ...
mit
432,437,678,276,773,500
39.577093
89
0.57681
false
4.150969
false
false
false
grnet/snf-image-creator
image_creator/distro/netbsd.py
2
1608
# -*- coding: utf-8 -*- # # Copyright (C) 2011-2018 GRNET S.A. # # 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. # # Thi...
gpl-3.0
1,483,908,420,316,769,300
33.212766
71
0.640547
false
3.573333
false
false
false
ptressel/sahana-eden-madpub
modules/s3/s3aaa.py
1
106007
# -*- coding: utf-8 -*- """ Authentication, Authorization, Accouting @requires: U{B{I{gluon}} <http://web2py.com>} @author: Dominic König <dominic[at]aidiq.com> @copyright: (c) 2010-2011 Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obt...
mit
-8,986,092,333,707,898,000
37.673477
207
0.465539
false
4.616095
false
false
false
yuanming-hu/taichi
examples/ad_gravity.py
1
1234
import taichi as ti ti.init() N = 8 dt = 1e-5 x = ti.Vector.field(2, float, N, needs_grad=True) # position of particles v = ti.Vector.field(2, float, N) # velocity of particles U = ti.field(float, (), needs_grad=True) # potential energy @ti.kernel def compute_U(): for i, j in ti.ndrange(N, N): r = x...
mit
-3,562,567,456,440,129,500
22.730769
85
0.571313
false
2.830275
false
false
false
BYU-MarsRover/Basestation
Mars_Gui_Java_II/src/python/xbox.py
1
11637
#!/usr/bin/python # Joseph DeVictoria - BYU ECEn 493 Mars Rover - 2015. # Simple program taking input from an xbox controller using pygame library # and sending this data over a linux pipe to a java aplication. import sys, os, pygame, serial, time from contextlib import contextmanager # Global Declarations. xbox = 0 ...
gpl-2.0
4,387,253,105,659,283,000
37.533113
91
0.459311
false
3.509349
false
false
false
trhd/cmdln
test/cmdln_man_page_generation.py
1
1455
#!/usr/bin/env python """ $ python cmdln_man_page_generation.py """ import sys import cmdln class Shell(cmdln.Cmdln): def get_optparser(self): """ the parser""" optparser = cmdln.CmdlnOptionParser(self, version="1.2.3") optparser.add_option("--foobar", action="store_true", ...
mit
3,920,647,265,962,740,000
23.661017
142
0.571821
false
3.03125
false
false
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/bgp/peer_groups/peer_group/use_multiple_paths/ibgp/config/__init__.py
1
14525
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
-4,390,816,822,130,651,000
38.045699
542
0.556971
false
4.40552
true
false
false
scampion/pimpy
pimpy/video/goodshotdetector.py
1
11090
from __future__ import division import os import sys import numpy import time import logging from urlparse import urlparse from xml.etree.ElementTree import Element, ElementTree , SubElement, tostring NB_CHANNELS = 1 NB_BINS = 255 K=10 T=70 MEAN_WINDOW = 3 MOTION_THRESHOLD = 0.15 SHOT_THRESHOLD = 0.15 HIGH_C...
agpl-3.0
-6,164,803,484,854,587,000
30.151685
117
0.521461
false
3.450529
false
false
false
dbuse/pyheldenblatt
pyheldenblatt/talente.py
1
25688
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, absolute_import from builtins import object import codecs from collections import OrderedDict from pkg_resources import resource_filename from . import config class BE(object): def __init__(self, regel): self.regel = rege...
apache-2.0
8,974,717,638,011,497,000
43.871252
119
0.576841
false
2.801365
true
false
false
iotile/coretools
iotileemulate/iotile/emulate/common/emulator_errors.py
1
1555
"""Custom exceptions for iotile-emulate.""" import struct from iotile.core.exceptions import InternalError from ..constants import pack_error class RPCRuntimeError(Exception): """Exception that indicates an RPC had a runtime error. Runtime errors are application defined and are translated to a 16-bit or ...
gpl-3.0
9,088,406,927,423,666,000
34.340909
109
0.631511
false
4.29558
false
false
false
california-civic-data-coalition/django-calaccess-lobbying-browser
lobbying/models.py
1
7037
from django.db import models from django.core.urlresolvers import reverse from django.utils.text import slugify class Filer(models.Model): FILER_TYPE_OPTIONS = ( ('c', 'Client'), ('e', 'Employer'), ('f', 'Firm'), ('l', 'Lobbyist'), ('p', 'Payment to Influence'), ) #...
mit
-790,185,043,879,308,000
35.273196
78
0.635356
false
3.532631
false
false
false
janusnic/mayblog
blog/main/preblog.py
4
6226
#!/usr/bin/env python # -*- coding: utf-8 -*- # from django.db import models from django.contrib.auth.models import User, Group, Permission from django.contrib.auth import get_user_model from django.http import HttpResponse from django.views.generic import View from django.shortcuts import render, redirect from django...
gpl-2.0
9,153,030,182,982,973,000
31.097938
126
0.629778
false
4.053385
false
false
false
caioserra/apiAdwords
examples/adspygoogle/dfa/v1_20/create_spotlight_activity.py
3
2265
#!/usr/bin/python # # Copyright 2013 Google Inc. 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 b...
apache-2.0
-2,562,357,388,290,201,000
33.318182
78
0.716998
false
3.431818
false
false
false
Kitsune30/PlushieBot
loop/lib.py
2
1792
""" A library designed to simulate the NEaB chat lib (while providing debugging tools) @author: Garth """ from .writer import read_log, write_log, full_message from message import Message class Profile: def __init__(self, username): self.username = username def auth(self, password): return T...
gpl-3.0
6,113,868,977,294,597,000
24.971014
91
0.604353
false
3.895652
false
false
false
Mohi75/Terminal-Radio-Chat
main.py
1
1956
#!/usr/bin/python3 #-*- coding: utf-8 -*- from pyeez import Pyeez #import RPi.GPIO as GPIO #from lib_nrf24 import NRF24 import time #import spidev #import _thread ''' def Transmit(): global pipes global stringI global radio global isSending global stringu while isSending: radio.openWritingPipe(pipes[1]...
gpl-2.0
2,369,683,329,559,472,600
16.621622
105
0.679448
false
2.583884
false
false
false
LISTERINE/gauntlet
external_applications/drone/droneserv.py
1
1602
from ardrone import libardrone from socket import socket, gethostbyname, gethostname, AF_INET, SOCK_STREAM from json import loads def process_input(data): if data["type"] == "accel": x = data.get("x", 50) y = data.get("y", 50) # Control forward and back with y axis if y < 30: ...
mit
1,604,189,394,945,228,000
26.62069
80
0.500624
false
3.536424
false
false
false
lemiere/python-lecture
tp_stat/correction/meteo_stat.py
1
1101
#!/usr/bin/python3.5 # -*- coding: utf-8 -*- # Lemiere Yves # Juillet 2017 print("***************************") print("* Welcome in meteost@t *") print("***************************\n") my_file = open('meteo.dat', 'r') results_file = open('stat.dat', 'w') mean = 0 max = 0 min = 10000 sum = 0 iterator = 0 l...
gpl-3.0
-6,795,761,862,559,364,000
17.982759
38
0.566757
false
2.70516
false
false
false
ankanaan/chimera
src/chimera/gui/modules/canvas.py
4
7913
#!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk import bip import goocanvas import sys import os class FITSCanvas(object): CONTRAST = 1 ZOOM = 2 PAN = 3 def __init__(self, frame): self.dragging = False self.lastPos = (0, 0) self.tool = FITSCanvas.CONTRA...
gpl-2.0
8,343,200,140,766,799,000
32.816239
101
0.58663
false
3.446429
false
false
false
KirillShaman/escalate_gspread
app/__init__.py
1
5111
# The MIT License (MIT) # Escalate Copyright (c) [2014] [Chris Smith] # 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, c...
mit
-6,925,267,047,899,254,000
35.507143
104
0.745451
false
3.544383
true
false
false
Wuguanping/Server_Manage_Plugin
Openstack_Plugin/hwsushy/hwsushy/resources/system/mappings.py
2
2723
# Copyright 2017 Red Hat, Inc. # 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...
apache-2.0
8,107,506,941,848,855,000
36.30137
78
0.716856
false
2.975956
false
false
false
amarzavery/AutoRest
src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/StorageManagementClient/fixtures/acceptancetestsstoragemanagementclient/models/storage_account_check_name_availability_parameters.py
16
1078
# 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
-6,147,164,398,076,109,000
29.8
76
0.56679
false
4.548523
false
false
false
gatfieldlab/cross-organ_riboprof
data_processing_pipeline/prepare_gtf_v3.py
1
12837
# -*- coding: utf-8 -*- """ Created on Thu Aug 15 11:01:26 2013 @author: barpat """ import HTSeq import sys, argparse import quicksect from accessories import utils parser = argparse.ArgumentParser(description='Prepares transcript models for ribosome profiling analysis') parser.add_argument('-v','--verbose', help="A...
gpl-3.0
6,331,536,616,074,108,000
48.563707
167
0.502298
false
3.467585
false
false
false
FenrirUnbound/kessel-run
controllers/routes.py
1
1999
from datetime import datetime, timedelta from flask import Blueprint, Response from models.route import Route from models.timing import Timing import json route_data = Route() routes_route = Blueprint('routes', __name__) CACHE_LIFETIME = timedelta(minutes=5) CACHE = {} def check_cache(route_id): # nothing in ca...
apache-2.0
-8,909,999,669,898,983,000
22.244186
74
0.630315
false
3.494755
false
false
false
libavg/libavg
samples/app_complete.py
1
3135
#!/usr/bin/env python # -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2013-2021 Ulrich von Zadow # # This library 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 # vers...
lgpl-2.1
9,165,805,955,650,476,000
39.192308
89
0.660925
false
4.008951
false
false
false
Sorsly/subtle
google-cloud-sdk/lib/surface/compute/disks/describe.py
4
2330
# Copyright 2017 Google Inc. 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 applicable law or ag...
mit
-6,244,740,625,457,294,000
30.917808
76
0.739485
false
3.870432
false
false
false
zooniverse/aggregation
Stargazing_2015/postmortem.py
2
1896
#!/usr/bin/env python __author__ = 'ggdhines' import cPickle as pickle from postgres_aggregation import PanoptesAPI from cassandra.cluster import Cluster import json import numpy as np # stargazing = PanoptesAPI() # stargazing.__cleanup__() # metadata = pickle.load(open("/tmp/metadata.pickle","rb")) supernova_subjec...
apache-2.0
-5,587,444,772,505,967,000
28.169231
131
0.640823
false
3.478899
false
false
false
dwightgunning/django
django/core/management/commands/squashmigrations.py
162
8767
from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections, migrations from django.db.migrations.loader import AmbiguityError, MigrationLoader from django.db.migrations.migration import SwappableTuple from django.db.migrations.o...
bsd-3-clause
7,980,345,237,681,844,000
46.907104
119
0.596669
false
4.66578
false
false
false
facebookexperimental/eden
eden/scm/edenscm/mercurial/bundle2.py
2
81460
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # bundle2.py - generic container format to transmit arbitrary data. # # Copyright Matt Mackall <mpm@selenic.com> and others # # This software m...
gpl-2.0
7,312,757,192,250,301,000
34.806593
144
0.618733
false
4.069541
false
false
false
JulyKikuAkita/PythonPrac
cs15211/ZumaGame.py
1
4619
__source__ = 'https://leetcode.com/problems/zuma-game/#/description' # Time: O() # Space: O() # # Description: 488. Zuma Game # # Think about Zuma Game. You have a row of balls on the table, # colored red(R), yellow(Y), blue(B), green(G), and white(W). # You also have several balls in your hand. # # Each time, you may...
apache-2.0
4,217,206,870,564,083,700
32.722628
94
0.535397
false
3.308739
true
false
false
IsaacYangSLA/nuxeo-drive
nx_esky/__init__.py
1
2257
"""esky extension Extends the 'bdist_esky' command with: - the 'create-zipfile' option to allow not creating a zip file of the esky freeze. - the 'rm-freeze-dir-after-zipping' option to allow not removing the esky freeze directory after zipping it if 'create-zipfile' is True. """ import sys import os from esky.bdi...
lgpl-2.1
-1,662,003,914,026,719,500
34.825397
77
0.655738
false
3.565561
false
false
false
ndm25/notifyable
src/api_readers/rss_reader.py
1
2532
from api_reader_daemon import APIReaderDaemon from models import RSSFeed, RSSEntry import time import datetime import feedparser class RSSReaderDaemon(APIReaderDaemon): def __init__(self, **kwargs): # we're just accessing content over the public web # we don't need anything special. pass ...
mit
64,756,719,825,092,770
42.655172
112
0.545419
false
4.426573
false
false
false
adrn/globber
scripts/deredden-ps1.py
1
1594
""" Write out a binary file containing the PS1 data with dereddened photometry """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os # Third-party import astropy.coordinates as coord import astropy.table as table import astropy.units as u impo...
mit
7,437,596,460,485,086,000
27.981818
82
0.659975
false
3.279835
false
false
false
strogo/djpcms
djpcms/permissions.py
1
2633
'''Permission for inline editing''' from django.contrib.auth.backends import ModelBackend def get_view_permission(obj): return '%s_view' % obj._meta def get_change_permission(obj): opts = obj._meta return opts.app_label + '.' + opts.get_change_permission() def has_permission(user, permission_codename, ...
bsd-3-clause
7,629,513,528,296,460,000
33.657895
97
0.61071
false
4.352066
false
false
false
alazaro/lymph
lymph/serializers/base.py
1
3401
import abc import datetime import decimal import functools import json import msgpack import six import uuid from lymph.utils import Undefined, UndefinedType @six.add_metaclass(abc.ABCMeta) class ExtensionTypeSerializer(object): @abc.abstractmethod def serialize(self, obj): raise NotImplementedError ...
apache-2.0
-6,314,290,441,782,385,000
24.765152
100
0.648633
false
3.940904
false
false
false
emreg00/biana
biana/ext/networkx/readwrite/adjlist.py
1
13293
""" *************** Adjacency Lists *************** Read and write NetworkX graphs as adjacency lists. Note that NetworkX graphs can contain any hashable Python object as node (not just integers and strings). So writing a NetworkX graph as a text file may not always be what you want: see write_gpickle and gread_gpic...
gpl-3.0
3,411,034,849,767,695,000
30.5
92
0.565787
false
3.782869
true
false
false
VPAC/lintory
lintory/backends/auth.py
1
3661
# lintory - keep track of computers and licenses # Copyright (C) 2008-2009 Brian May # # 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 ...
gpl-3.0
6,476,693,580,126,972,000
35.979798
99
0.597105
false
4.536555
false
false
false
rizumu/deploymachine
kokki-cookbooks/redis/metadata.py
1
2089
__description__ = "Redis in-memory database" __config__ = { "redis.configfile": dict( description = "Path to the config file", default = "/etc/redis.conf", ), "redis.listen": dict( description = "All the interfaces will listen for connections", default = False, ), "r...
mit
-613,168,991,117,609,900
31.640625
130
0.580661
false
4.080078
false
false
false
thomasw/djproxy
djproxy/views.py
1
3262
"""HTTP Reverse Proxy class based generic view.""" from django import get_version as get_django_version from django.http import HttpResponse from django.views.generic import View from requests import request from six.moves.urllib.parse import urljoin from six import iteritems from .headers import HeaderDict from .prox...
mit
3,065,531,897,337,035,000
35.244444
79
0.656652
false
4.113493
false
false
false
iocoop/beancount
src/python/beancount/utils/bisect_key.py
1
1511
""" A version of bisect that accepts a custom key function, like the sorting ones do. """ __author__ = "Martin Blais <blais@furius.ca>" def bisect_left_with_key(sequence, value, key=None): """Find the last element before the given value in a sorted list. Args: sequence: A sorted sequence of elements. ...
gpl-2.0
8,901,919,603,050,866,000
25.051724
81
0.575778
false
3.730864
false
false
false
gersteinlab/AlleleDB
alleledb_pipeline/CreateMirroredGenome.py
1
2240
import random import getNew1000GSNPAnnotations import singleFasta splitTable={ 'a':('a','a'), 'c':('c','c'), 'g':('g','g'), 't':('t','t'), 'r':('a','g'), 'y':('c','t'), 's':('c','g'), 'w':('a','t'), 'k':('g','t'), 'm':('a','c'), 'n':('n','n'), } def flip(p): if random.random() < 0.50: return (p[0].lower(...
cc0-1.0
-2,915,722,704,154,094,000
28.866667
169
0.536607
false
2.901554
false
false
false
warehaus/warehaus
python-backend/warehaus_api/hardware/type_class.py
2
10678
import copy import httplib import rethinkdb as r from logging import getLogger from flask import request from flask import abort as flask_abort from flask_jwt import current_identity from ..auth.roles import require_user from ..auth.roles import require_admin from ..events.models import create_event from .models import...
agpl-3.0
5,358,260,010,073,078,000
39.911877
144
0.591028
false
4.095896
false
false
false
citrix-openstack-build/trove
trove/taskmanager/manager.py
2
4422
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
1,472,955,309,128,962,000
42.352941
78
0.651515
false
4.318359
false
false
false
sinall/ShiPanE-Python-SDK
strategyease_sdk/jobs/online_quant_following.py
1
3110
# -*- coding: utf-8 -*- from datetime import datetime from requests import HTTPError from strategyease_sdk.jobs.basic_job import BasicJob from strategyease_sdk.market_utils import MarketUtils class OnlineQuantFollowingJob(BasicJob): def __init__(self, strategyease_client, quant_client, client_aliases=None, nam...
mit
2,911,853,510,165,843,500
39.810811
119
0.50894
false
4.332855
false
false
false
weaverch/super8scan
Scripts/Capture/super8scan/perforation.py
1
3541
##################################################################### # Finds center Y value of perforation by thresholding thin vertical # # slice and averaging the Y value of white pixels. Works on film # # with black background probably not if translucent # ########################################...
bsd-3-clause
6,916,819,577,208,777,000
38.344444
84
0.563118
false
3.544545
false
false
false
simone-campagna/rubik
rubik/application/help_functions/functor_help.py
1
1188
#!/usr/bin/env python3 # # Copyright 2014 Simone Campagna # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
5,808,326,133,499,242,000
30.263158
74
0.680135
false
4.110727
true
false
false
boada/ICD
sandbox/legacy_plot_code/plot_color_vs_mass_hist.py
1
6572
#!/usr/bin/env python # File: plot_color_vs_mass.py # Created on: Mon 12 Mar 2012 12:03:42 PM CDT # Last Change: Mon 19 Mar 2012 03:27:41 PM CDT # Purpose of script: <+INSERT+> # Author: Steven Boada import pylab as pyl from mk_galaxy_struc import mk_galaxy_struc def plot_color_vs_mass_hist(): galaxies = mk_galax...
mit
1,676,228,385,591,857,200
34.717391
80
0.565581
false
2.471606
false
false
false
odb9402/OPPA
oppa/preProcess.py
1
8482
from multiprocessing import cpu_count from loadParser.loadKaryotype import run as loadKaryotype import subprocess import os import glob def split_by_chr(input_bam, valid_set, PATH, input_karyo): """ This method make subsection of bam files from input_bam and it will write that subsection as file in PATH. Those f...
mit
-7,840,958,814,972,163,000
29.731884
142
0.628507
false
2.787381
false
false
false
alphagov/notify-frontend
app/main/views/service.py
1
2785
from datetime import datetime from flask import render_template, session, redirect, url_for, flash from .. import main from . import get_template_data from app import admin_api_client from flask_login import login_required from notify_client.errors import APIError from app.main.auth import role_required from app.main...
mit
-8,993,817,560,898,633,000
33.8125
105
0.677199
false
3.63103
false
false
false
natj/bender
runs/out/reds.py
1
3348
import numpy as np import matplotlib as mpl from pylab import * from matplotlib import cm from matplotlib.colors import LogNorm mpl.rcParams['image.cmap'] = 'inferno' mpl.rc('font', family='serif') mpl.rc('xtick', labelsize='small') mpl.rc('ytick', labelsize='small') gs = GridSpec(1, 3) gs.update(hspace = 0.3) ...
mit
9,089,197,880,353,573,000
19.539877
86
0.559737
false
2.84452
false
false
false
iotile/coretools
transport_plugins/bled112/iotile_transport_bled112/bled112_auth.py
1
7686
"""Implements authentication logic.""" import enum import os import struct import hashlib import hmac from typing import Callable, Tuple from iotile.core.hw.auth.auth_chain import ChainedAuthProvider from iotile.core.exceptions import NotFoundError class AuthType(enum.Enum): AUTH_METHOD_0 = 1 << 0 # Null Key A...
gpl-3.0
-2,607,390,251,956,283,000
37.818182
110
0.644549
false
4.125604
false
false
false
ritchiewilson/majormajor
tests/ot/test_array_and_string_deletes_in_two_branches.py
1
8516
# MajorMajor - Collaborative Document Editing Library # Copyright (C) 2013 Ritchie Wilson # # 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)...
gpl-3.0
-6,976,033,874,867,371,000
30.424354
78
0.515383
false
3.503085
false
false
false
VDL-PRISM/dylos
sensors/fake_lcd.py
1
2861
from datetime import datetime import logging import os import threading import time LOGGER = logging.getLogger(__name__) def setup_sensor(config): return LCDWriter(display_aq=config['display_air_quality']) # pylint: disable=too-many-instance-attributes class LCDWriter: def __init__(self, display_aq=False)...
apache-2.0
-4,963,246,491,657,260,000
27.61
105
0.507165
false
3.749672
false
false
false
caguado/boinc-v2
sched/testasm.py
28
1493
!/usr/bin/env python import boinc_path_config from Boinc.assimilator import * class TestAssimilator(Assimilator): """ A minimal Assimilator example that dumps the result out to the log """ def __init__(self): Assimilator.__init__(self) def assimilate_handler(self, wu, results, c...
gpl-3.0
-8,039,869,492,958,597,000
35.414634
107
0.601474
false
4.013441
false
false
false
ucam-smt/sgnmt
cam/sgnmt/predictors/structure.py
1
19784
# -*- coding: utf-8 -*- # coding=utf-8 # Copyright 2019 The SGNMT 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 requir...
apache-2.0
-1,370,457,319,441,021,700
36.612167
81
0.542256
false
3.799501
false
false
false
wummel/dosage
dosagelib/plugins/f.py
2
6931
# -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam from re import compile, escape, IGNORECASE from ..util import tagre from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter class FalconTwin(_Ba...
mit
5,999,700,765,395,185,000
37.72067
131
0.610879
false
2.810624
false
false
false
Lekensteyn/Solaar
lib/logitech_receiver/common.py
2
8334
# -*- python-mode -*- # -*- coding: UTF-8 -*- ## Copyright (C) 2012-2013 Daniel Pavel ## ## 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 opti...
gpl-2.0
-1,814,283,002,115,420,400
27.541096
126
0.660787
false
3.164009
false
false
false
XinDongol/warehouse
Build_Dataset/generate-batch-from-raw-data[ImageNet]/validate.py
1
2032
#!/usr/bin/env python '''Validates a converted ImageNet model against the ILSVRC12 validation set.''' import argparse import numpy as np import tensorflow as tf import os.path as osp import models import dataset import os def save_batch(batch_output, name, ith_batch, dir_name): if not os.path.exists(dir_name): ...
mit
2,675,767,324,944,557,000
32.311475
101
0.685039
false
3.552448
false
false
false
hoyjustin/ScopusAdapter
CorsTests/test_credentials.py
1
2215
# -*- coding: utf-8 -*- """ test ~~~~ Flask-CORS is a simple extension to Flask allowing you to support cross origin resource sharing (CORS) using a simple decorator. :copyright: (c) 2014 by Cory Dolphin. :license: MIT, see LICENSE for more details. """ from tests.base_test import FlaskCorsTes...
mit
-1,913,735,262,418,055,200
28.932432
79
0.636569
false
4.012681
true
false
false
indictranstech/omnitech-frappe
frappe/setup_logging.py
43
1620
from __future__ import unicode_literals import frappe import logging import logging.config import os import json from pprint import pformat class ContextFilter(logging.Filter): """ This is a filter which injects request information (if available) into the log. """ def filter(self, record): record.form_dict = pf...
mit
5,889,012,113,784,729,000
23.923077
108
0.617284
false
3.079848
false
false
false
mattions/TimeScales
helpers/off_screen.py
1
2775
import os from shutil import copyfile import numpy as np # Getting the qt in before mayavi from PyQt4 import QtGui app = QtGui.QApplication.instance() from enthought.mayavi import mlab # Offscreen mlab.options.offscreen = True import neuronvisio.controls from neuronvisio.visio import Visio prefix = 'Data_rmt/' di...
bsd-3-clause
6,475,107,763,289,886,000
32.047619
85
0.565405
false
3.622715
false
false
false
husky-prophet/personal-backup
Pokemon/potatomon.py
1
2050
import random import codecs import time balls=20 xp=0 level=1 run_program=True pokedex=[] while run_program==True: file = open('Potato1.txt','r') list=[] for line in file: # if line.startswith(codecs.BOM_UTF8): # line = line[3:] list.append(line.strip()) #pri...
mit
-6,982,204,612,143,921,000
24.282051
84
0.481463
false
3.590193
false
false
false
keithodulaigh/Hets
FreeCAD/Plugins/fcxml-reader.py
6
1204
#!/usr/bin/python ################################################################################ # Module $Hets - FreeCAD$ #Description Reader for the XML file dumped by Hets for FreeCAD datatypes #Copyright (c) Robert Savu and Uni Bremen 2011 #License GPLv2 or higher, see LICENSE.txt # ...
gpl-2.0
-7,229,093,765,293,609,000
26.363636
80
0.474252
false
3.986755
false
false
false
dweinstein/mitmproxy
libmproxy/web/__init__.py
1
4937
from __future__ import absolute_import, print_function import collections import tornado.ioloop import tornado.httpserver import os from .. import controller, flow from . import app class Stop(Exception): pass class WebFlowView(flow.FlowView): def __init__(self, store): super(WebFlowView, self).__in...
mit
-8,778,844,302,523,044,000
24.984211
72
0.527446
false
3.924483
false
false
false
h2oai/steam
python/steam.py
1
47074
# ------------------------------ # --- This is generated code --- # --- DO NOT EDIT --- # ------------------------------ import httplib import base64 import string import json import sys import logging from collections import namedtuple class RPCError(Exception): def __init__(self, value): self.value =...
agpl-3.0
-7,116,876,956,270,008,000
21.66442
98
0.684794
false
3.272664
false
false
false
iivvoo/sodfa
sodfa/app/views.py
1
3193
from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout as dj_logout import json import couchdb couchbase = "localhost:5984" COUCH_BASE = couchbase ADMIN_USER = "admin" ADMIN_PASS = "admin" def setup_db(username): docdata = open(...
bsd-2-clause
7,847,540,512,761,088,000
35.701149
80
0.547134
false
4.109395
false
false
false
malikcjm/qtcreator
tests/system/suite_debugger/tst_simple_analyze/test.py
2
7570
############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this f...
lgpl-2.1
-1,505,351,054,951,280,400
49.13245
119
0.587847
false
4.291383
true
false
false
sunchuanleihit/vimrc
sources_non_forked/YouCompleteMe/python/ycm/client/base_request.py
1
9472
# Copyright (C) 2013 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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 vers...
mit
-5,101,806,699,912,978,000
33.823529
80
0.665329
false
4.257079
false
false
false
adampresley/Blast-for-Basis
blast/commands/CreateApp.py
1
1724
import os, sys, re import distutils.dir_util class CreateApp: __args = {} __path = "" __cwd = "" __scriptPath = "" def __init__(self, args, scriptPath): self.__args = args.command self.__cwd = os.getcwd() self.__scriptPath = scriptPath def validate(self): if len(self.__args) <= 1: print "You must p...
bsd-2-clause
-4,338,905,119,889,701,000
21.986667
138
0.62761
false
3.029877
false
false
false
aldryn/djangocms-cascade
cmsplugin_cascade/plugin_base.py
1
9347
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.exceptions import ObjectDoesNotExist from django.forms.widgets import media_property from django.utils import six from django.utils.safestring import SafeText from cms.plugin_pool import plugin_pool from cms.plugin_base import CMSPluginBas...
mit
3,475,977,866,345,279,000
44.373786
110
0.644592
false
4.044569
false
false
false