repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
eci/mezzanine-people
mezzanine_people/templatetags/people_tags.py
1
1656
from django.db.models import Count from .models import Person, PersonCategory from mezzanine import template register = template.Library() @register.as_tag def people_categories(*args): """ Put a list of categories for people into the template context. """ people = Person.objects.published() ca...
mit
7,240,576,681,706,077,000
27.551724
99
0.649758
false
3.738149
false
false
false
GliderGeek/PySoar
PySoar/exportClass.py
1
14631
import datetime import xlwt from opensoar.utilities.helper_functions import add_times def ss2hhmmss(time_ss, colon=True): if time_ss is None: return None seconds = (time_ss % 3600) % 60 minutes = ((time_ss % 3600) - seconds) / 60 hours = (time_ss - (time_ss % 3600)) / 3600 if colon: ...
gpl-3.0
-7,354,456,287,760,471,000
43.880368
167
0.552662
false
3.847226
false
false
false
richardseifert/Hydra_pipeline
libs/spectra.py
1
12705
import numpy as np from scipy.interpolate import interp1d import matplotlib.pyplot as plt plt.ion() from astropy.io import fits from fitstools import common_header from html_plot import plotter def unpack_xy(use_args='all', preserve=False): def decorator(f): def wrapper(use_args, *args, **kwargs): ...
mit
500,354,099,611,034,300
38.703125
154
0.555136
false
3.271112
false
false
false
mdtraj/tftraj
examples/profile/profile.py
1
1144
import timeit import mdtraj as md import numpy as np import tensorflow as tf import tftraj.rmsd_op import tftraj.rmsd results = {} sess = tf.Session() traj = md.load(['fs_peptide/trajectory-{}.xtc'.format(i + 1) for i in range(28)], top='fs_peptide/fs-peptide.pdb') traj = traj[::100] traj_xyz = np.array(traj.xyz) tr...
mit
1,208,493,363,684,150,500
34.75
114
0.657343
false
2.635945
false
false
false
awacha/cct
attic/gui/toolframes/accounting.py
1
3520
import logging from ..core.functions import update_comboboxtext_choices from ..core.toolframe import ToolFrame from ...core.services.accounting import Accounting, PrivilegeLevel logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class AccountingFrame(ToolFrame): def __init__(self, *args, **kwarg...
bsd-3-clause
-1,270,912,631,302,270,000
46.567568
117
0.633523
false
4.433249
false
false
false
HarkDev/sklearn.onsteroids
feature_engineering/DateTransformer.py
1
1298
class DateTransformer(TransformerMixin): """ Converts a datetime type column, into 3 separate columns that represent: * year * month * day * day_of_week Parameters ********** * date_column: Name of the date column. * include_day_of_week: Defaults True. Set to False to avoid creating this column. * drop_d...
mit
776,890,732,986,759,700
32.307692
85
0.612481
false
3.406824
false
false
false
mirkolai/evaluate_post_disaster_planning_with_social_medias
004 - util script - recover admin order levels - wheter phenomena.py
1
3187
__author__ = 'mirko' import sys import time import oauth2 as oauth import json import config as cfg import MySQLdb db = MySQLdb.connect(host=cfg.mysql['host'], # your host, usually localhost user=cfg.mysql['user'], # your username passwd=cfg.mysql['passwd'], # your password db=cf...
gpl-2.0
-4,731,220,389,659,833,000
37.878049
125
0.566991
false
3.654817
false
false
false
ddurieux/alignak
test/test_escalations.py
1
31118
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors # # This file is part of Alignak. # # Alignak 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 So...
agpl-3.0
6,491,218,345,128,111,000
46.872308
126
0.584664
false
3.850637
true
false
false
michaelsmit/openparliament
parliament/alerts/views.py
1
7175
import re from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import get_object_or_404, render from django import forms from django.conf import settings from django.contrib import messages from django.core import urlresolvers from...
agpl-3.0
-7,349,912,890,321,646,000
34.519802
104
0.638188
false
3.986111
false
false
false
wking/thumbor
thumbor/url.py
1
5290
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import re from urllib import quote class Url(object): unsafe_o...
mit
-4,982,072,253,703,790,000
30.301775
119
0.46465
false
3.751773
false
false
false
faaceb/Auditoria
montarSoD.py
1
1434
# -*- coding: iso-8859-1 -*- #Arquivo contendo as funcoes e respectivas transacoes matrizConflitos = "matrizConflitosLibbs.csv" #matrizConflitos = "matrizConflitos.csv" #matrizConflitos = "matrizConflitosInternet.csv" #matrizConflitos = "matrizConflitosInternet2.csv" transacoes = "transacoes.csv" #Listas e dicionario...
gpl-3.0
-35,940,191,028,250,496
31.590909
133
0.642259
false
2.715909
false
false
false
tiagofilipe12/pATLAS
patlas/utils/node_size_n_links.py
1
3751
#!/usr/bin/env python3 import sys import json import plotly import plotly.graph_objs as go def make_histogram(trace_list): ''' Function to make an histogram from a list Parameters ---------- trace_list: list A list with all entries to the histogram (entries should be float) ''' s...
gpl-3.0
-1,156,766,333,690,464,000
35.067308
80
0.494002
false
4.439053
false
false
false
arupiot/deskcontrol
deskcontrol/modules/navigation.py
1
1502
class StateModule(object): always_tick = False def __init__(self, controller): self.id = self.__class__.__name__ self.controller = controller def draw(self): pass def try_bricklet(self, uid, device_identifier, position): pass def navigate(self, direct...
mit
8,111,437,387,768,366,000
28.04
70
0.527297
false
4.242938
false
false
false
nosyndicate/pytorchrl
pytorchrl/replay.py
1
6213
import numpy as np import rllab.misc.logger as logger from rllab.misc import special2 as special class SimpleReplayPool(object): def __init__( self, max_pool_size, observation_dim, action_dim, replacement_policy='stochastic', replacement_p...
mit
-9,150,253,699,225,256,000
35.122093
115
0.55738
false
4.095583
false
false
false
krzysztof/invenio-openaire
invenio_openaire/tasks.py
1
4010
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
gpl-2.0
-4,988,418,684,989,777,000
35.454545
78
0.715461
false
3.733706
false
false
false
111pontes/ydk-py
cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_SESS_BORDER_CTRLR_STATS_MIB.py
1
94513
""" CISCO_SESS_BORDER_CTRLR_STATS_MIB The main purpose of this MIB is to define the statistics information for Session Border Controller application. This MIB categorizes the statistics information into following types\: 1. RADIUS Messages Statistics \- Represents statistics of various RADIUS messages for RADIUS s...
apache-2.0
1,297,357,869,498,135,000
44.94701
947
0.6242
false
4.108189
false
false
false
noironetworks/horizon
horizon/workflows/base.py
1
35452
# Copyright 2012 Nebula, 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 agree...
apache-2.0
3,305,374,578,553,780,700
36.555085
79
0.596581
false
4.696873
false
false
false
saleemjaveds/https-github.com-openstack-nova
nova/db/sqlalchemy/api.py
1
221580
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
apache-2.0
2,602,919,378,681,646,600
35.253272
79
0.577223
false
4.275048
false
false
false
keon/algorithms
algorithms/tree/is_subtree.py
1
1133
""" Given two binary trees s and t, check if t is a subtree of s. A subtree of a tree t is a tree consisting of a node in t and all of its descendants in t. Example 1: Given s: 3 / \ 4 5 / \ 1 2 Given t: 4 / \ 1 2 Return true, because t is a subtree of s. Example 2: Given s: 3 ...
mit
-6,491,295,747,256,641,000
14.957746
80
0.572816
false
3.284058
false
false
false
WalrusRPG/WFont
wrpg/wfont/pack.py
1
1439
#!/bin/env python import struct import zlib from wrpg.wfont.common import (header_structure, character_entry_strucutre, PFONT_VERSION) def pack_fontdata(archive): default_char = struct.pack(character_entry_strucutre(), 0, 0, 0, 0, 0, 0) char_array = [default_char] * 256 for char in archive['chars']: ...
mit
8,490,607,961,962,444,000
36.868421
95
0.466991
false
4.597444
false
false
false
reisalex/test-sfm
examples/terminator/initdb.py
1
4066
from synbiomts import dbms from Bio import SeqIO import xlrd from openpyxl import load_workbook get = lambda cell: cell[0].value # for openpyxl # Initialize DataBase DB = dbms.DataBase() ''' ----------------------------------------------------------------------------------- Cambray, Guillaume, Joao C. Guimaraes, Vive...
gpl-3.0
3,891,673,166,296,407,000
34.365217
105
0.653222
false
2.879603
false
false
false
timohtey/mediadrop_copy
mediacore_env/Lib/site-packages/flup-1.0/flup/server/fcgi_base.py
1
38949
# Copyright (c) 2002, 2003, 2005, 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # noti...
gpl-3.0
2,389,262,307,269,843,000
32.148085
83
0.551311
false
4.242348
false
false
false
openstack/vitrage
vitrage/api_handler/apis/base.py
1
4616
# Copyright 2016 - Nokia # # 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, sof...
apache-2.0
2,543,015,688,747,234,300
30.401361
77
0.594887
false
3.55624
false
false
false
matthiaskramm/corepy
corepy/arch/vmx/isa/__init__.py
1
3324
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
bsd-3-clause
6,901,892,014,790,161,000
42.736842
80
0.595066
false
4.491892
false
false
false
imjonsnooow/synapse
synapse/compat.py
1
1088
from __future__ import absolute_import,unicode_literals ''' A module to isolate python version compatibility filth. ''' import sys import time import base64 import collections major = sys.version_info.major minor = sys.version_info.minor micro = sys.version_info.micro majmin = (major,minor) version = (major,minor,mic...
apache-2.0
8,203,169,023,927,822,000
17.758621
55
0.636949
false
3.421384
false
false
false
yusufnb/umlsequence
tailbone/__init__.py
1
5640
# 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 by applicable law or a...
apache-2.0
-7,691,145,162,515,019,000
30.333333
99
0.661525
false
3.624679
false
false
false
succhiello/hieratic-dynamodb
tests/test_flat.py
1
3792
from pytest import fixture, raises from datetime import datetime from boto3.dynamodb.conditions import Key from hieratic.collection import CollectionResource from hieratic.index import SimpleIndex @fixture def UsersResource(UserResource, ddb): @CollectionResource.define( item_class=UserResource, ...
mit
2,531,767,255,374,252,000
31.698276
119
0.565137
false
3.970681
false
false
false
qiyeboy/SpiderBook
ch15/15.3.py
1
1487
#coding:utf-8 from scrapy.dupefilters import RFPDupeFilter class URLFilter(RFPDupeFilter): """根据url过滤""" def __init__(self, path=None,debug=False): self.urls_seen = set() RFPDupeFilter.__init__(self, path) def request_seen(self, request): if request.url in self.urls_seen: ...
mit
5,596,792,075,468,190,000
28.877551
86
0.611073
false
3.106157
false
false
false
svalenti/FLOYDS_pipeline
site_code/plot_xmlguideinfo.py
1
6671
#!/opt/epd/bin/python import pyfits import os #import matplotlib #matplotlib.use('Agg') import scipy from numpy import array, where, nan from xml.dom import minidom from plot_guideinfo import plot_guideflux, plot_guidepos, plot_xposwtime, plot_yposwtime, plot_fwhmwtime, plot_guidestate def mk_guideinfo_plots(rootname...
mit
424,357,099,756,460,800
34.484043
121
0.637086
false
3.263699
false
false
false
sunlightlabs/hanuman
extraction/migrations/0001_initial.py
1
1699
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.contrib.postgres.fields import uuid class Migration(migrations.Migration): dependencies = [ ('data_collection', '0004_auto_20150512_2124'), ] operations = [ migrations....
bsd-3-clause
-7,269,391,328,728,008,000
38.511628
126
0.576221
false
4.567204
false
false
false
Ultimaker/Uranium
examples/definition_viewer/main.py
1
2488
# Copyright (c) 2017 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import sys import os.path import signal import traceback from PyQt5.QtCore import QObject, QUrl, pyqtSlot, pyqtProperty, pyqtSignal from PyQt5.QtQml import QQmlApplicationEngine, qmlRegisterType from PyQt5.QtWidgets imp...
lgpl-3.0
230,418,118,665,629,400
30.897436
98
0.67926
false
3.713433
false
false
false
mwhagedorn/basaGC
basagc/computer.py
1
11894
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- """This file contains the guts of the guidance computer""" # This file is part of basaGC (https://github.com/cashelcomputers/basaGC), # copyright 2014 Tim Buchanan, cashelcomputers (at) gmail.com # This program is free software; you can redistribute it and/or modify # ...
gpl-2.0
8,683,317,448,400,047,000
32.223464
116
0.583656
false
3.784283
false
false
false
scorpionis/docklet
src/nodemgr.py
1
6883
#!/usr/bin/python3 import threading, random, time, xmlrpc.client, sys #import network from nettools import netcontrol from log import logger import env ########################################## # NodeMgr # Description : manage the physical nodes # 1. list running nodes now # ...
bsd-3-clause
-1,103,196,115,511,232,800
41.487654
117
0.527241
false
4.214942
false
false
false
jasonleaster/Algorithm
Stack/Python_version/stack_by_two_queue.py
1
1379
class Stack(): def __init__(self, arg = []): self.Q1 = arg self.Q2 = [] def stack_empty(self): if len(self.Q1) == 0 and len(self.Q2) == 0: return True else: return False def push(self, x): if self.stack_empty() is True: self.Q1.ap...
gpl-2.0
7,906,497,586,329,862,000
20.546875
51
0.423495
false
3.221963
false
false
false
petertodd/replace-by-fee-tools
lib/python-bitcoinlib/bitcoin/core/script.py
1
34644
# Copyright (C) 2012-2015 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
gpl-3.0
-7,740,762,687,538,103,000
28.58497
146
0.570777
false
3.050185
false
false
false
DouFM/wang_fm
storage/music.py
1
1709
#!/usr/bin/env python # encoding: utf-8 import mongoengine from .base import BaseMongoStorage from config import DB_HOST, DB_PORT, DB_NAME mongoengine.connect(DB_NAME, host=DB_HOST, port=DB_PORT) class MusicStorage(BaseMongoStorage, mongoengine.Document): """store music info key str title ...
mit
-6,727,684,040,444,985,000
28.982456
86
0.607958
false
3.983683
false
false
false
bamford/astrobamf
cosmology.py
1
17513
# cosmology.py # (formerly distance_modulus.py) from math import log, sqrt, pi, sin, cos, exp from nr import erffc #from ppgplot_spb import * from checkarray import checkarray import scipy.integrate import numpy as N # WMAP 1-year results h0_WMAP1 = 0.71 H0_WMAP1 = h0_WMAP1 * 100.0 omega_m0_WMAP1 = 0.135 / h0_WMAP1**...
mit
5,570,644,595,929,895,000
31.857411
104
0.600525
false
2.5518
false
false
false
deepakgupta1313/models
syntaxnet/syntaxnet/graph_builder.py
1
23995
# Copyright 2016 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 a...
apache-2.0
-1,037,172,848,354,709,400
41.096491
80
0.612086
false
4.389062
false
false
false
MissionCriticalCloud/marvin
marvin/cloudstackAPI/addVpnUser.py
1
2003
"""Adds vpn users""" from baseCmd import * from baseResponse import * class addVpnUserCmd (baseCmd): typeInfo = {} def __init__(self): self.isAsync = "true" """password for the username""" """Required""" self.password = None self.typeInfo['password'] = 'string' ...
apache-2.0
2,789,623,737,036,903,000
32.949153
114
0.572142
false
4.13843
false
false
false
pekzeki/SoundcloudNetwork
favorite_information.py
1
1765
# import MySQLdb def getPlaylistInformation(client, user_id, favoritesCount): favoritesList = list() favorite_url = '/users/' + str(user_id) + '/favorites' for i in range(0, favoritesCount, 50): favorites = client.get(favorite_url, offset=i) favoritesList.append(favorites) return...
mit
3,434,409,342,504,076,300
29.431034
128
0.561473
false
3.580122
false
false
false
lamestation/LEAM
games/maps/03_ParallaxScrolling.py
1
1111
#/usr/bin/env python from lame import gfx from lame import map from lame import ctrl def main(): xoffset = 0 offsetw = 0 w1 = 0 dx = 0 map.start(gfx.start()) gfx.limit(gfx.FULLSPEED) cavelake = gfx.load('gfx/cavelake.png') cave = map.load('gfx/cave.tmx') cave2 = map....
gpl-3.0
-1,402,535,558,148,705,500
22.638298
53
0.49505
false
3.002703
false
false
false
sanger-pathogens/gff3toembl
gff3toembl/EMBLContig.py
1
19185
import re from textwrap import TextWrapper from six.moves.urllib.parse import unquote as gff3_unescape class EMBLContig(object): def __init__(self): self.header = None self.features = {} self.sequence = None def format(self): try: header = self.header.format() except AttributeError: ...
gpl-3.0
967,759,466,079,958,900
41.44469
134
0.666927
false
3.840841
false
false
false
vsoch/docfish
docfish/apps/users/models.py
1
7665
''' Copyright (c) 2017 Vanessa Sochat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
mit
-7,754,442,776,888,561,000
40.209677
131
0.604436
false
4.522124
false
false
false
johnthebrave/sentiment-mining
src/nn.py
1
9990
__author__ = 'alexei' import gensim from data_processing.mongo import MongoORM from data_processing.util import Timer from pprint import pprint as pp import nltk from nltk.stem import WordNetLemmatizer as wnl wnl = wnl() from pybrain.datasets import SupervisedDataSet from pybrain.supervised.trainers import BackpropT...
gpl-2.0
-3,132,925,131,072,069,600
25.571809
112
0.530831
false
3.789833
false
false
false
arturtamborski/wypok
wypok/posts/models.py
1
1761
from django.urls import reverse from django.contrib.auth import get_user_model from django.db import models from django.conf import settings from wypok.validators import FileValidator from wypok.utils.markup import markup from wypok.utils.slugify import slugify_max from sections.models import Section def posts_attac...
mit
-3,024,259,250,169,399,000
30.446429
88
0.707553
false
3.707368
false
false
false
skoslowski/gnuradio
grc/core/blocks/_build.py
1
5788
# Copyright 2016 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # from __future__ import absolute_import import itertools import re from ..Constants import ADVANCED_PARAM_TAB from ..utils import to_list from ..Messages import send_warning from .block im...
gpl-3.0
5,468,785,309,365,975,000
27.234146
87
0.555632
false
3.861241
false
false
false
LewisSarcasm/PingAI
hello.py
1
1770
import pygame, sys from pygame.locals import * import random WIDTH = 640 HEIGHT = 480 screen = pygame.display.set_mode((WIDTH, HEIGHT), 0, 32) pygame.display.set_caption("PongAI") clock = pygame.time.Clock() balls = [] for _ in range(500): ball = { "x": random.randrange(0, WIDTH), "y": random.randrange(0, HEIG...
mit
-7,116,693,056,600,813,000
29.517241
262
0.575141
false
2.411444
false
false
false
ales-erjavec/orange-bio
orangecontrib/bio/ontology.py
2
32024
""" ============================== OBO Ontology (:mod:`ontology`) ============================== This module provides an interface for parsing, creating and manipulating of `OBO ontologies <http://www.obofoundry.org/>`_. Construct an ontology from scratch with custom terms :: >>> term = OBOObject("Term", id="foo...
gpl-3.0
2,057,996,227,598,516,200
27.902527
170
0.544529
false
3.865299
false
false
false
kitefishlabs/Genomic
genomic5.py
1
16909
import sc, random, contextlib, wave, os, math import shlex, subprocess, signal import NRTOSCParser3 import numpy as np import scipy.signal # generator class for weighted random numbers # # Pass in one or the other: # - weights: custom weights array # - size: size of "standard" weights array that algo should make on ...
gpl-3.0
3,330,973,013,081,838,600
33.161616
235
0.644923
false
2.697671
false
false
false
9468305/script
geetest_offline/util.py
1
3599
#!/usr/local/bin/python3 # -*- coding: utf-8 -*- ''' geetest常用公共方法 ''' SPLIT_ARRAY_JS = ''' function getSplitArray() { for (var a, b = "6_11_7_10_4_12_3_1_0_5_2_9_8".split("_"), c = [], d = 0, e = 52; d < e; d++) a = 2 * parseInt(b[parseInt(d % 26 / 2)]) + d % 2, parseInt(...
mit
-119,942,036,943,591,280
31.669811
144
0.35332
false
2.773116
false
false
false
tseaver/google-cloud-python
talent/google/cloud/talent_v4beta1/gapic/enums.py
1
48648
# -*- coding: utf-8 -*- # # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
-5,653,163,422,906,155,000
41.673684
120
0.669812
false
4.012537
false
false
false
JeremyOT/Toto
toto/messaging.py
1
1817
from threading import Thread from traceback import format_exc import zmq import logging class MessageQueue(): def __init__(self): self.__handlers = {} self.__zmq_context = zmq.Context() self.__out_socket = self.__zmq_context.socket(zmq.PUSH) self.__thread = None self.__protocol = None self._...
mit
-1,360,145,696,010,402,300
23.226667
81
0.605394
false
3.907527
false
false
false
allspeak/api.allspeak.eu
web/project/user/views.py
1
6116
from flask import render_template, Blueprint, request, redirect, url_for, flash, abort, jsonify from sqlalchemy.exc import IntegrityError from flask_login import login_user, current_user, login_required, logout_user from threading import Thread from itsdangerous import URLSafeTimedSerializer from datetime import dateti...
mit
-7,856,011,717,960,179,000
32.977778
95
0.600065
false
3.808219
false
false
false
TuSimple/simpledet
models/FPN/assign_layer_fpn.py
1
2616
""" Assign Layer operator for FPN author: Yi Jiang, Chenxia Han """ import mxnet as mx import numpy as np class AssignLayerFPNOperator(mx.operator.CustomOp): def __init__(self, rcnn_stride, roi_canonical_scale, roi_canonical_level): super().__init__() self.rcnn_stride = rcnn_stride self.r...
apache-2.0
4,098,218,341,457,388,000
34.835616
86
0.606651
false
3.045402
false
false
false
NullRecursive/WebLanches
loja/migrations/0010_auto_20161119_2248.py
1
1216
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('loja', '0009_auto_20161117_2110'), ] operations = [ migrations.CreateModel( name='Item', fields=[ ...
mit
-4,721,522,809,531,881,000
30.179487
114
0.536184
false
4.222222
false
false
false
dhamaniasad/readitbetter
docs/conf.py
1
8452
#!/usr/bin/env python # -*- coding: utf-8 -*- # # readitbetter documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
mit
-5,454,957,879,573,766,000
29.734545
76
0.706342
false
3.710272
true
false
false
bitcraft/pyglet
contrib/scene2d/examples/los.py
1
1819
# Lots Of Sprites """ Results (us per sprite per frame): sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 28.3 29.3 20.6 22.0 after __slots__ removal sprites AMD64/mesa AMD64/nv6.6k MacBook Pro AMD/nv7.8k 2000 """ import os import sys import random from pyglet ...
bsd-3-clause
-3,383,312,969,358,007,000
21.182927
78
0.575041
false
3.031667
false
false
false
maltouzes/pixel-fighters-2D
change_background.py
1
1084
""" This file is a part of pixel-fighters-2D made by Maltouzes """ def change_background(self, keycode): """ Change the background """ if keycode[1] == '&': self.img_back.source = (self.path + '/background/fight-backgrounds-16.gif') self.default_y_character = 11...
gpl-3.0
5,851,817,295,676,720,000
40.692308
71
0.52952
false
3.712329
false
false
false
SchwarzerWolf/KSFH
modules/base.py
1
4197
#!/usr/bin/env python """ SchwarzerWolf.cc ************************** *date = '2017-10-30' * *module_version = '0.0.4'* ************************** *********************************************************************** *[KSFH - Kraftsport und Fitness Helfer] * *Module -> './modules/...
gpl-3.0
-7,002,189,345,975,905,000
33.121951
72
0.432452
false
4.537297
false
false
false
Philips14171/qt-creator-opensource-src-4.2.1
share/qtcreator/debugger/creatortypes.py
1
8306
############################################################################ # # Copyright (C) 2016 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. # # Commercial License Usage # Licensees holding valid commercial Qt licenses may use this file in # accordance with the co...
gpl-3.0
-1,459,053,719,158,352,600
31.700787
85
0.646641
false
3.333066
false
false
false
hongquan/saleor
saleor/userprofile/models.py
1
6670
from __future__ import unicode_literals import re from django.contrib.auth.hashers import (check_password, make_password, is_password_usable) from django.contrib.auth.models import BaseUserManager, PermissionsMixin from django.db import models from django.forms.models import mo...
bsd-3-clause
2,852,591,300,496,579,600
34.105263
77
0.634183
false
4.006006
false
false
false
jasonmule/arbtt-swag-reporter
arbtt2xapi.py
1
2536
#!/usr/bin/env python from __future__ import print_function import os from config import lrs, activity_map from arbtt_record import ArbttRecord from tincan import ( RemoteLRS, Statement, Agent, Verb, Activity, ActivityDefinition, Extensions, Context, LanguageMap, ) def create...
mit
-238,710,388,698,091,500
24.616162
73
0.594243
false
3.925697
false
false
false
mbuhot/mbuhot-euler-solutions
python/problem-098.py
1
2320
#! /usr/bin/env python3 from collections import defaultdict from itertools import combinations, permutations, count from math import sqrt description = ''' Anagramic squares Problem 98 By replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively, we form a square number: 1296 = 362. What is rema...
mit
7,893,644,826,818,010,000
38.322034
442
0.701293
false
3.139378
false
false
false
manpen/thrill
frontends/swig_python/python_rpyc.py
4
1113
#!/usr/bin/env python ########################################################################## # frontends/swig_python/python_rpyc.py # # Part of Project Thrill - http://project-thrill.org # # Copyright (C) 2015 Timo Bingmann <tb@panthema.net> # # All rights reserved. Published under the BSD-2 license in the LICENSE ...
bsd-2-clause
218,308,223,493,588,000
28.289474
77
0.510332
false
3.292899
false
false
false
gentimouton/swarch
pubsub-events/gamemanager.py
1
4172
""" Node connecting to the broker like a normal player, except it stores an up-to-date game state by subscribing to all in-game events, and it runs the whole game with its own tick. """ from __future__ import division # So to make division be float instead of int from network import poll_for, Handler from random imp...
mit
6,486,540,832,240,276,000
30.847328
83
0.546021
false
3.488294
false
false
false
elvandy/nltools
nltools/tests/test_analysis.py
1
1328
from __future__ import division import os import nibabel as nb import pandas as pd from nltools.simulator import Simulator from nltools.analysis import Roc from nltools.data import Brain_Data import matplotlib matplotlib.use('TkAgg') def test_roc(tmpdir): sim = Simulator() r = 10 sigma = .1 y = [0, 1]...
mit
3,994,434,864,774,681,000
30.619048
109
0.651355
false
3.066975
false
false
false
andremilke/utility
bruteforcehttppostuser.py
1
2616
import requests import datetime import sys class BruteForceService(object): def __init__(self, _listpass, _url, _user, _quote): self._listpass = _listpass self._url = _url self._user = _user self._quote = _quote def bruteForce(self): fpass = open(_listpa...
gpl-3.0
9,022,212,661,332,924,000
40.885246
172
0.487003
false
3.881306
false
false
false
jirenz/CS229_Project
hearthbreaker/cards/minions/druid.py
1
11367
from hearthbreaker.cards.base import MinionCard, ChoiceCard from hearthbreaker.game_objects import Minion from hearthbreaker.tags.action import Give, Damage, Silence, Transform, Draw, Heal, \ Summon, AddCard, GiveManaCrystal, Remove, Kill from hearthbreaker.tags.base import Choice, Buff, Effect, Battlecry, Deathrat...
mit
5,221,729,277,601,726,000
34.521875
118
0.622064
false
3.324656
false
false
false
honmaple/flask-apscheduler
sche/api.py
1
6046
#!/usr/bin/env python # -*- coding: utf-8 -*- # ************************************************************************** # Copyright © 2016 jianglin # File Name: api.py # Author: jianglin # Email: mail@honmaple.com # Created: 2016-11-11 16:05:44 (CST) # Last Update: Sunday 2018-09-30 17:50:04 (CST) # By: # D...
bsd-3-clause
1,439,876,263,449,702,100
30.649215
76
0.540116
false
3.782854
false
false
false
kbr/fritzconnection
fritzconnection/lib/fritzwlan.py
1
4692
""" Module to get informations about WLAN devices. """ # This module is part of the FritzConnection package. # https://github.com/kbr/fritzconnection # License: MIT (https://opensource.org/licenses/MIT) # Author: Bernd Strebel, Klaus Bremer import itertools from ..core.exceptions import FritzServiceError from .fritzb...
mit
-4,079,132,736,566,051,000
31.811189
87
0.610827
false
4.389149
false
false
false
wangjun/dodo-1
dodo.py
1
12198
#!/usr/bin/env python import argparse import calendar import json import re import time import os import sys from datetime import datetime from time import mktime DODO_FILE = os.path.join(os.getcwd(), 'DODO') VERSION = "0.99" class TerminalColors(object): """ Color class for listing out dodos """ HE...
bsd-3-clause
7,399,795,372,359,604,000
32.237057
115
0.523364
false
3.601417
false
false
false
slapec/yaat
dev/yaat/settings.py
1
2472
# # # Most stuff has been disabled. # See: INSTALLED_APPS, MIDDLEWARE_CLASSES, DATABASES # # # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) STATIC_URL = '/yatable/' # Quick-start development settings - unsuitab...
mit
893,957,678,182,100,600
24.484536
72
0.673139
false
3.400275
false
false
false
lcoandrade/DsgTools
core/ServerManagementTools/earthCoverageManager.py
1
3653
# -*- coding: utf-8 -*- """ /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2017-02-24 git sha ...
gpl-2.0
-2,215,078,940,906,647,600
48.364865
134
0.594032
false
4.819261
false
false
false
ualvesdias/dicgen
dicgen.py
1
2243
#!/usr/bin/env python import itertools as it import sys import progressbar as pb from time import time, ctime # The generator itself def generator(string,minLen,maxLen,prevCount): count = 0 bar = pb.ProgressBar(maxval = prevCount).start() # This for loops from the min length to the max for length in range(minLen,...
gpl-3.0
6,836,051,558,800,038,000
28.12987
85
0.666964
false
2.947438
false
false
false
virginiacc/owning-a-home
src/_lib/wordpress_journey_processor.py
1
2377
import sys import json import os.path import requests import dateutil.parser def posts_at_url(url): current_page = 1 max_page = sys.maxint while current_page <= max_page: url = os.path.expandvars(url) resp = requests.get(url, params={'page':current_page, 'count': '-1'}) resul...
cc0-1.0
1,026,639,759,227,327,500
28.7125
77
0.506521
false
3.883987
false
false
false
bashrc/zeronet-debian
src/src/lib/pyelliptic/ecc.py
1
18500
#!/usr/bin/python #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com> # See LICENSE for details. from hashlib import sha512 from .openssl import OpenSSL from .cipher import Cipher from .hash import hmac_sha256, equals from struct import pack, unpack class ECC: ...
gpl-2.0
-4,182,418,134,125,974,000
39.130152
79
0.517622
false
3.687463
false
false
false
javidombro/CGR
voip_p2p.py
1
7182
#!/usr/bin/env python3 import pyaudio import socket import sys import zlib import time import threading from threading import Thread import argparse import audioop from threading import Timer import RPi.GPIO as gpio dicIPSO = {} #Diccionario IP - StreamOutput recordEvent = threading.Event() clientEvent = threading.Ev...
gpl-3.0
-7,545,945,220,337,320,000
24.468085
111
0.574353
false
3.371831
false
false
false
Zentyal/zentyal-swift-middleware
setup.py
1
1147
#!/usr/bin/python # Copyright 2012 OpenStack, 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 a...
apache-2.0
703,918,658,693,047,300
36
74
0.691369
false
3.928082
false
false
false
marcusangeloni/smc2016
processing/feature_extraction.py
1
9777
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # Marcus de Assis Angeloni <marcus@liv.ic.unicamp.br> # Thu 7 Apr 2016 21:12:03 import numpy import bob.ip.base import bob.ip.gabor import os import sys import math import skimage.feature from skimage.feature import greycomatrix, greycoprops from scipy.stats import...
apache-2.0
-5,217,122,152,457,738,000
33.797153
144
0.542293
false
3.479359
false
false
false
adalke/rdkit
rdkit/Dbase/UnitTestDbUtils.py
1
4157
# $Id$ # # Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC # # @@ All Rights Reserved @@ # This file is part of the RDKit. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, found at the root # of the RDKit source tree. # """unit testing code ...
bsd-3-clause
924,426,392,574,821,400
29.343066
78
0.639163
false
3.255286
true
false
false
slugbucket/package-inventory-server
python/PackageInventoryServer.py
1
1237
#!/usr/bin/env python # # Run the server with # $ export FLASK_APP=PackageInventoryServer.py # $ flask run --host=0.0.0.0 # from flask import Flask, abort, request import os.path app = Flask(__name__) # # Based on http://flask.pocoo.org/docs/0.11/quickstart/#routing # @app.route('/package-inventory/<hostname>', meth...
apache-2.0
-1,550,531,850,034,835,200
24.244898
68
0.602264
false
3.334232
false
false
false
007gzs/django_restframework_apiview
apiview/code.py
1
1380
# encoding: utf-8 from __future__ import absolute_import, unicode_literals class CodeData(object): def __init__(self, code, tag, message): self.code = code self.message = message self.tag = tag def __str__(self): return str(self.code) def __eq__(self, other): if ...
lgpl-3.0
-7,000,125,340,502,342,000
25.037736
63
0.546377
false
3.976945
false
false
false
jittat/ku-eng-direct-admission
application/views/account.py
1
13340
# -*- coding: utf-8 -*- from django.http import HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render_to_response, get_object_or_404 from django.core.urlresolvers import reverse from django.conf import settings from django import forms from MySQLdb import IntegrityError from commons.utils im...
agpl-3.0
-2,274,095,997,374,761,200
40.1
102
0.537064
false
3.086358
false
false
false
eirannejad/pyRevit
pyrevitlib/rpw/db/transform.py
1
1871
""" Transform Wrappers """ import math import rpw from rpw import DB from rpw.base import BaseObjectWrapper class Transform(BaseObjectWrapper): """ `DB.Transform` Wrapper Attributes: _revit_object (DB.XYZ): Wrapped ``DB.Transform`` """ _revit_object_class = DB.Transform @classmethod...
gpl-3.0
-1,232,147,447,180,251,000
31.824561
96
0.544094
false
4.261959
false
false
false
Karaage-Cluster/python-tldap
tldap/utils.py
1
1651
# Copyright 2012-2014 Brian May # # This file is part of python-tldap. # # python-tldap is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
-3,364,013,351,599,750,000
29.018182
74
0.688674
false
4.148241
false
false
false
katsumin/HomeRpi
bp35c0_join2.py
1
1963
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys sys.path.append("/home/pi/HomeRpi") import serial import time import ConfigParser iniFile = ConfigParser.SafeConfigParser() iniFile.read('./config.ini') args = sys.argv # シリアルポート初期化 serialPortDev = iniFile.get('smartmete...
mit
-3,208,476,356,250,593,000
20.897727
56
0.622211
false
2.792754
false
false
false
cmuphyscomp/hmv-s16
Grasshopper/MocapDemo/optirecv.py
1
7577
# optirecv.py : motion capture data receiver for use within Grasshopper ghpython objects # Copyright (c) 2016, Garth Zeglin. All rights reserved. Licensed under the # terms of the BSD 3-clause license. # use RhinoCommon API import Rhino # Make sure that the Python libraries that are also contained within this course...
bsd-3-clause
5,983,820,118,657,110,000
46.955696
131
0.60776
false
4.140437
false
false
false
KarlPineau/patrimeph
lookForErrors.py
1
1377
import re import math import json import operator from collections import Counter import collections import xml.etree.ElementTree as ET import urllib.request import urllib.parse tree = ET.parse('workingDirectory/skos.rdf') root = tree.getroot() namespaces = {"skos": "http://www.w3.org/2004/02/skos/core#", ...
mit
9,186,682,194,282,567,000
32.585366
71
0.694989
false
3.604712
false
false
false
sri13/nas_sor_code
implementSOR.py
1
4374
# -*- coding: utf-8 -*- """ """ import numpy as np def get_euclid_norm(matrix): """ this function accepts one vector the calling function should compute this vector as the difference of two vectors the standard Euclidean distance formula sqrt(x1^2+x2^2+....+xn^2) is applied """ sum = 0 f...
gpl-3.0
-6,432,232,432,044,914,000
36.067797
116
0.568587
false
3.058741
false
false
false
lebinh/ministat
setup.py
1
2736
# Always prefer setuptools over distutils from setuptools import setup, find_packages # To use a consistent encoding from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: ...
mit
5,320,854,888,845,466,000
33.2125
90
0.652778
false
4.151745
false
false
false
FedericoCeratto/debian-python-logging-tree
logging_tree/tests/test_format.py
1
5711
"""Tests for the `logging_tree.format` module.""" import logging import logging.handlers import unittest import sys from logging_tree.format import build_description, printout from logging_tree.tests.case import LoggingTestCase if sys.version_info >= (3,): from io import StringIO else: from StringIO import Str...
bsd-2-clause
-7,244,357,543,753,971,000
27.989848
80
0.614778
false
3.784626
true
false
false
hunter007/baidupy
baidu/api/iplocation.py
1
1068
# -*- coding:utf-8 -*- from __future__ import unicode_literals from baidu.api.base import BaseAPI class IPLocationAPI(BaseAPI): scope = 'location' version = '' def get_location_info(self, ip='', coor=''): """ 获取 IP 对应的位置信息 1.获取指定IP的位置信息:指定IP值,返回该IP对应的位置信息; 2.获取当前设备IP的地址信息...
mit
-3,485,742,135,887,327,700
26.310345
53
0.541667
false
2.129032
false
false
false
typemytype/RoboFontExtensions
ramsaySt/RamsaySt.roboFontExt/lib/ramsayStData.py
1
3963
from AppKit import NSColor, NSObject from mojo.extensions import getExtensionDefault, setExtensionDefault, getExtensionDefaultColor, setExtensionDefaultColor _baseDefaultKey = "com.typemytype.ramsaySt" _fillColorDefaultKey = "%s.fillColor" % _baseDefaultKey _strokeColorDefaultKey = "%s.strokeColor" %_baseDefaultKey _s...
mit
6,503,598,902,005,581,000
39.865979
931
0.533434
false
3.122931
false
false
false
fuchsia-mirror/third_party-pyyaml
lib3/yaml/reader.py
1
6874
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
mit
-3,708,321,917,766,483,000
34.989529
107
0.547134
false
4.019883
false
false
false
i3visio/osrframework
osrframework/wrappers/theverge.py
1
3897
################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Softwa...
agpl-3.0
5,413,026,602,366,703,000
37.96
80
0.523101
false
4.333704
false
false
false
danielfaust/AutobahnPython
examples/serial2ws/serial2ws.py
1
4492
############################################################################### ## ## Copyright 2012 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www...
apache-2.0
-472,536,809,727,559,940
26.900621
98
0.637133
false
3.77479
false
false
false
benformosa/Toolbox
yaml2csv.py
1
1493
#!/usr/bin/env python2 import argparse import csv import itertools import sys import yaml def main(): parser = argparse.ArgumentParser( description='Convert a YAML mapping or sequence of mappings to a CSV' ) parser.add_argument( 'file', type=argparse.FileType('r...
unlicense
8,178,630,155,088,478,000
24.741379
81
0.553918
false
4.101648
false
false
false
junh1024/Reaper-Surround
Scripts/SetPanAccordingToName.py
1
1858
#Some Codes from "Rename tracks to take source filename", -- Set pan for selected track(s) (SPK77) #This script by junh1024 sets pans of tracks according to their suffixes. Useful for say, film dialogue. See global variables below for pans. from reaper_python import * from contextlib import contextmanager # import os ...
gpl-3.0
5,251,573,571,839,216,000
27.584615
161
0.705597
false
2.854071
false
false
false
rgerkin/python-neo
neo/core/block.py
1
5206
# -*- coding: utf-8 -*- ''' This module defines :class:`Block`, the main container gathering all the data, whether discrete or continous, for a given recording session. base class used by all :module:`neo.core` classes. :class:`Block` derives from :class:`Container`, from :module:`neo.core.container`. ''' # needed fo...
bsd-3-clause
-1,240,157,085,246,349,600
37.562963
87
0.599116
false
4.42311
false
false
false
tholum/PiBunny
system.d/library/tools_installer/tools_to_install/responder/tools/FindSQLSrv.py
1
1355
#!/usr/bin/env python # This file is part of Responder, a network take-over set of tools # created and maintained by Laurent Gaffie. # email: laurent.gaffie@gmail.com # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
mit
4,311,758,640,280,520,000
32.875
80
0.630996
false
3.904899
false
false
false