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
walter-weinmann/annlink_thrift
src_py/test_client.py
1
7195
from erlang_python import ErlangPythonServices from helper import get_host, get_port from os.path import basename from thrift import Thrift from thrift.protocol import TBinaryProtocol from thrift.transport import TSocket from thrift.transport import TTransport class Dbg(object): active = False DEBUGGER = Dbg() ...
apache-2.0
-549,609,106,085,616,960
33.591346
97
0.376095
false
5.038515
false
false
false
jbush001/NyuziProcessor
tests/stress/atomic/runtest.py
1
1580
#!/usr/bin/env python3 # # Copyright 2011-2015 Jeff Bush # # 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 l...
apache-2.0
806,546,870,032,523,100
28.259259
76
0.655063
false
3.574661
true
false
false
basnijholt/holoviews
holoviews/core/data/grid.py
1
28647
from __future__ import absolute_import import sys import datetime as dt from collections import OrderedDict, defaultdict, Iterable try: import itertools.izip as zip except ImportError: pass import numpy as np from .dictionary import DictInterface from .interface import Interface, DataError from ..dimension ...
bsd-3-clause
-7,135,710,993,006,160,000
40.397399
113
0.554857
false
4.04733
false
false
false
cgsheeh/SFWR3XA3_Redevelopment
src/TabWidgets.py
1
73329
# -*- coding: utf-8 -*- # # Created: Fri Nov 13 14:07:26 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! import hashlib from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s t...
mit
6,554,279,241,628,381,000
52.918382
362
0.674003
false
3.690438
false
false
false
frerepoulet/ZeroNet
plugins/Mute/MutePlugin.py
2
3864
import time import json import os import re from Plugin import PluginManager from Translate import Translate from Config import config from util import helper if os.path.isfile("%s/mutes.json" % config.data_dir): try: mutes = json.load(open("%s/mutes.json" % config.data_dir))["mutes"] except Exceptio...
gpl-2.0
2,080,761,283,754,991,900
37.64
134
0.587992
false
3.551471
true
false
false
jacerong/normalesp
normalesp/spell_checking.py
1
55817
# -*- coding: iso-8859-15 -*- """This is the main program of the Python project. To use this program, please check the document "/docs/usage.rst". """ import difflib, multiprocessing, os, re, socket, subprocess, threading,\ xml.etree.ElementTree as ET import kenlm, numpy as np, psutil, py_common_subseq fro...
mit
-1,392,678,479,065,251,600
38.590456
104
0.561087
false
3.379849
false
false
false
EUMSSI/EUMSSI-platform
crawlers/DW-import/DW-api-video-crawler.py
1
3632
#!/usr/bin/env python import uuid import ConfigParser import pymongo import json import requests import sys, os from os.path import isdir, join import urllib2 from bs4 import BeautifulSoup class ItemWriter: def __init__(self, source, meta_format): self.mongo_client = pymongo.MongoClient() self.db = self.m...
apache-2.0
-4,000,235,398,634,655,000
30.042735
187
0.591685
false
3.606753
false
false
false
BrentonEarl/slpkg
slpkg/config.py
1
3003
#!/usr/bin/python # -*- coding: utf-8 -*- # config.py file is part of slpkg. # Copyright 2014-2015 Dimitris Zlatanidis <d.zlatanidis@gmail.com> # All rights reserved. # Slpkg is a user-friendly package manager for Slackware installations # https://github.com/dslackw/slpkg # Slpkg is free software: you can redistri...
gpl-3.0
2,471,797,473,529,711,600
32
76
0.559108
false
3.930628
true
false
false
gem/oq-hazardlib
openquake/hazardlib/gsim/boore_1993.py
1
7260
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2013-2017 GEM Foundation # # OpenQuake 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 Licen...
agpl-3.0
-6,444,127,054,750,756,000
40.965318
79
0.637741
false
2.854896
false
false
false
kscottz/SkinnerBox
util/stepper.py
1
1710
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) enable_pin = 27 #18 coil_A_2_pin = 18 #23 #17 coil_A_1_pin = 23 #18 #4 coil_B_1_pin = 25 #23 coil_B_2_pin = 24 #24 GPIO.setup(enable_pin, GPIO.OUT) GPIO.setup(coil_A_1_pin, GPIO.OUT) GPIO.setup(coil_A_2_pin, GPIO.OUT) GPIO.setup(coil_B_1_pin, GPIO.OUT) G...
mit
-9,137,084,050,979,697,000
22.75
58
0.59883
false
2.358621
false
false
false
MaxTyutyunnikov/lino
lino/modlib/vocbook/fr4et.py
1
64556
# -*- coding: UTF-8 -*- ## Copyright 2011-2013 Luc Saffre ## This file is part of the Lino project. ## Lino 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 y...
gpl-3.0
-9,100,418,341,294,364,000
25.385458
133
0.611523
false
1.989088
false
false
false
gmarkall/COFFEE
coffee/visitors/utilities.py
1
13166
from __future__ import absolute_import import itertools import operator from copy import deepcopy from collections import OrderedDict, defaultdict import numpy as np from coffee.visitor import Visitor from coffee.base import Sum, Sub, Prod, Div, ArrayInit, SparseArrayInit from coffee.utils import ItSpace, flatten _...
bsd-3-clause
-2,043,333,322,198,643,500
34.297587
92
0.584764
false
3.894114
false
false
false
teknick/eve-wspace
evewspace/core/tasks.py
3
6163
# Eve W-Space # Copyright (C) 2013 Andrew Austin and other contributors # # 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...
gpl-3.0
887,700,468,034,383,200
36.809816
88
0.636703
false
3.94811
false
false
false
infoINGenieria/Zweb
z_web/costos/views.py
1
20488
# coding: utf-8 from functools import partial, wraps from django.apps import apps from django.contrib import messages from django.core.exceptions import ImproperlyConfigured, ValidationError from django.core.urlresolvers import reverse, reverse_lazy from django.db import IntegrityError, models from django.db.transactio...
gpl-2.0
-1,134,927,434,687,782,100
42.098947
194
0.615768
false
3.59284
false
false
false
openworm/PyOpenWorm
examples/apsp.py
2
1704
#!/usr/bin/env python """ This file is used as a module in shortest_path.py """ from __future__ import absolute_import from __future__ import print_function import re import sys #import random as rnd import numpy as np import fileinput from six.moves import range from six.moves import zip def lca_table_print_matrix(M,...
mit
7,942,327,064,089,769,000
27.4
83
0.496479
false
3.126606
false
false
false
r-alex-hall/fontDevTools
scripts/randomNsetChars.py
1
4876
# DESCRIPTION # Prints N variants of constructed random character sets (hard-coded but hackable: block # characters), at X characters across and Y lines down each. Prints to either terminal or # files; hack the global variable SAVE_TO_RND_FILENAMES to alter that; hack the other globals # also for whatever other purpose...
gpl-3.0
-5,715,836,599,177,097,000
42.333333
180
0.679418
false
3.296779
false
false
false
psteinb/libmultiviewnative
python/generate_dims.py
1
1731
import sys import math def produce_size_strings(begin, end, base=2, n_dims=3): """ function that produces 3D grid sizes in power-of-2 manner example: produce_size_strings(4, 6): 16x16x16 32x16x16 32x32x16 32x32x32 64x32x32 64x64x32 64x64x64 """ value = [] if begin > en...
gpl-2.0
2,539,788,888,527,334,000
22.391892
74
0.547083
false
3.147273
false
false
false
IronLanguages/ironpython3
Src/Scripts/generate_dynsites.py
3
1160
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from generate import generate MaxTypes = 16 def gen_delegate_func(cw): for i in range(MaxTypes + 1): ...
apache-2.0
774,702,040,638,528,100
35.25
126
0.663793
false
3.591331
false
false
false
libavg/mtc-geneatd
geneatd/tower.py
1
5136
#geneaTD - A multi-touch tower defense game. #Copyright (C) 2010-2011 Frederic Kerber, Pascal Lessel, Michael Mauderer # #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 Lic...
gpl-3.0
-6,594,611,462,057,214,000
34.178082
243
0.617017
false
3.807265
false
false
false
mdublin/Brightcove-Dynamic-Ingest-App
JSONPARSER.py
1
2470
#! /usr/bin/python # -*- coding: utf-8 -*- #This is a JSON parser version of our script. Sometimes you can change a feed from JSON to MRSS by changing a parameter in the URL from JSON to MRSS. But just in case... import BC_01 import json import requests r = requests.get('[Insert your JSON feed URL here]') json = js...
mit
3,602,246,432,034,681,300
32.378378
169
0.631984
false
3.681073
false
false
false
louistin/fullstack
Python/io/format_output_20161018.py
1
1432
#!/usr/bin/python # _*_ coding: utf-8 _*_ import math print "" # str() 将值转化为适于人阅读的形式 # repr() 转化为供解释器读取的形式 s = 'Hello, World' print str(s) print repr(s) print str(1 / 7) x = 10 * 3.25 y = 200 * 200 s = 'The value of x is ' + repr(x) + ', and y is ' + repr(y) + '...' print s hello = 'hello, world\n' hellos = repr(h...
mit
-3,130,768,762,048,186,400
20.59375
77
0.577424
false
2.250814
false
false
false
wolf9s/doconce
lib/doconce/DocWriter.py
2
38975
""" DocWriter is a tool for writing documents in ASCII, HTML, LaTeX, DocOnce, and other formats based on input from Python datastructures. The base class _BaseWriter defines common functions and data structures, while subclasses HTML, DocOnce, etc. implement (i.e., write to) various formats. This module works, but i...
bsd-3-clause
2,413,235,996,077,832,000
35.289572
181
0.585863
false
3.764973
false
false
false
idekerlab/py2cytoscape
py2cytoscape/data/style.py
1
6533
from . import BASE_URL, HEADERS import requests import json import pandas as pd import warnings warnings.warn('\n\n\n**** data.style will be deprecated in the next py2cytoscape release. ****\n\n\n') class Style(object): def __init__(self, name): # Validate required argument if name is None: ...
mit
7,537,577,756,058,937,000
32.849741
102
0.529772
false
4.045201
false
false
false
srmagura/goodnight-lead
goodnight_lead/settings/common.py
1
2349
"""LEAD common settings.""" # Imports from pathlib import Path # Project base directory BASE_DIR = Path(__file__).absolute().parent.parent.parent # Installed applications INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', ...
gpl-3.0
-363,059,362,030,304,300
22.727273
79
0.702427
false
3.734499
false
false
false
qedsoftware/commcare-hq
corehq/apps/userreports/transforms/specs.py
1
2806
from decimal import Decimal from dimagi.ext.jsonobject import DictProperty, JsonObject, StringProperty from corehq.apps.userreports.specs import TypeProperty from corehq.apps.userreports.transforms.custom.date import get_month_display, days_elapsed_from_date from corehq.apps.userreports.transforms.custom.numeric import...
bsd-3-clause
863,535,659,692,166,900
30.177778
100
0.692801
false
4.350388
false
false
false
gazfm/CaptureRoyaleTestServer
CaptureRoyalTestServer/settings.py
1
2760
""" Django settings for CaptureRoyalTestServer project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ ...
apache-2.0
1,262,952,607,708,974,000
24.803738
71
0.693841
false
3.445693
false
false
false
Evervolv/android_external_chromium_org
tools/telemetry/telemetry/page/actions/click_element.py
33
1716
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.core import util from telemetry.core import exceptions from telemetry.page import page as page_module from telemetry.page.actions import pa...
bsd-3-clause
-2,990,962,649,633,745,400
39.857143
75
0.68648
false
4.07601
false
false
false
5monkeys/djedi-cms
djedi/utils/templates.py
1
1151
import json from django.core.exceptions import ImproperlyConfigured from ..compat import NoReverseMatch, render, render_to_string, reverse def render_embed(nodes=None, request=None): context = {} if nodes is None: try: prefix = request.build_absolute_uri("/").rstrip("/") con...
bsd-3-clause
-2,862,257,654,988,312,000
29.289474
72
0.523892
false
4.513725
false
false
false
Connexions/cnx-epub
cnxepub/tests/test_collation.py
1
13693
# -*- coding: utf-8 -*- # ### # Copyright (c) 2016, Rice University # This software is subject to the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. # ### import os import io import unittest try: from unittest import mock except ImportError: import mock ...
agpl-3.0
3,295,563,899,847,968,300
36.897222
93
0.509859
false
3.72048
true
false
false
brjadams/basenoter
basenotes/notes/migrations/0005_auto__del_splitclient__add_splittrans__del_field_parfumsizes_size_oz__.py
1
13307
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'SplitClient' db.delete_table(u'notes_splitclient') ...
gpl-3.0
-2,967,022,694,690,005,500
60.893023
195
0.555723
false
3.596486
false
false
false
atc-/pyela
pyela/el/net/parsers.py
1
13131
# Copyright 2008 Alex Collins # # This file is part of Pyela. # # Pyela 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. # # Pyela is ...
gpl-3.0
5,822,827,569,618,822,000
38.790909
156
0.718605
false
3.087468
false
false
false
david-abel/simple_rl
simple_rl/tasks/gym/GymMDPClass.py
1
2220
''' GymMDPClass.py: Contains implementation for MDPs of the Gym Environments. ''' # Python imports. import random import sys import os import random from collections import defaultdict # Other imports. import gym from simple_rl.mdp.MDPClass import MDP from simple_rl.tasks.gym.GymStateClass import GymState class GymM...
apache-2.0
-8,199,863,990,945,955,000
26.75
139
0.582883
false
3.603896
false
false
false
Forage/Gramps
gramps/gen/filters/rules/_matchessourceconfidencebase.py
1
2347
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2011 Jerome Rapinat # Copyright (C) 2011 Douglas S. Blank # Copyright (C) 2011 Benny Malengier # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General ...
gpl-2.0
6,077,626,136,033,357,000
38.116667
92
0.57222
false
4.611002
false
false
false
jhayworth/config
.emacs.d/elpy/rpc-venv/lib/python2.7/site-packages/pip/_internal/utils/packaging.py
32
3035
from __future__ import absolute_import import logging from email.parser import FeedParser from pip._vendor import pkg_resources from pip._vendor.packaging import specifiers, version from pip._internal.exceptions import NoneMetadataError from pip._internal.utils.misc import display_path from pip._internal.utils.typin...
gpl-3.0
6,347,136,353,345,223,000
31.287234
78
0.68369
false
4.073826
false
false
false
IEEEDTU/CMS
Resource/models/Publication.py
1
2839
from django.db import models from .Resource import * class PublicationManager(models.Manager): def addPublication(self, request): """ add new publication """ R = Resource.objects.addResource(request) P = Publication( resource=R, title=request['title'], a...
mit
-3,805,081,301,058,507,000
34.4875
106
0.624868
false
4.301515
false
false
false
stochasticHydroTools/RotationalDiffusion
sphere/checkSPD.py
1
1283
'''Check if the new sphere mobility is positive definite for all distance''' import numpy as np import sys import sphere as sph sys.path.append('..') from fluids import mobility as mb from quaternion_integrator.quaternion import Quaternion if __name__ == '__main__': # Parameters points = 1000 d...
gpl-3.0
6,660,634,305,839,014,000
25.183673
79
0.533125
false
3.129268
false
false
false
ZiktoTae/pyMpuFirmwareDebugger
logger.py
1
5551
#!/usr/bin/python import sys import serial from serial.tools import list_ports from mpudata import quat_packet, debug_packet, data_packet import os import time import numpy as np import matplotlib.pyplot as plt import euclid class mpu9150interface(object): def __init__(self): #self.connect() #self....
gpl-2.0
-1,227,144,257,575,223,300
30.185393
86
0.443344
false
3.833564
false
false
false
snakeleon/YouCompleteMe-x64
third_party/ycmd/third_party/jedi_deps/jedi/jedi/third_party/django-stubs/mypy_django_plugin/transformers/querysets.py
2
8440
from collections import OrderedDict from typing import List, Optional, Sequence, Type from django.core.exceptions import FieldError from django.db.models.base import Model from django.db.models.fields.related import RelatedField from django.db.models.fields.reverse_related import ForeignObjectRel from mypy.nodes impor...
gpl-3.0
-9,191,325,024,441,455,000
42.958333
119
0.667773
false
3.812105
false
false
false
nmahlangu/cs263-project-one
exploit-4a.py
1
1843
#!/usr/bin/python import sys import socket import traceback import urllib import struct # stack values fd_addr = 0xbfffde10 return_addr = 0xbfffde0c ebp_addr = 0xbfffde08 i_addr = 0xbfffddfc value_addr = 0xbfffdbf4 envvar_addr = 0xbfffd9f4 # attack values func_addr = 0x4007b170 ptr_to_fi...
mit
3,121,236,461,207,966,700
25.710145
85
0.585458
false
3.129032
false
false
false
vcpe-io/vcpe-hub
basic_qos_control/portstatistic_monitor.py
4
6280
"""Project For Port Monitor on switches.""" from ryu.base import app_manager from ryu.controller import ofp_event from ryu.topology.api import get_switch from ryu.controller.handler import set_ev_cls from ryu.controller.handler import MAIN_DISPATCHER from ryu.lib import hub from setting.db.data_collection import swit...
apache-2.0
-3,953,848,409,782,491,000
42.013699
158
0.554618
false
3.52809
false
false
false
insua1990/DAI
DAI-master/Flask/practica2.py
1
1639
# -*- coding: utf-8 -*- from flask import Flask,request, url_for,render_template import mandelbrot import random app = Flask(__name__) @app.route("/user/pepe") def pepe(): return "CONTENIDO WEB ESTATICO PARA PEPE" @app.route("/user/zerjillo") def zerjillo(): return "CONTENIDO WEB ESTATICO PARA ZERJILLO" @ap...
gpl-3.0
-8,851,896,246,478,109,000
29.943396
257
0.639414
false
2.597464
false
false
false
deepmind/mc_gradients
monte_carlo_gradients/dist_utils.py
1
2918
# Copyright 2019 Deepmind Technologies 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 agr...
apache-2.0
3,290,071,452,825,769,000
30.717391
77
0.733036
false
3.53697
false
false
false
SnowRomance/CMDB
order/migrations/0002_auto_20161229_1615.py
1
1541
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-12-29 08:15 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('order', '0001_initial'), ] operations = [ migrations.AddFiel...
gpl-3.0
2,227,179,580,864,926,000
29.215686
136
0.549643
false
4.044619
false
false
false
losonczylab/sima
examples/scanbox.py
3
2651
"""Example script to load Scanbox data as a SIMA sequence.""" from __future__ import division import argparse import fnmatch import os import numpy as np import sima from sima import imaging_parameters def sbxread(path, info_path): """Read in an .sbx file and return a SIMA sequence. Based off of the sbxRea...
gpl-2.0
-7,431,469,433,316,229,000
32.556962
76
0.60845
false
3.58728
false
false
false
martin882003/PyRAT
plugins/screenshot.py
1
1230
#!/usr/bin/env python #-*- encoding:utf-8 -*- # screenshot.py from PyQt4.QtGui import QApplication, QPixmap from os import environ, mkdir, listdir from sys import argv, platform from time import strftime, gmtime class Screenshot(object): def __init__(self): if platform == 'win32': ...
gpl-2.0
-3,672,721,533,335,851,500
30.538462
77
0.509756
false
4.300699
false
false
false
haystack/eyebrowse-server
extension/views.py
1
12847
import datetime from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.db.models.aggregates import Sum from django.db.models import Q from django.shortcuts import get_object_or_404 from django.views.decorators.clickjacking import xframe_options_exempt from dja...
mit
-8,257,733,362,844,671,000
32.110825
149
0.535378
false
3.888317
false
false
false
openai/baselines
baselines/common/vec_env/vec_env.py
1
6195
import contextlib import os from abc import ABC, abstractmethod from baselines.common.tile_images import tile_images class AlreadySteppingError(Exception): """ Raised when an asynchronous step is running while step_async() is called again. """ def __init__(self): msg = 'already running an...
mit
827,595,282,135,824,100
26.780269
219
0.606295
false
4.387394
false
false
false
sangwook236/SWDT
sw_dev/python/ext/test/database/leveldb_main.py
1
3320
#!/usr/bin/env python # -*- coding: UTF-8 -*- import json import numpy as np #import caffe import leveldb def write_to_db_example(use_caffe_datum=False): N = 1000 X = np.zeros((N, 3, 32, 32), dtype=np.uint8) y = np.zeros(N, dtype=np.int64) leveldb_dir_path = './myleveldb' db = leveldb.LevelDB(leveldb_dir_path, ...
gpl-3.0
-4,361,505,926,520,029,700
26.666667
88
0.636747
false
2.620363
false
false
false
dannyperry571/theapprentice
script.module.nanscrapers/lib/nanscrapers/dialogs.py
1
7998
from threading import Thread, RLock import xbmc import xbmcaddon import xbmcgui def select_ext(title, populator, tasks_count, sort_function = None): addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8') dlg = SelectorDialog("DialogSelect.xml", addonPath, title=title, pop...
gpl-2.0
-3,316,285,077,037,326,300
31.91358
108
0.53801
false
4.304629
false
false
false
hgascon/adagio
adagio/core/featureAnalysis.py
1
6579
#!/usr/bin/python # ADAGIO Android Application Graph-based Classification # featureAnalysis.py >> Analysis of features from SVM linear model # Copyright (c) 2016 Hugo Gascon <hgascon@mail.de> import os import numpy as np import networkx as nx from random import shuffle from adagio.common import ml """ Example: im...
gpl-2.0
-6,568,646,348,829,557,000
32.912371
89
0.573035
false
3.540904
false
false
false
voutilad/courtlistener
cl/lib/scorched_utils.py
1
2383
from scorched import SolrInterface from scorched.search import Options, SolrSearch class ExtraSolrInterface(SolrInterface): """Extends the SolrInterface class so that it uses the ExtraSolrSearch class. """ def __init__(self, *args, **kwargs): super(ExtraSolrInterface, self).__init__(*args, **...
agpl-3.0
-1,908,037,165,999,588,600
31.202703
79
0.571129
false
3.98495
false
false
false
zpincus/RisWidget
ris_widget/layer.py
1
17002
# This code is licensed under the MIT License (see LICENSE file for details) from PyQt5 import Qt import textwrap import warnings import numpy from . import image from . import histogram from . import qt_property from . import async_texture SHADER_PROP_HELP = """The GLSL fragment shader used to render an image withi...
mit
-6,145,258,606,754,030,000
36.449339
159
0.566404
false
3.583895
false
false
false
emc-openstack/storops
storops_test/vnx/resource/test_nfs_share.py
1
6687
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
4,224,096,191,783,860,000
35.944751
78
0.600568
false
3.042311
true
false
false
TheGentlemanOctopus/thegentlemanoctopus
octopus_code/core/octopus/rpcServer.py
1
2481
#!/usr/bin/env python import threading import Queue import time from SimpleXMLRPCServer import SimpleXMLRPCServer from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler import xmlrpclib rpc_path = '/RPC2' # The RPC server listens at host:port/rpc_path class RequestHandler(SimpleXMLRPCRequestHandler): rpc_path...
gpl-3.0
584,448,511,133,125,900
27.517241
93
0.626763
false
3.846512
false
false
false
dhocker/athomepowerlineserver
database/action_group_devices.py
1
3254
# -*- coding: utf-8 -*- # # AtHomePowerlineServer # Copyright © 2020 Dave Hocker # # 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, version 3 of the License. # # See the LICENSE file for more de...
gpl-3.0
4,163,177,689,781,883,000
30.892157
99
0.584384
false
4.224675
false
false
false
Carralex/landlab
landlab/plot/tests/test_event_handler.py
1
1185
#! /usr/bin/env python """ Created on Thu Jun 29 11:02:28 2017 @author: njlyons """ from landlab import imshow_grid, RasterModelGrid from landlab.plot.event_handler import query_grid_on_button_press from matplotlib.pyplot import gcf from matplotlib.backend_bases import Event from numpy.testing import assert_equal d...
mit
5,975,126,253,596,191,000
32.857143
78
0.692827
false
3.211382
false
false
false
chichilalescu/bfps
bfps/PP.py
1
37051
####################################################################### # # # Copyright 2015 Max Planck Institute # # for Dynamics and Self-Organization # # ...
gpl-3.0
8,611,814,064,329,809,000
44.294621
103
0.471701
false
4.123192
false
false
false
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Pillow-2.9.0/winbuild/config.py
2
3822
import os SF_MIRROR = 'http://iweb.dl.sourceforge.net' pythons = {#'26': 7, '27': 7, #'32': 7, '33': 7.1, '34': 7.1} VIRT_BASE = "c:/vp/" X64_EXT = os.environ.get('X64_EXT', "x64") libs = { 'zlib': { 'url': 'http://zlib.net/zlib128.zip', 'hash': 'md5:1...
mit
7,292,043,135,636,486,000
25.358621
93
0.502878
false
2.489902
false
false
false
DataDog/moto
tests/helpers.py
2
1220
from __future__ import unicode_literals import boto import six from nose.plugins.skip import SkipTest def version_tuple(v): return tuple(map(int, (v.split(".")))) # Note: See https://github.com/spulec/moto/issues/201 for why this is a separate method. def skip_test(): raise SkipTest class requires_boto_gt...
apache-2.0
7,139,768,139,323,090,000
28.047619
88
0.639344
false
4.080268
true
false
false
fieldsofview/sim-city-webservice
scripts/app.py
1
6851
# SIM-CITY webservice # # Copyright 2015 Joris Borgdorff <j.borgdorff@esciencecenter.nl> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
-7,256,146,511,198,649,000
28.530172
98
0.610714
false
3.504348
true
false
false
seb-m/wcurve
examples/ecdsa.py
1
2981
""" ECDSA signature scheme. Requires Python >= 2.4 (http://pypi.python.org/pypi/hashlib is needed for python2.4). """ import hashlib import random import time # Local import try: import wcurve except ImportError: from os.path import abspath, dirname import sys parent = dirname(dirname(abspath(__file__)...
mit
4,652,287,337,975,180,000
29.418367
75
0.614559
false
3.301218
false
false
false
jackaljack/design-patterns
proxy.py
1
1771
"""Proxy pattern Proxy is a structural design pattern. A proxy is a surrogate object which can communicate with the real object (aka implementation). Whenever a method in the surrogate is called, the surrogate simply calls the corresponding method in the implementation. The real object is encapsulated in the surrogate...
mit
-7,203,322,972,638,070,000
27.111111
80
0.673066
false
4.277778
false
false
false
LeoIannacone/dtn
emulab/theory.py
5
5674
#!/usr/bin/python import sys from heapq import * from optparse import OptionParser def dprint(msg): print "[%d]: %s" % (time, msg) arglist = ("count", "size", "num_hops", "bw", "hop_mode", "conn", "uptime", "downtime") usage = "usage: %prog [options]" parser = OptionParser(usage) parser.add_option('--size',...
apache-2.0
-5,409,233,377,742,971,000
24.908676
88
0.561509
false
3.308455
false
false
false
ucsd-ccbb/Oncolist
src/restLayer/app/MirBase.py
1
2673
import requests import tarfile,sys import urllib2 import json import time import pymongo from itertools import islice def run_mirbase_download(): load_mirbase_list(0) return 0 def get_mir_data(mirna): client = pymongo.MongoClient() mirna_data = { 'results': [] } mirnaarray = mirna.s...
mit
-9,162,671,989,890,276,000
24.961165
95
0.558548
false
3.3
false
false
false
ilastik/ilastik-0.5
ilastik/modules/interactive_segmentation/core/segmentors/segmentorSV2.py
1
5024
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 C Sommer, C Straehle, U Koethe, FA Hamprecht. All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are # permitted provided that the following conditions are met: # # 1. Redistributions of...
bsd-2-clause
8,846,247,614,698,652,000
43.070175
121
0.592357
false
4.239662
false
false
false
again4you/retext
tests/test_editor.py
3
2873
# This file is part of ReText # Copyright: 2014 Dmitry Shachnev # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Th...
gpl-3.0
-1,381,616,808,012,160,800
36.311688
71
0.741733
false
3.482424
true
false
false
sqlviz/sqlviz
tests/unit/test_query.py
1
2690
from unittest import TestCase import website.query import pandas as pd import json class TestLimits(TestCase): def test_adding_simple_limits(self): query = website.query.Query( query_text="select * from some_table", db=1) query.add_limit() self.assertEqual( ...
mit
-8,957,055,358,823,039,000
31.409639
73
0.514498
false
3.695055
true
false
false
osamak/student-portal
arshidni/forms.py
2
4567
# -*- coding: utf-8 -*- from arshidni.models import GraduateProfile, Question, Answer, StudyGroup, LearningObjective, JoinStudyGroupRequest, ColleagueProfile, SupervisionRequest from django import forms class GraduateProfileForm(forms.ModelForm): class Meta: model = GraduateProfile fields = ['cont...
agpl-3.0
4,208,945,619,795,110,400
42.407767
153
0.63431
false
3.89121
false
false
false
lum4chi/mygensim
corpora/bidictionary.py
1
8483
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Francesco Lumachi <francesco.lumachi@gmail.com> from __future__ import division from gensim import corpora, utils from six import iteritems, itervalues, iterkeys from collections import defaultdict from itertools import tee, izip from scipy.stats impo...
gpl-3.0
-1,737,981,581,561,137,000
43.413613
125
0.591536
false
3.798925
false
false
false
Scille/parsec-cloud
parsec/backend/memory/realm.py
1
11618
# Parsec Cloud (https://parsec.cloud) Copyright (c) AGPLv3 2016-2021 Scille SAS import attr import pendulum from uuid import UUID from typing import List, Dict, Optional, Tuple from parsec.api.data import UserProfile from parsec.api.protocol import DeviceID, UserID, OrganizationID from parsec.backend.backend_events i...
agpl-3.0
-1,742,722,794,959,625,700
35.649842
98
0.622224
false
4.038234
false
false
false
jivesoftware/jive-splunk-ssi-alerts
splunk/bin/jive.py
1
1818
import sys import json import requests # creates outbound message from alert payload contents # and attempts to send to the specified endpoint def send_message(payload): config = payload.get('configuration') # Get the Tile Endpoint URL jive_url = config.get('jive_url') # create outbound JSON message ...
apache-2.0
1,257,286,227,576,477,000
36.102041
94
0.587459
false
3.717791
false
false
false
mhaessig/servo
tests/wpt/web-platform-tests/tools/wpt/run.py
2
13550
import argparse import os import platform import shutil import subprocess import sys import tarfile from distutils.spawn import find_executable wpt_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) sys.path.insert(0, os.path.abspath(os.path.join(wpt_root, "tools"))) from . import b...
mpl-2.0
-1,231,535,169,148,979,200
31.338902
113
0.605387
false
4.006505
true
false
false
b1-systems/kiwi
test/unit/container_image_docker_test.py
1
1827
from mock import ( call, patch, Mock ) from kiwi.container.docker import ContainerImageDocker class TestContainerImageDocker(object): @patch('kiwi.container.docker.Compress') @patch('kiwi.container.docker.Command.run') @patch('kiwi.container.oci.RuntimeConfig') @patch('kiwi.container.oci.OCI') ...
gpl-3.0
-8,185,668,525,592,596,000
32.833333
76
0.574165
false
3.683468
false
false
false
UQ-UQx/edx-platform_lti
lms/djangoapps/courseware/tests/test_masquerade.py
1
4291
""" Unit tests for masquerade Based on (and depends on) unit tests for courseware. Notes for running by hand: ./manage.py lms --settings test test lms/djangoapps/courseware """ import json from django.core.urlresolvers import reverse from django.test.utils import override_settings from opaque_keys.edx.locations imp...
agpl-3.0
-9,220,477,234,079,998,000
36.973451
154
0.648567
false
4.021556
true
false
false
google-research/recsim
setup.py
1
2855
# coding=utf-8 # Copyright 2019 The RecSim 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...
apache-2.0
9,064,123,179,898,431,000
31.816092
77
0.676357
false
3.998599
false
false
false
ericzundel/pants
tests/python/pants_test/engine/legacy/test_changed_integration.py
1
15510
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import shu...
apache-2.0
-7,091,702,238,887,517,000
39.181347
106
0.648227
false
3.567157
true
false
false
biocore-ntnu/pyranges
pyranges/methods/init.py
1
5712
import sys import numpy as np import pandas as pd from natsort import natsorted from pyranges.statistics import StatisticsMethods from pyranges.genomicfeatures import GenomicFeaturesMethods from pyranges import PyRanges from pyranges.helpers import single_value_key, get_key_from_df def set_dtypes(df, int64): # ...
mit
-507,038,553,936,319,200
28.142857
112
0.582983
false
3.550031
false
false
false
erinspace/scrapi
scrapi/harvesters/iwu_commons.py
2
3226
''' Harvester for the Digital Commons @ IWU for the SHARE project Example API call: http://digitalcommons.iwu.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc ''' from __future__ import unicode_literals from scrapi.base import OAIHarvester class Iwu_commonsHarvester(OAIHarvester): short_name = 'iwu_commons' ...
apache-2.0
4,698,636,792,873,201,000
25.227642
94
0.542157
false
2.908927
false
false
false
Gaaralmn/resume
scripts/fs_sty.py
10
1702
#!/usr/bin/env python import os import re from sys import argv scripts, css = argv # filter icon name, ignore alias def fil_icname(line): if re.search('^\.fa-.*:before {$', line): ic_name = re.split("[.:]", line)[1][3:] return ic_name def fil_iccode(line): if re.search('^ content: .*;$', ...
mit
5,049,159,092,591,307,000
26.901639
79
0.538778
false
2.934483
false
false
false
mmottahedi/neuralnilm_prototype
scripts/e544.py
2
6184
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource) from neuralnilm.source import (standardise, discretize, fdiff, power_and_fdiff, ...
mit
7,918,684,810,106,850,000
29.613861
133
0.599612
false
3.626979
false
false
false
pombredanne/SourceForge-Allura
ForgeWiki/forgewiki/command/wiki2markdown/loaders.py
2
7674
import os import json import datetime from pylons import c from ming.orm.ormsession import ThreadLocalORMSession from allura import model as M from forgewiki import model as WM from forgewiki.converters import mediawiki2markdown from forgewiki.converters import mediawiki_internal_links2markdown from allura.command imp...
apache-2.0
-5,020,394,957,929,959,000
39.17801
77
0.548345
false
4.03258
true
false
false
gstiebler/odemis
src/odemis/dataio/png.py
2
3415
# -*- coding: utf-8 -*- ''' Created on 2 Sep 2014 @author: Éric Piel Copyright © 2014 Éric Piel, Delmic This file is part of Odemis. Odemis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Odemis is ...
gpl-2.0
6,314,940,524,442,912,000
36.911111
226
0.666471
false
3.708696
false
false
false
Danielhiversen/home-assistant
homeassistant/components/media_player/songpal.py
3
7690
""" Support for Songpal-enabled (Sony) media devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.songpal/ """ import logging import voluptuous as vol from homeassistant.components.media_player import ( DOMAIN, PLATFORM_SCHEMA, SUPP...
mit
4,327,482,265,439,586,000
29.515873
78
0.602731
false
4.088251
false
false
false
yiwen-luo/LeetCode
Python/next-closest-time.py
3
1267
# Time: O(1) # Space: O(1) # Given a time represented in the format "HH:MM", # form the next closest time by reusing the current digits. # There is no limit on how many times a digit can be reused. # # You may assume the given input string is always valid. # For example, "01:34", "12:09" are all valid. "1:34", "12:9"...
mit
-679,157,756,229,711,200
30.675
114
0.595107
false
3.223919
false
false
false
fmartingr/iosfu
iosfu/backup.py
1
5063
from __future__ import with_statement from os import listdir from os.path import join as join_paths, basename, isdir, isfile from plistlib import readPlist from biplist import readPlist as readBinaryPlist from .conf import BACKUPS_PATH, BACKUP_DEFAULT_SETTINGS from iosfu import utils class BackupManager(object): ...
mit
8,790,374,785,862,651,000
24.700508
75
0.537428
false
4.22621
false
false
false
consbio/seedsource-core
seedsource_core/django/seedsource/management/commands/export_seedzone_stats.py
1
11651
import errno import json import math import os import time from collections import defaultdict from csv import DictWriter import warnings import numpy from progress.bar import Bar from django.conf import settings from django.core.management import BaseCommand, CommandError from django.contrib.gis.db.models.functions i...
bsd-3-clause
-5,571,044,848,462,398,000
43.639847
127
0.465711
false
5.203662
false
false
false
marcok/odoo_modules
hr_employee_time_clock/models/resource_calendar.py
1
16701
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>). # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
-787,052,981,684,389,600
43.18254
109
0.528232
false
4.130843
false
false
false
mamiaokui/tracer
tools/LogServer/Server.py
1
2827
import time import BaseHTTPServer import re from datetime import datetime HOST_NAME = '10.33.43.6' # !!!REMEMBER TO CHANGE THIS!!! PORT_NUMBER = 8080 # Maybe set this to 9000. class Event: time = "null" pid = 0 delay = 5 class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_HEAD(s): ...
gpl-2.0
9,211,730,896,767,646,000
33.47561
107
0.516095
false
3.784471
false
false
false
gwtsa/gwtsa
tests/test_project.py
1
2884
from pandas import read_csv import pastas as ps ps.set_log_level("ERROR") def test_create_project(): pr = ps.Project(name="test") return pr def test_project_add_oseries(): pr = test_create_project() obs = read_csv("tests/data/obs.csv", index_col=0, parse_dates=True, squeeze=True)...
mit
-4,870,507,018,814,844,000
22.639344
78
0.635576
false
3.097744
true
false
false
DylannCordel/django-cms
setup.py
2
1526
from setuptools import setup, find_packages import os import cms CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independ...
bsd-3-clause
3,222,477,265,272,711,700
30.142857
88
0.619921
false
3.740196
false
true
false
ashutoshpurushottam/wishper-blog
handlers/signup.py
1
2578
from main import BaseHandler from models.user import store_blog_user from base.helpers import validate from base.helpers import make_secure_val import time class SignupHandler(BaseHandler): """ Handles form validation, checks if the username and/or email id already exists. In case form is submitted with p...
apache-2.0
2,149,645,121,340,756,500
42.694915
87
0.537626
false
4.976834
false
false
false
tensorflow/datasets
tensorflow_datasets/core/lazy_imports_lib.py
1
5332
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets 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 appl...
apache-2.0
-587,575,874,370,292,600
23.685185
78
0.700863
false
3.659574
false
false
false
squarebracket/star
backends/myconcordia.py
1
19029
from registrator.models import StudentRecord from user_stuff.models import StarUser, Student from bs4 import BeautifulSoup, Tag from cookielib import CookieJar import urllib import urllib2 import urlparse from StringIO import StringIO import gzip import re from uni_info.models import Semester, Section, Course from reg...
gpl-2.0
5,778,534,104,969,647,000
39.489362
163
0.574859
false
3.571509
false
false
false
daviesjamie/spout
spout/streams.py
1
3869
import abc class Stream(object): """ Abstract implementation of a data stream. """ __metaclass__ = abc.ABCMeta def for_each(self, operation, limit=0, verbose=False): """ Applies the given Operation to each item in the stream. The Operation executes on the items in the str...
mit
4,541,527,865,234,232,300
25.875
98
0.583872
false
4.600476
false
false
false
apoorva-sharma/deep-frame-interpolation
data_loader.py
1
3243
import numpy as np from scipy import misc import glob from tensorflow.contrib.learn.python.learn.datasets import base class DataSet(object): def __init__(self, images, labels): self._images = images self._labels = labels self._num_examples = images.shape[0] self._epochs_completed = 0 self._index_in_epoch ...
mit
3,691,239,741,978,047,000
25.365854
76
0.708295
false
3.079772
true
false
false
leezu/mxnet
python/mxnet/gluon/probability/distributions/gamma.py
5
3721
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-6,705,765,177,642,580,000
35.480392
97
0.633701
false
3.828189
false
false
false
GeosoftInc/gxpy
geosoft/gxapi/GXMAPL.py
1
4787
### extends 'class_empty.py' ### block ClassImports # NOTICE: Do not edit anything here, it is generated code from . import gxapi_cy from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref ### endblock ClassImports ### block Header # NOTICE: The code generator will not replace the code in this block ### end...
bsd-2-clause
6,101,702,230,829,206,000
29.303797
135
0.608105
false
3.481455
false
false
false
isandlaTech/cohorte-demos
led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-20141209.234423-41-python-distribution/repo/sleekxmpp/plugins/xep_0202/time.py
8
3106
""" SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz This file is part of SleekXMPP. See the file LICENSE for copying permission. """ import logging from sleekxmpp.stanza.iq import Iq from sleekxmpp.xmlstream import register_stanza_plugin from sleekxmpp.xmlstream.ha...
apache-2.0
7,519,437,295,183,417,000
29.693878
71
0.577592
false
3.916772
false
false
false
pheanex/xpython
exercises/kindergarten-garden/kindergarten_garden_test.py
1
1974
import unittest from kindergarten_garden import Garden # Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.0 class KindergartenGardenTests(unittest.TestCase): def test_garden_with_single_student(self): self.assertEqual( Garden("RC\nGG").plants("Alice"), "Rad...
mit
-5,124,548,345,512,507,000
35.555556
77
0.629179
false
3.209756
true
false
false
hoechenberger/psychopy
setupApp.py
1
6565
#!/usr/bin/env python ################ # see notes at bottom for requirements from __future__ import absolute_import, print_function import glob import os import sys from sys import platform from distutils.core import setup from pkg_resources import parse_version # import versioneer import psychopy version = psychopy._...
gpl-3.0
-2,791,599,011,250,994,700
38.311377
98
0.592232
false
3.64925
false
false
false