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
ProjectQ-Framework/ProjectQ
projectq/backends/_circuits/_drawer_matplotlib.py
1
9345
# -*- coding: utf-8 -*- # Copyright 2020 ProjectQ-Framework (www.projectq.ch) # # 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
-8,068,839,753,462,731,000
39.454545
108
0.582343
false
4.342472
false
false
false
kaija/taiwan_stockloader
import.py
1
1750
import datetime import httplib import urllib import redis import json from datetime import timedelta #now = datetime.datetime.now(); #today = now.strftime('%Y-%m-%d') #print today rdb = redis.Redis('localhost') def isfloat(value): try: float(value) return True except ValueError: return False def convfloat(v...
mit
-800,522,717,132,503,800
20.875
315
0.626286
false
2.600297
false
false
false
arcman77/banned4hax.github.io
adam_opt_with_simple_func.py
1
3260
import math as math import random as random def get_data(n_points = 300, m = 2, b = 7, variance = 5): y_train = [(m * x + b + random.uniform(-variance, variance)) for x in range(0, n_points)] # x = [(m * x + b) for x in range(0, n_points)] x_train = [x for x in range(0, n_points)] return [x_train, y_tr...
mit
3,079,845,818,083,412,500
30.047619
93
0.547546
false
2.5
false
false
false
ExpResults/libweicws
tools/script/ws.py
2
3855
#!/usr/bin/env python unknownSample = "$NA$" ##################################################################### # # # Sentence class # # ...
gpl-3.0
4,750,003,086,841,327,000
35.714286
100
0.335668
false
4.644578
false
false
false
suhelhammoud/omr
src/omr_detection_old.py
1
7009
import numpy as np import cv2 from matplotlib import pyplot as plt class VPoint: A = 0 B = 1 C = 2 D = 3 ERROR = 10000000 def __init__(self, cx, cy): self.cx = cx self.cy = cy def which(self, x, y): if x < self.cx: if y < self.cy: return...
apache-2.0
-139,270,765,766,005,220
25.755725
81
0.550292
false
2.783558
false
false
false
alephdata/aleph
aleph/logic/export.py
1
6716
import os import shutil import logging from pprint import pformat # noqa from zipfile import ZipFile from tempfile import mkdtemp from flask import render_template from normality import safe_filename from followthemoney.helpers import entity_filename from followthemoney.export.excel import ExcelExporter from servicela...
mit
2,863,509,297,279,035,000
34.162304
83
0.640411
false
3.848711
false
false
false
igorsobreira/eizzek
tests/unit/test_decorators.py
1
1275
from unittest import TestCase import re from eizzek.lib.decorators import plugin, session_plugin from eizzek.lib.registry import registry, session_registry class PluginTest(TestCase): def setUp(self): registry.clear() def test_plugin(self): assert len(registry.plugins) ...
mit
-6,015,821,218,647,185,000
23.519231
60
0.574118
false
4.366438
true
false
false
GrahamCobb/ssdp-fake
ssdp-fake.py
1
11216
#!/usr/bin/python # Copyright (C) 2014 Graham R. Cobb # Released under GPL V2 -- see LICENSE # Python multicast code taken from Stack Overflow (https://stackoverflow.com/questions/603852/multicast-in-python/1794373#1794373) by tolomea (https://stackoverflow.com/users/10471/tolomea) under CC BY-SA 3.0 # Other example co...
gpl-2.0
3,653,407,125,376,547,000
36.891892
208
0.623573
false
2.642167
false
false
false
osrf/opensplice
examples/dcps/PerformanceScripts/Roundtrip.py
2
9418
import utils, os, sys, csv, subprocess, time, optparse, pdb def pingpong(o): texec = [] ping = 'ping' pong = 'pong' if sys.platform == 'win32': ping = 'ping.exe' pong = 'pong.exe' apiselect=0 if o.capi: #C texec.append([]) texec[apiselect].append(os.en...
apache-2.0
-2,146,004,641,214,619,400
41.423423
185
0.502548
false
4.077056
false
false
false
alephu5/Soundbyte
IO/datalistener.py
1
2367
#! ../environment/bin/python3.3 import argparse import tempfile import os from itertools import tee from binascii import hexlify def main(): parser = argparse.ArgumentParser(description = 'Reads binary data from a file') parser.add_argument('-f, --file', type = str, ...
gpl-3.0
4,968,535,609,732,957,000
33.808824
92
0.531474
false
4.264865
false
false
false
pierce-m/p4factory
mininet/swl_l2.py
4
2283
#!/usr/bin/python # Copyright 2013-present Barefoot Networks, 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 ap...
apache-2.0
7,596,828,744,844,814,000
33.590909
78
0.555848
false
3.539535
false
false
false
rohitdatta/pepper
pepper/innovation/views.py
1
2072
import validators import jwt import datetime import urllib from flask import request, jsonify, redirect, url_for, flash from flask_login import current_user, login_required from pepper import settings from pepper.utils import get_default_dashboard_for_role # sends an access token to the callback provided by the url @l...
agpl-3.0
-757,792,038,237,813,400
47.186047
134
0.686776
false
3.894737
false
false
false
marcoscastro/mochila_inteiro-busca_tabu
mochila_tabu.py
1
8440
# -*- coding:utf-8 -*- # Autor: Marcos Castro # Busca Tabu - Problema da Mochila Inteiro # Configuração da Mochila # Objeto (j) 1 2 3 4 5 # Peso (wj) 4 5 7 9 6 # Benefício (pj) 2 2 3 4 4 # Objetivo: Maximizar o benefício de cada elemento # Função objetivo: f(s) = SOMATORIO[j=1 até n](pj)(sj) - SOMATORIO[j=1 até n...
gpl-2.0
4,742,286,044,789,534,000
45.264045
129
0.743048
false
2.18609
false
false
false
krasch/smart-assistants
evaluation/experiment.py
1
12058
# -*- coding: UTF-8 -*- """ This module defines an evaluation framework for performing cross-validation experiments with the implemented classifiers. """ from datetime import datetime from math import sqrt from sklearn.cross_validation import KFold from scipy import stats as scipy_stats import pandas import numpy fr...
mit
2,074,946,014,355,926,500
48.826446
122
0.681705
false
4.499254
true
false
false
marcelopalin/minicurso
scripts/p01/hello_03.py
1
4588
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # # Description: Hello World! # - vs 3 - Facilitando a execução do código passando parâmetros no momento # da execução # # Author: @Palin # # Last Update: 10/2016 # Created: 10/2016 # Copyright: ...
mit
-4,412,214,303,823,284,000
34.512
113
0.546231
false
3.250712
false
false
false
liqd/adhocracy3.mercator
src/adhocracy_core/adhocracy_core/sheets/comment.py
2
2330
"""Comment sheet.""" from colander import deferred from substanced.util import find_service from adhocracy_core.interfaces import ISheet from adhocracy_core.interfaces import ISheetReferenceAutoUpdateMarker from adhocracy_core.interfaces import SheetToSheet from adhocracy_core.sheets import add_sheet_to_registry from ...
agpl-3.0
-6,638,699,725,018,826,000
28.871795
78
0.73691
false
3.819672
false
false
false
renegelinas/mi-instrument
mi/dataset/driver/ctdav_n/auv/test/test_ctdav_n_auv_deprecated_drivers.py
3
1370
#!/usr/bin/env python import os import unittest from mi.logging import log from mi.dataset.driver.ctdav_n.auv.ctdav_n_auv_telemetered_driver import parse as parse_telemetered from mi.dataset.driver.ctdav_n.auv.ctdav_n_auv_recovered_driver import parse as parse_recovered from mi.dataset.driver.ctdav_n.auv.resource imp...
bsd-2-clause
7,216,453,601,948,751,000
32.414634
101
0.727007
false
3.416459
true
false
false
gkoelln/youtube-dl
youtube_dl/extractor/cjsw.py
45
2412
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, unescapeHTML, ) class CJSWIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?cjsw\.com/program/(?P<program>[^/]+)/episode/(?P<id>\d+)' _TESTS = [{ 'url':...
unlicense
-4,063,502,987,773,949,400
32.472222
95
0.506224
false
3.247978
false
false
false
embik/bloks
bloks/__init__.py
1
1395
import os import logging from logging import Formatter from logging.handlers import RotatingFileHandler from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager from flask.ext.pagedown import PageDown app = Flask(__name__) app.config.from_object('bloks.config') # Ch...
mit
4,729,526,484,337,995,000
32.214286
83
0.779211
false
3.4875
true
false
false
hovo1990/deviser
generator/bindings_files/BindingsFiles.py
1
8465
#!/usr/bin/env python # # @file CMakeFiles.py # @brief class for generating the cmake files # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2015 by the California Institute of Technology # (California, USA), ...
lgpl-2.1
1,252,636,336,700,358,700
41.752525
78
0.537389
false
4.769014
false
false
false
uschille/FabSim
deploy/fabNanoMD.py
1
5847
# -*- coding: utf-8 -*- # # Copyright (C) University College London, 2013, all rights reserved. # # This file is part of FabMD and is CONFIDENTIAL. You may not work # with, install, use, duplicate, modify, redistribute or share this # file, or any part thereof, other than as allowed by any agreement # specifically m...
lgpl-3.0
-5,547,807,885,847,404,000
45.404762
181
0.638276
false
2.992323
true
false
false
vine/luigi
test/server_test.py
13
3810
# -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
4,112,797,289,493,169,000
28.765625
83
0.634908
false
3.720703
true
false
false
westphahl/verleihsystem
doc/code/server_contact_view.py
1
1178
def contact_form(request): if request.method == 'POST': form = ContactForm(request.POST) if form.is_valid(): name = form.cleaned_data['name'] mail = form.cleaned_data['mail'] subject = "[Verleihsystem:Kontakt]: "+form.cleaned_data['subject'] message = ...
isc
8,925,344,169,523,678,000
41.071429
78
0.550934
false
4.147887
false
false
false
seanbell/opensurfaces
server/common/migrations/0003_auto__add_papercitation.py
1
1955
# -*- 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): # Adding model 'PaperCitation' db.create_table(u'common_papercitation', (...
mit
-8,008,219,321,522,032,000
45.571429
113
0.593862
false
3.654206
false
false
false
ujdhesa/unisubs
apps/auth/admin.py
1
3332
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program 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 ...
agpl-3.0
7,780,854,028,149,304,000
39.144578
126
0.697479
false
3.95255
false
false
false
ivandavid77/learnetic_monitoreo_mcourserpro
apps/learnetic_monitoreo_mcourserpro/priv/utils/extraer_bigquery_events.py
1
2669
# -*- coding: utf-8 -*- import sys import csv import datetime from google.cloud import bigquery if __name__ == '__main__': client = bigquery.Client() query = ( 'SELECT * ' 'FROM `mcourser-mexico-he.events.events2017*` ' 'WHERE SUBSTR(username,0,3) IN ("DUR","JAL")' 'AND LENGTH(u...
bsd-3-clause
8,337,022,794,136,258,000
53.469388
120
0.529786
false
4.118827
false
false
false
APSL/libthumbor
tests/thumbor_py3/crypto.py
2
3928
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import base64 import hashlib import hmac from Crypto.Cipher import ...
mit
-3,555,383,855,582,258,700
27.258993
123
0.541752
false
3.987817
false
false
false
HydrelioxGitHub/home-assistant
homeassistant/components/sensor/demo.py
8
1876
""" Demo platform that has a couple of fake sensors. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.const import ( ATTR_BATTERY_LEVEL, TEMP_CELSIUS, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE) from homeassistant.hel...
apache-2.0
-2,061,182,217,085,773,000
27.861538
77
0.61887
false
4.225225
false
false
false
CyrilWaechter/pyRevitMEP
pyRevitMEP.tab/Lab.panel/Lab.pulldown/AutoInsulate.pushbutton/script.py
1
3350
# coding: utf8 import rpw from rpw import DB, revit from rpw import logger __doc__ = "Auto" __title__ = "Auto Insulate" __author__ = "Cyril Waechter" __context__ = "Selection" # TODO def apply_size_rule(size, rule): pass def set_system_rule(mep_system): mep_system return # rule def get_element_mep_s...
gpl-3.0
5,746,081,570,516,607,000
34.638298
119
0.664776
false
3.669222
false
false
false
webitup/python3-wforms
tests/validators.py
1
9174
#!/usr/bin/env python from unittest import TestCase from wtforms.validators import StopValidation, ValidationError, email, equal_to, ip_address, length, required, optional, regexp, url, NumberRange, AnyOf, NoneOf, unicode class DummyTranslations(object): def gettext(self, string): return string def ng...
bsd-3-clause
-3,406,957,340,670,500,400
49.685083
169
0.653913
false
3.849769
true
false
false
Rayvenden/scripts
watcher.py
1
1673
#!/usr/bin/python3 import argparse import os import subprocess import time import signal # Avoid zombie process signal.signal(signal.SIGCHLD, signal.SIG_IGN) # Exit after receiving Control-C signal.signal(signal.SIGINT, signal.SIG_DFL) parser = argparse.ArgumentParser(prog='watcher.py', description='Simple f...
bsd-3-clause
8,947,274,092,214,116,000
29.981481
84
0.644351
false
3.428279
false
false
false
ArcherSys/ArcherSys
eclipse/plugins/org.python.pydev_4.5.5.201603221110/pysrc/_pydevd_bundle/pydevd_utils.py
1
5587
from __future__ import nested_scopes import traceback import os try: from urllib import quote except: from urllib.parse import quote # @UnresolvedImport from _pydevd_bundle import pydevd_constants import sys from _pydev_bundle import pydev_log def save_main_module(file, module_name): # patch provided by...
mit
-831,696,770,111,931,300
29.2
104
0.581171
false
3.649249
false
false
false
ric2b/Vivaldi-browser
chromium/third_party/polymer/v1_0/create_components_summary.py
10
1643
# Copyright 2016 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. import json import os import re COMPONENTS_DIR = 'components' DESTINATION_COMPONENTS_DIR = 'components-chromium' COMPONENT_SUMMARY =\ """Name: %(name)s Rep...
bsd-3-clause
-7,055,168,873,998,143,000
25.934426
79
0.666464
false
3.503198
false
false
false
RiiConnect24/File-Maker
Channels/Everybody_Votes_Channel/voteslists.py
1
10385
#!/usr/bin/python # -*- coding: utf-8 -*- import collections """List of countries the EVC uses.""" countries = collections.OrderedDict() countries["Japan"] = ["日本", "Japan", "Japan", "Japon", "Japón", "Giappone", "Japan"] countries["Argentina"] = ["アルゼンチン", "Argentina", "Argentinien", "Argentine", "Argentina", "Arg...
agpl-3.0
-2,446,450,334,709,106,700
51.046632
254
0.676755
false
2.138144
false
false
false
ztane/Tonnikala
tonnikala/astutil/__init__.py
1
7620
import ast NoneValue = object() mappednames = [ False, True, NotImplemented, Ellipsis ] try: basestring except: basestring = (str, bytes) numbers = (int, float) def coerce(obj): if any(i is obj for i in mappednames): return Name(str(obj)) if obj is NoneValue: return...
apache-2.0
-4,026,238,387,926,721,500
21.280702
97
0.559449
false
3.485819
false
false
false
noironetworks/apic-ml2-driver
apic_ml2/neutron/db/l3out_vlan_allocation.py
1
10929
# Copyright (c) 2013 OpenStack Foundation # 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 ...
apache-2.0
1,540,721,351,962,109,700
42.027559
78
0.529875
false
4.274149
false
false
false
awalkaradi95moc/pfioh
pfioh/dgmsocket.py
1
3029
#!/usr/bin/env python3 # # NAME # # dgmsocket class # # DESCRIPTION # # The 'dgmsocket' class provides a very simple wrapper the standard # python socket API. # # More specifically, this class provides datagram socket services. # # HISTORY # # 25 March 2006 # o Initial development implementation # # 06 December 2011 #...
mit
-1,144,093,641,679,235,300
31.923913
102
0.468141
false
3.734895
false
false
false
openstack/monasca-ui
monitoring/overview/views.py
1
16561
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
8,722,627,612,540,159,000
36.810502
100
0.577381
false
4.352431
false
false
false
huseyinbiyik/script.module.livelib
lib/livelib.py
2
2019
import boogietools as bt import sys import xbmcgui class livelib(): def __init__(self): self.timeout=None def scrape(self,scraper,*args,**kwargs): try: module=__import__("scrapers",fromlist=[scraper]) scraper_function=getattr(module,scraper) except Exception,e: type="ERROR: LIVELIB | No scraper for ...
gpl-2.0
-2,178,086,190,224,053,200
26.297297
79
0.631005
false
2.847673
false
false
false
scienceopen/pyrinex
src/georinex/__main__.py
1
8696
import argparse from pathlib import Path import numpy as np from datetime import timedelta import logging import georinex as gr def georinex_read(): """ Reads RINEX 2/3 OBS/NAV file and plot (or convert to NetCDF4 / HDF5). Returns data as xarray.Dataset, think of it like an N-dimensional Numpy NDarray wi...
mit
2,579,951,635,595,863,600
29.512281
109
0.604991
false
3.238734
false
false
false
ubuntunux/PyEngine3D
PyEngine3D/Render/Renderer.py
1
60697
from ctypes import c_void_p import math import numpy as np from OpenGL.GL import * from OpenGL.GLU import * from PyEngine3D.Common import logger, COMMAND from PyEngine3D.Common.Constants import * from PyEngine3D.Utilities import * from PyEngine3D.OpenGLContext import InstanceBuffer, FrameBufferManager, RenderBuffer,...
bsd-2-clause
-7,607,777,899,450,570,000
50.525467
173
0.595565
false
3.928608
false
false
false
azumimuo/family-xbmc-addon
script.module.liveresolver/lib/liveresolver/resolvers/sawlive.py
1
3289
# -*- coding: utf-8 -*- import re,urllib,urlparse,base64 from liveresolver.modules import client,decryptionUtils from liveresolver.modules import jsunpack from liveresolver.modules.log_utils import log def resolve(url): try: page = re.compile('//(.+?)/(?:embed|v)/([0-9a-zA-Z-_]+)').findall(url)[0] ...
gpl-2.0
-8,261,275,550,164,415,000
39.109756
107
0.511402
false
3.498936
false
false
false
mlcommons/training
reinforcement/tensorflow/minigo/oneoffs/eval_sgf_to_cbt.py
4
8454
#!/usr/bin/env python3 # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
7,526,406,922,997,493,000
29.854015
94
0.632127
false
3.532804
false
false
false
antin/Open-Knesset
fabfile.py
11
3568
from fabric.api import run, cd, sudo, roles, runs_once, env from fabric.contrib.files import first # add a local_fab_settings.py file, # so that you can access your servers # but please, don't commit it to git. try: from local_fab_settings import * except ImportError as e: pass env.venv_roots = ['/oknesset_w...
bsd-3-clause
-1,471,443,326,784,855,600
22.629139
118
0.632848
false
3.312906
false
false
false
glue-viz/glue-qt
glue/clients/tests/test_histogram_client.py
1
17190
#pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103 import pytest from mock import MagicMock import matplotlib.pyplot as plt import numpy as np from ..histogram_client import HistogramClient from ..layer_artist import HistogramLayerArtist from ...core.data_collection import DataCollection from ...core.exceptions im...
bsd-3-clause
1,918,965,604,323,963,400
30.951673
76
0.606981
false
3.491064
true
false
false
sergeiliashko/sif
graphics/plotenergy.py
1
2486
import numpy as np import matplotlib.pyplot as plt from sys import argv import matplotlib.gridspec as gridspec from scipy.signal import argrelextrema from scipy.interpolate import interp1d from matplotlib.ticker import FormatStrFormatter import matplotlib.patches as patches import matplotlib.pyplot as plt def main(ene...
gpl-3.0
8,936,404,085,841,171,000
37.84375
181
0.641995
false
2.921269
false
false
false
psephologic/everyonevoting
everyonevoting/locations/models-dev.py
1
1466
from django.db import models from core.models import BaseEMSModel, Organization class GeoDistrict(BaseEMSModel): """EML 150.""" # TODO: At some point, consider using django-mptt # TODO: Should we have a separate model for the district type, where # things defining the type of district can be made (e...
agpl-3.0
8,356,047,771,490,293,000
38.648649
99
0.688267
false
3.788114
false
false
false
satyajeet76626/WordPress_BrutForce
w_press.py
1
5159
#!usr/bin/python3 # Modules related comments are only applied in this Script. import requests # Using this module to send request and getting response from local_server. import sys # Using this module for writting formated text on the terminal. from col...
mit
-6,060,353,860,117,834,000
45.9
169
0.499128
false
3.092926
false
false
false
rgrandin/MechanicsTools
truss/truss_solver.py
1
22478
# # -*- coding: utf-8 -*- # # Python-Based Truss Solver # ============================================================= # # Author: Robert Grandin # # Date: Fall 2007 (Creation of original Fortran solution in AerE 361) # October 2011 (Python implementation) # November 2014 (Clean-u...
bsd-3-clause
-8,282,621,646,964,861,000
35.080257
150
0.569891
false
2.738214
false
false
false
r2m/machine-learning
k-means/lab2/main.py
1
3130
import numpy as np import matplotlib.cm as cm import KMeans as kmeans from Point import Point from Plotter import Plotter from Centroid import Centroid def loadData(fileName): """ Returns two data sets. First return value is the x values and the second one is the y values. """ data = np.loadtxt(fileNam...
apache-2.0
-5,114,689,128,812,637,000
34.568182
119
0.739936
false
3.394794
false
false
false
fs714/drcontroller
drcontroller/test/recovery_rollback.py
1
7584
import logging import os import hashlib from functools import wraps from taskflow import engines import sys sys.path.append('../recovery') from base import AnsibleTask, ShellTask, LinearFlowCreator, UnorderedFlowCreator sys.path.append("../db") from db_Dao import DRGlanceDao, DRNovaDao def task_list(fn): @wraps(...
apache-2.0
2,197,469,561,397,222,100
38.915789
218
0.635153
false
3.470938
true
false
false
djnugent/mavlink
pymavlink/examples/mavtcpsniff.py
43
2992
#!/usr/bin/env python ''' connect as a client to two tcpip ports on localhost with mavlink packets. pass them both directions, and show packets in human-readable format on-screen. this is useful if * you have two SITL instances you want to connect to each other and see the comms. * you have any tcpip based mavlink...
lgpl-3.0
1,323,866,075,814,192,600
32.244444
156
0.621324
false
3.56615
false
false
false
vkuznet/rep
rep/metaml/folding.py
1
15416
""" This is specific meta-algorithm based on the idea of cross-validation. """ from __future__ import division, print_function, absolute_import import numpy from sklearn import clone from six.moves import zip from . import utils from sklearn.cross_validation import KFold from sklearn.utils.validation import check_ran...
apache-2.0
2,105,406,814,477,879,600
43.944606
118
0.638622
false
4.250345
false
false
false
gotclout/PythonJunk
6.py
1
1220
#!/usr/bin/env python from math import * MAX_TRI = 9999999L triangles = [] def next_pos(mn, pos): if mn > triangles[MAX_TRI - 1]: return -1 else: maxv = MAX_TRI - 1 minv = pos mid = minv + (maxv - minv) / 2 while triangles[mid] != mn and minv < maxv: if triangles[mid] < mn : mi...
mit
-49,138,977,504,631,160
21.181818
68
0.488525
false
2.62931
false
false
false
kontza/sigal
sigal/plugins/album_title_mangler.py
1
2734
# -*- coding: utf-8 -*- # Copyright (c) 2015 - Juha Ruotsalainen # 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, ...
mit
5,192,421,733,631,370,000
37.507042
78
0.724579
false
4.12368
false
false
false
ratnania/fortlint
fortlint/extractors.py
1
6817
# -*- coding: utf8 -*- import re import os # ... list_keywords_decs = ["integer", "real", "logical", "type", "class"] dict_keywords_re = {} for word in list_keywords_decs: # pattern = r"[ ]*\b" + word + r"\b\s*::\s*" pattern = r"[ ]*" + word + r"[^:]*::\s*(.+)" word_re = re.compile(pattern, re.DOTALL | r...
mit
-7,290,100,828,926,428,000
25.525292
78
0.511809
false
3.169224
false
false
false
linyc74/WinduVision
gui/gui_tuner_window.py
1
12150
import cv2, time, sys, threading, os, json from PyQt4 import QtCore, QtGui, QtOpenGL from constants import * class SliderWidget(QtGui.QWidget): ''' This widget wraps a single parameter in the TunerWindow. Name, value, min, max, interval are stored in this object. Three gui elements are included to ...
mit
1,961,563,425,208,689,200
34.217391
109
0.601646
false
3.998026
false
false
false
ecreall/nova-ideo
novaideo/views/amendment_management/submit.py
1
7416
# Copyright (c) 2014 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import colander import deform from pyramid.view import view_config from pyramid.threadlocal import get_current_registry import html_diff_wrapper from dace.processinsta...
agpl-3.0
-2,999,962,509,159,644,700
35.17561
119
0.618528
false
4.094975
false
false
false
jbernhard/qm2017
qm/model.py
1
6803
""" model output """ import logging from pathlib import Path import pickle from hic import flow import numpy as np from sklearn.externals import joblib from . import workdir, cachedir, systems, expt from .design import Design # TODO move this symmetric cumulant code to hic def csq(x): """ Return the absol...
mit
-6,326,045,663,442,107,000
27.584034
79
0.541232
false
3.576761
false
false
false
himanshuo/osf.io
website/addons/dataverse/client.py
3
2660
import httplib as http from dataverse import Connection from framework.exceptions import HTTPError from website.addons.dataverse import settings def connect(username, password, host=settings.HOST): connection = Connection( username=username, password=password, host=host, disable_s...
apache-2.0
-7,594,533,291,548,695,000
24.825243
69
0.692481
false
3.8
false
false
false
melmorabity/streamlink
src/streamlink/plugins/app17.py
5
1780
import re from streamlink.plugin import Plugin from streamlink.plugin.api import useragents from streamlink.stream import HLSStream, RTMPStream, HTTPStream API_URL = "https://api-dsa.17app.co/api/v1/liveStreams/getLiveStreamInfo" _url_re = re.compile(r"https://17.live/live/(?P<channel>[^/&?]+)") _status_re = re.comp...
bsd-2-clause
3,212,339,349,401,970,700
32.584906
86
0.57809
false
3.390476
false
false
false
woonsangcho/a3c
argparser.py
1
4230
import argparse import os class ArgParser(): def __init__(self): self.parser = argparse.ArgumentParser(description=None) self._add_arguments() def parse_args(self): return self.parser.parse_args() def _add_arguments(self): self.parser.add_argument("--hostname", type=str, ...
mit
6,432,203,380,480,910,000
69.5
161
0.591017
false
4.071222
false
false
false
pqtoan/mathics
mathics/builtin/importexport.py
3
33728
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Importing and Exporting """ from __future__ import unicode_literals from __future__ import absolute_import import six from mathics.core.expression import Expression, from_python, strip_context from mathics.builtin.base import Builtin, Predefined, Symbol, String from ...
gpl-3.0
-858,749,363,756,354,700
33.307223
575
0.570454
false
3.656114
false
false
false
kdurril/internaljobmarket
internaljobmarket/models_base.py
1
8051
from sqlalchemy import Column, Integer, String, ForeignKey, Table, UniqueConstraint, ForeignKeyConstraint from sqlalchemy.orm import relationship from internaljobmarket.database import Base roleplay = ''' class Role(Base): __tablename__ = "roles" id = Column(Integer, primary_key=True) name = Column(Strin...
gpl-2.0
-719,030,571,077,346,300
36.451163
119
0.652962
false
3.874398
false
false
false
deployed/internal_links
internal_links/tests.py
1
1317
# encoding: utf-8 import unittest from .helpers import insert_links_to_text, find_text_occurrences class TestFindText(unittest.TestCase): def test_find_text_occurrences(self): text_dict = {'content': 'Ok, Ala ma kota, ala kota tez ma, ale ola nie ma kota tak jak ala'} self.assertEqual(find_text_...
mit
199,016,406,607,265,800
47.777778
119
0.579347
false
3.048611
true
false
false
direvius/yandex-tank
tests/TankCore_Test.py
2
1254
import unittest from Tank_Test import TankTestCase import yandextank.core as tankcore class TankCoreTestCase(TankTestCase): def setUp(self): self.foo = tankcore.TankCore() def tearDown(self): del self.foo self.foo = None def test_tankcorefail(self): paths = ['config_err/...
lgpl-2.1
8,863,918,829,289,162,000
26.866667
112
0.606061
false
3.335106
true
false
false
eklinger-UofA/3DOrthotics
orthotics_project/clients/views.py
1
1074
from django.shortcuts import render_to_response from django.http import HttpResponse from django.template import RequestContext from clients.models import Client, Dependent def index(request): context = RequestContext(request) client_list = Client.objects.all() client_dict = {'clients': client_list} ...
apache-2.0
3,895,278,928,022,930,000
30.588235
75
0.667598
false
4.195313
false
false
false
robwarm/gpaw-symm
gpaw/xc/rpa.py
1
15513
from __future__ import print_function import os import sys from time import ctime import numpy as np from ase.units import Hartree from ase.utils import devnull from scipy.special.orthogonal import p_roots from gpaw import GPAW import gpaw.mpi as mpi from gpaw.response.chi0 import Chi0 from gpaw.wavefunctions.pw imp...
gpl-3.0
-8,841,506,788,400,135,000
36.929095
79
0.474634
false
3.340439
false
false
false
justanothercoder/LSTM-Optimizer-TF
scripts/tensorflow_rename_variables.py
1
2707
import os os.environ["CUDA_VISIBLE_DEVICES"] = "" os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import sys, getopt import tensorflow as tf usage_str = 'python tensorflow_rename_variables.py --checkpoint_dir=path/to/dir/ ' \ '--replace_from=substr --replace_to=substr --add_prefix=abc --dry_run' def rename(che...
mit
-4,302,017,214,150,975,500
31.614458
91
0.536757
false
3.812676
false
false
false
mozilla/user-advocacy
flask/useradvocacy/reports/views.py
1
12475
# -*- coding: utf-8 -*- '''Templating engine for reports''' from flask import (current_app, Flask, Blueprint, request, render_template, url_for, flash, redirect, session, send_from_directory, safe_join, Response, jsonify) from werkzeug.exceptions import Unauthorized, Forbidden, NotFound, BadRequest, Conflict ...
mpl-2.0
-5,215,486,145,157,596,000
38.603175
161
0.607214
false
4.035911
false
false
false
eske/seq2seq
scripts/multi-print.py
1
1271
#!/usr/bin/python3 import argparse import sys import subprocess import re import sys parser = argparse.ArgumentParser() parser.add_argument('files', nargs='+') parser.add_argument('--head', action='store_true') parser.add_argument('--shuf', action='store_true') parser.add_argument('-n', type=int) parser.add_argument(...
apache-2.0
-607,270,027,683,511,700
25.479167
103
0.630999
false
3.130542
false
false
false
lisprolog/python
save_pawns.py
1
1937
def safe_pawns(pawns): coordinates = getCoord(pawns); listCoordinates = coordinates[0]; listSavePositions = coordinates[1]; #print(listCoordinates); #print(listSavePositions); safe = checkCoord(listCoordinates, listSavePositions); return safe # translates the chess coordinates into ...
bsd-3-clause
3,029,310,417,977,442,300
31.830508
84
0.56634
false
3.180624
false
false
false
blendit/env
src/blender/grease_pencil.py
1
10818
import bpy import os import sys import subprocess import ast import random script_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(script_dir) # Get system's python path proc = subprocess.Popen('python3 -c "import sys; print(sys.path)"', stdout=subprocess.PIPE, shell=...
gpl-3.0
-8,310,356,213,299,858,000
33.784566
184
0.592808
false
3.124783
false
false
false
mynameisfashanu/Craft
server.py
1
11016
from math import floor import Queue import SocketServer import datetime import random import re import sqlite3 import sys import threading import time import traceback HOST = '0.0.0.0' PORT = 4080 CHUNK_SIZE = 32 BUFFER_SIZE = 1024 SPAWN_POINT = (0, 0, 0, 0, 0) DB_PATH = 'craft.db' COMMIT_INTERVAL = 5 YOU = 'U' BLOCK...
mit
-343,538,699,915,906,300
34.307692
78
0.51398
false
3.473983
false
false
false
jcnelson/syndicate
old/md-service/SMDS/web2py/extras/SMDS_auth.py
2
29953
""" SMDS authentication module for web2py. Parts borrowed from /usr/share/python-support/python-gluon/gluon/tools.py """ import sys sys.path.append( "/usr/share/syndicate_md" ) sys.path.append( "/usr/share/python-support/python-gluon/" ) import base64 import cPickle import datetime import thread import logging import...
apache-2.0
1,897,465,155,611,255,800
35.087952
164
0.567723
false
4.274115
false
false
false
is0280fp/Side-by-Side-Walking-Model
scraper.py
1
4280
from collections import defaultdict import numpy as np class UtilityScraper(object): def __init__(self, num_grid_x, num_grid_y): self.num_grid_x = num_grid_x self.num_grid_y = num_grid_y self.utilities = defaultdict(list) self.factors = defaultdict(list) self.ra_values = de...
mit
-4,301,349,524,016,367,000
42.673469
72
0.542757
false
2.943604
false
false
false
team-vigir/flexbe_behavior_engine
flexbe_core/src/flexbe_core/logger.py
1
2138
#!/usr/bin/env python import rospy from flexbe_msgs.msg import BehaviorLog class Logger(object): ''' Realizes behavior-specific logging. ''' REPORT_INFO = BehaviorLog.INFO REPORT_WARN = BehaviorLog.WARN REPORT_HINT = BehaviorLog.HINT REPORT_ERROR = BehaviorLog.ERROR REPORT_DEBUG = Beh...
bsd-3-clause
-6,835,429,230,349,826,000
26.410256
88
0.61927
false
3.831541
false
false
false
jkandasa/integration_tests
cfme/tests/services/test_operations.py
1
4462
# -*- coding: utf-8 -*- """Tests checking for link access from outside.""" import fauxfactory import pytest from widgetastic.utils import partial_match from cfme import test_requirements from cfme.infrastructure.provider import InfraProvider from cfme.infrastructure.virtual_machines import Vm from cfme.fixtures impor...
gpl-2.0
5,842,273,452,863,127,000
33.589147
100
0.680636
false
3.774958
true
false
false
flopezag/fiware-management-scripts
HelpDesk/synchronization.py
1
4487
#!/usr/bin/env <PATH_HELPDESK>/env/bin/python # -*- coding: utf-8 -*- ## # Copyright 2017 FIWARE Foundation, e.V. # 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 # # ...
apache-2.0
-5,162,619,168,462,307,000
32.984848
95
0.625279
false
3.935088
false
false
false
rossella/neutron
quantum/tests/unit/test_security_groups_rpc.py
1
52820
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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://ww...
apache-2.0
-953,503,682,981,960,700
43.724809
79
0.53262
false
3.154563
true
false
false
sehgalayush1/RestAPIDjango
snippets/views.py
1
1253
from snippets.models import Snippet from snippets.serializers import SnippetSerializer, UserSerializer from django.contrib.auth.models import User from rest_framework import permissions, renderers from snippets.permissions import IsOwnerOrReadOnly from rest_framework.decorators import api_view, detail_route from rest_f...
gpl-3.0
-8,928,990,795,269,132,000
31.973684
81
0.787709
false
3.903427
false
false
false
universalcore/unicore-mc
unicoremc/migrations/0021_auto__del_field_project_repo_url__del_field_project_base_repo_url__del.py
1
8224
# -*- 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 field 'Project.repo_url' db.delete_column(u'unicoremc_project'...
bsd-2-clause
2,015,478,026,492,564,700
70.521739
223
0.559703
false
3.589699
false
false
false
jmchilton/lwr
lwr/messaging/__init__.py
1
1079
""" This module contains the server-side only code for interfacing with message queues. Code shared between client and server can be found in submodules of ``lwr.lwr_client``. :mod:`lwr.messaging.bind_amqp` Module ------------------------------ .. automodule:: lwr.messaging.bind_amqp :members: :undoc-members...
apache-2.0
2,951,453,091,740,333,600
24.093023
93
0.665431
false
3.682594
false
false
false
o2r-project/o2r-meta
parsers/parse_erc_config.py
1
4786
""" Copyright (c) 2016, 2017 - o2r project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law ...
apache-2.0
-5,145,742,858,696,219,000
39.91453
134
0.514626
false
4.158123
true
false
false
saiias/pymamemose
pymamemose/pymamemose.py
1
12369
#! /usr/bin/env python # -*- coding: utf-8 -*- import BaseHTTPServer as bts import subprocess import urlparse import os import json import urllib2 import re import codecs HOME_DIR = os.environ["HOME"] try: SETTING=json.load(open(HOME_DIR+'/.pymamemose.json')) except IOError,(errno,strerrno): print "Don't exi...
bsd-3-clause
-6,843,100,928,478,583,000
26.029545
117
0.524426
false
3.012411
false
false
false
hubbardgary/AdventOfCode
day01.py
1
2209
# --- Day 1: Not Quite Lisp --- # # Santa was hoping for a white Christmas, but his weather machine's "snow" function is powered by stars, and he's fresh # out! To save Christmas, he needs you to collect fifty stars by December 25th. # # Collect stars by helping Santa solve puzzles. Two puzzles will be made available o...
mit
-5,081,958,315,049,967,000
39.907407
119
0.70077
false
3.545746
false
false
false
vhaasteren/piccard
piccard/hmcwrappers.py
1
3004
#!/usr/bin/env python # encoding: utf-8 # vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab from __future__ import division, print_function import numpy as np import math import scipy.linalg as sl, scipy.special as ss from functools import partial from transformations import * from stingrays import * from fullstin...
gpl-3.0
4,308,661,855,888,951,300
33.136364
84
0.712383
false
4.248939
false
false
false
arantebillywilson/python-snippets
py2/htp/ch04/fig04_07.py
2
1226
#!/usr/bin/python # # fig04_07.py # Roll a six-sided die 6000 times. # # Author: Billy Wilson Arante # Created: 2016/08/06 PHT # # Attribution: Python How to Program, 1st Ed. by Deitel & Deitel # import random def main(): """Main""" # Initialize frequency1 = 0 frequency2 = 0 frequency3 = 0 f...
mit
8,852,127,518,474,271,000
20.892857
71
0.520392
false
3.260638
false
false
false
kardapoltsev/vkdownloader
vk.py
1
2091
#!/usr/bin/env python3 # PYTHON_ARGCOMPLETE_OK # Copyright 2013 Alexey Kardapoltsev # # 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 # # Unle...
apache-2.0
8,169,627,644,131,124,000
31.671875
136
0.725968
false
3.556122
false
false
false
yadt/yadt-config-rpm-maker
src/config_rpm_maker/utilities/profiler.py
1
4724
# yadt-config-rpm-maker # Copyright (C) 2011-2013 Immobilien Scout GmbH # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
8,090,430,440,642,751,000
36.492063
144
0.657494
false
3.834416
false
false
false
Ilias95/guitarchords
chords/tests/helper_functions.py
1
1234
from chords.models import Artist, Song, User def create_artist(name='Some Artist'): artist = Artist(name=name) artist.save() return artist def create_song(title='Random Song', artist=None, sender=None, published=True, tabs=False, genre=None): song = Song(title=title, artist=artist, se...
mit
-31,426,872,652,309,664
32.351351
80
0.60778
false
3.618768
false
false
false
IgnitionProject/ignition
demo/dsl/flame/iterative/CG_inv_generator.py
1
3186
"""Demonstrates how to generate loop invariants from a single PME In this example, we define the conjugent gradient PME and use it to generate invariant operators. These operators can then be passed to the flame generator functions to generate worksheets or algorithms. """ from itertools import chain, combinations ...
bsd-3-clause
-2,550,230,135,679,058,000
35.204545
86
0.548023
false
3.375
false
false
false
kokjo/pycoin
genesisblock.py
1
1579
import msgs blkmsg = msgs.Blockmsg.fromjson({"type": "block", "txs": [{"inputs": [{"script": "04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73", "outpoint": {"index": 4294967295, "tx": "0000000000000000000000000000...
unlicense
9,101,266,588,675,411,000
91.882353
830
0.860671
false
2.471049
false
true
false
tuna/fishroom
fishroom/matrix.py
2
7312
#!/usr/bin/env python3 from matrix_client.client import MatrixClient from matrix_client.api import MatrixRequestError from requests.exceptions import MissingSchema from .bus import MessageBus, MsgDirection from .base import BaseBotInstance, EmptyBot from .models import Message, ChannelType, MessageType from .helpers i...
gpl-3.0
8,994,990,554,163,678,000
34.495146
100
0.569748
false
3.876988
true
false
false
ogajduse/spacewalk
backend/satellite_tools/sync_handlers.py
10
18900
# # Copyright (c) 2008--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
-8,960,262,656,581,139,000
31.698962
111
0.644868
false
4.07943
false
false
false
OptimalBPM/WebSocket-for-Python
example/bug167_client.py
5
1625
def run_threaded(): from ws4py.client.threadedclient import WebSocketClient class EchoClient(WebSocketClient): def opened(self): self.send("hello") def closed(self, code, reason=None): print(("Closed down", code, reason)) def received_message(self, m...
bsd-3-clause
2,127,205,877,635,809,500
24
65
0.561231
false
4.145408
false
false
false
aneumeier/stocks
portfolio/migrations/0001_initial.py
2
1885
# encoding: utf8 from __future__ import unicode_literals from django.db import models, migrations def initial_data(apps, schema_editor): Symbol = apps.get_model('portfolio', 'Symbol') return class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel(...
agpl-3.0
-5,571,421,897,167,403,000
34.566038
114
0.501326
false
4.642857
false
false
false
ARM-software/bob-build
tests/output/verify.py
1
1459
#!/bin/env python # Copyright 2019 Arm Limited. # SPDX-License-Identifier: Apache-2.0 # # 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 # # U...
apache-2.0
6,177,579,979,156,486,000
29.395833
87
0.717615
false
3.770026
false
false
false
zenoss/Community-Zenpacks
ZenPacks.ZenSystems.ApcPdu/ZenPacks/ZenSystems/ApcPdu/info.py
3
1485
########################################################################## # Author: Jane Curry, jane.curry@skills-1st.co.uk # Date: February 3rd, 2011 # Revised: # # info.py for ApcPdu ZenPack # # This program can be used under the GNU General Public License version 2 # You can find full...
gpl-2.0
-2,358,501,561,546,443,000
28.7
80
0.660606
false
3.69403
false
false
false
melkisedek/sen_project
src/books/models.py
1
2286
from django.db import models from datetime import datetime from django.utils import timezone from django.conf import settings from django.core.urlresolvers import reverse # Create your models here. class Author(models.Model): first_name = models.CharField(max_length=60) last_name = models.CharField(max_length=60) e...
mit
2,984,121,168,891,878,400
32.617647
75
0.706912
false
3.327511
false
false
false