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
abhishekraok/GraphMap
graphmap/tree_viewer.py
1
3451
import imagetree import serializer from utilities import quadkey_to_xyz, xyz_to_quadkey, is_valid_quadkey from serializer import create_tree_from_jpg_url import commander import constants import sys valid_commands = ['+', '-', 'l', 'r', 'u', 'd', 's'] def tree_viewer_valid_input(input_command): return input_comm...
apache-2.0
-6,180,173,991,250,044,000
37.775281
118
0.578093
false
3.503553
false
false
false
Denvi/FlatCAM
FlatCAMWorker.py
1
1587
from PyQt4 import QtCore class Worker(QtCore.QObject): """ Implements a queue of tasks to be carried out in order in a single independent thread. """ # avoid multiple tests for debug availability pydevd_failed = False task_completed = QtCore.pyqtSignal(str) def __init__(self, app, n...
mit
5,585,728,055,401,166,000
25.898305
78
0.559546
false
4.100775
false
false
false
engeens/pangolin
routes.py
1
1523
# -*- coding: utf-8 -*- # This is an app-specific example router # # This simple router is used for setting languages from app/languages directory # as a part of the application path: app/<lang>/controller/function # Language from default.py or 'en' (if the file is not found) is used as # a default_language # # ...
gpl-3.0
-6,541,904,693,397,986,000
39.078947
87
0.676297
false
3.855696
false
false
false
demin-dmitriy/almost-haskell
src/AHLexerTest.py
1
10390
from unittest import TestCase from AHLexer import * # Tests and helper methods that are common for PreLexer and AHLexer class CommonLexerTestCase: class BasicErrorListener: def syntaxError(self, recogn, sym, line, column, msg, exc): raise LexerError("some error %s" % msg, line, column, None) ...
mit
3,729,728,006,217,532,000
31.28125
80
0.488771
false
3.549828
true
false
false
gizmachi/ct_tools
gaol/gaol_lib.py
1
1947
import json import urllib import urllib2 import ssl import base64 from lib import * class sslparameters: sslcontext = None def get_opener(): try: opener = urllib2.build_opener(urllib2.HTTPSHandler(context=sslparameters.sslcontext)) except TypeError: opener = urllib2.build_opener(urllib2.H...
bsd-3-clause
5,098,226,471,701,478,000
28.515152
93
0.608115
false
3.520796
false
false
false
CCallahanIV/data-structures
src/test_priorityq.py
1
4519
"""This Module contains testing for the Priority Q.""" import pytest TEST_SET = [ [(17, 1), (99, 2), (15, 1), (99, 3), (1, 2), (9, 3)] ] BAD_PRIO = [True, False, [1, 2], (), {"oops": "This is bad"}, "No more, please!"] BAD_INIT = [[(1, 2), (1, 2, 3)], True, False, "whoops"] @pytest.fixture def empty_priority_q(...
mit
-5,064,511,433,917,170,000
30.381944
89
0.658553
false
3.262816
true
false
false
platformio/platformio-core
platformio/commands/update.py
1
2091
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
-3,055,954,892,819,605,500
34.440678
84
0.726925
false
3.747312
false
false
false
fridayy/movie-trailer-uc
main/fresh_tomatoes.py
1
6763
import webbrowser import os import re # Styles and scripting for the page main_page_head = ''' <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Fresh Tomatoes!</title> <!-- Bootstrap 3 --> <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.m...
gpl-3.0
-8,687,864,254,606,987,000
32.815
144
0.554488
false
3.632116
false
false
false
shiyifuchen/PyFem
pyfem/pyfem/fem/Assembly.py
1
4289
# -*- coding: utf-8 -*- from numpy import zeros, ones, ix_ from pyfem.util.dataStructures import Properties from pyfem.util.dataStructures import elementData from scipy.sparse import lil_matrix import time ####################################### # General array assembly routine for: # # * assembleInternalForce ...
gpl-3.0
7,672,155,459,087,517,000
31.5
95
0.592213
false
3.653322
false
false
false
3dfxsoftware/cbss-addons
project_conf/model/project.py
1
4367
# # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # # # 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, eith...
gpl-2.0
-1,541,785,040,471,365,400
45.956989
294
0.580948
false
3.87833
true
false
false
stephrdev/django-formwizard
formwizard/storage/cookie.py
1
1712
from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils import simplejson as json from django.utils.hashcompat import sha_constructor import hmac from formwizard import storage sha_hmac = sha_constructor class CookieStorage(storage.BaseStorage): encoder = json....
bsd-3-clause
-7,821,872,325,361,776,000
30.127273
80
0.625584
false
3.855856
false
false
false
MalloyDelacroix/DownloaderForReddit
DownloaderForReddit/viewmodels/add_reddit_object_list_model.py
1
5090
""" Downloader for Reddit takes a list of reddit users and subreddits and downloads content posted to reddit either by the users or on the subreddits. Copyright (C) 2017, Kyle Hickey This file is part of the Downloader for Reddit. Downloader for Reddit is free software: you can redistribute it and/or modify it und...
gpl-3.0
6,999,803,051,143,106,000
36.426471
118
0.651277
false
3.885496
false
false
false
binarybana/samcnet
exps/priorstrength.py
1
2301
import sys, os, random import zlib, cPickle ############### SAMC Setup ############### import numpy as np import scipy as sp import networkx as nx from samcnet.samc import SAMCRun from samcnet.bayesnetcpd import BayesNetSampler, BayesNetCPD from samcnet import utils from samcnet.generator import * if 'WORKHASH' in o...
mit
5,560,503,565,455,464,000
26.722892
82
0.616688
false
3.178177
false
false
false
cordery/django-countries-plus
countries_plus/utils.py
1
7136
# coding=utf-8 import re import requests import six from django.core.exceptions import ValidationError from .models import Country DATA_HEADERS_ORDERED = [ 'ISO', 'ISO3', 'ISO-Numeric', 'fips', 'Country', 'Capital', 'Area(in sq km)', 'Population', 'Continent', 'tld', 'CurrencyCode', 'CurrencyName', 'Phone', ...
mit
7,095,548,300,540,033,000
23.904255
99
0.467749
false
2.821615
false
false
false
tensorflow/graphics
tensorflow_graphics/image/color_space/tests/srgb_test.py
1
3322
# Copyright 2020 The TensorFlow 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 law or agreed to i...
apache-2.0
3,111,544,979,320,867,000
40.525
79
0.688742
false
3.456816
true
false
false
jiaaro/django-alert
alert/utils.py
1
8238
from alert.exceptions import AlertIDAlreadyInUse, AlertBackendIDAlreadyInUse,\ InvalidApplicableUsers import django from django.conf import settings from django.utils import timezone from django.template.loader import render_to_string, get_template from django.contrib.sites.models import Site from django.template i...
mit
-3,880,105,067,049,292,300
30.930233
224
0.59092
false
4.158506
false
false
false
Forage/Gramps
gramps/gen/merge/mergerepositoryquery.py
1
2677
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Michiel D. Nauta # # 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...
gpl-2.0
-7,466,816,308,397,948,000
35.671233
80
0.583115
false
4.395731
false
false
false
griimick/feature-mlsite
app/static/hindi-dependency-parser-2.0/bin/normalize_bojar_lrec_2010.py
1
1281
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys vowels_to_be_replaced= {} def replace_null(from_chr_num, to_chr_num): for x in range(from_chr_num, to_chr_num): vowels_to_be_replaced[chr(x)]= "" #replace_null(0x0900, 0x0904) #replace_null(0x093A, 0x0950) #replace_null(0x0951, 0x0958) #replace_nu...
mit
5,023,343,353,184,191,000
25.777778
47
0.617427
false
2.260788
false
false
false
balint256/ice
tlm/ui.py
1
18027
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ui.py # # Copyright 2014 Balint Seeber <balint256@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 ...
gpl-3.0
-1,446,360,939,147,403,300
30.460733
179
0.669107
false
2.851922
false
false
false
jwilliamn/handwritten
extraction/FormatModel/TestingCornersAlgorithms.py
1
1349
import numpy as np import cv2 import time import helloworld def countNonZero(sum, i_j, x_y = None): if x_y is None: i = i_j[0] j = i_j[1] if i<0 or j<0: return 0 return sum[i,j] else: i = i_j[0] j = i_j[1] x = x_y[0] y = x_y[1] ...
gpl-3.0
-184,997,578,644,377,950
24.961538
80
0.4596
false
2.624514
false
false
false
maximeolivier/pyCAF
pycaf/importer/importNetwork/importSwitch/cisco_switch.py
1
3141
#| This file is part of pyCAF. | #| | #| pyCAF is free software: you can redistribute it and/or modify | #| it under the terms of the GNU General Public License as published by | #| t...
gpl-3.0
3,787,811,056,711,934,000
41.445946
107
0.584527
false
4.084525
false
false
false
evilncrazy/vake
vake.py
1
2076
import sys, os import subprocess import re import select """ Runs an instance of make, echoing the stdout and storing the stderr line by line. """ def run_make(args): p = subprocess.Popen(["make"] + args, stdout = subprocess.PIPE, stderr = subprocess.PIPE) stderr = [] while p.poll() == None: reads = [p.s...
mit
-6,059,614,288,028,511,000
27.067568
124
0.587669
false
2.982759
false
false
false
cloudera/recordservice
tests/query_test/test_partitioning.py
1
4640
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
1,965,043,666,579,426,000
40.428571
89
0.708405
false
3.523159
true
false
false
hickeroar/simplebayes
simplebayes/__init__.py
1
10281
# coding: utf-8 """ The MIT License (MIT) Copyright (c) 2015 Ryan Vennell 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...
mit
-7,677,386,702,332,478,000
32.376623
78
0.603502
false
4.538631
false
false
false
prasanna08/oppia
core/storage/topic/gae_models.py
1
25011
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
apache-2.0
-248,851,925,992,345,250
38.7
82
0.65963
false
4.1685
false
false
false
CentralLabFacilities/m3meka
python/m3/omnibase.py
1
31978
# -*- coding: utf-8 -*- #M3 -- Meka Robotics Robot Components #Copyright (c) 2010 Meka Robotics #Author: edsinger@mekabot.com (Aaron Edsinger) #M3 is free software: you can redistribute it and/or modify #it under the terms of the GNU Lesser General Public License as published by #the Free Software Foundation, either v...
mit
7,803,926,033,021,083,000
42.44837
150
0.492682
false
4.020367
false
false
false
blckshrk/Weboob
modules/parolesmania/backend.py
1
1697
# -*- coding: utf-8 -*- # Copyright(C) 2013 Julien Veyssier # # This file is part of weboob. # # weboob 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 op...
agpl-3.0
5,074,640,716,121,560,000
31.018868
86
0.714791
false
3.498969
false
false
false
harisbal/pandas
pandas/tests/generic/test_generic.py
1
36186
# -*- coding: utf-8 -*- # pylint: disable-msg=E1101,W0612 from copy import copy, deepcopy from warnings import catch_warnings, simplefilter import pytest import numpy as np import pandas as pd from pandas.core.dtypes.common import is_scalar from pandas import (Series, DataFrame, Panel, date_range...
bsd-3-clause
2,502,932,496,458,174,000
34.03001
79
0.520063
false
3.707962
true
false
false
tdjordan/tortoisegit
gitproc.py
1
3594
# # front-end for TortoiseHg dialogs # # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com> # import os import sys from tortoisegit.tgitutil import get_prog_root # always use git exe installed with TortoiseHg tgitdir = get_prog_root() try: os.environ['PATH'] = os.path.pathsep.join([tgitdir, os.environ['PATH']]) exce...
gpl-2.0
-3,280,306,436,063,970,300
30.80531
97
0.553422
false
3.355742
false
false
false
Guymer/PyGuymer
return_dict_of_ISO_subtitle_streams.py
1
2124
# -*- coding: utf-8 -*- ############################################################################################## # This file is deprecated because Python 2.x is deprecated # # A Python 3.x version of this file can be found at: # # ...
apache-2.0
-7,274,281,633,515,023,000
35.62069
94
0.469397
false
4.637555
false
false
false
hyperspy/hyperspy_gui_ipywidgets
hyperspy_gui_ipywidgets/tests/test_tools.py
1
9853
import numpy as np import hyperspy.api as hs from hyperspy_gui_ipywidgets.tests.utils import KWARGS from hyperspy.signal_tools import (Signal1DCalibration, ImageContrastEditor, EdgesRange) class TestTools: def setup_method(self, method): self.s = hs.signals.Signal1D(1 ...
gpl-3.0
6,585,736,890,534,469,000
37.944664
81
0.563077
false
3.464487
true
false
false
google-research/language
language/nqg/model/parser/training/training_utils.py
1
3956
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
apache-2.0
2,828,534,664,817,358,000
40.642105
80
0.623357
false
3.822222
false
false
false
Nablaquabla/sns-analysis
sns-test.py
1
2499
import os import time as tm import sys # Handles the creation of condor files for a given set of directories # ----------------------------------------------------------------------------- def createCondorFile(dataDir,outDir,time): # Condor submission file name convention: run-day-time.condor with open('/home/...
gpl-3.0
-34,610,708,783,304,316
28.4
81
0.517407
false
3.590517
true
false
false
seikichi/tuitwi
tuitwi/state.py
1
11226
#!/usr/bin/python # -*- coding: utf-8 -*- import os import curses import curses.ascii class State(object): '''Stateパターン用の基底クラス''' def __init__(self, stdscr, form): self._form = form self._stdscr = stdscr self._func = {} self._func[curses.KEY_RESIZE] = self._resize self...
mit
-3,273,382,893,051,582,000
32.550152
116
0.588965
false
3.380704
false
false
false
knaggsy2000/stormforce-mq
plugins/plugin_core_serverdetails.py
1
8457
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # Copyright/License Notice (Modified BSD License) # ######################################################################### ###################################################...
bsd-3-clause
8,567,733,712,468,731,000
36.923767
420
0.601987
false
3.989151
false
false
false
kaichogami/wavenet
model.py
1
15261
"""Model for wavenet. Defines ops in tensorflow sense""" import numpy as np import tensorflow as tf MIN_DIL = 2 MAX_DIL = 4096 def _dilated_convolution(X, filters, dilation, name): """Helper function to carry out dilated convolution Parameters ========== X : tf.Tensor of shape(batch, width, height, ...
mit
-5,600,043,305,285,726,000
39.914209
92
0.539283
false
4.33059
false
false
false
ping/instagram_private_api
instagram_private_api/endpoints/collections.py
1
3411
import json from ..compatpatch import ClientCompatPatch class CollectionsEndpointsMixin(object): """For endpoints in related to collections functionality.""" def list_collections(self): return self._call_api('collections/list/') def collection_feed(self, collection_id, **kwargs): """ ...
mit
5,582,873,594,909,179,000
34.905263
101
0.522427
false
4.406977
false
false
false
sudhir-serpentcs/business-requirement
business_requirement_deliverable_project/models/project.py
1
3606
# -*- coding: utf-8 -*- # © 2016 Elico Corp (https://www.elico-corp.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models from openerp.tools.translate import _ from openerp.exceptions import ValidationError class Project(models.Model): _inherit = "proje...
agpl-3.0
-5,362,266,994,235,058,000
36.947368
77
0.56699
false
4.434194
false
false
false
crowdworks/redash
redash/cli/groups.py
1
3319
from __future__ import print_function from sys import exit from sqlalchemy.orm.exc import NoResultFound from flask.cli import AppGroup from click import argument, option from redash import models manager = AppGroup(help="Groups management commands.") @manager.command() @argument('name') @option('--org', 'organizat...
bsd-2-clause
-6,601,441,871,846,674,000
32.525253
91
0.637843
false
3.941805
false
false
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/StLa/PyScripts/Strangeland.py
1
7705
import dsz.version.checks import dsz.lp import dsz.version import dsz.ui import dsz.path import dsz.file import dsz.control import dsz.menu import dsz.env tool = 'StLa' version = '1.2.0.1' resDir = dsz.lp.GetResourcesDirectory() logdir = dsz.lp.GetLogsDirectory() STLA_PATH = ('%s%s' % (resDir, tool)) def stlaverify(i...
unlicense
-3,926,526,841,632,269,000
44.064327
197
0.615834
false
3.137215
false
false
false
crickert1234/ParamAP
ParamAP.py
1
51951
#!/usr/bin/env python3 ''' ParamAP.py (parametrization of sinoatrial myocyte action potentials) Copyright (C) 2018 Christian Rickert <christian.rickert@ucdenver.edu> 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-2.0
1,966,777,943,420,654,000
57.713793
315
0.51666
false
3.196985
false
false
false
baohaojun/dico
dicoweb/settings-sample.py
1
2553
# Django settings for Dicoweb project. # # This file is part of GNU Dico. # Copyright (C) 2008-2010, 2012 Wojciech Polak # # GNU Dico 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, or ...
gpl-3.0
7,779,301,981,850,678,000
27.685393
78
0.725421
false
3.350394
false
false
false
danielktaylor/PyLimitBook
pylimitbook/book.py
1
4650
#!/usr/bin/python from collections import deque from pylimitbook.tick import Bid, Ask, Trade from pylimitbook.tree import Tree from builtins import input from six.moves import cStringIO as StringIO def parse_csv(columns, line): """ Parse a CSV line that has ',' as a separator. Columns is a list of the co...
mit
-3,987,454,480,899,093,000
31.517483
88
0.517849
false
3.79902
false
false
false
evernote/pootle
pootle/apps/pootle_store/views.py
1
33949
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010-2013 Zuza Software Foundation # Copyright 2013-2014 Evernote Corporation # # This file is part of Pootle. # # 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-2.0
359,415,182,582,297,860
34.474399
80
0.605732
false
4.168079
false
false
false
rgbkrk/binder
web/app.py
1
4824
import Queue import json import signal from tornado import gen from tornado.ioloop import IOLoop from tornado.web import Application, RequestHandler from tornado.httpserver import HTTPServer from binder.service import Service from binder.app import App from .builder import Builder # TODO move settings into a config...
apache-2.0
1,329,055,373,027,206,000
28.595092
98
0.623134
false
3.899757
false
false
false
blaze33/django
tests/modeltests/model_forms/tests.py
1
66035
from __future__ import absolute_import, unicode_literals import datetime import os from decimal import Decimal from django import forms from django.core.files.uploadedfile import SimpleUploadedFile from django.core.validators import ValidationError from django.db import connection from django.db.models.query import E...
bsd-3-clause
-1,320,706,784,182,750,000
42.529993
219
0.605936
false
3.788366
true
false
false
dfreedman55/Python4NetworkEngineers
week2/exercise3.py
1
1448
#!/usr/bin/env python import telnetlib import time import socket import sys class DefineNetworkDevice(object): def __init__(self, ip, uname, pword): ''' Object initialization ''' self.ip = ip self.uname = uname self.pword = pword self.TELNET_PORT = 23 self.TELNET_TIMEOUT = 6 def TelnetConnect(self...
gpl-2.0
-9,119,668,020,921,804,000
24.403509
112
0.709945
false
2.961145
false
false
false
sirex/databot
databot/pipes.py
1
26342
import collections import datetime import itertools import sqlalchemy as sa import traceback import tqdm from databot.db.serializers import serrow, serkey from databot.db.utils import strip_prefix, create_row, get_or_create, Row from databot.db.windowedquery import windowed_query from databot.db.models import Compress...
agpl-3.0
-4,314,377,841,758,033,000
33.033592
118
0.534242
false
3.990003
false
false
false
wateraccounting/wa
Collect/ALEXI/monthly.py
1
1291
# -*- coding: utf-8 -*- """ Created on Mon Aug 28 07:54:17 2017 @author: tih """ import os import sys from DataAccess import DownloadData def main(Dir, Startdate='', Enddate='', latlim=[-60, 70], lonlim=[-180, 180], Waitbar = 1): """ This function downloads monthly ALEXI data Keyword arguments: Dir -...
apache-2.0
8,970,401,376,894,572,000
31.275
108
0.656081
false
3.110843
false
false
false
GStreamer/cerbero
recipes/custom.py
1
6402
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python import os from collections import defaultdict from cerbero.build import recipe from cerbero.build.source import SourceType from cerbero.build.cookbook import CookBook from cerbero.enums import License, FatalError def running_on_cerbero_ci(): return os....
lgpl-2.1
1,029,590,351,478,202,200
44.728571
104
0.565761
false
3.83583
true
false
false
emilroz/openmicroscopy
components/tools/OmeroPy/src/omero/util/populate_metadata.py
1
21324
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Populate bulk metadata tables from delimited text files. """ # # Copyright (C) 2011-2014 University of Dundee. All rights reserved. # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
gpl-2.0
-6,591,823,371,403,086,000
38.343173
89
0.570718
false
4.031002
false
false
false
indictools/grammar
common.py
1
7812
import sys,os import time from os import walk, path from os.path import splitext, join from json import dumps from config import * import signal import subprocess import re import shutil import glob from flask import * def wl_batchprocess(args, cmd, func): wloads = args.get('wlnames').split(',') print "In wl" ...
gpl-3.0
-2,206,379,886,968,884,200
31.280992
99
0.549283
false
3.640261
false
false
false
gongghy/checkio_python
Home/The_Most_Wanted_Letter.py
1
1140
def checkio(text): text = text.lower() text = [letter for letter in text if letter.isalpha()] d = dict.fromkeys(text, 0) for char in text: d[char] += 1 value = 0 for item in d.items(): if item[1] > value: value = item[1] lesser_keys = [] for item in d.items():...
mit
6,739,730,774,419,538,000
34.625
85
0.566667
false
3.323615
false
false
false
cmars/pystdf
pystdf/IO.py
1
7630
# # PySTDF - The Pythonic STDF Parser # Copyright (C) 2006 Casey Marshall # # 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 versi...
gpl-2.0
-556,588,033,002,586,940
29.277778
99
0.634076
false
3.394128
false
false
false
dmsurti/mayavi
tvtk/pyface/ui/wx/decorated_scene.py
1
11998
#------------------------------------------------------------------------------ # # Copyright (c) 2006, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions d...
bsd-3-clause
49,747,729,586,761,630
37.210191
89
0.471245
false
4.692217
false
false
false
yati-sagade/RyDyrect
settings.py
1
1727
# Initialize App Engine and import the default settings (DB backend, etc.). # If you want to use a different backend you have to remove all occurences # of "djangoappengine" from this file. from djangoappengine.settings_base import * import os import people # Activate django-dbindexer for the default database DATABASE...
bsd-3-clause
59,960,683,604,811,500
31.584906
83
0.734221
false
3.454
false
false
false
avih/treeherder
deployment/update/update.py
1
5356
""" Deploy this project in stage/production. Requires commander_ which is installed on the systems that need it. .. _commander: https://github.com/oremj/commander """ import os import requests import sys from commander.deploy import hostgroups, task sys.path.append(os.path.dirname(os.path.abspath(__file__))) impor...
mpl-2.0
-1,774,610,298,137,748,000
36.985816
98
0.673824
false
3.570667
false
false
false
spivachuk/sovrin-node
indy_node/test/state_proof/test_state_proofs_for_get_requests.py
1
12398
import base64 import random import time import base58 import pytest from common.serializers import serialization from common.serializers.serialization import state_roots_serializer from crypto.bls.bls_multi_signature import MultiSignature, MultiSignatureValue from plenum.bls.bls_store import BlsStore from plenum.comm...
apache-2.0
3,612,552,977,990,105,600
34.022599
110
0.611228
false
3.529177
true
false
false
hubert667/AIR
build/billiard/billiard/_reduction3.py
2
7954
# # Module which deals with pickling of objects. # # multiprocessing/reduction.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # from __future__ import absolute_import import copyreg import functools import io import os import pickle import socket import sys __all__ = ['send...
gpl-3.0
4,350,371,272,115,698,000
30.943775
79
0.587126
false
3.85555
false
false
false
Afonasev/Blog
backend/posts/management/commands/fill_fake_data.py
1
2311
from random import choice, randint from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from faker import Faker from backend.posts import models fake = Faker() def make_text(min_paragraphs, max_paragraphs): return '\n'.join(fake.paragraphs( nb=randint(min_p...
mit
-8,112,549,477,395,559,000
27.182927
74
0.536132
false
3.984483
false
false
false
exaile/exaile
plugins/ipconsole/__init__.py
1
8594
# This plugin is adapted from the Python Console plugin and the IPython # cookbook at: # http://ipython.scipy.org/moin/Cookbook/EmbeddingInGTK # Copyright (C) 2009-2010 Brian Parma # Updated 2012 Brian Parma # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
9,188,069,743,243,977,000
31.187266
86
0.603677
false
3.951264
false
false
false
curtisalexander/learning
python/talk-python/jumpstart/file-search/program.py
1
1784
from collections import namedtuple import os SearchResult = namedtuple('SearchResult', 'file, line, text') def main(): print_header() folder = get_folder_from_user() if not folder: print("Sorry we can't search that location.") return text = get_search_text_...
mit
-3,788,486,095,612,305,400
22.473684
73
0.556054
false
3.811966
false
false
false
lnls-sirius/dev-packages
siriuspy/siriuspy/clientconfigdb/configdb_client.py
1
9599
"""Define a class to communicate with configuration database API.""" import json as _json import datetime as _datetime from urllib import parse as _parse from urllib.request import Request as _Request, urlopen as _urlopen from urllib.error import URLError as _URLError import dateutil.parser import numpy as _np from ...
gpl-3.0
-8,357,856,691,299,465,000
34.420664
78
0.59277
false
4.314157
true
false
false
ttreeagency/PootleTypo3Org
pootle/apps/pootle_store/util.py
1
6417
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2004-2012 Zuza Software Foundation # # This file is part of translate. # # translate 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...
gpl-2.0
8,377,143,370,565,134,000
30.455882
76
0.616332
false
4.013133
false
false
false
steven-murray/pydftools
pydftools/model.py
1
4956
""" A module for defining generative distribution function models. All models *must* be subclassed from :class:`~Model`, which provides the abstract base methods required to implement. """ import numpy as np from .utils import numerical_jac, numerical_hess class Model(object): """ Base class defining a gene...
mit
2,237,806,698,947,694,600
25.934783
141
0.521186
false
3.150668
false
false
false
ControCurator/controcurator
cronjobs/clusterComments.py
1
25964
import numpy as np import pandas as pd import nltk from nltk.stem.snowball import SnowballStemmer from sklearn.feature_extraction.text import TfidfVectorizer from bs4 import BeautifulSoup import re import os import codecs from sklearn import feature_extraction from sklearn.cluster import KMeans from pprint import pprin...
mit
6,142,809,010,730,646,000
55.689956
246
0.749615
false
2.592252
false
false
false
perrette/iis
setup.py
1
2732
#!/usr/bin/env python """ """ #from distutils.core import setup import os, sys, re from distutils.core import setup import warnings with open('README.md') as file: long_description = file.read() # # Track version after pandas' setup.py # MAJOR = 0 MINOR = 0 MICRO = 0 ISRELEASED = False VERSION = '%d.%d.%d' % (MAJ...
mit
8,472,331,363,098,328,000
26.877551
94
0.598097
false
3.604222
false
false
false
ericmjl/influenza-reassortment-detector
full_affmat.py
1
1077
import pandas as pd import sys class FullAffmatCompiler(object): """docstring for FullAffmatCompiler""" def __init__(self, handle): super(FullAffmatCompiler, self).__init__() self.handle = handle self.summed_affmat = pd.DataFrame() self.current_df = None self.affmats = d...
mit
-9,035,768,609,521,674,000
34.933333
170
0.627669
false
3.130814
false
false
false
widdowquinn/THAPBI
ITS_region_genomic_coverage/get_genes_from_GFF.py
1
1976
#!/usr/bin/env python #author: Peter Thorpe September 2016. The James Hutton Insitute,Dundee,UK. #Title: #script to get the gene columns only from GFF" #imports import os import sys from sys import stdin,argv import sys import datetime from optparse import OptionParser ##############################################...
mit
6,784,813,885,300,704,000
23.395062
79
0.566296
false
3.372014
false
false
false
GermanRuizMarcos/Classical-Composer-Classification
code_8/classification_1.py
1
8408
''' AUDIO CLASSICAL COMPOSER IDENTIFICATION BASED ON: A SPECTRAL BANDWISE FEATURE-BASED SYSTEM ''' import essentia from essentia.standard import * import glob import numpy as np import arff from essentia.standard import * from scipy import stats # Dataset creation with specific attributes (spectral features) and a s...
gpl-3.0
4,417,720,493,671,316,500
23.16092
144
0.614534
false
2.340757
false
false
false
juharris/tensorflow
tensorflow/contrib/layers/python/layers/target_column.py
1
19116
# Copyright 2016 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
887,826,027,601,003,500
35.411429
80
0.672003
false
3.928483
false
false
false
dbhirko/ansible-modules-extras
cloud/vmware/vsphere_copy.py
1
6194
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2015 Dag Wieers <dag@wieers.com> # # This file is part of Ansible # # Ansible 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 Lice...
gpl-3.0
-8,349,510,817,290,760,000
34.597701
155
0.656926
false
3.825818
false
false
false
TAJaroszewski/lma_contrail_monitoring
deployment_scripts/puppet/modules/lma_collector/files/collectd/openstack_keystone.py
1
3086
#!/usr/bin/python # Copyright 2015 Mirantis, 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 a...
apache-2.0
3,808,081,965,423,770,000
30.814433
74
0.629618
false
4.098274
false
false
false
asgeirrr/pgantomizer
pgantomizer/anonymize.py
1
8192
import argparse import logging import os import subprocess import sys import psycopg2 import yaml from .utils import get_in DEFAULT_PK_COLUMN_NAME = 'id' ANONYMIZE_DATA_TYPE = { 'timestamp with time zone': "'1111-11-11 11:11:11.111111+00'", 'date': "'1111-11-11'", 'boolean': 'random() > 0.5', 'int...
bsd-3-clause
-4,770,951,618,853,237,000
41.226804
120
0.630005
false
3.675191
false
false
false
CptDemocracy/Python
MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Week-6/PSET-6/decryptStory.py
1
3795
""" PSET-6 Problem 2: Decryption (decryptStory) Now that you have all the pieces to the puzzle, please use them to decode the file story.txt. In the skeleton file, you will see a method getStoryString() that will return the encrypted version of the story. Fill in the following function; it should create the wordList,...
mit
3,336,012,462,027,109,400
30.106557
80
0.529644
false
3.583569
false
false
false
asipto/kamcli
kamcli/commands/cmd_aliasdb.py
1
5403
import click from sqlalchemy import create_engine from kamcli.ioutils import ioutils_dbres_print from kamcli.cli import pass_context from kamcli.cli import parse_user_spec @click.group("aliasdb", help="Manage database user aliases") @pass_context def cli(ctx): pass @cli.command("add", short_help="Add a user-ali...
gpl-2.0
-459,473,105,445,511,100
28.850829
79
0.531371
false
3.770412
false
false
false
mdtux89/amr-eager
action.py
1
1131
#!/usr/bin/env python #coding=utf-8 ''' Definition of Action class. In AMREAGER, an action can be either 'shift', 'reduce', 'rarc' or 'larc'. When it's a shift, the argument is the subgraph triggered by the token. When it's a reduce, the argument is used to specify the optional reeentrant edge to create. For rarcs and...
bsd-2-clause
-1,735,350,711,124,829,000
30.416667
102
0.576481
false
3.307018
false
false
false
Quihico/repository.spartacus
temp/script.module.python.koding.aio/lib/koding/video.py
1
16114
# -*- coding: utf-8 -*- # script.module.python.koding.aio # Python Koding AIO (c) by whufclee (info@totalrevolution.tv) # Python Koding AIO is licensed under a # Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. # You should have received a copy of the license along with this # wor...
gpl-2.0
1,564,265,599,120,319,500
40.738342
148
0.616946
false
4.077449
false
false
false
shiquanwang/pylearn2
pylearn2/scripts/tutorials/softmax_regression/tests/test_softmaxreg.py
1
1450
""" Test for softmax_regression.ipynb """ import os from pylearn2.testing.skip import skip_if_no_data from pylearn2.config import yaml_parse from theano import config def test(): skip_if_no_data() dirname = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..') with open(os.path.join(dirname, ...
bsd-3-clause
-464,289,127,205,744,400
24.892857
76
0.577241
false
3.341014
false
false
false
CCharlieLi/StaffManagmentSystem
Website/admin.py
1
1775
from django.contrib import admin from Website.models import * from django import forms from django.utils.translation import ugettext_lazy from Skyrover.widgets import KindEditor # Register your models here. class kindeditorNewsForm(forms.ModelForm): Content = forms.CharField(label=ugettext_lazy(u"Content"), widge...
gpl-2.0
-58,941,322,863,837,096
31.272727
123
0.761127
false
3.21558
false
false
false
uclmr/inferbeddings
scripts/fb15k/UCL_FB15K_adv_v3.1.py
1
3991
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configuration.items()...
mit
-8,338,077,182,654,248,000
34.633929
112
0.496617
false
3.513204
false
false
false
cmoutard/mne-python
mne/io/brainvision/brainvision.py
1
20471
# -*- coding: utf-8 -*- """Conversion tool from Brain Vision EEG to FIF""" # Authors: Teon Brooks <teon.brooks@gmail.com> # Christian Brodbeck <christianbrodbeck@nyu.edu> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os import time import re import warnings import numpy...
bsd-3-clause
-8,863,967,679,030,398,000
37.91635
79
0.593796
false
3.794957
false
false
false
cstlee/kafkamark
scripts/kafkamark_plot.py
1
1296
# ISC License # # Copyright (c) 2017, Stanford University # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE...
isc
2,795,149,768,533,533,000
29.139535
79
0.677469
false
3.857143
false
false
false
weedge/doubanFmSpeackerPi
plugin/fm/baseFM.py
1
3321
# -*- coding: utf-8-*- import os import logging import pipes import tempfile import subprocess import psutil import signal import lib.appPath from lib.baseClass import AbstractClass class AbstractFM(AbstractClass): """ Generic parent class for FM class """ @classmethod def is_available(cls): ...
apache-2.0
4,241,096,129,657,073,000
25.822034
95
0.52575
false
3.266254
false
false
false
balloob/pychromecast
examples/yleareena_example.py
1
2570
""" Example on how to use the Yle Areena Controller """ import argparse import logging import sys from time import sleep import pychromecast from pychromecast.controllers.yleareena import YleAreenaController import zeroconf logger = logging.getLogger(__name__) # Change to the name of your Chromecast CAST_NAME = "...
mit
-3,048,973,992,877,498,000
31.125
129
0.706226
false
3.697842
false
false
false
ecodiv/code-snippets
cross-validation/cross_fold_validation.py
1
8776
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ DESCRIPTION: Code to run a n-fold cross validation on the results of the GRASS GIS v.surf.bspline and v.surf.idw function. This code is used in a tutorial about carrying out n-fold cross validation in GRASS GIS (https://tutori...
gpl-3.0
8,661,852,449,883,056,000
38.178571
79
0.559594
false
3.584967
false
false
false
arider/riderml
riderml/regression/gradient_descent.py
1
6474
import numpy ETA_PLUS = 1.2 ETA_MINUS = 0.5 def stochastic_gradient_descent(function, derivative, x, y, theta=None, iterations=100, learning_rate=0.000001, ...
mit
-6,365,893,648,222,809,000
34.571429
79
0.545103
false
4.287417
false
false
false
dstanek/keystone
keystone/common/ldap/core.py
1
76540
# Copyright 2012 OpenStack Foundation # # 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
6,774,204,902,072,156,000
38.926969
79
0.568709
false
4.160687
false
false
false
mfiers/Moa
moa/plugin/job/openLavaActor.py
1
9361
# Copyright 2009-2011 Mark Fiers # The New Zealand Institute for Plant & Food Research # # This file is part of Moa - http://github.com/mfiers/Moa # # Licensed under the GPL license (see 'COPYING') # """ **sgeActor** - Run jobs through SGE ----------------------------------------------------------- """ import os impor...
gpl-3.0
-2,962,970,957,543,276,500
28.253125
77
0.577075
false
3.141275
false
false
false
hackerbot/DjangoDev
django/forms/models.py
2
55275
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) fro...
bsd-3-clause
4,096,164,790,503,905,300
41.00228
124
0.589326
false
4.337676
false
false
false
rleigh-dundee/openmicroscopy
components/tools/OmeroWeb/omeroweb/settings.py
1
22862
#!/usr/bin/env python # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Django settings for OMERO.web project. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Copyright (c) 2008 University of Dundee. # # This progr...
gpl-2.0
-7,212,896,495,762,122,000
43.220503
290
0.673301
false
3.407154
true
false
false
DonnchaC/onionbalance
test/functional/test_publish_master_descriptor.py
1
5980
# -*- coding: utf-8 -*- import os import sys import socket import time import pytest import Crypto.PublicKey.RSA import yaml import pexpect import stem.control import onionbalance.util # Skip functional tests if Chutney environment is not running. pytestmark = pytest.mark.skipif( "os.environ.get('CHUTNEY_ONION_A...
gpl-3.0
-6,428,917,183,354,752,000
33.367816
78
0.661371
false
4.107143
true
false
false
codeman38/toggldesktop
third_party/cppclean/cpp/symbols.py
1
6773
# Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google 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 ...
bsd-3-clause
-7,632,433,835,013,923,000
32.696517
79
0.598996
false
4.658184
false
false
false
emccode/HeliosBurn
heliosburn/django/hbproject/webui/backends.py
1
1440
from django.conf import settings from mongoengine.django.auth import User import requests import json class HeliosAuthBackend(object): """ Authenticate against the API. """ def authenticate(self, username=None, password=None): payload = {'username': username, 'password': password} ur...
mit
-4,774,238,198,615,431,000
31.022222
72
0.565278
false
4.417178
false
false
false
commtrack/commtrack-old-to-del
apps/reports/custom/all/domain_summary.py
1
3326
from django.template.loader import render_to_string import settings from xformmanager.models import FormDefModel, Metadata from receiver.models import Submission, Attachment def domain_summary(request, domain=None, detail_view=True): '''Domain Admin Summary Data''' if not domain: domain = request.ex...
bsd-3-clause
-5,803,733,305,685,974,000
42.776316
110
0.553818
false
4.10111
false
false
false
uaprom-summer-2015/Meowth
project/gallery.py
1
1876
import os from werkzeug.datastructures import FileStorage from project.models import UploadedImage from PIL import Image from PIL.ExifTags import TAGS IM_EXTENSIONS = frozenset(['.jpg', '.jpeg', '.gif', '.png']) def remove_exif_orientation(file_path): ext = os.path.splitext(file_path)[1].lower() if ext == ...
bsd-3-clause
-2,487,392,880,310,597,000
28.3125
66
0.58209
false
3.678431
false
false
false
UManPychron/pychron
pychron/envisage/initialization/initialization_parser.py
1
13078
# =============================================================================== # Copyright 2011 Jake Ross # # 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...
apache-2.0
3,117,435,444,442,191,000
31.942065
97
0.523627
false
3.917915
false
false
false
ntduong/data-science-newbie
Articles_Data_Analysis/cluster_articles.py
1
1885
import numpy as np import scipy.cluster.hierarchy as hier import scipy.spatial.distance as dist import matplotlib.pyplot as plt import make_data from transform import count_transform from cluster_algos import kmeans, hcluster def clustering(X, labels, algo='hcluster', n_clusters=5, figname='cluster_result.png'): ...
mit
4,438,244,582,114,250,000
39.12766
136
0.620159
false
3.360071
false
false
false
dannybrowne86/django-avatar
setup.py
2
1958
import codecs import re from os import path from setuptools import setup, find_packages def read(*parts): filename = path.join(path.dirname(__file__), *parts) with codecs.open(filename, encoding='utf-8') as fp: return fp.read() def find_version(*file_paths): version_file = read(*file_paths) ...
bsd-3-clause
9,097,149,291,649,415,000
31.098361
68
0.589888
false
3.900398
false
false
false
garbear/EventGhost
eg/Classes/MacroSelectButton.py
1
2415
# This file is part of EventGhost. # Copyright (C) 2005 Lars-Peter Voss <bitmonster@eventghost.org> # # EventGhost 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 # (a...
gpl-2.0
1,440,151,838,803,465,500
29.776316
76
0.609938
false
3.726852
false
false
false