repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
daafgo/CourseBuilder-Xapi
controllers/assessments.py
1
11134
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
-1,744,682,290,816,362,200
38.342756
114
0.599335
false
4.364563
false
false
false
t-artistik/browserscope
third_party/check_for_updates.py
9
2884
#!/usr/bin/python2.5 # Copyright 2009 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 applicable law or ag...
apache-2.0
2,495,092,349,654,564,400
35.05
79
0.675451
false
3.673885
false
false
false
mostafamosly/Uraeus
Small/Small/urls.py
1
2153
from django.conf.urls import patterns, include, url from django.contrib import admin from Small import views from .views import * from django.contrib.staticfiles.urls import staticfiles_urlpatterns #from core.views import shop from django.contrib.staticfiles.urls import staticfiles_urlpatterns from core.views imp...
gpl-3.0
8,056,116,137,476,029,000
31.621212
73
0.587088
false
3.858423
false
true
false
aliyun/oss-ftp
python27/win32/Lib/site-packages/pyftpdlib/__main__.py
4
3808
# Copyright (C) 2007-2016 Giampaolo Rodola' <g.rodola@gmail.com>. # Use of this source code is governed by MIT license that can be # found in the LICENSE file. """ Start a stand alone anonymous FTP server from the command line as in: $ python -m pyftpdlib """ import logging import optparse import os import sys from...
mit
-1,431,102,941,654,268,400
37.857143
79
0.609244
false
4.081458
false
false
false
lehtolav/distributed-face-recognition
pi side/messager.py
1
2766
# Trades messages with a remote host/client # Essentially provides a layer to transform generic socket datastreams # into messages (strings) with messagetypes # Messagetype will be used to invoke a registered callback for that type # with the message content as its argument import socket import select import struct m...
mit
7,856,820,791,128,280,000
27.22449
76
0.686551
false
3.150342
false
false
false
ssinger/skytools-cvs
python/pgqadm.py
1
5673
#! /usr/bin/env python """PgQ ticker and maintenance. """ import sys import skytools from pgq.ticker import SmartTicker from pgq.status import PGQStatus #from pgq.admin import PGQAdmin """TODO: pgqadm ini check """ command_usage = """ %prog [options] INI CMD [subcmd args] commands: ticker star...
isc
-5,971,504,502,442,351,000
27.651515
82
0.52459
false
3.631882
true
false
false
mick-d/nipype
nipype/interfaces/niftyseg/base.py
2
1612
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ The niftyseg module provides classes for interfacing with `niftyseg <https://sourceforge.net/projects/niftyseg/>`_ command line tools. These are the base tools for working with ...
bsd-3-clause
1,078,164,674,367,968,600
33.297872
82
0.708437
false
3.393684
false
false
false
brechtm/rinohtype
src/rinoh/attribute.py
1
20698
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) Brecht Machiels. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import re from collections import OrderedDict from conf...
agpl-3.0
-5,342,931,260,759,857,000
32.710098
81
0.576239
false
4.414161
true
false
false
davetcoleman/catkin_pkg
src/catkin_pkg/package_templates.py
3
18106
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
bsd-3-clause
-7,094,375,736,727,865,000
40.243736
156
0.591738
false
4.16613
false
false
false
openfisca/LawToCode
lawtocode/controllers/sessions.py
1
3560
# -*- coding: utf-8 -*- # Law-to-Code -- Extract formulas & parameters from laws # By: Emmanuel Raviart <emmanuel@raviart.com> # # Copyright (C) 2013 OpenFisca Team # https://github.com/openfisca/LawToCode # # This file is part of Law-to-Code. # # Law-to-Code is free software; you can redistribute it and/or modify # ...
agpl-3.0
6,062,235,559,573,949,000
29.956522
101
0.658146
false
3.552894
false
false
false
dials/dials
algorithms/integration/integrator_stills.py
1
7546
class ReflectionBlockIntegratorStills: """A class to perform the integration.""" def __init__(self, params, experiments, reference, extractor=None): """Initialise the integrator.""" from dials.algorithms import shoebox # Ensure we have 1 experiment at the moment assert len(expe...
bsd-3-clause
-5,393,693,544,913,015,000
36.919598
89
0.590246
false
4.026681
false
false
false
philchristensen/django-salesforce
salesforce/backend/query.py
1
21370
# django-salesforce # # by Phil Christensen # (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org) # See LICENSE.md for details # """ Salesforce object query and queryset customizations. """ # TODO hynekcer: class CursorWrapper and function handle_api_exceptions should # be moved to salesforce.backen...
mit
5,083,674,688,785,843,000
33.691558
115
0.697847
false
3.144034
false
false
false
socsol/infsocsol
tests/test_fisheries_det_basic.py
1
2311
# Copyright 2019 Alastair Pharo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
apache-2.0
-2,571,641,643,230,344,000
43.442308
107
0.632627
false
3.118758
false
false
false
motte/python-yelp
setup.py
1
1207
#!/usr/bin/env python # -*- encoding: utf-8 -*- from os.path import join from setuptools import setup, find_packages import pyyelp # To get python setup.py test to work on python 2.7 try: import multiprocessing import logging except ImportError: pass setup( name=pyyelp.__name__, version=pyyelp._...
isc
-8,819,387,810,392,762,000
29.948718
97
0.63546
false
3.702454
false
false
false
google/google-ctf
third_party/edk2/BaseTools/Source/Python/UPT/Library/UniClassObject.py
1
50306
## @file # Collect all defined strings in multiple uni files. # # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The f...
apache-2.0
5,085,709,943,603,805,000
44.57963
121
0.500139
false
4.175465
false
false
false
kseetharam/genPolaron
datagen_qdynamics_cart_massRat.py
1
7033
import numpy as np import pandas as pd import xarray as xr import Grid import pf_dynamic_cart import os import sys from timeit import default_timer as timer # import pf_static_cart if __name__ == "__main__": start = timer() # ---- INITIALIZE GRIDS ---- (Lx, Ly, Lz) = (21, 21, 21) (dx, dy, dz) = (0....
mit
4,372,049,834,979,202,600
40.615385
173
0.545571
false
2.731262
false
false
false
lightbase/WSCacicNeo
wscacicneo/views/graficos.py
1
6987
__author__ = 'adley' import requests import json import random from wscacicneo.utils.utils import Utils from pyramid.httpexceptions import HTTPFound from wscacicneo.model import config_reports from liblightbase.lbsearch.search import NullDocument from pyramid.session import check_csrf_token from wscacicneo.search.orga...
gpl-2.0
6,287,621,518,878,857,000
36.853261
126
0.536617
false
3.573114
true
false
false
CodeLionX/CommentSearchEngine
cse/lang/Preprocessor.py
1
1532
class Preprocessor(object): __tokenizer = None __steps = [] def __init__(self, tokenizer, steps): self.__tokenizer = tokenizer self.__steps = steps def processText(self, comment): tokens = self.__tokenizer.tokenize(comment) tokenTuple = [(token, position) for positio...
mit
4,829,856,591,023,380,000
34.627907
102
0.567885
false
3.709443
false
false
false
messense/stacktracer
setup.py
1
1227
#!/usr/bin/env python from __future__ import with_statement import os from setuptools import setup readme = 'README.md' if os.path.exists('README.rst'): readme = 'README.rst' with open(readme) as f: long_description = f.read() setup( name='stacktracer', version='0.1.2', author='messense', auth...
mit
9,144,691,725,418,073,000
30.461538
71
0.632437
false
4.216495
false
false
false
geertj/gruvi
lib/gruvi/dbus.py
2
21739
# # This file is part of Gruvi. Gruvi is free software available under the # terms of the MIT license. See the file "LICENSE" that was provided # together with this source file for the licensing terms. # # Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a # complete list. """ The :mod:`gruvi.dbus...
mit
-2,074,246,292,200,640,500
38.311031
98
0.609596
false
4.191863
false
false
false
rainwoodman/nbodykit
legacy/measurepower-mm.py
3
3829
from sys import argv from sys import stdout from sys import stderr import logging from argparse import ArgumentParser parser = ArgumentParser("Parallel Cross Power Spectrum Calculator", description= """Calculating cross matter power spectrum from two RunPB input files. Output is written to stdou...
gpl-3.0
4,916,736,200,148,130,000
33.495495
135
0.653957
false
3.431004
false
false
false
tzewangdorje/SIPserv
Twisted-13.1.0/doc/core/howto/listings/pb/pb4client.py
18
1794
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.spread import pb from twisted.internet import reactor def main(): rootobj_def = pb.getObjectAt("localhost", 8800, 30) rootobj_def.addCallbacks(got_rootobj) obj2_def = getSomeObjectAt("localhost", 88...
gpl-3.0
-4,227,292,638,903,783,400
29.931034
62
0.662765
false
3.340782
false
false
false
alexis-jacq/Mutual_Modelling
nodes/cowriter_mutual_modelling.py
1
5953
#!/usr/bin/env python #coding: utf-8 import sys import time import rospy import json from std_msgs.msg import String, Empty, Float64 from mutualModelling.agent2 import Agent # this node udate models of agents (by the robot) and publishes the choice of action by the robot: #--------------------------------------------...
isc
3,709,407,553,419,079,000
42.772059
448
0.624055
false
3.47519
false
false
false
rfdrake/netbox
netbox/utilities/templatetags/helpers.py
1
2526
from markdown import markdown from django import template from django.utils.safestring import mark_safe register = template.Library() # # Filters # @register.filter() def oneline(value): """ Replace each line break with a single space """ return value.replace('\n', ' ') @register.filter() def ge...
apache-2.0
3,335,065,604,694,656,500
22.174312
94
0.638559
false
3.618911
false
false
false
brain-research/acai
vae.py
1
5092
# 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
-914,411,565,567,096,600
36.718519
79
0.616261
false
3.347798
false
false
false
bluemini/agenetic
ga.py
1
14226
#!/usr/bin/env python # Copyright (c) 2012, Nick Harvey # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # - Redistributions of source code must retain the above copyright notice, this ...
bsd-3-clause
4,133,773,500,725,697,000
36.448649
121
0.675524
false
3.490186
true
false
false
urban48/python-telegram-bot
telegram/user.py
6
1109
#!/usr/bin/env python from telegram import TelegramObject class User(TelegramObject): def __init__(self, id, first_name, last_name=None, username=None): self.id = id self.first_name = first_name self.last_name = last_nam...
gpl-2.0
-6,433,096,805,626,666,000
26.725
62
0.513977
false
3.946619
false
false
false
ktok07b6/polyphony
tests/chstone/jpeg/chenidct.py
1
7203
from polyphony import testbench ''' +--------------------------------------------------------------------------+ | CHStone : A suite of Benchmark Programs for C-based High-Level Synthesis | | ======================================================================== | | ...
mit
-2,255,885,441,398,530,600
30.871681
76
0.451617
false
2.848161
false
false
false
mblayman/handroll
handroll/composers/atom.py
1
3542
# Copyright (c) 2014, Matt Layman from datetime import datetime import io import json import os import time from werkzeug.contrib.atom import AtomFeed from werkzeug.contrib.atom import FeedEntry from handroll import logger from handroll.composers import Composer from handroll.exceptions import AbortError from handro...
bsd-2-clause
2,655,987,242,932,133,000
35.895833
79
0.620553
false
4.043379
false
false
false
rockyzhang/workload-automation
wlauto/tests/test_extension.py
1
7254
# Copyright 2014-2015 ARM 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 w...
apache-2.0
7,303,976,956,362,171,000
24.363636
92
0.630824
false
3.605368
true
false
false
Cadasta/cadasta-platform
cadasta/search/tests/test_urls_async.py
1
1424
from django.test import TestCase from django.core.urlresolvers import reverse, resolve from ..views import async class SearchUrlTest(TestCase): def test_search(self): actual = reverse('async:search:search', kwargs={ 'organization': 'habitat', ...
agpl-3.0
3,628,609,514,204,241,000
37.486486
79
0.543539
false
4.45
true
false
false
stuporglue/solar_scripts
dems2mosaic.py
1
2191
#!/usr/bin/env python # -*- coding: utf-8 -*- # Create a Mosaic Dataset in the workspace and add all # *.img rasters from the input directory # # python dems2mosaic.py "C:\workspace\dems" "C:\workspace" "26915.prj" import arcpy,sys,os from config import * from distutils.spawn import * from arcpy import * ##########...
gpl-2.0
-110,512,337,708,578,380
30.753623
106
0.724783
false
2.913564
false
false
false
skevas/unshorten
isurlshortener/unshortener.py
1
3295
# -*- coding: utf-8 -*- """Unshortener Documentation This module unshortens URLs """ import re import http from urllib.parse import urlparse from http import client from isurlshortener.exceptions import PathMissing, UnhandledHTTPStatusCode, LocationHeaderMissing, ProtocolException class Unshortener(object): ...
mit
-8,120,319,903,030,770,000
31.95
120
0.617906
false
4.601955
false
false
false
gnovis/swift
swift_fca/swift_core/interval_fca.py
1
1073
from math import isinf class Interval: def __init__(self, val_from, val_to): self._val_from = float(val_from) self._val_to = float(val_to) def __contains__(self, value): return bool(self._val_from <= float(value) <= self._val_to) def __str__(self): return "{}-{}".format(...
gpl-3.0
-8,449,861,179,838,928,000
25.170732
67
0.564772
false
3.725694
false
false
false
oscurart/BlenderAddons
oscurart_bake_pbr_maps_linear.py
1
13463
import bpy import os def setSceneOpts(): global channels global sizex global sizey global selected_to_active # VARIABLES sizex = bpy.context.scene.bake_pbr_channels.sizex sizey = bpy.context.scene.bake_pbr_channels.sizey selected_to_active= bpy.context.scene.bake_pbr_channels.selt...
gpl-2.0
6,051,950,876,114,977,000
35.193548
110
0.575578
false
3.5401
false
false
false
rcbops/opencenter-agent
setup.py
1
2431
#!/usr/bin/env python # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
apache-2.0
8,020,559,618,043,347,000
36.984375
79
0.625257
false
4.134354
false
false
false
rdmorganiser/rdmo
rdmo/questions/migrations/0042_remove_null_true.py
2
9265
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2019-03-13 11:54 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('questions', '0041_data_migration'), ] operations = [ migrations.AlterField...
apache-2.0
1,959,474,701,729,166,000
49.081081
170
0.612412
false
4.370283
false
false
false
canvasnetworks/canvas
common/boto/cloudformation/stack.py
10
9892
from datetime import datetime from boto.resultset import ResultSet class Stack: def __init__(self, connection=None): self.connection = connection self.creation_time = None self.description = None self.disable_rollback = None self.notification_arns = [] self.outputs ...
bsd-3-clause
7,997,148,358,143,673,000
33.228374
79
0.577638
false
4.243672
false
false
false
mrcslws/nupic.research
nupic/research/frameworks/backprop_structure/experiments/mixins/regularize.py
3
2518
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
6,127,967,217,921,844,000
36.029412
85
0.586974
false
4.496429
false
false
false
pruperting/python-music-gen
midiutil/Scales.py
4
2527
""" Music Scales Source: http://en.wikipedia.org/wiki/List_of_musical_scales_and_modes Copyright (C) 2012 Alfred Farrugia 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 Li...
gpl-3.0
-3,992,176,263,368,867,000
33.148649
69
0.607835
false
2.226432
false
false
false
mrachinskiy/blender-addon-jewelcraft
op_scatter/__init__.py
1
2581
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2019 Mikhail Rachinskiy # # 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...
mit
-3,390,926,506,677,198,300
38.106061
93
0.717164
false
3.54533
false
false
false
tobiasjakobi/mpv
waftools/clang_compilation_database.py
27
2379
#!/usr/bin/env python # encoding: utf-8 # Christoph Koke, 2013 # Original source: waflib/extras/clang_compilation_database.py from # waf git 15d14c7bdf2e (New BSD License) """ Writes the c and cpp compile commands into build/compile_commands.json see http://clang.llvm.org/docs/JSONCompilationDatabase.html Usage: ...
gpl-2.0
-4,243,942,583,667,116,500
34.507463
92
0.575032
false
3.958403
false
false
false
BGS/pyLauncher
plugins/pyLWeb.py
1
1610
# -*- coding: utf-8 -*- ''' pyLauncher: Windows Application Launcher Copyright (C) Blaga Florentin Gabriel 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 yo...
gpl-3.0
4,868,357,547,482,469,000
29.377358
118
0.628571
false
3.788235
false
false
false
JohanComparat/pySU
galaxy/python/ModelSpectraStacks.py
1
22503
""" .. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com> General purpose: ................ The class ModelSpectraStacks is dedicated to modelling and extracting information from stacks of spectra. *Imports*:: import matplotlib matplotlib.use('pdf') import matplotlib.pyplot as p import os import a...
cc0-1.0
5,811,073,617,534,907,000
43.384615
316
0.68462
false
2.521627
false
false
false
motoz/nbetest
client.py
1
3133
#! /usr/bin/python # -*- coding: utf-8 -*- """ Copyright (C) 2013 Anders Nylund 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 optio...
gpl-2.0
1,483,653,078,911,860,000
35.430233
113
0.658474
false
3.774699
false
false
false
auxten/pymw
pymw/interfaces/grid_simulator.py
2
8122
#!/usr/bin/env python """Provide a interface for simulating master worker computing on a desktop grid based on traces. Thanks to Derrick Kondo for the idea. """ __author__ = "Eric Heien <pymw@heien.org>" __date__ = "2 May 2009" import errno import heapq import array # TODO: have some sort of wraparound for worker av...
mit
-6,526,020,610,318,547,000
33.709402
105
0.691455
false
3.008148
false
false
false
weixsong/algorithm
leetcode/199.py
1
1052
# -*- encoding: utf-8 -*- ''' Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binary tree, 1 <--- / \ 2 3 <--- \ \ 5 4 <--- You should return [1,...
mit
819,643,236,911,964,000
21.869565
142
0.469582
false
3.757143
false
false
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/Conn_PinSocket/cq_base_parameters.py
4
8672
# -*- coding: utf8 -*- #!/usr/bin/python # #**************************************************************************** #* * #* base classes for generating part models in STEP AP214 * #* ...
gpl-2.0
6,652,362,685,478,027,000
37.542222
139
0.561232
false
4.863713
false
false
false
eliben/luz-cpu
luz_asm_sim/lib/asmlib/objectfile.py
1
1466
# Represents the object file recognized by the Luz architecture. # An object file is relocatable. It is created by the assembler, # and later combined with other object files by the linker into # an executable. # # Luz micro-controller assembler # Eli Bendersky (C) 2008-2010 # class ObjectFile(object): """ Use one...
unlicense
-8,877,308,944,578,829,000
28.32
65
0.572988
false
4.261628
false
false
false
karies/root
tutorials/roofit/rf205_compplot.py
6
4552
## \file ## \ingroup tutorial_roofit ## \notebook ## Addition and convolution: options for plotting components of composite p.d.f.s. ## ## \macro_code ## ## \date February 2018 ## \author Clemens Lange, Wouter Verkerke (C++ version) import ROOT # Set up composite pdf # -------------------------------------- # Declar...
lgpl-2.1
-1,549,633,416,669,288,700
31.985507
82
0.672012
false
2.931101
false
false
false
VCG/gp
raveler/ray/ray/decision_stump.py
3
2202
import math import numpy import operator class DecisionStump(): """ Class for a decision stump, adapted from pyclassic. """ def fit(self, X, Y, w): feature_index, stump = train_decision_stump(X,Y,w) self.feature_index = feature_index self.stump = stump return sel...
mit
3,073,037,846,525,142,000
30.382353
85
0.589918
false
3.020576
false
false
false
rlc2/pygame_maker
pygame_maker/actions/action_sequence.py
1
21092
""" Author: Ron Lockwood-Childs Licensed under LGPL v2.1 (see file COPYING for details) Container type for sequences of actions. """ import re from pygame_maker.actions.action import Action, ActionException __all__ = ["ActionSequence", "ActionSequenceStatement", "ActionSequenceConditional", "ActionSequen...
lgpl-2.1
-3,735,501,381,617,849,000
37.630037
99
0.619856
false
4.718568
false
false
false
mattfleaydaly/newstatuslive
statuspage/tests.py
2
7197
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import unittest from datetime import datetime from unittest import TestCase from mock import patch, Mock from click.testing import CliRunner from statuspage import cli, update, create, iter_systems, get_severity, SYSTEM_LAB...
mit
3,852,729,542,538,435,000
32.95283
112
0.599139
false
3.611139
true
false
false
birgander2/PyRAT
pyrat/load/Spaceborne_GDAL.py
1
8118
import pyrat, os import logging from osgeo import gdal import glob import numpy as np class ENVISAT(pyrat.ImportWorker): """ Import of ENVISAT satellite data. **author:** Andreas Reigber\n **status:** --beta-- No metadata are extracted. Mostly untested! """ gui = {'menu': 'File|Import spaceb...
mpl-2.0
-4,090,027,154,837,745,700
32.825
103
0.559128
false
3.566784
false
false
false
fairbird/OpenPLI-BlackHole
lib/python/Components/Downloader.py
1
2347
from twisted.web import client from twisted.internet import reactor, defer, ssl from urlparse import urlparse class HTTPProgressDownloader(client.HTTPDownloader): def __init__(self, url, outfile, headers = None): client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent='STB HTTP Downloade...
gpl-2.0
-88,920,652,326,574,430
35.107692
104
0.633149
false
4.275046
false
false
false
memclutter/clinic-crm
src/timetables/models.py
1
1135
from django.db import models class Timetable(models.Model): DW_MON = 0 DW_TUE = 1 DW_WED = 2 DW_THU = 3 DW_FRI = 4 DAY_OF_WEEK_CHOICES = ( (DW_MON, 'Monday'), (DW_TUE, 'Tuesday'), (DW_WED, 'Wednesday'), (DW_THU, 'Thursday'), (DW_FRI, 'Friday'), ) ...
bsd-2-clause
6,153,335,067,055,088,000
28.102564
91
0.56652
false
3.092643
false
false
false
jorgenschaefer/monads-for-normal-programmers
monads/mathop/test_mathop.py
1
1530
import unittest class MathopTest(unittest.TestCase): CLASS = None def setUp(self): if self.CLASS is None: raise unittest.SkipTest("Base class not tested") def test_should_chain_computation(self): self.assertEqual(repr(self.CLASS(5)), "<MathOp 5>") ...
bsd-2-clause
3,253,654,990,349,496,000
27.333333
74
0.551634
false
3.477273
true
false
false
apagac/robottelo-blrm
robottelo/cli/activationkey.py
3
3275
# -*- encoding: utf-8 -*- """ Usage:: hammer activation-key [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands:: add-host-collection Associate a resource add-subscription Add ...
gpl-3.0
-6,796,707,891,215,969,000
33.473684
67
0.620763
false
4.816176
false
false
false
CIGIHub/greyjay
greyjay/newsletter/migrations/0018_auto_20151015_2253.py
1
1229
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('newsletter', '0015_newsletterexternalarticlelink2'), ] operations = [ migrations.AlterField...
mit
-7,314,742,994,192,745,000
39.966667
199
0.651749
false
4.056106
false
false
false
arangodb/arangodb
3rdParty/V8/gyp/MakefileWriter.py
1
58894
import hashlib import os import re import gyp from gyp import xcode_emulation from gyp.common import GypError, EnsureDirExists from gyp.generator.make import generator_default_variables,CalculateVariables # The .d checking code below uses these functions: # wildcard, sort, foreach, shell, wordlist # wildcard can hand...
apache-2.0
6,971,785,228,950,044,000
42.240822
167
0.633817
false
3.852302
true
false
false
rolisz/walter_waiter
sensors/webcam.py
1
7932
import numpy as np import itertools import cv2 from time import sleep import os import math import event from color_matcher import ColorMatcher from sensors.sift_matcher import SIFTMatcher from pixels2coords import pixels2coords, get_distance_from_cup_width def distance_between_faces(face1, face2): x1, y1, w1, h1...
mit
-6,352,059,488,724,073,000
34.253333
92
0.51122
false
3.25082
false
false
false
dionhaefner/veros
veros/tools/setup.py
1
17459
import numpy as np import scipy.interpolate import scipy.spatial def interpolate(coords, var, interp_coords, missing_value=None, fill=True, kind='linear'): """Interpolate globally defined data to a different (regular) grid. Arguments: coords: Tuple of coordinate arrays for each dimension. var (...
mit
149,458,022,250,451,620
42.538653
153
0.616817
false
3.428712
false
false
false
TheWardoctor/Wardoctors-repo
plugin.video.metalliq/resources/lib/meta/play/base.py
1
9730
import sys, os import json from traceback import print_exc from xbmcswift2 import xbmc, xbmcgui, xbmcplugin from meta import plugin from meta.gui import dialogs from meta.utils.executor import execute from meta.utils.properties import set_property from meta.utils.text import to_unicode, urlencode_path, apply_parameters...
apache-2.0
8,459,668,550,241,768,000
43.43379
192
0.613155
false
3.868787
false
false
false
sameersingh/ml-discussions
week3/mltools/datagen.py
1
4211
import numpy as np from numpy import loadtxt as loadtxt from numpy import asarray as arr from numpy import asmatrix as mat from numpy import atleast_2d as twod from scipy.linalg import sqrtm ################################################################################ ## Methods for creating / sampling synthetic...
apache-2.0
3,725,305,290,967,670,300
22.926136
103
0.582284
false
2.67026
false
false
false
wmttom/wormhole
wormhole/server.py
1
1497
#coding:utf-8 import zmq import json context = zmq.Context() class Server(object): def __init__(self, port): self.server = context.socket(zmq.REP) self.server.bind("tcp://*:{0}".format(port)) def run(self): print "ready" while True: recv = self.server.recv() ...
mit
6,078,282,835,601,481,000
27.807692
89
0.47161
false
4.240793
false
false
false
baderj/domain_generation_algorithms
shiotob/dga.py
1
1677
import argparse def get_next_domain(domain): qwerty = 'qwertyuiopasdfghjklzxcvbnm123945678' def sum_of_characters(domain): return sum([ord(d) for d in domain[:-3]]) sof = sum_of_characters(domain) ascii_codes = [ord(d) for d in domain] + 100*[0] old_hostname_length = len(domain) - 4 f...
gpl-2.0
6,526,263,581,269,655,000
27.913793
85
0.571258
false
3.422449
false
false
false
ActiveState/code
recipes/Python/499379_GroupBySorted/recipe-499379.py
1
2704
__docformat__ = "restructuredtext" class peekable: """Make an iterator peekable. This is implemented with an eye toward simplicity. On the downside, you can't do things like peek more than one item ahead in the iterator. On the bright side, it doesn't require anything from itertools, etc., so ...
mit
-8,495,643,545,564,302,000
22.111111
77
0.527737
false
4.017831
false
false
false
lwahlmeier/python-threadly
tests/futureCheck.py
1
1948
import threadly, time, random import unittest clf = 0 llf = 0 def callLF(lf): # print "CALLED" lf.setter(True) def listenFromFuture(): global llf # print "GotCalled" llf +=1 def callFromFuture(s): global clf # print "GotCalled", s clf +=1 def listenException(): raise Exception("TEST1") def callExcep...
unlicense
-4,023,683,026,387,194,400
24.973333
66
0.690965
false
3.001541
true
false
false
cheral/orange3
Orange/tests/test_fss.py
8
3767
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import unittest import numpy as np from scipy.sparse import csr_matrix from Orange.data import Table, Variable from Orange.preprocess.score import ANOVA, Gini, UnivariateLinearRegression, \ Chi2 from Orange.preproc...
bsd-2-clause
5,897,100,212,451,810,000
34.87619
96
0.640297
false
3.615163
true
false
false
jeetsukumaran/Ginkgo
ginkgopy/setup.py
1
2611
#! /usr/bin/env python ############################################################################### ## ## GINKGO Biogeographical Evolution Simulator Post-Processing Library. ## ## Copyright 2009 Jeet Sukumaran and Mark T. Holder. ## ## This program is free software; you can redistribute it and#or modify ## it under...
gpl-3.0
-7,690,661,539,944,862,000
33.813333
115
0.607047
false
4.079688
false
false
false
hpfn/charcoallog
charcoallog/bank/migrations/0001_initial.py
1
1232
# -*- coding: utf-8 -*- # Generated by Django 1.11.7 on 2018-01-21 11:56 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('core', '0012_auto_20180121_1155') ] operations = [ migr...
gpl-3.0
1,365,360,019,991,636,500
33.222222
114
0.575487
false
4.248276
false
false
false
digling/sinotibetan
datasets/bai/modify_bai.py
1
3172
from lib.sino import db import lingpyd as lingpy numbersup = '¹²³⁴⁵⁶⁰' numbersdown = '₁₂₃₄₅₆₀' for k in db: subgroup = db[k,'subgroup'] if subgroup == 'Bai': # modify tokens tks = db[k,'tokens'] if tks not in ['-','']: tks = tks.split(' ') ntk = [] ...
gpl-2.0
8,496,444,828,046,954,000
26.79646
62
0.463228
false
3.055447
false
false
false
milkmeat/thomas
project euler/q51.py
1
1040
def listprime(lp): prime=[True]*lp prime[0]=False prime[1]=False for x in range(lp): if prime[x]: bei=x+x while bei<lp: prime[bei]=False bei+=x return prime def replaceStar(s): result=[] if '*' in s: for ...
mit
-4,113,597,390,468,659,000
19.666667
42
0.500962
false
3.623693
false
false
false
Jdsleppy/sweetmorse
setup.py
1
2423
from setuptools import setup, find_packages from os import path here = path.abspath(path.dirname(__file__)) long_description = """sweetmorse ---------- Morse code tools from read to write, analog to digital. .. image:: https://www.travis-ci.org/Jdsleppy/sweetmorse.svg?branch=master :target: https://www.travis-c...
mit
7,612,446,665,855,582,000
27.174419
79
0.645481
false
3.762422
false
false
false
MenloAthertonCoding/cruzebase
authtoken/authentication.py
1
5202
from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from rest_framework import authentication from rest_framework.exceptions import AuthenticationFailed from jwt.exceptions import TokenException from jwt import BaseToken, compare, token_factory from auth.models ...
apache-2.0
8,676,209,387,682,481,000
36.157143
100
0.656863
false
4.386172
false
false
false
Lucasgscruz/harpia
harpia/bpGUI/rotate.py
2
9475
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
gpl-2.0
1,089,525,163,356,173,600
38.475
149
0.519105
false
3.785058
false
false
false
dsysoev/fun-with-algorithms
graph/kruskal.py
1
2967
""" Kruskal's algorithm https://en.wikipedia.org/wiki/Kruskal%27s_algorithm """ from __future__ import print_function class Graph(object): """ Simple implementation of directed acyclic graph Parameters ---------- nodes : set set of all nodes in the graph dependencies : list ...
mit
-5,975,846,086,834,512,000
31.604396
79
0.539939
false
3.774809
false
false
false
marshallward/f90nml
f90nml/namelist.py
1
34448
"""Fortran namelist interface. The ``Namelist`` is a representation of a Fortran namelist and its contents in a Python environment. :copyright: Copyright 2014 Marshall Ward, see AUTHORS for details. :license: Apache License, Version 2.0, see LICENSE for details. """ from __future__ import print_function import iterto...
apache-2.0
6,405,817,952,973,433,000
34.808732
79
0.547724
false
4.373794
false
false
false
brain-tec/partner-contact
partner_ref_unique/models/res_partner.py
2
1192
# Copyright 2016 Antonio Espinosa # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import _, api, models from odoo.exceptions import ValidationError class ResPartner(models.Model): _inherit = "res.partner" @api.multi @api.constrains('ref', 'is_company', 'company_id') de...
agpl-3.0
5,771,191,152,878,194,000
36.25
71
0.510067
false
4.350365
false
false
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/DeMi/PyScripts/Lib/demi/__init__.py
1
3580
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: __init__.py import demi.windows import demi.registry import dsz.env import re ConnectedEnv = '_DEMI_KISU_COMMS_ESTABLISHED' KiSuEnabledEnv = '_DEMI_K...
unlicense
-6,117,307,922,654,907,000
23.696552
79
0.586313
false
3.199285
false
false
false
AronTrask/Kaspbot
libkasbot/ExcelBot/utils.py
1
1672
# Consider if this is the correct location for this element def test_valid_coord(coord): """ Fill in """ assert type(coord) is tuple, "{} is not a tuple (coord)".format(coord) assert type(coord[0]) is int, "{} is not an int (coord 0)".format(coord[0]) assert type(coord[1]) is int, "{} is not an...
mit
-5,784,959,346,883,634,000
35.347826
172
0.617823
false
3.650655
false
false
false
south-coast-science/scs_dfe_eng
src/scs_dfe/particulate/opc_n3/opc_status.py
1
3264
""" Created on 16 Nov 2018 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) """ from collections import OrderedDict from scs_core.data.json import JSONable # -------------------------------------------------------------------------------------------------------------------- class OPCStatus(JSONable): ...
mit
409,894,917,096,973,500
27.382609
118
0.434743
false
4
false
false
false
predikto/python-sdk
predikto/errors.py
1
1828
# Copyright 2014-2015 Predikto, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
675,187,820,182,811,300
18.869565
75
0.626368
false
4.145125
false
false
false
artwr/airflow
tests/utils/test_helpers.py
3
9730
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
9,064,997,477,779,371,000
37.458498
100
0.567215
false
3.948864
true
false
false
miarcompanies/sdn-wise-contiki
contiki/examples/zolertia/tutorial/99-apps/mqtt-node/internals/mqtt-check.py
1
1042
### Taken from https://pypi.python.org/pypi/paho-mqtt ### Requires Paho-MQTT package, install by: ### pip install paho-mqtt import paho.mqtt.client as mqtt MQTT_URL = "" MQTT_USERID = "" MQTT_PASSWD = "" MQTT_TOPIC_EVENT = '' MQTT_TOPIC_PUB = '' MQTT_PUB_STRING = '' def on_connect(client, userd...
bsd-3-clause
-5,148,396,591,194,084,000
26.421053
70
0.670825
false
2.831522
false
false
false
AZLisme/sihoo
sihoo/utils/time.py
1
1785
# -*- coding: utf-8 -*- """ 时间处理模块,统一处理时间相关函数 @author: AZLisme @email: helloazl@icloud.com """ from datetime import datetime, timedelta import pytz import time _DEFAULT_TIMEZONE = pytz.utc def now(tz=None): """获取现在的日期对象(带时区)""" if tz is None: return datetime.now(tz=_DEFAULT_TIMEZONE) else: ...
gpl-3.0
-3,036,369,990,444,020,000
19.333333
75
0.61377
false
2.390282
false
false
false
Officium/iLearn
pyml/gensim/textmining.py
2
2539
# -*- coding: utf-8 -*- import gensim import jieba import pandas as pd from tqdm import tqdm from datetime import datetime class yjiang(object): def __init__(self): self.idx2id = None self.raw_sentence = None self.preprocess_sentence = None self.vecs = None self.alternative...
apache-2.0
1,891,772,289,946,144,500
34.871429
115
0.56591
false
3.561702
false
false
false
Yipit/truck
tests/test_loader.py
1
2758
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of truck # <truck - test-friendly event bus layer on top of django signals> # Copyright (C) <2012> Gabriel Falcão <gabriel@yipit.com> # Copyright (C) <2012> Yipit Inc. <coders@yipit.com> # # This program is free software: you can redistribute it and/or...
lgpl-3.0
-5,574,983,629,860,531,000
34.346154
72
0.713094
false
3.459222
false
false
false
941design/ptTools
ptTools/writers/ansiwriter.py
1
5061
#!/usr/bin/env python3 """Module providing an AnsiParseTreeWriter for formatted printing of ptTools.ParseTreeNodes to an output channel on linux systems.""" __all__ = [ 'BLINK', 'BOLD', 'COLOR', 'COLORS', 'COMMENT', 'PRECEDENCE', 'UNDERLINE', 'AnsiParseTreeWriter', ] from . verbos...
gpl-3.0
5,937,019,086,103,000,000
30.04908
75
0.595534
false
4.162007
false
false
false
grokkers/cr-async
crasync/errors.py
1
1899
''' MIT License Copyright (c) 2017 grokkers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, dist...
mit
8,547,925,704,511,391,000
37
78
0.71248
false
4.267416
false
false
false
RoyBoy432/Emergence-Senescence
model/NYI_SSTOSIMPLE.py
1
8783
from __future__ import division from random import shuffle, choice, randint, seed from os.path import expanduser from numpy import log10 from scipy import stats import numpy as np import time import math import copy import sys import os from pprint import pprint as pp mydir = expanduser("~/") sys.path.append(mydir + ...
gpl-3.0
237,521,331,691,269,800
37.186957
159
0.511784
false
2.596984
false
false
false
jhorey/ferry
ferry/data/dockerfiles/hadoop-client/mounthelper.py
1
1115
import json import os import sys import logging from subprocess import Popen, PIPE def mkdir(directory): if not os.path.isdir(directory): cmd = 'mkdir -p %s' % directory Popen(cmd, shell=True) def mount(entry_point, mount_point): # Check if the mount point exists. If not # go ahead and cre...
apache-2.0
-3,390,376,736,842,846,700
29.135135
67
0.609865
false
3.348348
false
false
false
PySimulator/PySimulator
PySimulator/Plugins/SimulationResult/Csv/Csv.py
1
4603
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (C) 2011-2015 German Aerospace Center DLR (Deutsches Zentrum fuer Luft- und Raumfahrt e.V.), Institute of System Dynamics and Control All rights reserved. This file is part of PySimulator. PySimulator is free software: you can redistribute it and/or modify...
lgpl-3.0
7,949,613,338,050,799,000
30.513699
123
0.599652
false
3.830974
false
false
false
MIREL-UNC/mirel-scripts
preprocess/22_add_high_level_classes.py
1
1652
"""Add the high level classes (person/organization/etc.) to a label file.""" import argparse import pickle from tqdm import tqdm def read_arguments(): parser = argparse.ArgumentParser() parser.add_argument('--labels_file', type=unicode, help='Pickled file with...
bsd-3-clause
-9,118,652,511,027,232,000
29.592593
77
0.585351
false
4.03912
false
false
false
itamaro/home-control-RPC
HomeControlRPC/cam/views.py
1
1024
import logging import json import sys import tempfile from mimetypes import guess_type from django.http import HttpResponse from django.conf import settings from cam.models import WebCam, is_file_image logger = logging.getLogger(__name__) def get_snapshot(request): "Take a webcam snapshot and return it as HTTP ...
apache-2.0
-4,536,109,680,444,750,300
33.133333
63
0.668945
false
4.129032
false
false
false
lucasdnd/2048-ai
ai.py
1
2810
import random class _AI: def get_command_letter(self, command): if command == 0: return "w" elif command == 1: return "a" elif command == 2: return "s" else: return "d" class RandomAI(_AI): def __init__(self): self.name = "random_ai" def get_next_command(self, availa...
gpl-2.0
-3,631,155,268,515,528,700
24.779817
77
0.588968
false
3.431013
false
false
false
j91321/rext
modules/exploits/zte/f660_config_download.py
1
2035
# Name:ZTE F660 remote config download # File:f660_config_download.py # Author:Ján Trenčanský # License: GNU GPL v3 # Created: 25.12.2015 # Last modified: 25.12.2015 # Shodan Dork: # Description: ZTE F660 firmware Version: 2.22.21P1T8S does not check Cookies And Credentials on POST # Based on: https://www.exploit-db.co...
gpl-3.0
-4,303,776,654,742,305,000
35.232143
107
0.663381
false
3.547203
true
false
false
aayushkapadia/chemical_reaction_simulator
MainFrame.py
1
3865
import ReactionMaker.inversion as inversion import ReactionMaker.duplicate as duplicate import ReactionMaker.increment as increment import ReactionMaker.decrement as decrement import ReactionMaker.multiply as multiply import ReactionMaker.logarithm as logarithm import ReactionMaker.power as power import Simulator.XMLP...
mit
6,386,970,407,418,349,000
26.614286
67
0.760155
false
3.375546
false
false
false
mariomosca/damnvid
dLog.py
12
2690
# -*- coding: utf-8 -*- import os, sys import time import traceback from dCore import * class DamnLog: def __init__(self, logpath=None, stderr=True, flush=False, handleerrors=True, overrides={}): DamnLog.instance = self self.time = 0 self.streams = [] self.autoflush = flush self.overrides = {} if logpath ...
gpl-3.0
-7,886,833,101,879,418,000
24.619048
93
0.646097
false
2.822665
false
false
false
MTgeophysics/mtpy
mtpy/uofa/simpleplotEDI.py
1
3748
#!/usr/bin/env python import os import sys import os.path as op import mtpy.core.edi as MTedi def main(): fn = sys.argv[1] if not op.isfile(fn): print('\n\tFile does not exist: {0}\n'.format(fn)) sys.exit() saveplot = False if len(sys.argv) > 2: arg2 = sys.argv[2] i...
gpl-3.0
5,839,306,716,589,147,000
24.496599
99
0.534152
false
2.923557
false
false
false