repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
Hossein-Noroozpour/PyHDM
hml/classification/HNearestNeighborsClassifier.py
1
2014
#!/usr/bin/python3.3 # coding=utf-8 """ Module for K nearest neighbours. """ __author__ = 'Hossein Noroozpour Thany Abady' #from math3d import sqrt import numpy class HNearestNeighboursClassifier(): """ Class for K nearest neighbors algorithm. """ def __init__(self, n_neighbors=5, weight_function=l...
mit
3,813,939,173,336,904,000
25.866667
120
0.478153
false
ndexbio/ndex-enrich
Persistence_Unit_Tests.py
1
5444
__author__ = 'aarongary' import unittest from persistence import EnrichmentPersistence class Dev_Uint_Tests(unittest.TestCase): def test_persistence(self): try: my_json = { 'termClassification': [{ 'status': 'unknown', 'geneSymbol...
bsd-2-clause
8,271,728,539,399,308,000
39.325926
120
0.2759
false
ybonjour/nuus
services/indexing/Indexer.py
1
3702
__author__ = 'Yves Bonjour' from Tokenizer import create_tokenizer import redis import uuid def create_indexer(redis_host, redis_port): tokenizer = create_tokenizer() redis_db = redis.Redis(redis_host, redis_port) store = RedisIndexStore(redis_db) return Indexer(store, tokenizer) class Indexer: ...
mit
5,113,585,835,216,535,000
29.105691
93
0.642896
false
cria/microSICol
import_db.py
1
7329
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Script to import XML data to current SICol database # Obs: This script must be executed on root directory # Author:Renato Arnellas Coelho renatoac at gmail dot com import sys import os from xml.dom.minidom import Document,parse def importSQLite(xml,sqlite_path='./db/sql...
gpl-2.0
-555,823,517,836,128,260
39.716667
127
0.617137
false
longde123/MultiversePlatform
server/config/friendworld/extensions_proxy.py
1
50308
# # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # 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 restrict...
mit
7,856,342,551,657,046,000
43.168569
244
0.654389
false
cwilkes/event_store_meta
tests/test_models.py
1
1689
# -*- coding: utf-8 -*- """Model unit tests.""" import datetime as dt import pytest from event_store_meta.user.models import User, Role from .factories import UserFactory @pytest.mark.usefixtures('db') class TestUser: def test_get_by_id(self): user = User('foo', 'foo@bar.com') user.save() ...
bsd-3-clause
3,872,727,385,110,969,300
28.631579
63
0.612789
false
MG-group-tools/MGFunc
mgfunc_v2/cluster2fasta.py
1
15574
#!/usr/bin/env python2.7 import sys import os # -*- coding: utf-8 -*- """ Created on Tue Oct 29 13:13:45 2013 CLASS-VERSION @author: Kosai """ import cPickle as pickle from datetime import datetime as dt import time import argparse import gzip class main: ''' Class version of the cluster2fasta program ...
gpl-3.0
5,104,992,305,668,626,000
39.557292
307
0.553679
false
GoogleCloudPlatform/professional-services
examples/bq-email-exports/export_query_results_function/main.py
1
2698
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-1,615,927,224,140,515,800
34.973333
84
0.659748
false
hustodemon/spacewalk
backend/server/rhnServer/server_hardware.py
1
34703
# # Copyright (c) 2008--2014 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-6,922,134,149,411,319,000
32.757782
109
0.51788
false
iffy/eliot
benchmarks/logwriter.py
1
1041
""" A benchmark for eliot.logwriter. """ import tempfile import time from twisted.internet.task import react from twisted.python.filepath import FilePath from eliot.logwriter import ThreadedFileWriter LENGTH = 100 MESSAGES = 100000 def main(reactor): print "Message size: %d bytes Num messages: %d" % (LENGT...
apache-2.0
-6,183,397,444,295,994,000
20.6875
74
0.622478
false
kennym/itools
test/test_ical.py
1
36237
# -*- coding: UTF-8 -*- # Copyright (C) 2005-2008 Juan David Ibáñez Palomar <jdavid@itaapy.com> # Copyright (C) 2006-2007 Nicolas Deram <nicolas@itaapy.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 Software...
gpl-3.0
-2,529,380,354,615,915,500
34.291423
79
0.597227
false
hirofumi0810/tensorflow_end2end_speech_recognition
utils/dataset/xe.py
1
5444
#! /usr/bin/env python # -*- coding: utf-8 -*- """Base class for loading dataset for the frame-wise model. In this class, all data will be loaded at each step. You can use the multi-GPU version. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function imp...
mit
-3,416,920,738,480,581,600
35.536913
93
0.549596
false
cs591B1-Project/Social-Media-Impact-on-Stock-Market-and-Price
data/25 verizon/getDataAutoQuery.py
1
3761
import webhose; import time; from datetime import datetime, timedelta from lxml import html import requests import unirest webhose.config(token='c6052904-f312-436b-a6d8-d915084ac866') days_back = 30 date_days_ago = datetime.now() - timedelta(days=days_back) organization = 'verizon' lang = 'english' country = 'US' #...
mit
3,822,441,865,177,565,000
26.253623
208
0.686785
false
jumpserver/jumpserver
apps/perms/serializers/asset/permission.py
1
5347
# -*- coding: utf-8 -*- # from rest_framework import serializers from django.utils.translation import ugettext_lazy as _ from django.db.models import Prefetch, Q from orgs.mixins.serializers import BulkOrgResourceModelSerializer from perms.models import AssetPermission, Action from assets.models import Asset, Node,...
gpl-2.0
-1,230,686,421,651,684,400
40.913386
125
0.622957
false
brainstorm/bcbio-nextgen
tests/bcbio_vm/test_docker.py
1
3019
import os import subprocess import pytest from tests.conftest import make_workdir from tests.conftest import get_post_process_yaml @pytest.marks('docker') def test_docker(install_test_files, data_dir): """Run an analysis with code and tools inside a docker container. Requires https://github.com/chapmanb/bc...
mit
-4,401,909,337,369,498,600
34.940476
87
0.576019
false
commtrack/commtrack-old-to-del
apps/hq/tests/views.py
1
3356
from django.test import TestCase from django.test.client import Client from hq.models import ExtUser, Domain, Organization, ReporterProfile from hq.tests.util import create_user_and_domain from reporters.models import Reporter class ViewsTestCase(TestCase): def setUp(self): user, domain = create_user_and_d...
bsd-3-clause
-5,212,102,433,399,762,000
42.025641
70
0.665375
false
chromium/chromium
buildtools/checkdeps/rules.py
5
7044
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Base classes to represent dependency rules, used by checkdeps.py""" import os import re class Rule(object): """Specifies a single rule for an includ...
bsd-3-clause
3,845,343,916,866,982,000
36.870968
80
0.66113
false
anhaidgroup/py_entitymatching
py_entitymatching/dask/dask_extract_features.py
1
9597
import logging import os import pandas as pd import multiprocessing import numpy as np import dask from dask.diagnostics import ProgressBar from dask import delayed from cloudpickle import cloudpickle import tempfile import py_entitymatching.catalog.catalog_manager as cm import py_entitymatching.utils.catalog_helpe...
bsd-3-clause
4,681,506,796,973,360,000
38.012195
115
0.624153
false
NuAoA/mopidy-alcd
mopidy_AdafruitLCD/Adafruit_LCD_frontend.py
1
3199
#!/usr/bin/env python import logging import traceback import pykka import mopidy import sys import re #todo: remove import threading from time import sleep from mopidy import core from .Adafruit_player import AdafruitPlayer logger = logging.getLogger(__name__) class AdafruitLCD(pykka.ThreadingActor, core.CoreListene...
apache-2.0
-27,827,435,575,448,490
24.388889
87
0.65708
false
chilitechno/barrioSquare
setup.py
1
1178
from py2deb import Py2deb from glob import glob version = "0.1.20" p=Py2deb("barriosquare") p.author="Chris J. Burris" p.mail="chris@chlitechno.com" p.description="Maemo application to access foursquare.com api functionality" p["/opt/barrioSquare"] = ["barriosq.py|barriosq","barrioConfig.py","barrioStyles.py","get-loc...
gpl-3.0
-1,532,249,144,477,468,200
55.095238
418
0.745331
false
EdDev/vdsm
tests/virttests/vmstats_test.py
1
18952
# # Copyright 2015 Red Hat, Inc. # # 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. # # This program is distributed in th...
gpl-2.0
-2,565,157,551,980,856,000
31.067682
79
0.503271
false
pankajk/MasterThesis
Code/Graph_Kernels/SKG/KroneckerGenerator.py
1
2725
import numpy as np import networkx as nx import math import random def convert(something):#use networkx conversion from numpy array #g = nx.from_numpy_matrix(someNPMat) g = nx.to_networkx_graph(something) return g def deleteSelfLoops(graph, nNodes): #used to take away self loops in final graph for stat p...
mit
-5,153,844,839,685,211,000
28.945055
114
0.557798
false
eniac/faas
factor/linalg.py
1
5126
import sys import os import re import math import utils import logging logger = logging.getLogger('Linalg') cmd_logger = logging.getLogger('cmd') # Exact configuration here will depends on instance/hardware type. def run_rankfile(linalg_params): logger.info("--- Generating rankfile ---") machines = linal...
lgpl-3.0
764,551,282,516,274,000
41.716667
161
0.552282
false
timevortexproject/timevortex
timevortex/utils/timeserieslogger.py
1
1057
#!/usr/bin/python3 # -*- coding: utf8 -*- # -*- Mode: Python; py-indent-offset: 4 -*- """TSL functions""" from timevortex.utils.globals import ERROR_TIMESERIES_NOT_DEFINED KEY_TSL_BAD_JSON = "ts_without_json_message" KEY_TSL_NO_SITE_ID = "ts_without_site_id" KEY_TSL_NO_VARIABLE_ID = "ts_without_variable_id" KEY_TSL_...
mit
4,012,301,638,480,330,000
41.28
84
0.703879
false
fos/fos-legacy
fos/actor/odfslicer.py
1
2054
import numpy as np class ODF_Slice(object): def __init__(self,odfs,vertices,faces,noiso,batch,group=None): J=0 self.odfs_no=J self.vertex_list=(odfs.shape[0]*odfs.shape[1])*[None] for index in np.ndindex(odfs.shape[:2]): values=odfs[index] if noi...
bsd-3-clause
-3,123,293,143,917,437,000
32.672131
75
0.399708
false
kkoksvik/FreeCAD
src/Mod/Start/StartPage/StartPage.py
2
26929
#*************************************************************************** #* * #* Copyright (c) 2012 * #* Yorik van Havre <yorik@uncreated.net> * #* ...
lgpl-2.1
-881,293,649,298,753,800
38.252616
368
0.527461
false
Nikita1710/ANUFifty50-Online-Mentoring-Platform
project/fifty_fifty/webcore/views.py
1
4115
from django.shortcuts import render, get_object_or_404 from django.core.mail import send_mail, BadHeaderError from django.contrib import messages from django.conf import settings from django.contrib.auth.decorators import login_required from content.models import Mentee, Mentor, Content_Summary from blog.models import ...
apache-2.0
8,039,884,220,214,451,000
33.579832
185
0.687728
false
NicoVarg99/daf-recipes
ckan/ckan/ckan/ckan/tests/logic/action/test_delete.py
1
20446
# encoding: utf-8 import nose.tools import ckan.tests.helpers as helpers import ckan.tests.factories as factories import ckan.logic as logic import ckan.model as model import ckan.plugins as p import ckan.lib.search as search assert_equals = nose.tools.assert_equals assert_raises = nose.tools.assert_raises class T...
gpl-3.0
-774,451,038,322,788,900
36.039855
79
0.581923
false
arnaldog12/Manual-Pratico-Deep-Learning
utils/samples_generator.py
1
1868
import numpy as np def make_cubic(n_samples, x_min, x_max, a=1, b=0, c=0, d=0, noise=0.0, random_state=None): np.random.seed(random_state) x = np.linspace(x_min, x_max, n_samples) y = a*x**3 + b*x**2 + c*x + d + (2*noise*np.random.random(n_samples) - noise) return x.reshape(-1,1), y.reshape(-1,1) def ...
mit
8,612,343,678,604,408,000
43.47619
90
0.600107
false
sthyme/ZFSchizophrenia
BehaviorAnalysis/HSMovieAnalysis/setResolutionWidget.py
1
5960
#----------------------- # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'selectUI.ui' # Created: Thu Feb 26 13:45:32 2015 by: PyQt4 UI code generator 4.11.3 # # Created by Emily Conklin # February 2015 # This program is connected to the main widget (NeuroGUI.py) and is a sub-user interface...
mit
-8,555,149,342,993,067,000
41.571429
114
0.69245
false
xin1195/smartSearch
setting.py
1
1207
#!/usr/bin/env python3 # _*_coding:utf-8_*_ import os import motor.motor_tornado import redis from pymongo import MongoClient from common.logManageLib import get_logger settings = dict( template_path=os.path.join(os.path.dirname(__file__), "templates"), static_path=os.path.join(os.path.dirname(__file__), "st...
apache-2.0
8,254,905,785,951,247,000
23.617021
98
0.685393
false
Detry322/map-creator
app/random.py
1
1453
from app.models import all_models from app.utils import mkdir_p from app import GENERATED_TILES_FOLDER, RANDOM_FOLDER, BACKPROPS_FOLDER from scipy import misc import glob import numpy as np import os from keras.models import load_model, Model from keras.optimizers import Adam, SGD, Adagrad from keras.layers import Lo...
mit
-2,502,770,354,397,162,500
32.022727
133
0.722643
false
prefetchnta/questlab
bin/x64bin/python/36/Lib/calendar.py
1
23926
"""Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).""" import sys i...
lgpl-2.1
7,043,734,647,202,540,000
31.556802
124
0.557302
false
linsalrob/EdwardsLab
phage_protein_blast_genera/tax_violin_plots.py
1
2239
""" """ import os import sys import argparse import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt if __name__ == '__main__': parser = argparse.ArgumentParser(description="") parser.add_argument('-f', help='Genome average output file (from genera_per_phage_protein.py', default='/home/redw...
mit
952,300,114,054,625,500
28.853333
149
0.571237
false
euccas/CodingPuzzles-Python
leet/source/searchDFS/permutations.py
1
1421
class Solution(): def permute(self, nums): if nums is None: return [[]] elif len(nums) <= 1: return [nums] result = [] for i, item in enumerate(nums): #print("i={0}, item={1}".format(i, item)) for p in permute(nums[:i] + nums[i + 1:]):...
mit
405,264,178,974,588,860
26.326923
81
0.474314
false
ganeti-github-testing/ganeti-test-1
lib/client/gnt_instance.py
1
62250
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 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: # # 1. Redistributions of source code must retain the above copyri...
bsd-2-clause
8,941,289,388,210,791,000
35.149826
80
0.618715
false
bmazin/ARCONS-pipeline
fluxcal/fluxCal.py
1
29931
#!/bin/python ''' fluxCal.py Created by Seth Meeker on 11-21-2012 Modified on 02-16-2015 to perform absolute fluxCal with point sources Opens ARCONS observation of a spectrophotometric standard star and associated wavelength cal file, reads in all photons and converts to energies. Bins photons to generate a spectru...
gpl-2.0
1,007,656,973,070,526,800
43.016176
240
0.640406
false
emc-openstack/storops
storops_test/lib/test_tasks.py
1
3524
# coding=utf-8 # Copyright (c) 2016 EMC Corporation. # 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 # #...
apache-2.0
-1,893,215,132,781,401,000
31.036364
78
0.608116
false
induktio/LamaTrainer
falib/PdaSimulator.py
1
2691
import sys,os,json,pprint class PDA(): """ Represents a Push-Down Automaton """ EPSILON = '_e' MAX_STEPS = 10000 def __init__(self): pass def testAutomata(self, pda, testcases): """ Tests whether the given PDA accepts or rejects the given testcases appropriately Args: * pda: PDA object to be ...
gpl-3.0
3,181,897,919,882,742,000
26.181818
87
0.644742
false
rossumai/keras-multi-gpu
keras_tf_multigpu/examples/kuza55/cifar10_cnn_functional_multigpu.py
1
4556
'''Train a simple deep CNN on the CIFAR10 small images dataset. GPU run command with Theano backend (with TensorFlow, the GPU is automatically used): THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatx=float32 python cifar10_cnn.py It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs. (it's s...
mit
-8,435,183,062,125,755,000
33.778626
111
0.663082
false
lumig242/Video-Share-System
video/views.py
1
4497
from django.shortcuts import render from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext from video.form import * from video.models import Video,Comment from django.contrib.auth.decorators import login_required import ...
mit
-4,826,796,093,921,239,000
35.266129
142
0.653769
false
scott48074/Restorative-Justice-App
app/facesheet.py
1
4506
''' Takes in a list of values from the database and creates a facesheet. ''' import os from docx import Document from docx.enum.text import WD_ALIGN_PARAGRAPH def assemble_address(street, apartment, city, state, zip_code): address = street.title() if apartment: address += f' APT: {apartment.title()}'...
mit
5,163,028,321,451,028,000
28.644737
99
0.583666
false
kri5/pghoard
test/test_restore.py
1
4618
""" pghoard Copyright (c) 2015 Ohmu Ltd See LICENSE for details """ from .base import PGHoardTestCase from dateutil import tz from pghoard.restore import create_recovery_conf, Restore, RestoreError from unittest.mock import Mock import datetime import os import pytest class TestRecoveryConf(PGHoardTestCase): def...
apache-2.0
-1,430,156,587,909,244,200
43.403846
110
0.573408
false
wtgme/labeldoc2vec
gensim/models/labeldoc2vec.py
1
45979
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Deep learning via the distributed memory and distributed bag of words models from [1]_, using either hierarchical softmax or negative ...
lgpl-2.1
-8,098,908,495,692,754,000
48.760823
167
0.614911
false
grahamking/goodenergy
campaign/management/commands/ge_copy_campaign.py
1
4417
"""Copies the contents (indicators and actions) of one campaign into another """ # Copyright 2010,2011 Good Energy Research Inc. <graham@goodenergy.ca>, <jeremy@goodenergy.ca> # # This file is part of Good Energy. # # Good Energy is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
-979,541,411,536,322,800
37.745614
97
0.644329
false
dpnishant/appmon
tracer/android_tracer.py
1
12107
#!/usr/bin/python ### # Copyright (c) 2016 Nishant Das Patnaik. # # 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
7,836,066,327,096,006,000
36.255385
416
0.550508
false
oroszgy/spaCy.hu
spacy/tests/regression/test_issue910.py
1
3547
from __future__ import unicode_literals import json import os import random import contextlib import shutil import pytest import tempfile from pathlib import Path import pathlib from ...gold import GoldParse from ...pipeline import EntityRecognizer from ...en import English try: unicode except NameError: uni...
mit
762,616,782,780,650,200
30.389381
94
0.581054
false
andrew-lundgren/gwpy
gwpy/cli/spectrum.py
1
5127
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) Joseph Areeda (2015) # # This file is part of GWpy. # # GWpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
1,358,993,382,451,397,000
35.105634
80
0.561537
false
shpakoo/YAP
YAP_MiSeq.py
1
29538
######################################################################################## ## This file is a part of YAP package of scripts. https://github.com/shpakoo/YAP ## Distributed under the MIT license: http://www.opensource.org/licenses/mit-license.php ## Copyright (c) 2011-2013 Sebastian Szpakowski #############...
mit
-7,766,473,033,472,721,000
36.201511
308
0.511138
false
varlog00/Sigil
src/Resource_Files/python3lib/xmlprocessor.py
1
16367
#!/usr/bin/env python3 import sys import os from sigil_bs4 import BeautifulSoup from sigil_bs4.builder._lxml import LXMLTreeBuilderForXML import re from urllib.parse import unquote from urllib.parse import urlsplit from lxml import etree from io import BytesIO from opf_newparser import Opf_Parser ASCII_CHARS = set...
gpl-3.0
-1,157,109,961,533,576,400
39.412346
136
0.587646
false
rdcrt/pystarling
test/api_objects/test_Account.py
1
1419
import dateutil import pytest from pystarling.api_objects.Account import Account class TestAccount(object): test_data = { 'id': 'ee8152d7-6ff2-4f79-b9de-39861bdec427', 'number': '99999999', 'sortCode': '608371', 'iban': 'GB26SRLG60837199999999', 'bic': 'SRLGGB2L', ...
mit
2,434,672,469,967,569,000
32.785714
86
0.639183
false
APMonitor/arduino
2_Regression/2nd_order_MIMO/GEKKO/tclab_2nd_order_linear.py
1
3283
import numpy as np import time import matplotlib.pyplot as plt import random # get gekko package with: # pip install gekko from gekko import GEKKO import pandas as pd # import data data = pd.read_csv('data.txt') tm = data['Time (sec)'].values Q1s = data[' Heater 1'].values Q2s = data[' Heater 2'].values...
apache-2.0
-3,404,360,134,149,806,000
22.318519
70
0.624733
false
DistrictDataLabs/yellowbrick
yellowbrick/contrib/scatter.py
1
11862
# yellowbrick.contrib.scatter # Implements a 2d scatter plot for feature analysis. # # Author: Nathan Danielsen # Created: Fri Feb 26 19:40:00 2017 -0400 # # Copyright (C) 2017 The scikit-yb developers # For license information, see LICENSE.txt # # ID: scatter.py [a89633e] benjamin@bengfort.com $ """ Implements a 2D...
apache-2.0
-159,934,294,901,768,700
32.041783
87
0.583966
false
dichen001/Go4Jobs
JackChen/hash/18. 4Sum.py
1
1449
""" Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution set must not contain duplicate quadruplets. For example, given array S = [1, 0, -1, 0, -2, 2], and target = 0. ...
gpl-3.0
125,500,663,320,398,770
34.275
176
0.429952
false
santiago-salas-v/walas
node_images.py
1
1746
import matplotlib import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) patch1 = matplotlib.patches.Circle( [0.5,0.5],0.05 ) patch2 = matplotlib.patches.Rectangle( [0.3,0.3],0.4, 0.4, alpha=0.5, fill=False, edgecolor='black', linestyle = '--' ) arrow1 = matplotlib.patches.Arrow( ...
mit
-8,638,347,603,755,213,000
20.567901
42
0.611111
false
audiohacked/pyBusPirate
src/buspirate/uart.py
1
5375
# Created by Sean Nelson on 2018-08-19. # Copyright 2018 Sean Nelson <audiohacked@gmail.com> # # This file is part of pyBusPirate. # # pyBusPirate 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...
gpl-2.0
5,007,357,886,985,508,000
27.439153
97
0.599256
false
Re4son/Kali-Pi
Menus/menu-9p.py
1
2924
#!/usr/bin/env python import kalipi from kalipi import * ############################# ## Local Functions ## ## Local Functions ## ############################# ############################# ## Buttons ## # define all of the buttons label1 = Button(labelPadding * " " + " ", originX...
gpl-3.0
1,339,044,619,860,689,200
25.107143
202
0.515048
false
JKarathiya/Lean
Algorithm.Python/InceptionDateSelectionRegressionAlgorithm.py
1
2432
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice...
apache-2.0
-5,988,067,062,033,275,000
38.209677
132
0.733333
false
kret0s/gnuhealth-live
tryton/server/trytond-3.8.3/trytond/ir/property.py
1
5773
# This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. from decimal import Decimal from ..model import ModelView, ModelSQL, fields from ..transaction import Transaction from ..cache import Cache from ..pool import Pool __all__ = [...
gpl-3.0
-8,129,677,329,808,463,000
32.760234
75
0.493677
false
larsks/cloud-init
cloudinit/sources/DataSourceBigstep.py
2
1917
# Copyright (C) 2015-2016 Bigstep Cloud Ltd. # # Author: Alexandru Sirbu <alexandru.sirbu@bigstep.com> # # This file is part of cloud-init. See LICENSE file for license information. import errno import json from cloudinit import log as logging from cloudinit import sources from cloudinit import url_helper from cloudi...
gpl-3.0
2,950,398,994,128,199,700
27.61194
79
0.664058
false
derks/cement
tests/core/exc_tests.py
1
1924
"""Tests for cement.core.exc.""" import unittest from nose.tools import eq_, raises from nose import SkipTest from cement.core import exc from cement.utils import test_helper as _t class ExceptionTestCase(unittest.TestCase): def setUp(self): self.app = _t.prep() @raises(exc.CementConfigError) ...
bsd-3-clause
-5,528,875,962,445,368,000
32.754386
71
0.614345
false
praphull27/diskBasedLdaBenchmarkingTools
readXmlAndOutputToTxt.py
1
1444
from bs4 import BeautifulSoup import re import os import multiprocessing def read_and_tokenize (file_name): xml_file_handle = open(file_name, 'rb') xml_file_contents = xml_file_handle.read() xml_file_handle.close() xml_file_text = '' full_text_all = BeautifulSoup(xml_file_contents).find_all(class_="full_text") ...
mit
5,477,891,135,625,652,000
28.489796
96
0.687673
false
dc3-plaso/dfvfs
dfvfs/credentials/keychain.py
1
2743
# -*- coding: utf-8 -*- """The path specification key chain. The key chain is used to manage credentials for path specifications. E.g. BitLocker Drive Encryption (BDE) encrypted volumes can require a credential (e.g. password) to access the unencrypted data (unlock). """ from dfvfs.credentials import manager class ...
apache-2.0
-8,760,681,104,130,690,000
31.654762
80
0.692308
false
hbldh/skboost
skboost/stumps/decision_stump.py
1
17561
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`decision_stump` ================== .. module:: decision_stump :platform: Unix, Windows :synopsis: .. moduleauthor:: hbldh <henrik.blidh@nedomkull.com> Created on 2014-08-31, 01:52 """ from __future__ import division from __future__ import print_function...
mit
-5,267,852,490,259,074,000
35.509356
115
0.553442
false
mozilla/addons-server
src/olympia/amo/tests/test_helpers.py
1
15332
# -*- coding: utf-8 -*- import mimetypes import os from datetime import datetime, timedelta from unittest.mock import Mock, patch from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import NoReverseMatch from django.test.client import RequestFactory from dja...
bsd-3-clause
-319,905,060,783,356,350
30.929167
88
0.609161
false
GoogleCloudPlatform/bigquery-utils
tools/cloud_functions/gcs_event_based_ingest/tests/conftest.py
1
20146
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
5,131,152,216,655,499,000
31.079618
80
0.59729
false
535521469/crawler_sth
scrapyd/app.py
1
1586
from twisted.application.service import Application from twisted.application.internet import TimerService, TCPServer from twisted.web import server from twisted.python import log from scrapy.utils.misc import load_object from .interfaces import IEggStorage, IPoller, ISpiderScheduler, IEnvironment from .launcher impor...
bsd-3-clause
-6,586,102,020,023,485,000
34.244444
93
0.759142
false
deepmind/lab2d
dmlab2d/lib/game_scripts/levels/clean_up/play.py
1
3449
# Copyright 2020 The DMLab2D Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
7,325,948,526,025,038,000
30.642202
80
0.677298
false
ray-project/ray
release/tune_tests/scalability_tests/workloads/test_network_overhead.py
1
1297
"""Networking overhead (200 trials on 200 nodes) In this run, we will start 100 trials and run them on 100 different nodes. This test will thus measure the overhead that comes with network communication and specifically log synchronization. Cluster: cluster_100x2.yaml Test owner: krfricke Acceptance criteria: Shoul...
apache-2.0
4,828,814,425,852,465,000
24.94
78
0.683115
false
cdiener/pyart
asciinator.py
1
1723
#!/usr/bin/env python # asciinator.py # # Copyright 2014 Christian Diener <ch.diener@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 Software Foundation; either version 2 of the License, or # ...
gpl-3.0
-7,175,192,178,625,269,000
32.784314
89
0.702263
false
bmazin/ARCONS-pipeline
astrometry/guide-centroid/manage.py
1
5233
from FitsAnalysis import convert,StarCalibration from catalog import queryVizier,queryFitsImage import os import warnings from radec import radec from functions import * #ignore the warning caused by astropy warnings.filterwarnings("ignore") #This specifies the center of fits images retrieved from the data base #Tho...
gpl-2.0
9,176,613,468,110,063,000
35.859155
176
0.648003
false
katchengli/tech-interview-prep
interview_cake/ic3.py
1
1451
#constraint: list_of_ints will always have at least 3 integers #can have negative numbers def highest_product_three_ints(list_of_ints): biggest_int = max(list_of_ints) list_of_ints.remove(biggest_int) max_int1 = max(list_of_ints) list_of_ints.remove(max_int1) max_int2 = max(list_of_ints) list_...
apache-2.0
2,525,693,542,367,842,300
30.543478
63
0.671261
false
mitocw/latex2edx
latex2edx/test/test_custom_html.py
1
2044
import os import unittest from lxml import etree from io import StringIO from latex2edx.main import latex2edx from latex2edx.test.util import make_temp_directory class MakeTeX(object): def __init__(self, tex): buf = """\\documentclass[12pt]{article}\n\\usepackage{edXpsl}\n\n\\begin{document}""" b...
agpl-3.0
-7,746,251,309,045,981,000
31.967742
147
0.527397
false
hemidactylus/flaskbiblio
config.py
1
1074
import os # directories and so on basedir = os.path.abspath(os.path.dirname(__file__)) DB_DIRECTORY=os.path.join(basedir,'app/database') DB_NAME='biblio.db' # stuff for Flask WTF_CSRF_ENABLED = True from sensible_config import SECRET_KEY # formats, etc DATETIME_STR_FORMAT = '%Y-%m-%d %H:%M:%S' SHORT_DATETIME_STR_FO...
gpl-3.0
-1,613,392,918,894,984,700
29.685714
74
0.752328
false
valmynd/MediaFetcher
src/plugins/youtube_dl/youtube_dl/extractor/francetv.py
1
15999
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( clean_html, determine_ext, ExtractorError, int_or_none, parse_duration, try_get, url_or_none, ) from .dailymotion import Dailymotion...
gpl-3.0
156,838,244,433,017,060
30.034951
257
0.633173
false
mharrys/sudoku
sudoku.py
1
7848
import fileinput from dlx import DLX from numpy import array, unique from optparse import OptionParser class SudokuError(Exception): """Raised when any error related to Sudoku is found during construction and validation such as unexpected values or contradictions. """ def __init__(self, value): ...
gpl-3.0
3,664,689,965,295,890,400
28.727273
78
0.507645
false
Bekt/tweetement
src/service.py
1
3578
import logging import string import tweepy from credentials import (consumer_key, consumer_secret) from models import Stopword from collections import Counter class Service(object): # Map uppercase to lowercase, and deletes any punctuation. trans = {ord(string.ascii_uppercase[i]): ord(string.ascii_lowercase...
mit
-3,306,388,078,736,274,000
34.425743
82
0.536333
false
nbessi/pyhiccup
pyhiccup/page.py
1
3037
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2014 # Original concept by James Reeves # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
agpl-3.0
384,448,600,303,087,940
32.01087
93
0.591373
false
docusign/docusign-python-client
docusign_esign/models/external_file.py
1
7550
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.gi...
mit
7,504,362,721,954,708,000
23.121406
140
0.513907
false
edx/ecommerce
ecommerce/extensions/voucher/migrations/0001_initial.py
1
3161
# -*- coding: utf-8 -*- from decimal import Decimal from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('order', '0001_initial'), ('offer', '0001_initial'), migrations.swappable_dependency(settings.AUTH_USER...
agpl-3.0
9,208,904,800,063,817,000
53.5
293
0.598545
false
tensorflow/tfx
tfx/examples/mnist/mnist_pipeline_native_keras_e2e_test.py
1
5568
# Copyright 2019 Google LLC. 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
-3,441,124,305,496,440,000
40.552239
76
0.683908
false
AlfioEmanueleFresta/practical-ecb-lib
cp_ecb/image.py
1
4402
from PIL import Image class InMemoryImage: """ A very simple class to represent an image. """ def __init__(self, w, h, c=3, b=b'', encrypted=False): """ Instantiate a new image. :param w: The width of the image (px). :param h: The height of the image (...
gpl-3.0
2,049,984,958,980,118,500
33.124031
125
0.655838
false
pvagner/orca
test/keystrokes/firefox/line_nav_lists.py
1
9203
#!/usr/bin/python """Test of HTML list presentation.""" from macaroon.playback import * import utils sequence = MacroSequence() # Work around some new quirk in Gecko that causes this test to fail if # run via the test harness rather than manually. sequence.append(KeyComboAction("<Control>r")) sequence.append(utils...
lgpl-2.1
6,838,572,798,517,745,000
44.559406
136
0.700532
false
pythonchelle/opencomparison
apps/accounts/urls.py
1
1313
from django.conf import settings from django.conf.urls.defaults import patterns, include, url from django.views.generic.simple import direct_to_template from registration.views import activate from registration.views import register from accounts.forms import RegistrationForm urlpatterns = patterns('', url(...
mit
-5,129,256,107,149,540,000
36.542857
78
0.64128
false
ismail-s/warehouse
tests/unit/test_config.py
1
15964
# 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, software # distributed under the Li...
apache-2.0
-714,326,451,956,778,200
34.008772
79
0.567339
false
jamesiter/JimV-N
models/event_process.py
1
9567
#!/usr/bin/env python # -*- coding: utf-8 -*- import libvirt from models.initialize import guest_event_emit from models import Guest __author__ = 'James Iter' __date__ = '2017/6/15' __contact__ = 'james.iter.cn@gmail.com' __copyright__ = '(c) 2017 by James Iter.' class EventProcess(object): conn = None g...
gpl-3.0
7,831,306,273,110,688,000
35.497872
110
0.55847
false
petrvanblokland/Xierpa3
xierpa3/sites/examples/helloworldblueprint/make.py
1
9548
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
mit
-8,731,468,573,358,479,000
59.43038
143
0.662233
false
ericmoritz/requests_debug
test.py
1
6351
import threading import Queue from wsgiref.simple_server import make_server from functools import partial from pprint import pprint from requests_debug import debug as requests_debug import requests import time from testfixtures import compare from contextlib import contextmanager import logging logging.basicConfig(lev...
mit
-395,756,526,548,463,300
28.133028
79
0.516139
false
bd-j/magellanic
magellanic/sfhs/prediction_scripts/predicted_total.py
1
5894
import sys, pickle, copy import numpy as np import matplotlib.pyplot as pl import astropy.io.fits as pyfits import magellanic.regionsed as rsed import magellanic.mcutils as utils from magellanic.lfutils import * try: import fsps from sedpy import observate except ImportError: #you wont be able to predict...
gpl-2.0
5,455,226,854,893,435,000
34.721212
99
0.557686
false
bccp/abopt
abopt/legacy/tests/test_vmad.py
1
2670
from __future__ import print_function from abopt.legacy.vmad import VM, microcode, programme, Zero, Tape from numpy.testing import assert_raises, assert_array_equal, assert_allclose import numpy class TestVM(VM): @microcode(ain=['x'], aout=['y']) def unitary(self, x, y, factor): y[...] = x * factor ...
gpl-3.0
6,831,476,231,680,616,000
29.340909
77
0.535955
false
reverse-CSE-591/reverse
driver.py
1
19133
#!/usr/bin/python -tt ##################################################################################################################### # CSE 591: Security and Vulnerability Analysis # # Team 5: # # Kartheek Nallepalli # Bhargavi Rajagopalan # Priya Pipada # Ayush Maheshwari # Nikhil Aourpally # # # This is the dr...
mit
6,833,721,684,920,172,000
39.111111
130
0.516176
false
woelfware/BluMote
test/button_tx.py
1
1963
#!/usr/bin/env python # Copyright (C) 2011 Woelfware from bluetooth import * import blumote import cPickle from glob import glob import os import sys import time class Blumote_Client(blumote.Services): def __init__(self): blumote.Services.__init__(self) self.addr = None def find_blumote_pods(self, pod_name = N...
gpl-3.0
-4,726,947,572,065,195,000
23.5375
69
0.671931
false
VcamX/grpc
src/python/grpcio/grpc/framework/alpha/_face_utilities.py
1
7822
# Copyright 2015-2016, 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 ...
bsd-3-clause
5,831,767,619,180,549,000
41.743169
94
0.749297
false
ovnicraft/openerp-server
openerp/addons/base/module/wizard/base_update_translations.py
1
2901
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,133,423,672,400,212,000
40.442857
98
0.592554
false
citrix-openstack-build/python-openstackclient
openstackclient/tests/common/test_clientmanager.py
1
1180
# Copyright 2012-2013 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 ...
apache-2.0
6,764,901,367,657,484,000
32.714286
77
0.714407
false
PageArkanis/StEVE
steve/constellation.py
1
1217
from steve.backend.sqlitedb import SDB from steve.system import System class Constellation(object): def __init__(self, universe, data): self.universe = universe self.regionID = data[0] self.uid = data[1] self.name = data[2] self.x ...
agpl-3.0
3,538,158,798,730,244,000
26.659091
88
0.501233
false
blueyed/coveragepy
tests/test_templite.py
1
10970
# coding: utf-8 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for coverage.templite.""" import re from coverage.templite import Templite, TempliteSyntaxError, TempliteValueError from tests.coveraget...
apache-2.0
1,905,987,912,981,123,000
33.670886
79
0.478094
false
RyanSkraba/beam
sdks/python/apache_beam/coders/typecoders.py
1
8078
# # 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 us...
apache-2.0
-3,578,803,315,472,674,000
41.072917
80
0.709953
false
sunshinelover/chanlun
vn.trader/ctaAlgo/uiChanlunWidget.py
1
68647
# encoding: UTF-8 """ 缠论模块相关的GUI控制组件 """ from vtGateway import VtSubscribeReq from uiBasicWidget import QtGui, QtCore, BasicCell,BasicMonitor,TradingWidget from eventEngine import * from ctaBase import * import pyqtgraph as pg import numpy as np import pymongo from pymongo.errors import * from datetime import datetime...
mit
1,005,031,568,701,190,500
37.755556
237
0.49587
false
blsmit5728/PokeAlarm
PokeAlarm/Events/MonEvent.py
1
13089
# Standard Library Imports from datetime import datetime # 3rd Party Imports # Local Imports from PokeAlarm import Unknown from PokeAlarm.Utilities import MonUtils from PokeAlarm.Utils import ( get_gmaps_link, get_move_type, get_move_damage, get_move_dps, get_move_duration, get_move_energy, get_pokemon_size, ...
agpl-3.0
1,737,988,250,561,061,600
39.150307
79
0.533578
false