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
berkmancenter/mediacloud
apps/common/src/python/mediawords/util/colors.py
1
4207
import random from colorsys import hsv_to_rgb, rgb_to_hsv from typing import List from mediawords.db import DatabaseHandler from mediawords.util.perl import decode_object_from_bytes_if_needed __MC_COLORS = [ '1f77b4', 'aec7e8', 'ff7f0e', 'ffbb78', '2ca02c', '98df8a', 'd62728', 'ff9896', '9467bd', 'c5b0d5', ...
agpl-3.0
3,920,569,508,398,515,000
33.768595
120
0.614452
false
3.170309
false
false
false
bundgus/python-playground
matplotlib-playground/examples/user_interfaces/embedding_in_qt4_wtoolbar.py
5
2225
from __future__ import print_function import sys import numpy as np from matplotlib.figure import Figure from matplotlib.backend_bases import key_press_handler from matplotlib.backends.backend_qt4agg import ( FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QT as NavigationToolbar) from matplotlib.backend...
mit
708,373,481,128,667,900
29.067568
91
0.653034
false
3.471139
false
false
false
anthill-services/anthill-common
anthill/common/pubsub.py
1
4971
from tornado.ioloop import IOLoop from . import rabbitconn from pika.exceptions import ChannelClosed import logging import ujson class Publisher(object): def __init__(self): pass async def publish(self, channel, payload, routing_key=''): raise NotImplementedError() async def release(s...
mit
-2,485,012,216,796,939,300
28.766467
118
0.612955
false
4.212712
false
false
false
NuGrid/NuGridPy
nugridpy/regression_tests/ImageCompare/abu_chart.py
1
1292
from builtins import str from builtins import range from ... import ppn as p import os import os.path def load_chart_files(path = '.'): n = 39 nsparsity = 10 for cycle in range(0,n,nsparsity): cycle_str = str(cycle).zfill(2) os.system("wget -q --content-disposition --directory '" + path + "...
bsd-3-clause
2,772,963,692,733,972,000
48.692308
107
0.619969
false
2.708595
false
false
false
vidyar/memsql-python
memsql/common/sql_step_queue.py
1
9254
from memsql.common.connection_pool import MySQLError from memsql.common import json, errorcodes, sql_utility import time from datetime import datetime from contextlib import contextmanager PRIMARY_TABLE = """\ CREATE TABLE IF NOT EXISTS %(prefix)s_tasks ( id INT AUTO_INCREMENT PRIMARY KEY, created TIMESTAMP DE...
mit
-6,992,098,494,900,591,000
30.158249
100
0.505727
false
4.440499
false
false
false
NUKnightLab/cityhallmonitor
cityhallmonitor/management/commands/pull_pdfs.py
1
6662
import logging import pprint import re import urllib from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.db.models import F, Q from django.utils import timezone from cityhallmonitor.models import Matter, MatterAttachment from documentcloud import DocumentCloud ...
mit
-6,875,443,334,515,436,000
32.817259
91
0.574602
false
4.112346
false
false
false
dimara/synnefo
snf-cyclades-app/synnefo/logic/server_attachments.py
1
5690
# Copyright (C) 2010-2014 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. # # This program is distributed i...
gpl-3.0
733,053,273,350,417,200
37.445946
79
0.644991
false
3.934993
false
false
false
Anstow/TeamAwesome
game/hud.py
1
1406
import gm class PlayerHud: def __init__(self, player): self.player = player self.player_ident = player.player_ident self.player_text = "Player " + str(self.player_ident) + ": " self.player_score = str(player.score) self.pos = [ 20, 20 ] self.gfx = gfx if self.player_ident % 2 = 0: self.pos[0] = conf....
gpl-3.0
-5,930,283,141,110,601,000
28.291667
67
0.615932
false
2.584559
false
false
false
janisstreib/hiwi-stunden
hiwi_portal/migrations/0001_squashed_0017_fillerworkdustactivity_fixedworkdustactivity.py
1
9482
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-01-12 15:51 from __future__ import unicode_literals import datetime from django.conf import settings import django.contrib.auth.models import django.core.validators from django.db import migrations, models import django.db.models.deletion from django.utils....
mit
-7,186,392,725,970,846,000
46.41
772
0.576988
false
4.124402
false
false
false
rsalvador/appium
appium/robot/bitbeambot-d2/robot.py
2
5977
# Copyright 2012 Appium Committers # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apach...
apache-2.0
612,778,788,196,825,100
38.582781
170
0.61034
false
3.602773
false
false
false
HexHive/datashield
compiler/llvm/tools/clang/docs/tools/dump_ast_matchers.py
1
14172
#!/usr/bin/env python # A tool to parse ASTMatchers.h and update the documentation in # ../LibASTMatchersReference.html automatically. Run from the # directory in which this file is located to update the docs. import collections import re import urllib2 MATCHERS_FILE = '../../include/clang/ASTMatchers/ASTMatchers.h' ...
gpl-3.0
5,687,331,996,876,751,000
36.893048
129
0.542549
false
3.440641
false
false
false
mrkm4ntr/incubator-airflow
docs/exts/docs_build/lint_checks.py
1
8575
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-1,313,190,920,077,928,000
36.609649
106
0.63207
false
3.937098
false
false
false
baloo/shinken
shinken/external_command.py
1
78581
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2011 : # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you ...
agpl-3.0
-5,605,207,427,382,680,000
47.838409
164
0.630967
false
3.566028
false
false
false
carawalter/RiverCorridorPolygons
ManagementInterface.py
1
19417
################################################################################### # ArcGIS Interface Module for management tools # This module includes classes to interface with ArcGIS. # The class provides insulation from ArcGIS changes and provides friendlier error # messages. # Original Author: Jim Graham # Date: ...
mit
115,150,130,067,006,380
54.636103
133
0.57563
false
4.493636
false
false
false
modcloth/tory-client
tory_client/sync/joyent.py
1
1277
# vim:fileencoding=utf-8 from ..client import put_host from ..junkdrawer import stringified_dict def sync_machine(log, server, auth_token, machine): machine = machine.copy() host_def = machine.copy() for key in ('id', 'ips'): host_def.pop(key) interpreter = '/usr/bin/python' user = 'ubun...
mit
2,187,057,721,023,259,600
28.697674
58
0.555991
false
3.680115
false
false
false
MeshCollider/bitcoin
test/functional/wallet_basic.py
8
35202
#!/usr/bin/env python3 # Copyright (c) 2014-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet.""" from decimal import Decimal from itertools import product from test_framework.test...
mit
6,660,457,864,703,686,000
52.569254
193
0.630629
false
3.638854
true
false
false
Urinx/SomeCodes
Python/calc_interpreter/calc2.py
1
2562
#!/usr/bin/env python INTEGER, PLUS, MINUS, EOF = 'INTEGER', 'PLUS', 'MINUS', 'EOF' class Token(object): def __init__(self, type, value): self.type = type self.value = value def __str__(self): return 'Token({type}, {value})'.format( type = self.type, value = self.repr(v...
gpl-2.0
1,257,494,814,170,796,500
22.722222
74
0.54879
false
3.852632
false
false
false
codeforamerica/template-maker
template_maker/generator/models.py
1
1235
from template_maker.database import ( Column, Model, db, ReferenceCol ) class DocumentBase(Model): ''' Metadata about a new document, relates back to a template ''' __tablename__ = 'document_base' id = Column(db.Integer, primary_key=True) created_at = Column(db.DateTime) ...
bsd-3-clause
2,186,300,471,116,755,700
28.404762
78
0.653441
false
3.847352
false
false
false
Graghav/surabi
ADMIN/venv/lib/python2.7/site-packages/pymongo/cursor.py
11
42633
# Copyright 2009-2015 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
2,228,343,693,537,399,800
36.039965
80
0.556189
false
4.535908
false
false
false
edlund/lut
fs/mkrandtree.py
2
8204
#!/usr/bin/env python # coding: UTF-8 # Copyright (C) 2015 Erik Edlund <erik.edlund@32767.se> # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the # following conditions are met: # # * Redistributions of source code must retain the above # copyright...
bsd-3-clause
-7,953,901,000,566,019,000
30.193916
72
0.714408
false
3.264624
false
false
false
geobeda/QgisCadastrePlugin-master
forms/cadastre_search_form.py
4
24268
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'forms/cadastre_search_form.ui' # # Created: Mon Jan 27 10:07:04 2014 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromU...
gpl-3.0
-674,153,083,256,626,700
67.705382
180
0.732363
false
3.361469
false
false
false
BrambleLLC/H4H_2014
keygen.py
1
2242
import hashlib import time TYPE_USER = 0 TYPE_ADMIN = 1 #TODO: remove random element from seed generation def gen_key(username, key_type=TYPE_USER): current_time = str(int(round(time.time() * 1000))) sig = username + str(current_time) seed = (int(hashlib.sha512(sig).hexdigest(), 16)) >> 480 key_byte...
mit
-8,204,002,816,051,934,000
24.781609
69
0.512935
false
3.046196
false
false
false
openkamer/openkamer
scraper/documents.py
1
4689
import logging import requests import lxml.html import lxml.etree logger = logging.getLogger(__name__) def get_html_content(document_id): url = 'https://zoek.officielebekendmakingen.nl/{}.html'.format(document_id) response = requests.get(url, timeout=60) tree = lxml.html.fromstring(response.content) ...
mit
-7,506,058,310,461,450,000
39.076923
93
0.603114
false
3.40029
false
false
false
brucewinter/myhouse
air.py
1
26554
# -*- coding: utf-8 -*- # Monitor air quality, graph it to a local LCD, send it to a smarthouse via mqtt, and control a range hood fan for smoke control # More info at: # https://www.youtube.com/brucewinter # https://github.com/brucewinter # Note: # Local fan control via switchbot is done from the smar...
gpl-2.0
2,333,927,129,253,851,000
40.136508
250
0.548143
false
2.860252
false
false
false
facebookexperimental/eden
eden/hg-server/edenscm/hgext/amend/restack.py
2
2295
# 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. # restack.py - rebase to make a stack connected again from __future__ import absolute_import from edenscm.hgext import rebase from edenscm.mercurial i...
gpl-2.0
3,579,521,769,971,183,000
39.982143
83
0.622222
false
4.019264
false
false
false
CroceRossaItaliana/jorvik
attivita/migrations/0005_auto_20160122_1956.py
1
1811
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('attivita', '0004_auto_20160118_2059'), ] operations = [ migrations.AlterModelOptions( name='partecipazione', ...
gpl-3.0
2,532,907,146,130,208,300
37.531915
182
0.583103
false
3.772917
false
false
false
John-Gee/HFRSteam
gamesinfo.py
1
11158
import asyncio import copy from datetime import datetime import os import sys import traceback import uvloop from cache import Cache from game import Category from game import StoreData from mapper import Mapper import namematching import parallelism import progressbar import steam import styledprint import utils impo...
gpl-3.0
3,735,292,828,559,162,000
40.947368
96
0.475085
false
4.656928
false
false
false
teknolab/teknolab-wapiti
wapiti/attack/attack.py
1
4042
# Wapiti SVN - A web application vulnerability scanner # Wapiti Project (http://wapiti.sourceforge.net) # Copyright (C) 2008 Nicolas Surribas # # David del Pozo # Alberto Pastor # Informatica Gesfor # ICT Romulus (http://www.ict-romulus.eu) # # This program is free software; you can redistribute it and/or modify # it u...
gpl-2.0
-5,216,976,222,578,111,000
29.390977
82
0.591291
false
3.648014
false
false
false
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGLContext/browser/visual.py
2
10047
"""VPython as a target: Documentation on which we're basing our implementation: http://www.vpython.org/webdoc/visual/index.html What are the key determinants in the visual python API's success: geometry is simply created system has interactive operation (shell) flat hierarchies used throughout ...
lgpl-3.0
6,886,235,157,161,103,000
33.057627
96
0.606052
false
3.820152
false
false
false
dmpiergiacomo/scion
python/lib/packet/cert_mgmt.py
1
3775
# Copyright 2015 ETH Zurich # # 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
-836,124,035,748,544,900
30.991525
76
0.636556
false
3.226496
false
false
false
henrysher/opslib
opslib/icsutils/jsondiff.py
1
9312
""" JsonDiff: Library for JSON DIFF ------------------------------- +------------------------+-------------+ | This is the JsonDiff common library. | +------------------------+-------------+ """ try: import json except ImportError: import simplejson as json from opslib.icsexception import IcsException impor...
apache-2.0
-801,774,102,115,567,100
31.559441
78
0.474871
false
4.175785
false
false
false
erral/plugin.video.eitb
utils.py
1
1638
import requests API_URL = 'https://still-castle-99749.herokuapp.com' VIDEO_PLAYLIST_URL = '{0}/playlist'.format(API_URL) LAST_BROADCAST_VIDEO_PLAYLIST_URL = '{0}/last-broadcast-list'.format(API_URL) RADIO_PLAYLIST_URL = '{0}/radio'.format(API_URL) PROGRAM_TYPES_URL = '{0}/program-type-list'.format(API_URL) PROGRAM_TYP...
gpl-3.0
-5,499,499,826,162,889,000
23.833333
89
0.675824
false
3.15
false
false
false
wzhang1984/Noncoding-tumor-mutation-paper
annotate_mutations/annotate_mut_GeneHancer.py
1
2878
# Annotate noncoding mutations using GeneHancer # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5467550/ import sys fn_prefix = sys.argv[1] merge_size = sys.argv[2] occurrence_cutoff = int(sys.argv[3]) binsize = 10000 print 'Reading GeneHancer_hg19' bin2GeneHancer = {} fn = '/cellar/data/users/wzhang1...
gpl-3.0
-6,248,541,469,730,508,000
31.08046
130
0.567755
false
2.970072
false
false
false
pawaranand/phr_frappe
frappe/website/statics.py
17
5584
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, time def sync_statics(rebuild=False): s = sync() s.verbose = True # s.start(rebuild) # frappe.db.commit() while True: s.start(rebuild) frappe.db.c...
mit
-7,153,857,291,017,994,000
31.277457
136
0.6601
false
2.945148
false
false
false
pjryan126/solid-start-careers
store/api/zillow/venv/lib/python2.7/site-packages/pandas/core/window.py
1
49027
""" provide a generic structure to support window functions, similar to how we have a Groupby object """ from __future__ import division import warnings import numpy as np from collections import defaultdict import pandas as pd from pandas.lib import isscalar from pandas.core.base import PandasObject, SelectionMix...
gpl-2.0
-124,270,254,565,814,900
32.419905
95
0.571155
false
4.108867
false
false
false
ternaris/marv-robotics
code/marv/marv_node/stream.py
1
5996
# Copyright 2016 - 2018 Ternaris. # SPDX-License-Identifier: AGPL-3.0-only # pylint: disable=import-outside-toplevel from collections import deque from itertools import count from numbers import Integral from capnp.lib.capnp import KjException from marv_api.setid import SetID from marv_api.utils import NOTSET, err...
agpl-3.0
6,142,566,103,589,658,000
27.688995
98
0.594563
false
3.85843
false
false
false
satheeshgopalan/python
CurrencyConverter.py
1
1588
""" GUI APP to convert currency 1 to currency 2's value given exchange rate #Author : Satheesh Gopalan """ import Tkinter from Tkinter import * import tkMessageBox def OnClick(): """ Handle the Button click's Gets input Verifies that input is valid """ currency1 = 0 ex...
mit
-4,386,792,213,332,889,600
19.358974
123
0.600126
false
3.125984
false
false
false
Gab0/gekkoJaponicus
evaluation/gekko/statistics.py
1
2549
#!/bin/python from deap import tools import numpy as np epochStatisticsNames = { 'avg': 'Average profit', 'std': 'Profit variation', 'min': 'Minimum profit', 'max': 'Maximum profit', 'size': 'Population size', 'maxsize': 'Max population size', 'avgTrades': 'Avg trade number', 'sharpe':...
mit
-2,450,411,621,466,724,000
33.917808
81
0.633582
false
3.667626
false
false
false
tclose/FouTS
sysconf/linux.py
1
1244
from sysconf.common import * obj_suffix = '.o' exe_suffix = '' lib_prefix = 'lib' lib_suffix = '.so' cpp = [ 'g++', '-c', '$flags$', '$path$', '$src$', '-o', '$obj$' ] cpp_flags = [ '-Wall', '-march=x86-64', '-fPIC', '-Wno-deprecated'] cflags_thread = [] ld = [ 'g++', '$flags$', '$path$', '$obj$', '$mrtrix$', '-o',...
gpl-3.0
4,048,223,657,805,592,600
28.619048
136
0.545016
false
2.424951
false
false
false
stephane-martin/salt-debian-packaging
salt-2016.3.2/salt/modules/influx.py
2
16445
# -*- coding: utf-8 -*- ''' InfluxDB - A distributed time series database Module to provide InfluxDB compatibility to Salt (compatible with InfluxDB version 0.5+) .. versionadded:: 2014.7.0 :depends: - influxdb Python module :configuration: This module accepts connection configuration details either as param...
apache-2.0
-6,111,658,236,898,173,000
23.954476
109
0.593676
false
4.193014
false
false
false
splanger/dbmake
dbmake/helper.py
1
1625
import pyclbr import re def find_string_between(s, start, end): """ Returns a substring between two other substrings :param s: Text :param start: A substring to start extracting the desired substring from :param end: A substring to stop extracting the desired substring on :return: """ ...
apache-2.0
-2,724,419,628,980,167,700
29.660377
108
0.669538
false
3.611111
false
false
false
sobomax/virtualbox_64bit_edd
src/VBox/ValidationKit/testmanager/webui/wuireport.py
2
6010
# -*- coding: utf-8 -*- # $Id: wuireport.py $ """ Test Manager WUI - Reports. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify ...
gpl-2.0
401,514,084,464,273,340
37.037975
126
0.624958
false
3.703019
true
false
false
darongliu/Lstm_Turing_LM_tf
all_model_prototype/model.py
1
7416
import tensorflow as tf def inference(input_x, embedding_dim, lstm_hidden_dim_1, lstm_hidden_dim_2=None, vocab_size, dropout=None) : """ Args: input_x: 2D tensor batch_size X time_step embedding_dim: embedding dimension hidden_unit_list: list of the hidden unit size lstm_hidden_dim_1: the dimen...
mit
-7,664,722,447,724,385,000
43.674699
133
0.628506
false
3.447699
false
false
false
mice-software/maus
bin/online/reconstruct_daq_emr_reducer.py
1
2746
#!/usr/bin/env python ################################################################# ###!!! YOU ARE NOT ALLOWED TO MODIFY THIS FILE DIRECTLY !!!### ###!!! PLEASE MAKE A COPY OF THIS FILE WITH THE CP COMMAND !!!### ################################################################# """ Online analysis to produce r...
gpl-3.0
-276,372,884,407,744,030
36.616438
77
0.645302
false
3.584856
false
false
false
teamtuga4/teamtuga4ever.repository
script.module.urlresolver/lib/urlresolver/plugins/idowatch.py
3
1963
""" grifthost urlresolver plugin Copyright (C) 2015 tknorris 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. This program is d...
gpl-2.0
5,450,925,819,580,143,000
35.351852
106
0.640856
false
3.608456
false
false
false
cabalamat/parrot
util.py
1
2858
# util.py # # (c)1999 Philip Hunt # # Various python utility functions # Last altered: 11-May-1999 # History: # 28-Apr-1999 PhilHunt: created # 11-May-1999 PH: added savePickle(), loadPickle() functions import string, os, stat, pprint from cPickle import * #----------------------------------------------------------...
gpl-2.0
-4,633,167,410,953,049,000
22.235772
60
0.475507
false
3.673522
false
false
false
GeosoftInc/gxapi
spec/core/VULCAN.py
1
5218
from .. import Availability, Class, Constant, Define, Method, Parameter, Type gx_class = Class('VULCAN', doc="The :class:`VULCAN` class is used for importing Maptek® Vulcan block and triangulation files.") gx_defines = [ Define('BLOCK_MODEL_VARIABLE_TYPE', doc="Which variables to retu...
bsd-2-clause
3,033,769,105,831,783,000
47.305556
126
0.51773
false
4.88941
false
false
false
ryfeus/lambda-packs
Tensorflow/source/tensorboard/main.py
1
2214
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mit
-1,357,330,156,759,209,000
34.709677
80
0.69467
false
4.122905
false
false
false
visitor83/fighting_stm32
bsp/fighting/rtconfig.py
1
3487
import SCons.cpp # component options # make all component false RT_USING_FINSH = False RT_USING_DFS = False RT_USING_DFS_ELMFAT = False RT_USING_DFS_YAFFS2 = False RT_USING_LWIP = False RT_USING_WEBSERVER = False RT_USING_RTGUI = False # parse rtconfig.h to get used component PreProcessor = SC...
gpl-2.0
1,810,656,682,017,844,500
24.022388
130
0.580728
false
2.713619
true
true
false
aksheus/Detect-Depression
generate_test_data.py
1
1925
""" Generates test data choose a chunk and it distributes it randomly so that Feature Space Tree can build the required vectors USAGE : generate-test_data.py path_to_test_data path_to_target_folders which_chunk_to_distribute """ # <imports> import os import sys from random import shuffle from ...
mit
-3,005,639,251,030,700,500
21.137931
103
0.676883
false
3.181818
false
false
false
crscardellino/dnnwsd
preprocess/semeval_vec.py
1
2689
#!/usr/bin/env python # -*- coding: utf-8 -*- # Add dnnwsd to the path import sys from os import path sys.path.append(path.abspath(path.dirname('../'))) import cPickle as pickle import uuid import numpy as np import gensim # Change the log config file to relative path from dnnwsd.utils import setup_logging setup_l...
bsd-3-clause
-4,322,636,156,738,971,000
34.381579
116
0.731871
false
3.487678
false
false
false
alevy/Dunbarify
models/account.py
1
2191
# Copyright (c) 2011 Amit Levy <amit@amitlevy.com> # # 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,...
mit
-512,721,832,861,470,140
45.638298
125
0.748973
false
4.027574
false
false
false
tikael1011/aiflee_python
Localization and Evaluation/count_result_on_org.py
1
2964
#UTF-8 Jie ''' This is about the basic footprint method to evaluate accuray, results includes several parameters. Will have details below ''' import os import statistics import math import numpy as np import statsmodels.api as sm import matplotlib.pyplot as plt import tkinter as tk from collections import Counter ...
gpl-3.0
-7,874,098,802,753,997,000
22.712
121
0.659919
false
3.093946
false
false
false
wangjun/pyload
module/plugins/hoster/DlFreeFr.py
2
7894
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import pycurl from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo, replace_patterns from module.common.json_layer import json_loads from module.network.Browser import Browser from module.network.CookieJar import CookieJar class Custom...
gpl-3.0
-8,672,376,838,864,295,000
38.253731
146
0.57275
false
3.431927
false
false
false
google/b-con
handlers/dv360_handler.py
1
10385
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
7,724,194,224,648,506,000
28.171348
81
0.648146
false
3.646419
false
false
false
adkerr/tempest
tempest/services/network/json/network_client.py
1
26276
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicabl...
apache-2.0
1,793,466,490,960,584,200
35.647141
79
0.562947
false
3.542195
false
false
false
SeyVu/subscription_renewal
telecom_churn.py
1
7941
######################################################################################################### # Description: Main file for telecom_churn dataset. Key function is to transform dataset into needed # input_features and output ###################################################################################...
mit
-5,764,745,351,355,387,000
37.548544
119
0.581287
false
3.956652
false
false
false
davy39/eric
Preferences/ConfigurationPages/Ui_EditorAPIsPage.py
1
7873
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Preferences/ConfigurationPages/EditorAPIsPage.ui' # # Created: Tue Nov 18 17:53:57 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui...
gpl-3.0
-3,366,846,485,868,375,600
63.532787
155
0.742665
false
3.884065
false
false
false
ozsolarwind/siren
powermodel.py
1
132240
#!/usr/bin/python3 # # Copyright (C) 2015-2020 Sustainable Energy Now Inc., Angus King # # powermodel.py - This file is part of SIREN. # # SIREN 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, eith...
agpl-3.0
-7,718,492,627,276,156,000
47.564084
128
0.419427
false
4.015181
false
false
false
divergentdave/inspectors-general
inspectors/pbgc.py
3
7559
#!/usr/bin/env python import datetime import logging import os import re from urllib.parse import urljoin from utils import utils, inspector # http://oig.pbgc.gov/ archive = 1998 # options: # standard since/year options for a year range to fetch from. # # Notes for IG's web team: # AUDIT_REPORTS_URL = "http://oi...
cc0-1.0
4,551,702,568,992,596,000
30.894515
105
0.671385
false
3.157477
true
false
false
TotalF2PSkillers/f2p-state
runeclan/xp_tracker.py
1
1932
import requests from lxml import html import runeclan.scraper_utils as scraper BASEPATH='http://www.runeclan.com/clan/' XP_TRACKER_PATH='/xp-tracker/' CRITERIA1_PARAM='criteria_set1' CRITERIA2_PARAM='criteria_set2' SKILL_PARAM='skill' LAST_MONTH_CRITERIA='last_month' CURRENT_MONTH_CRITERIA='month' DOUBLE_WP_WEEKEND_...
apache-2.0
2,997,439,324,685,730,000
34.796296
134
0.689959
false
3.004666
false
false
false
SnowWalkerJ/quantlib
quant/data/wind/tables/ashareholdernumber.py
1
1168
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class AShareHolderNumber(BaseModel): """ 4.37 中国A股股东户数 Attributes ---------- object_id: VARCHAR2(100) 对象ID s_info_windcode: VARCHAR2(40) Wind代码 ...
gpl-3.0
5,777,270,374,049,963,000
26
109
0.614035
false
2.353211
false
false
false
shub0/algorithm-data-structure
python/tree_traversal.py
1
6044
#! /usr/bin/python ''' Binary Tree Traversal ''' from node_struct import TreeNode class Solution: def preOrderTraversalNonRecursive(self, root): output = list() nodes_in_tree = list() current_node = root while len(nodes_in_tree) > 0 or current_node: while current_node:...
bsd-3-clause
7,991,569,660,289,871,000
31.847826
76
0.506287
false
4.341954
false
false
false
pmacosta/putil
docs/support/pcsv_example_5.py
1
1211
# pcsv_example_5.py # Copyright (c) 2013-2016 Pablo Acosta-Serafini # See LICENSE for details # pylint: disable=C0111,C0410,W0104 import putil.misc, putil.pcsv def main(): ctx = putil.misc.TmpFile with ctx() as ifname: with ctx() as ofname: # Create first data file data = [ ...
mit
-8,343,569,794,735,711,000
27.833333
61
0.410405
false
3.58284
false
false
false
victoredwardocallaghan/xen
tools/python/xen/util/acmpolicy.py
44
60076
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
7,286,991,950,228,136,000
36.038224
186
0.534323
false
3.766284
false
false
false
FTSRG/mondo-collab-framework
integration/uk.ac.york.mondo.integration.eclipse.product/generate-p2inf.py
1
6558
#!/usr/bin/env python3 import argparse ENTRIES_NOGPL = ( ('fr.inria.atlanmod.mondo.integration.cloudatl.cli.feature.feature.group', '[0.0.0,2.0.0)'), ('org.eclipse.ecf.core.feature.feature.group', '[1.1.0,2.0.0)'), ('org.eclipse.ecf.core.ssl.feature.feature.group', '[1.0.0,2.0.0)'), ('org.eclipse.ecf....
epl-1.0
707,290,959,912,996,600
65.242424
105
0.657823
false
2.394304
false
false
false
jyotiska/colorweave
setup.py
1
1640
#!/usr/bin/env python from distutils.core import setup import sys, os, multiprocessing import colorweave requires = [] py_version = sys.version_info[:2] PY3 = py_version[0] == 3 if PY3: raise RuntimeError('colorweave runs only on Python 2.6 or Python 2.7') else: if py_version < (2, 6): ...
gpl-2.0
400,651,015,008,337,540
28.943396
83
0.604878
false
3.620309
false
false
false
jbergantine/django-blog
tests/test_settings.py
1
2101
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = 'fake-key' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sites...
mit
5,818,926,728,844,144,000
20.885417
83
0.623037
false
3.41626
false
true
false
liugangabc/ccs_web
protocol/proto_indexResponseCheckAgentInfo_pb2.py
1
4660
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: proto_indexResponseCheckAgentInfo.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import descriptor_pb2 # @@protoc_...
apache-2.0
-1,883,150,462,296,093,200
37.833333
414
0.741845
false
3.369487
false
false
false
cvandeplas/plaso
plaso/formatters/skype.py
1
2395
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
apache-2.0
-3,638,039,270,999,130,000
26.215909
78
0.692276
false
3.486172
false
false
false
djkonro/client-python
kubernetes/client/models/v1_pod_condition.py
2
7465
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
5,466,332,796,939,748,000
28.741036
166
0.576825
false
4.312536
false
false
false
code-sauce/tensorflow
scripts/sr_classify_image.py
1
11313
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
300,159,668,755,227,650
37.090909
149
0.632458
false
3.753484
false
false
false
changbindu/rufeng-finance
src/stock.py
1
8402
# coding=utf-8 __author__ = 'Du, Changbin <changbin.du@gmail.com>' import json import datetime import logging from collections import MutableMapping import numpy as np from pandas import DataFrame class StockBase(object): def __init__(self, code=None, name=None): # Basic info self.code = code # 代...
lgpl-3.0
-4,006,361,539,967,852,000
30.40081
110
0.557891
false
2.835832
false
false
false
thomas-hinterecker/SQUARELAND2.0
Miscellaneous/OpenSesame/squareland2/squareland2.py
1
2893
# Import the required modules. import shutil import subprocess from os import chdir from os import listdir from os.path import isfile, join import pygame import psychopy from libopensesame import debug from libopensesame.item import item from libqtopensesame.items.qtautoplugin import qtautoplugin class squareland2(it...
gpl-2.0
-7,096,678,303,757,643,000
24.610619
99
0.646733
false
3.035677
false
false
false
HerdOfBears/Learning_Machine_Learning
Reinforcement Learning/cart_pole_bins.py
1
6641
import pandas as pd import gym import numpy as np import matplotlib.pyplot as plt GAMMA = 0.9 ALL_POSSIBLE_ACTIONS = [0,1] def random_action(a, epsilon): p = np.random.rand() if p < epsilon: action = np.random.choice(ALL_POSSIBLE_ACTIONS) else: action = a return action def max_dict(dictionary, s): # dict...
mit
7,232,982,705,181,853,000
22.633452
111
0.622045
false
2.54835
false
false
false
RickyCook/DockCI
dockci/views/project.py
2
2165
""" Views related to project management """ from flask import abort, redirect, render_template, request from flask_security import current_user from dockci.api.job import filter_jobs_by_request from dockci.models.project import Project from dockci.server import APP from dockci.util import str2bool def shields_io_sa...
isc
-5,097,623,252,212,684,000
27.486842
74
0.625866
false
3.81162
false
false
false
Triv90/Heat
heat/tests/test_api_openstack_v1.py
1
71334
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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
6,338,218,931,821,207,000
37.831791
79
0.496664
false
4.293349
true
false
false
gcblue/gcblue
scripts/PointDefense.py
1
2779
from UnitCommands import * from GroupCommands import * import math import random def GetPointDefenseLaunchers(UI): # build list of all launcher info launcher_list = [] nLaunchers = UI.GetLauncherCount() for n in range(0, nLaunchers): launcher_info = UI.GetLauncherInfo(n) if ((laun...
bsd-3-clause
-7,219,447,971,578,728,000
34.177215
136
0.618928
false
3.705333
false
false
false
mmlab/eice
EiCGraphAlgo/core/search.py
1
13717
import time,gc,logging,pickle,os,sys,math from urllib.parse import urlparse from core.worker_pool import Worker from core.pathfinder_async import PathFinder from core import randompath, graph from core import config_search logger = logging.getLogger('pathFinder') query_log = logging.getLogger('query') blacklist = con...
agpl-3.0
-3,783,267,506,170,892,000
41.735202
160
0.5908
false
3.753968
false
false
false
stvstnfrd/edx-platform
openedx/tests/xblock_integration/test_done.py
5
3815
''' Tests for the DoneXBlock. This is nice as a simple example of the edX XBlock test framework. ''' from openedx.tests.xblock_integration.xblock_testcase import XBlockTestCase # pylint: disable=abstract-method class TestDone(XBlockTestCase): """ Simple tests for the completion XBlock. We set up a page wit...
agpl-3.0
2,928,645,477,135,331,300
34.990566
96
0.585059
false
3.949275
true
false
false
shawnhermans/cyborg-identity-manager
cyborg_identity/location/apps.py
1
1555
from django.apps import AppConfig from django_graph.registry import registry import sys from cyborg_identity import router current_module = sys.modules[__name__] class CyborgIdentityLocationConfig(AppConfig): name = 'cyborg_identity.location' def ready(self): Geohash = self.get_model('GeoHash') ...
mit
5,853,332,208,678,880,000
24.916667
69
0.554984
false
4.146667
false
false
false
allenai/allennlp
allennlp/training/metrics/auc.py
1
5313
from typing import Optional from overrides import overrides import torch import torch.distributed as dist from sklearn import metrics from allennlp.common.util import is_distributed from allennlp.common.checks import ConfigurationError from allennlp.training.metrics.metric import Metric @Metric.register("auc") clas...
apache-2.0
6,154,903,549,579,065,000
38.355556
111
0.599097
false
4.1218
false
false
false
sony/nnabla
python/test/solver/test_amsbound.py
1
3174
# Copyright 2019,2020,2021 Sony Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
1,245,892,378,135,716,400
37.240964
136
0.619408
false
3.046065
true
false
false
hpparvi/PyTransit
pytransit/lpf/ttvlpf.py
1
6189
# PyTransit: fast and easy exoplanet transit modelling in Python. # Copyright (C) 2010-2019 Hannu Parviainen # # 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 Licen...
gpl-2.0
8,891,468,421,198,459,000
44.844444
120
0.605267
false
3.091409
false
false
false
nirmeshk/oh-mainline
mysite/profile/migrations/0036_make_person_nullable.py
17
12132
# This file is part of OpenHatch. # Copyright (C) 2009 OpenHatch, Inc. # # 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 License, or # (at your option) any later v...
agpl-3.0
4,257,737,274,522,573,300
63.190476
146
0.572618
false
3.744444
false
false
false
Edraak/circleci-edx-platform
lms/djangoapps/edraak_forus/helpers.py
1
6397
import logging import hmac from urllib import urlencode from hashlib import sha256 from collections import defaultdict from datetime import datetime, timedelta from django_countries import countries from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse from django.conf import...
agpl-3.0
50,745,825,195,102,190
28.344037
98
0.624355
false
4.098014
false
false
false
hbuyse/VBTournaments
accounts/migrations/0001_initial.py
1
1569
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
mit
7,488,885,610,189,463,000
53
391
0.604725
false
3.764423
false
false
false
dprog-philippe-docourt/django-qr-code
qr_code/qrcode/maker.py
1
3002
"""Tools for generating QR codes. This module depends on the Segno library.""" import io from typing import Mapping, Any from django.utils.html import escape from django.utils.safestring import mark_safe import segno from qr_code.qrcode.constants import DEFAULT_CACHE_ENABLED, \ DEFAULT_URL_SIGNATURE_ENABLED from q...
bsd-3-clause
-1,548,420,874,700,346,000
37.487179
154
0.673884
false
3.462514
false
false
false
jbarlow83/OCRmyPDF
misc/watcher.py
1
5818
# Copyright (C) 2019 Ian Alexander: https://github.com/ianalexander # Copyright (C) 2020 James R Barlow: https://github.com/jbarlow83 # # 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...
gpl-3.0
687,988,929,171,311,200
34.048193
84
0.670677
false
3.600248
false
false
false
michele-mada/cv-eyetracking-project-2017
py_eyetracker_v1.0/utils/camera/capture.py
1
2196
from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, contrast=None, saturation=None, debug=False): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) self.saved_contrast = None ...
mit
-6,668,825,792,570,327,000
36.237288
83
0.622495
false
4.029358
false
false
false
recessburton/FTPScanner
IPRangeCalc.py
1
1526
#! /usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C),2014-2015, YTC, www.bjfulinux.cn Created on 2015-09-24 16:40 @author: ytc recessburton@gmail.com @version: 1.0 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...
gpl-3.0
-8,623,088,591,869,231,000
32.173913
69
0.633028
false
3.199161
false
false
false
KatiRG/flyingpigeon
flyingpigeon/processes/wps_c4i_percentile_indice.py
1
11688
from pywps.Process import WPSProcess import icclim import icclim.util.callback as callback import dateutil.parser from datetime import datetime import os from os.path import expanduser #from mkdir_p import * from flyingpigeon.utils import make_dirs transfer_limit_Mb = 100 import logging logger = logging.getLogger(...
apache-2.0
4,282,581,633,001,511,400
48.948718
285
0.488193
false
4.159431
true
false
false
maxli99/SmartChecker
modules/flexins/TN_CN_20151124_IPDU_FreeMem.py
1
9078
# -*- coding: utf-8 -*- u"""FlexiNS/MME IPDU空闲内存持续减少的问题 - NS/MME软件版本为NS3.15, NS3.15.1 - ACPI4-A& ACPI4-B 解决方法:单元倒换或重启 """ import re from libs.checker import ResultInfo,CheckStatus ## Mandatory variables ##----------------------------------------------------- #check_id = '20160308.TN20151013' module_id = 'NS...
mit
607,413,475,795,255,300
27.664407
110
0.641675
false
2.174338
false
false
false
ahammel/Exasott
exasott/test/test_board.py
1
1758
"""Unit tests for the exasott.boards module. """ from exasott import boards, test import pytest class SetupBoardTest(object): """Shared objects for all exasott.board test classes. """ normal_board = boards.Board(8, 8) rectangle_board = boards.Board(2, 6) rectangle_board_str = (" AB\n" ...
bsd-3-clause
5,777,333,420,259,835,000
28.3
76
0.562571
false
3.838428
true
false
false
sisap-ics/sisaptools
sisaptools/database.py
1
21481
# -*- coding: utf8 -*- """ Eines per a la connexió a bases de dades relacionals (Oracle i MariaDB) i la manipulació de les seves dades i estructures. """ import datetime import os import random import time import cx_Oracle import MySQLdb.cursors from .constants import (APP_CHARSET, IS_PYTHON_3, TMP_FOLDER, ...
mit
8,641,174,514,809,038,000
42.802041
79
0.499837
false
4.092868
false
false
false
zestrada/nova-cs498cc
nova/tests/api/openstack/compute/contrib/test_baremetal_nodes.py
7
9013
# Copyright (c) 2013 NTT DOCOMO, 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 requ...
apache-2.0
-2,591,924,370,840,028,000
40.155251
78
0.564629
false
3.683286
true
false
false
simba518/CollisionHandle
script/rename.py
1
1061
#! /usr/bin/env python import os import glob def addSubFold(file_path): file_name = os.path.basename(file_path) file_dir = os.path.dirname(file_path) sub_fold = file_dir + "/" + file_name[0:5] if not os.path.exists(sub_fold): os.makedirs(sub_fold) return sub_fold + "/" + file_name def cha...
apache-2.0
4,502,206,236,536,143,400
30.205882
69
0.595664
false
2.699746
false
false
false
haaja/osinfo
src/osinfo.py
1
16942
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # osinfo.py # # Prints miscellaneous information about linux host. # # Licence: MIT (See LICENCE file or http://opensource.org/licenses/MIT) # Author: Janne Haapsaari <haaja@iki.fi> # import platform import getpass import subprocess import sys import os def g...
mit
4,414,962,370,184,419,000
39.338095
75
0.31177
false
3.843466
false
false
false
morenopc/edx-platform
lms/lib/comment_client/utils.py
3
4274
from contextlib import contextmanager from dogapi import dog_stats_api import logging import requests from django.conf import settings from time import time from uuid import uuid4 from django.utils.translation import get_language log = logging.getLogger(__name__) def strip_none(dic): return dict([(k, v) for k, v...
agpl-3.0
7,686,069,124,591,405,000
28.273973
80
0.597099
false
3.885455
false
false
false
kosgroup/odoo
addons/project_issue/tests/test_issue_process.py
24
1416
# -*- coding: utf-8 -*- from odoo.addons.project_issue.tests.common import TestIssueUsers class TestIssueProcess(TestIssueUsers): def test_issue_process(self): # Sending mail to get more details. vals = {'email_from': 'support@mycompany.com', 'email_to': 'Robert_Adersen@yahoo.co...
gpl-3.0
-3,139,989,795,240,224,300
37.27027
96
0.477401
false
4.553055
false
false
false