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
lteasdale/ltbio
scripts/seq_chopper.py
1
1942
#!/usr/bin/env python # Seq_chopper! from __future__ import print_function from os import path # The fasta parser. import screed import docopt import sys __author__ = "Luisa Teasdale" CLI_ARGS = """ USAGE: seq_chopper.py -f SEQFILE -p PARTITIONS OPTIONS: -f SEQFILE The multi-species alignment file in fasta f...
mpl-2.0
2,092,505,129,969,343,500
27.144928
79
0.635942
false
3.563303
false
false
false
YusufCelik/YChip8
emulator/instructions.py
1
12062
from random import randint from emulator import state from hardware import gpu, keyboard def executeOpcode(opcode): """ Function mapped to a specific opcode or opcode family will be executed. :param opcode: """ if (opcode & 0xf0ff) == 0x00e0 or (opcode & 0xf0ff) == 0x00ee: instructio...
gpl-3.0
-2,646,583,697,571,645,400
24.501057
79
0.610181
false
3.026851
false
false
false
twz915/django
django/forms/utils.py
1
5880
import json import sys from collections import UserList from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.html import escape, format_html, format_html_join,...
bsd-3-clause
-6,116,146,199,201,036,000
31.307692
96
0.596259
false
4.055172
false
false
false
stuart-knock/tvb-library
tvb/basic/readers.py
1
7790
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://www...
gpl-2.0
8,471,436,281,063,750,000
32.012712
118
0.646727
false
3.691943
false
false
false
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/pprint.py
1
10427
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly no...
gpl-3.0
2,932,550,155,883,395,600
31.635484
79
0.503884
false
4.388468
false
false
false
SalesforceFoundation/mrbelvedereci
metaci/contrib/sites/migrations/0003_set_site_domain_and_name.py
1
1044
""" To understand why this file is here, please read: http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.db import migrations...
bsd-3-clause
6,772,709,289,891,087,000
28.828571
129
0.685824
false
3.411765
false
false
false
rossant/galry
galry/glrenderer.py
1
60655
try: import OpenGL.GL as gl except: from galry import log_warn log_warn(("PyOpenGL is not available and Galry won't be" " able to render plots.")) class _gl(object): def mock(*args, **kwargs): return None def __getattr__(self, name): return self.mock g...
bsd-3-clause
-5,473,990,361,901,274,000
36.791277
102
0.550144
false
4.314625
false
false
false
DolphinDream/sverchok
nodes/logic/input_switch_mod.py
1
7641
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE import bpy from bpy.props impor...
gpl-3.0
-1,290,757,482,226,110,700
37.984694
117
0.647821
false
3.526073
false
false
false
merrikat/volunteerAnalysisPage
combine-csv.py
1
3302
""" Combine .csv files into a single .csv file with all fields 2013-Nov-25 by Robert Woodhead, trebor@animeigo.com 2016-Apr by merrikat Usage: python combine-csv.py {csv folder} {output file} [{optional count field name}] Where: {csv folder} is a folder containing .csv files. {output file} is the destination fi...
mit
-5,366,394,753,895,992,000
21.161074
104
0.654755
false
3.040516
false
false
false
tcew/OCCA
scripts/setupKernelOperators.py
1
15182
from os import environ as ENV maxN = 50 nSpacing = 3 def vnlc(n, N): ret = '' if n < (N - 1): ret = ', ' if n != (N - 1) and ((n + 1) % nSpacing) == 0: ret += '\n ' return ret; def nlc(n, N): ret = '' if n < (N - 1): ret = ', ' if n !...
mit
6,060,624,692,903,006,000
40.143631
173
0.471479
false
3.305465
false
false
false
yugangzhang/chxanalys
chxanalys/chx_correlation.py
1
42284
# ###################################################################### # Developed at the NSLS-II, Brookhaven National Laboratory # # Developed by Sameera K. Abeykoon, February 2014 # # # # Copyright (c) 2014, Brookh...
bsd-3-clause
5,104,684,623,473,763,000
37.089189
79
0.573135
false
3.954541
false
false
false
robertbarrett/eventsottawabot
eventsOttawaBot.py
1
7649
#!/bin/python import praw import re import os import sqlite3 import time from config_bot import * import datetime header = "Type|Artist(s)/Event|Venue|Price|Time\n---|---|---|---|---|---|---|\n" footer1 = "------------------------\n[Link to next week's draft post](" footer2 = "). If you know of something awesome hap...
mit
1,773,334,267,225,267,500
31.828326
410
0.615898
false
3.434665
false
false
false
hivesolutions/netius
src/netius/base/agent.py
1
3121
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foun...
apache-2.0
-7,933,112,070,094,923,000
29.826531
76
0.671369
false
4.093176
false
false
false
risbudaditya/FightFiresWithTheSmokeyBears
flask_twilio/routes.py
1
2868
import psycopg2 from googlemaps import client import sys key= "A GOOGLE API KEY AUTHORIZED ON SEVERAL DIRECTIONS APIS" myClient = client.Client(key) def getRoutes(cursor) : valsToText = [] cursor.execute("""select * from person""") person=cursor.fetchone() while(person): [minCluster,minDirecti...
mit
5,612,678,407,702,821,000
31.965517
141
0.634937
false
3.506112
false
false
false
sserrot/champion_relationships
venv/Lib/site-packages/networkx/classes/reportviews.py
1
38439
# Copyright (C) 2004-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Authors: Aric Hagberg (hagberg@lanl.gov), # Pieter Swart (swart@lanl.gov), # Dan Schult(dschult@colgate.edu) """...
mit
-2,740,391,334,213,308,400
31.63073
79
0.547829
false
3.692862
false
false
false
os-cloud-storage/openstack-workload-disaster-recovery
contrib/horizon/openstack_dashboard/dashboards/project/draas_restore/tables.py
1
3037
# vim: tabstop=4 shiftwidth=4 softtabstop=4 '''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 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 c...
apache-2.0
2,222,686,669,548,437,200
32.373626
78
0.626934
false
4.479351
false
false
false
EduPepperPDTesting/pepper2013-testing
lms/djangoapps/administration/pepreg.py
1
62497
from mitxmako.shortcuts import render_to_response, render_to_string from django.http import HttpResponse import json from models import PepRegTraining, PepRegInstructor, PepRegStudent from django import db from datetime import datetime, timedelta, date from pytz import UTC from django.contrib.auth.models import User i...
agpl-3.0
-2,855,808,094,077,198,000
40.972465
276
0.534442
false
3.930135
false
false
false
CNAMmaster/Tweeples
tool_collect_tweets.py
1
5792
#!/usr/bin/env python # Sample script that collects tweets matching a string. # # This file is part of the Tweeples collection of scripts. # # Tweeples is free software: you can redistribute it and/or modify it # under the terms of the BSD license. For the full terms of the license # see the file `COPYING' in this dir...
bsd-2-clause
1,034,474,566,967,908,600
39.222222
79
0.597203
false
4.315946
false
false
false
EuropeanSocialInnovationDatabase/ESID-main
ESIDcrawlers/ESIDcrawlers/spiders/GeneralWebsite.py
1
9315
from HTMLParser import HTMLParser import MySQLdb from scrapy.linkextractors import LinkExtractor from lxml.html.clean import Cleaner from lxml.html.soupparser import fromstring from lxml.etree import tostring import re import BeautifulSoup from scrapy.spiders import Rule, CrawlSpider from database_access import * im...
gpl-3.0
-9,137,522,277,027,694,000
40.039648
160
0.575309
false
3.765158
false
false
false
uros-sipetic/PyLOH
bin/seg2bed.py
1
2149
#!/usr/bin/env python #======================================================================================================================= # Created on 2013-09-28 # @author: Yi Li # # PyLOH # BICseq2bed.py # # Copyright (c) 2013 Yi Li <yil8@uci.edu> # # This code is free software; you can redistribute it and/or mo...
gpl-2.0
-4,049,469,077,399,976,400
34.229508
120
0.455561
false
3.705172
false
false
false
dwillmer/blaze
blaze/compute/tests/test_postgresql_compute.py
1
4193
import itertools from datetime import timedelta import pytest sa = pytest.importorskip('sqlalchemy') pytest.importorskip('psycopg2') import numpy as np import pandas as pd import pandas.util.testing as tm from odo import odo, resource, drop, discover from blaze import symbol, compute, concat names = ('tbl%d' % i ...
bsd-3-clause
2,335,371,108,966,097,000
25.371069
77
0.57429
false
3.031815
true
false
false
pariahsoft/Dennis
commands/join.py
1
2591
######################################## ## Adventure Bot "Dennis" ## ## commands/join.py ## ## Copyright 2012-2013 PariahSoft LLC ## ######################################## ## ********** ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software...
mit
-1,338,686,518,646,774,300
40.790323
158
0.660363
false
3.760522
false
false
false
tensorflow/agents
tf_agents/utils/common.py
1
50736
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
apache-2.0
7,468,900,581,231,471,000
34.356098
87
0.673802
false
3.715562
false
false
false
leonardoo/django-pipeline
pipeline/templatetags/pipeline.py
1
5342
from __future__ import unicode_literals import logging from django.contrib.staticfiles.storage import staticfiles_storage from django import template from django.template.base import VariableDoesNotExist from django.template.loader import render_to_string from django.utils.safestring import mark_safe from ..collect...
mit
3,920,505,165,884,596,000
34.377483
163
0.647323
false
4.128284
false
false
false
ncsu-osgeorel/grass-particle-flow-visualization
v.random.probability/v.random.probability.py
1
3506
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################ # # MODULE: v.random.probability # AUTHOR(S): Anna Petrasova # PURPOSE: Generates random vector points based on probability raster # COPYRIGHT: (C) 2013 by the GRASS Development Team # # ...
gpl-2.0
-3,447,419,904,983,814,000
32.711538
108
0.579578
false
3.603289
false
false
false
bmoretz/Algorithms
Python/ch_02/Progression/__init__.py
1
1237
class Progression: """Iterator producing a generic progression Default iterator produces the whole numbers 0, 1, 2, ... """ def __init__(self, start=0): """Initialize current to the first value of the progression.""" self._current = start def _advance(self): """Update self...
gpl-3.0
-8,686,870,622,804,007,000
26.511111
75
0.57882
false
4.355634
false
false
false
hobarrera/khal
khal/khalendar/khalendar.py
1
13821
# Copyright (c) 2013-2017 Christian Geier et al. # # 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
-4,693,823,169,885,647,000
39.177326
95
0.616019
false
4.248694
false
false
false
Ernestyj/PyStudy
DataScience/python/mysql_query/td_job_time_used_query.py
1
2104
# -*- coding: utf-8 -*- import os import MySQLdb import pandas as pd import traceback import logging from mysql_query import ROOT_PATH from tools.json_tools import JsonConf class TDJobTimeUsedQuery(): def __init__(self, conf_path=os.path.join(ROOT_PATH, 'conf/conf.json')): # init param self.conf_...
apache-2.0
8,852,176,755,778,378,000
34.083333
116
0.569867
false
4.007619
false
false
false
savithruml/HOT-OpenStack
python-automate/create_VN.py
1
1146
#!/usr/bin/env python #AUTHOR: SAVITHRU LOKANATH #CONTACT: SAVITHRU AT JUNIPER.NET import sys from vnc_api import vnc_api def create_VirtualNetwork(network_name, network_subnet, network_mask, vnc, project): """ FUNCTION TO CREATE VIRTUAL-NETWORK """ vn_obj = vnc_api.VirtualNetwork(name=network_nam...
apache-2.0
7,363,044,350,327,122,000
29.972973
130
0.648342
false
3.183333
false
false
false
sproberts92/interleave-pdf
interleave-pdf.py
1
1996
import PyPDF2 import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as fd class Application(tk.Frame): def __init__(self, master=None): root = tk.Tk() root.iconbitmap('icon\\interleave-pdf.ico') self.input_path = tk.StringVar(); self.output_path = tk.StringVar(); ttk.Frame.__init__(self...
mit
-7,549,118,881,770,922,000
29.242424
93
0.692385
false
2.807314
false
false
false
steveluo/ponticons
builder/generate.py
1
11854
from subprocess import call import os import json BUILDER_PATH = os.path.dirname(os.path.abspath(__file__)) ROOT_PATH = os.path.join(BUILDER_PATH, '..') FONTS_FOLDER_PATH = os.path.join(ROOT_PATH, 'fonts') CSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'css') SCSS_FOLDER_PATH = os.path.join(ROOT_PATH, 'scss') LESS_FOLDER_...
mit
-5,047,914,053,536,614,000
28.78392
115
0.595411
false
2.935612
false
false
false
KarolBedkowski/alldb
alldb/gui/dialogs/message_boxes.py
1
7396
#!/usr/bin/python2.4 # -*- coding: utf-8 -*- """ message_boxes KPyLibs Copyright (c) Karol Będkowski, 2004, 2005, 2006 This file is part of KPyLibs """ __author__ = "Karol Będkowski" __copyright__ = "Copyright (c) Karol Będkowski, 2004-2010" __version__ = "2010-05-24" __all__ = ['message_box_error', 'message_box_inf...
gpl-2.0
7,842,975,698,442,234,000
28.690763
79
0.70188
false
2.822833
false
false
false
mitchellrj/touchdown
touchdown/aws/rds/rollback.py
1
7940
# Copyright 2015 Isotoma Limited # # 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
-4,548,377,842,502,384,600
38.899497
130
0.622922
false
4.317564
false
false
false
ros2/ci
ros2_batch_job/batch_job.py
1
1859
# Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-2,010,590,071,138,349,800
30.508475
90
0.672405
false
4.158837
false
false
false
stana/django-ztree
ztree/view_dispatch.py
1
1272
from ztreeauth.decorators import authorize_request from ztree.component.views import SiteHomeView from akuna.component import get_component import logging logger = logging.getLogger('ztree') #def _request_kwargs(request): # # XXX QueryDict in release 1.4 will have dict() method # from ztree.utils import query...
mit
3,043,349,934,671,011,000
35.342857
84
0.708333
false
3.543175
false
false
false
Erotemic/ubelt
dev/bench_local_import.py
1
2765
""" Tests the difference between importing something globally versus locally """ def bench_local_versus_global_import(): """ Write two python files that loop over a test function that uses some external module. One version imports the dependency globally at startup, the other does a lazy import o...
apache-2.0
1,189,146,794,990,709,200
27.802083
89
0.547197
false
4.145427
true
false
false
JMoravec/unkRadnet
zunzunCode/pythonequations/Examples/ComplexExamples/WeightedFitNonExtendedBioScienceEquations2D.py
2
8379
#! /usr/bin/python # Version info: $Id: FitAllEquations2D.py 75 2009-08-04 19:32:09Z zunzun.com $ # the pythonequations base is located up one directory from the top-level examples # directory, go up one directory in the path from there for the import to work properly from __future__ import generators import sys, o...
bsd-3-clause
8,186,659,841,814,698,000
42.86911
123
0.667741
false
4.277182
false
false
false
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/Cryptodome/SelfTest/Cipher/test_CBC.py
1
15791
# =================================================================== # # Copyright (c) 2014, Legrandin <helderijs@gmail.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. Redistributio...
gpl-2.0
824,887,642,023,354,600
37.514634
96
0.593883
false
3.386446
true
false
false
braaen/netaddr
netaddr/ip/__init__.py
1
66056
#----------------------------------------------------------------------------- # Copyright (c) 2008-2016, David P. D. Moss. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #----------------------------------------------------------------------------- """Routines for IPv4 a...
bsd-3-clause
6,058,366,375,679,334,000
33.656873
105
0.562129
false
4.247155
false
false
false
2uller/LotF
App/Lib/idlelib/ReplaceDialog.py
1
6017
from Tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase import re def replace(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) ...
gpl-2.0
8,539,603,881,804,720,000
29.835979
80
0.499252
false
3.927546
false
false
false
thomaslee/python-dbutil
dbutil/connection.py
1
2646
from .row import row class cursor(object): def __init__(self, impl): object.__init__(self) self.impl = impl def __getattr__(self, key): return getattr(self.impl, key) def one(self, query, params): if params is None: params = tuple() self.impl.execut...
mit
-4,737,184,511,130,028,000
26.5625
63
0.538927
false
4.089645
false
false
false
alangwansui/mtl_ordercenter
openerp/addons/001_sale/wizard/order_recive_wizard.py
1
2937
#! /usr/bin/python # -*- coding:utf-8 -*- from osv import fields,osv from tools.translate import _ import time from datetime import datetime class order_recive_wizard(osv.osv_memory): _name='order.recive.wizard' _columns={ 'name':fields.char(u'客户',readonly=False,size=16), } def creat...
agpl-3.0
7,303,427,420,835,464,000
33.662651
136
0.492875
false
3.396694
false
false
false
AlexanderPease/viv
app/api.py
1
3691
import app.basic, settings, ui_methods import logging, datetime import tornado.web from db.entrydb import Entry ######################## ### AddEntry ### User clicked "Learn More" ### api/addentry ######################## class AddEntry(app.basic.BaseHandler): def post(self): logging.info("POST to /addent...
gpl-3.0
4,879,624,602,401,724,000
38.265957
105
0.502032
false
4.415072
false
false
false
gunthercox/mathparse
mathparse/mathwords.py
1
13231
# -*- coding: utf-8 -*- from __future__ import unicode_literals import math """ Utility methods for getting math word terms. """ BINARY_OPERATORS = { '^', '*', '/', '+', '-' } MATH_WORDS = { 'ENG': { 'unary_operators': { 'squared': '^ 2', 'cubed': '^ 3', 'square ro...
mit
3,602,475,967,823,126,500
24.249476
78
0.347725
false
2.973827
false
false
false
muccg/rdrf
rdrf/rdrf/db/filestorage.py
1
1946
import logging import re from rdrf.models.definition.models import Registry, CDEFile from rdrf.helpers.utils import models_from_mongo_key logger = logging.getLogger(__name__) __all__ = ["get_id", "delete_file_wrapper", "get_file", "store_file", "store_file_by_key"] def get_id(value): if isinstance(va...
agpl-3.0
4,928,787,294,243,687,000
28.938462
96
0.595581
false
3.444248
false
false
false
FrederichRiver/neutrino
applications/saturn/saturn/markov.py
1
1065
#!/usr/bin/python3 import pandas as pd from venus.stock_base import StockEventBase class markov_stratagy(StockEventBase): # def __init__(self, header): # super(StockEventBase, markov_stratagy).__init__(header) def run(self): import matplotlib.pyplot as plt stock_list = self.get_all_sto...
bsd-3-clause
-8,550,457,769,135,806,000
30.323529
71
0.539906
false
3.538206
false
false
false
google/uis-rnn
uisrnn/loss_func.py
1
2386
# Copyright 2018 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
4,144,776,973,042,356,000
30.394737
79
0.688181
false
3.722309
false
false
false
mpatacchiola/deepgaze
deepgaze/saliency_map.py
1
15440
#!/usr/bin/env python # The MIT License (MIT) # Copyright (c) 2017 Massimiliano Patacchiola # https://mpatacchiola.github.io # https://mpatacchiola.github.io/blog/ # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, F...
mit
-3,878,077,992,595,285,500
55.764706
141
0.6125
false
3.541284
false
false
false
rhyolight/nupic.son
tests/app/summerofcode/logic/test_organization.py
1
2546
# Copyright 2013 the Melange 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 wr...
apache-2.0
2,475,230,859,541,138,000
32.064935
80
0.714847
false
3.744118
true
false
false
littlecarson/web-scraping
00/common.py
1
2363
# -*- coding: utf-8 -*- import urllib2 import urlparse def download1(url): """Simple downloader""" return urllib2.urlopen(url).read() def download2(url): """Download function that catches errors""" print 'Downloading:', url try: html = urllib2.urlopen(url).read() except urllib2.URLE...
mit
6,100,448,820,335,470,000
28.55
71
0.603893
false
3.848534
false
false
false
Evanqiao/LeetCode-qyh
1_TwoSum/1_TwoSum.py
1
1108
''' * Given an array of integers, return indices of the two numbers such that t * hey add up to a specific target. * You may assume that each input would have exactly one solution. * Example: * Given nums = [2, 7, 11, 15], target = 9, * * Because nums[0] + nums[1] = 2 + 7 = 9, * return [0, 1]. * * Author: qia...
gpl-2.0
-4,506,444,111,493,428,000
20.72549
76
0.576715
false
2.547126
false
false
false
ZeitgeberH/nengo
nengo/decoders.py
1
12524
""" Functions concerned with solving for decoders or full weight matrices. Many of the solvers in this file can solve for decoders or weight matrices, depending on whether the post-population encoders `E` are provided (see below). Solvers that are only intended to solve for either decoders or weights can remove the `E...
gpl-3.0
2,231,580,630,669,790,200
31.957895
79
0.59382
false
3.016378
false
false
false
openstack/heat
heat/engine/resources/openstack/blazar/lease.py
1
12150
# # 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 # ...
apache-2.0
-1,035,794,979,680,853,400
38.320388
79
0.499671
false
4.762838
false
false
false
anchore/anchore-engine
scripts/data_generators/generate_gem_records.py
1
1738
import sys def generate_npms(user_id, image_id, count, use_seq=False): result_rows = [] latest = "2.1.0" versions_json = '["2.1.0"]' licenses_json = '["MIT"]' origins_json = "[]" source_pkg = "" seq = 0 for c in range(count): path = "/usr/testing/somegems/{}".format(c) ...
apache-2.0
-7,615,746,500,324,746,000
23.828571
85
0.43153
false
3.713675
false
false
false
Riverscapes/pyBRAT
SupportingTools/perennialNetwork.py
1
22231
# ------------------------------------------------------------------------------- # Name: Perennial Network # Purpose: Script generates perennial network using NHD data inputs # # Author: Sara Bangen (sara.bangen@gmail.com) # # ----------------------------------------------------------------------------...
gpl-3.0
4,668,356,773,407,889,000
58.441176
177
0.699879
false
3.209789
false
false
false
nullzero/wp
lib/libservice.py
1
2527
# -*- coding: utf-8 -*- """ Library to extract information from a service. Also clear the page of service so that it is ready for next customer. """ __version__ = "1.0.1" __author__ = "Sorawee Porncharoenwase" import sys, difflib import preload import pwikipedia as pywikibot from lib import libwikitable, libinfo, re...
mit
-2,177,928,872,968,498,400
31.397436
78
0.58053
false
3.760417
false
false
false
zhiyu-he/algorithm-trip
growth/oj/leet_code/algorithms/200-number-of-islands.py
1
1997
# -*- coing: utf-8 -*- class UnionFind(object): def __init__(self, N): self.roots = [0] * N for i in range(N): self.roots[i] = i def find_roots(self, i): root = i while root != self.roots[root]: root = self.roots[root] # 路径压缩, 用于提升速度, TODO: 补充一个pa...
gpl-2.0
1,653,012,239,232,337,700
28.38806
80
0.450482
false
3.412478
false
false
false
elena/django
django/db/backends/mysql/base.py
6
15740
""" MySQL database backend for Django. Requires mysqlclient: https://pypi.org/project/mysqlclient/ """ from django.core.exceptions import ImproperlyConfigured from django.db import IntegrityError from django.db.backends import utils as backend_utils from django.db.backends.base.base import BaseDatabaseWrapper from dja...
bsd-3-clause
6,379,511,573,347,565,000
38.547739
112
0.592122
false
4.363737
false
false
false
jwadden/django-sharding
tests/test_router.py
1
10527
from mock import patch from django.conf import settings from django.contrib.auth.models import Group from django.test import TestCase from tests.models import TestModel, ShardedTestModelIDs from django_sharding_library.exceptions import InvalidMigrationException from django_sharding_library.router import ShardedRoute...
bsd-3-clause
2,236,797,598,634,923,800
46.85
127
0.681106
false
3.430108
true
false
false
fred-dbg/fred
fred/personality/personality.py
1
11925
############################################################################### # Copyright (C) 2009, 2010, 2011, 2012 by Kapil Arya, Gene Cooperman, # # Tyler Denniston, and Ana-Maria Visan # # {kapil,gene,tyler,amvisan}@ccs.neu.edu # ...
gpl-3.0
-1,365,031,280,516,349,700
43.00369
79
0.576268
false
4.057503
false
false
false
oliverodaa/cs184-final-proj
dwinelle/video/sandbox.py
1
1539
#!/usr/bin/env python3 # This file is part of dwinelle-tools. # dwinelle-tools 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. # dwi...
mit
1,949,084,359,407,042,300
33.2
73
0.584795
false
3.8475
false
false
false
EvilKhaosKat/simple-python-log-analyzer
main.py
1
3502
import sys from SettingsAnalyzer import SettingsAnalyzer #import statprof PARAM_FILENAME = "-filename" PARAM_OUTPUT_FILENAME = '-output_filename' PARAM_SETTINGS_FILENAME = '-settings_filename' class Main: filename = "" settings_filename = "" output_filename = "" def __init__(self, filename, setting...
apache-2.0
-4,360,315,384,879,046,700
27.704918
137
0.604512
false
4.43853
false
false
false
hajicj/safire
test/test_rbm_unsupervised_training.py
1
2261
#!/usr/bin/env python """ Testing a small training procedure to check that the loading and training architecture is OK. """ import logging import os import unittest from safire.data.loaders import MultimodalDatasetLoader from safire.learning.interfaces.model_handle import ModelHandle from safire.learning.models impor...
gpl-3.0
8,496,698,427,094,147,000
30.402778
78
0.68598
false
3.932174
true
false
false
Comunitea/CMNT_004_15
project-addons/crm_claim_rma_custom/models/stock.py
1
3528
############################################################################## # # Copyright (C) 2015 Comunitea Servicios Tecnológicos # $Carlos Lombardía Rodríguez <carlos@comunitea.com>$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
agpl-3.0
1,379,849,753,858,374,400
43.0625
110
0.539574
false
4.456384
false
false
false
tgsmith61591/pyramid
pmdarima/utils/metaestimators.py
1
3457
# -*- coding: utf-8 -*- # # Author: Taylor Smith <taylor.smith@alkaline-ml.com> # # Metaestimators for the ARIMA class. These classes are derived from the # sklearn metaestimators, but adapted for more specific use with pmdarima. from operator import attrgetter from functools import update_wrapper __all__ = [ 'if...
mit
6,635,367,079,954,199,000
34.27551
79
0.637836
false
4.364899
false
false
false
researchstudio-sat/wonpreprocessing
python-processing/scripts/create_category_slice.py
1
1856
__author__ = 'hfriedrich' import sys import codecs import numpy as np from scipy.sparse import csr_matrix from scipy.io import mmwrite # simple script that creates a categoryslice.mtx including a new headers file from the headers.txt file and the # categorized needs in the allneeds.txt file. import logging logging.b...
apache-2.0
-1,714,567,181,031,670,300
28.935484
111
0.682651
false
3.374545
false
false
false
grueni75/GeoDiscoverer
Source/Platform/Target/Android/core/src/main/jni/gdal-3.2.1/swig/python/samples/magphase.py
1
2070
#!/usr/bin/env python3 # ****************************************************************************** # # Project: GDAL # Purpose: Example computing the magnitude and phase from a complex image. # Author: Frank Warmerdam, warmerdam@pobox.com # # *****************************************************************...
gpl-3.0
-347,377,057,396,650,430
42.125
80
0.662802
false
3.980769
false
false
false
kerimlcr/ab2017-dpyo
ornek/lollypop/lollypop-0.9.229/save/mpd.py
1
48981
# Copyright (c) 2014-2016 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # Copyright (C) 2011 kedals0@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 3 of the Licens...
gpl-3.0
-4,235,209,214,175,695,400
33.109331
79
0.466589
false
4.112249
false
false
false
RigoBono/PracticaManejoMysqlPython
Interfaz.py
1
1613
import gtk class PyApp(gtk.Window): def __init__(self): super(PyApp, self).__init__() self.set_title("Libreria") self.set_size_request(600, 300) self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(6400, 6400, 6440)) self.set_position(gtk.WIN_POS_CENTER) mb = gtk.MenuB...
gpl-2.0
9,197,252,487,395,023,000
25.442623
73
0.614383
false
3.14425
false
false
false
decathorpe/kentauros
kentauros/modules/sources/git.py
1
19533
import configparser as cp import datetime import logging import os import shutil from git import Repo from git.exc import BadName from kentauros.conntest import is_connected from kentauros.context import KtrContext from kentauros.package import KtrPackage from kentauros.result import KtrResult from kentauros.shell_en...
gpl-2.0
-4,113,949,804,338,584,600
28.328829
99
0.559719
false
3.992029
false
false
false
NUCyberEd/CloudWhip
cloudWhip/netIps.py
1
2534
__author__ = 'shekarnh' import itertools import sys import logging from ipaddress import ip_network import re class NetIps(object): def __init__(self): self.logger = logging.getLogger(__name__) def generate_cidr_blocks(self, input_string): ip_block = input_string.split('/') if len(i...
mit
8,509,422,852,336,583,000
36.835821
100
0.570639
false
3.726471
false
false
false
cyanfish/heltour
heltour/tournament/migrations/0005_auto_20160717_2320.py
1
1097
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-17 23:20 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('tournament', '0004_auto_20160717_2229'), ] operations = [ migrations.CreateModel( ...
mit
5,704,541,506,627,418,000
33.28125
114
0.578851
false
4.353175
false
false
false
eldarion/mimesis
docs/conf.py
1
7160
# -*- coding: utf-8 -*- # # mimesis documentation build configuration file, created by # sphinx-quickstart on Fri May 28 12:50:21 2010. # # 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 # autogenerated file. # # All...
bsd-3-clause
-3,665,696,451,101,933,600
31.545455
80
0.70824
false
3.719481
true
false
false
foligny/browsershots-psycopg2
shotfactory/shotfactory04/gui/windows/shiretoko.py
1
3175
# browsershots.org - Test your web design in different browsers # Copyright (C) 2007 Johann C. Rocholl <johann@browsershots.org> # # Browsershots 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-3.0
4,722,275,427,968,675,000
34.277778
85
0.637795
false
3.704784
false
false
false
rzanluchi/keyard
tests/app/test_integration_app.py
1
4134
# -*- coding: utf-8 -*- import falcon import falcon.testing import json from keyard.app import resource from keyard.app.utils import prepare_app class TestIntegrationKeyardResource(falcon.testing.TestBase): def before(self): self.resource = resource.KeyardResource() self.api.add_route('/keyard',...
mit
7,312,402,123,765,632,000
36.581818
74
0.59821
false
3.632689
true
false
false
droundy/deft
papers/renormalization/figs/fluctuations.py
1
1264
#!/usr/bin/python2 import matplotlib, sys if 'show' not in sys.argv: matplotlib.use('Agg') from pylab import * from numpy import random random.seed(0) ks = arange(0.0, 1.0, .005) ks[ks>0.5] -= 1 kx, ky = meshgrid(ks, ks) gaus = random.normal(size = kx.shape)/(kx**2 + ky**2)**.7 for i in range(gaus.shape[0]): ...
gpl-2.0
-3,917,242,472,954,922,500
19.063492
63
0.564082
false
2.273381
false
false
false
davidb24v/drwho
volume.py
1
1243
''' Set the alsa mixer volume level ''' import os import glob import subprocess class Volume(object): def __init__(self, wd): self.wd = wd self.setVolume(create=True) def setVolume(self, create=False): volFile = os.path.join(self.wd, "Sounds", "Volume", "Level.txt") if glob...
mit
-8,750,216,282,086,911,000
26.021739
72
0.436846
false
4.271478
false
false
false
maykungth/phrWorkload
Summarize1.py
1
6182
from datetime import datetime from datetime import timedelta import csv,glob import numpy from matplotlib import pyplot as plt # Setup param CSV_DIR = "C:\Users\mayku\Documents\LAB_res_lar\L_0.5_dis" CSV_OUTPUT = "table_summarize.csv" CSV_CONCLUS = "conclus_all.csv" CSV_FILE_SIZE = "file_size_analyze.csv" start_seq = ...
gpl-3.0
-3,351,475,876,406,509,000
43.797101
159
0.56616
false
2.75613
false
false
false
nttks/edx-platform
biz/djangoapps/ga_contract_operation/student_unregister.py
1
6427
import logging import time from django.contrib.auth.models import User from django.db import transaction from django.utils.translation import ugettext as _ from student.models import CourseEnrollment from biz.djangoapps.ga_contract_operation.models import ContractTaskHistory, StudentUnregisterTaskTarget ...
agpl-3.0
-941,207,903,661,544,800
41.134228
189
0.648203
false
4.236651
false
false
false
dsnopek/bibliobird-anki-server
addon/bibliobird.py
1
1571
# -*- coding: utf-8 -*- # Copyright: David Snopek <dsnopek@gmail.com> # License: GNU Affero GPL, version 3 or later; http://www.gnu.org/copyleft/agpl-3.0.html # # Sync decks to BiblioBird.com instead of AnkiWeb. # # This allows BiblioBird users to access a special "bibliobird" deck, which # contains flashcards for all ...
agpl-3.0
-3,223,279,291,392,075,300
33.152174
88
0.674093
false
3.12326
false
false
false
octohedron/TouristFriend
touristfriend/service.py
1
3900
from touristfriend.external import google from touristfriend.external import yelp import time def bayesian(R, v, m, C): """ Computes the Bayesian average for the given parameters :param R: Average rating for this business :param v: Number of ratings for this business :param m: Minimum ratings requ...
mit
3,389,382,049,317,615,600
33.210526
100
0.59
false
4.166667
false
false
false
jkyeung/XlsxWriter
xlsxwriter/test/comparison/test_optimize08.py
1
1279
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2016, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
1,603,871,859,798,802,400
26.804348
93
0.582486
false
3.739766
true
false
false
Eksmo/calibre
src/calibre/gui2/convert/txt_input_ui.py
1
5598
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gugu/w/calibre/src/calibre/gui2/convert/txt_input.ui' # # Created: Thu Jul 19 23:32:30 2012 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _f...
gpl-3.0
-6,037,604,166,180,521,000
54.425743
215
0.70686
false
3.82116
false
false
false
florianfesti/boxes
boxes/generators/winerack.py
1
4987
#!/usr/bin/env python3 # Copyright (C) 2013-2016 Florian Festi # # 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....
gpl-3.0
-8,086,438,510,310,509,000
36.496241
92
0.505915
false
3.158328
false
false
false
rajivpant/employeeware
orgchartapp/models.py
1
1252
from django.db import models # Create your models here. class Employee(models.Model): full_name = models.CharField(max_length=100) job_title = models.CharField(max_length=100) contractor = models.BooleanField(default=False) part_time_status = models.BooleanField(default=False) def __unicod...
mit
2,027,749,668,032,919,300
31.102564
93
0.707668
false
3.277487
false
false
false
nsdf/nsdf
graphviz/event_dialects/data_ev_oned.py
1
4870
# This script was written by Chaitanya Chintaluri c.chinaluri@nencki.gov.pl # This software is available under GNU GPL3 License. # Uses pygraphviz to illustrate the inner structure of NSDF file format # This is to use in the NSDF paper and to generate machine readable file structure # for the convenience of the user. ...
gpl-3.0
6,416,509,634,007,546,000
46.745098
339
0.638193
false
2.903995
false
false
false
liuyonggg/learning_python
leetcode/p16.py
1
3855
''' Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for each node, and , as a separator for node label and each neighbor of the node. As an example, consider the serialized graph {...
mit
5,551,133,630,314,498,000
28.204545
105
0.542412
false
3.724638
false
false
false
anton-golubkov/Garland
src/ipf/ipfblock/matchtemplate.py
1
1585
#------------------------------------------------------------------------------- # Copyright (c) 2011 Anton Golubkov. # All rights reserved. This program and the accompanying materials # are made available under the terms of the GNU Lesser Public License v2.1 # which accompanies this distribution, and is available at #...
lgpl-2.1
-6,886,518,663,075,567,000
37.658537
80
0.652997
false
3.837772
false
false
false
ahkab/ahkab
ahkab/options.py
1
7088
# -*- coding: utf-8 -*- # options.py # Global options file # Copyright 2006 Giuseppe Venturini # This file is part of the ahkab simulator. # # Ahkab is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 2 o...
gpl-2.0
-7,127,362,403,686,608,000
32.752381
81
0.734058
false
3.346553
false
false
false
metajack/notify-mublog
githook.py
1
1585
# githook.py """Small library to handle interaction with Git for notification scripts. """ from datetime import datetime import re import subprocess _EMAIL_RE = re.compile("^(.*) <(.*)>$") def parse_input(f): """Parse the hook input data from Git. """ data = [] for line in f.readlines(): old, new,...
gpl-3.0
-6,614,151,803,508,881,000
21.971014
73
0.58612
false
3.013308
false
false
false
rndusr/stig
stig/commands/cli/_table.py
1
10256
# 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 in the hope that it will be useful # but...
gpl-3.0
-3,521,809,208,679,807,000
39.370079
88
0.636727
false
3.79216
false
false
false
delphcf/sis
sis/food/forms.py
1
4017
from django.forms.models import inlineformset_factory from django.forms.widgets import CheckboxSelectMultiple from django.utils.translation import ugettext as _ from crispy_forms.layout import Submit, Layout, Field, Div from crispy_forms.bootstrap import ( FormActions, InlineField, InlineCheckboxes) from crispy_f...
bsd-3-clause
-3,859,865,743,165,371,000
40
154
0.53423
false
4.366304
false
false
false
lefnire/tensorforce
tensorforce/core/explorations/epsilon_decay.py
1
2398
# Copyright 2017 reinforce.io. 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...
apache-2.0
-8,116,625,388,283,116,000
37.063492
120
0.629274
false
3.983389
false
false
false
Curious72/EvalAI
settings/common.py
1
7093
""" Django settings for evalai project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import dat...
gpl-3.0
-5,516,002,025,231,491,000
25.077206
99
0.607641
false
3.615189
false
false
false
guorendong/iridium-browser-ubuntu
third_party/chromite/lib/brick_lib.py
1
9174
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Common brick related utilities.""" from __future__ import print_function import os from chromite.lib import osutils from chromite.lib import workspa...
bsd-3-clause
2,635,621,546,866,329,000
32.604396
80
0.648681
false
3.990431
true
false
false
forkbong/qutebrowser
qutebrowser/browser/shared.py
1
13322
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
-5,497,054,268,093,385,000
33.874346
88
0.617325
false
4.021129
true
false
false
khrapovs/fangoosterlee
tests/test_fangoosterlee.py
1
6131
#!/usr/bin/env python # -*- coding: utf-8 -*- """Testing suite for COS method. """ from __future__ import print_function, division import unittest as ut import numpy as np import scipy.stats as scs from impvol import impvol_bisection, blackscholes_norm, lfmoneyness from fangoosterlee import (cosmethod, cfinverse, GB...
mit
-3,686,408,673,662,308,400
32.502732
79
0.617354
false
3.346616
true
false
false
egbertbouman/tribler-g
Tribler/Core/APIImplementation/miscutils.py
1
1042
# Written by Arno Bakker # see LICENSE.txt for license information import sys import re from threading import Timer DEBUG = False def parse_playtime_to_secs(hhmmss): if DEBUG: print >>sys.stderr,"miscutils: Playtime is",hhmmss r = re.compile("([0-9\.]+):*") occ = r.findall(hhmmss) ...
lgpl-2.1
-306,814,076,071,390,850
22.232558
65
0.53071
false
3.266458
false
false
false
yafeunteun/wikipedia-spam-classifier
revscoring/revscoring/scorer_models/test_statistics/tests/test_accuracy.py
1
2008
from nose.tools import eq_ from ..accuracy import accuracy def test_boolean(): test_statistic = accuracy() score_labels = [ ({'prediction': True}, {'prediction': True}, True), ({'prediction': False}, {'prediction': True}, False), ({'prediction': True}, {'prediction': True}, True), ...
mit
501,779,021,087,786,500
36.185185
61
0.552291
false
3.670932
true
false
false
apporc/nova
nova/tests/unit/virt/xenapi/test_xenapi.py
1
177611
# Copyright (c) 2010 Citrix Systems, 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 applicab...
apache-2.0
7,545,088,937,095,447,000
41.51101
79
0.562595
false
3.8756
true
false
false