repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
hydroffice/hyo_ssp
hydroffice/ssp/helper.py
1
1806
from __future__ import absolute_import, division, print_function, unicode_literals import os import logging log = logging.getLogger(__name__) from hydroffice.base import helper def hyo_ssp_installation_folder(): """ Return the HydrOffice SSP folder """ return os.path.dirname(os.path.realpath(__...
lgpl-3.0
2,532,796,859,515,877,000
31.444444
110
0.615725
false
4.170901
false
false
false
meahmadi/nsun
ir/ac/iust/me_ahmadi/multiProcessMind/language.py
1
24906
import pyparsing as pp import sys import traceback import random import re import copy from mdatetime import MDateTime class Basket(object): pass class Language(object): def __init__(self,mind): self.mind = mind self.initialParser() def log(self,something): self.mind.log(something...
gpl-2.0
-9,123,517,027,277,424,000
47.646484
294
0.545812
false
3.786833
false
false
false
streethacker/koenig
koenig/handler/query.py
1
5456
# -*- coding: utf-8 -*- import datetime import gevent import psutil import logging from gevent import monkey from psutil import ( AccessDenied, NoSuchProcess, ) from koenig import koenig_thrift from koenig.models import RuntimeProfile from koenig.utils import ( profile_, serialize, datetime2utc...
gpl-2.0
-529,409,717,615,251,300
22.118644
78
0.681085
false
3.382517
false
false
false
Tsjerk/MartiniTools
Mapping/__init__.py
1
22248
import glob,os,re,math,sys,random # Should version this... 140813-16 TAW # More flexible handling of residue/molecule names # More extensive support for geometric operations # In the context of this module, a residue is a list of atoms, where each atom/item # is a list or tuple with at least 7 values: # # (atom nam...
gpl-2.0
1,781,999,935,892,594,200
34.091483
140
0.47883
false
3.603499
false
false
false
0xc0170/pyOCD
pyOCD/target/target_MKL28Z512xxx7.py
1
10404
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
apache-2.0
6,637,862,194,874,885,000
50.251232
153
0.7302
false
2.309947
false
false
false
oudalab/phyllo
phyllo/extractors/lutherDB.py
1
4549
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup, NavigableString from phyllo.phyllo_logger import logger import nltk from itertools import cycle nltk.download('punkt') from nltk import sent_tokenize def parseRes2(soup, title, url, cur, author, date, collectiont...
apache-2.0
4,469,785,690,926,578,000
34.818898
114
0.511321
false
3.89136
false
false
false
dogoncouch/logdissect
logdissect/filters/rprocess.py
1
2501
# MIT License # # Copyright (c) 2017 Dan Persons <dpersonsdev@gmail.com> # # 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 ...
mit
-8,721,093,635,964,524,000
42.12069
80
0.660136
false
4.319516
false
false
false
skirpichev/omg
diofant/integrals/prde.py
1
36682
""" Algorithms for solving Parametric Risch Differential Equations. The methods used for solving Parametric Risch Differential Equations parallel those for solving Risch Differential Equations. See the outline in the docstring of rde.py for more information. The Parametric Risch Differential Equation problem is, giv...
bsd-3-clause
-4,305,575,387,577,792,500
41.456019
110
0.558666
false
3.037344
false
false
false
Ecogenomics/GTDBNCBI
src/gtdb/PowerUserManager.py
1
26868
############################################################################### # # # 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 # ...
gpl-3.0
-1,511,977,503,236,711,000
53.278788
227
0.529589
false
3.912056
false
false
false
plepe/pgmapcss
pgmapcss/eval/possible_values.py
1
3475
import pgmapcss.eval import pgmapcss cache = {} # returns a tuple: # 1st return value: # a set of all possible values; True for unpredictable values # 2nd return value: # mutability of the return value def possible_values(value, prop, stat): global eval_param # if we find the value in our cache, we don't ...
agpl-3.0
-9,063,874,269,261,503,000
34.824742
199
0.57295
false
3.773073
false
false
false
tuomasjjrasanen/klupu
klupung/flask/models.py
1
13461
# KlupuNG # Copyright (C) 2013 Koodilehto Osk <http://koodilehto.fi>. # # 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 option) any later ve...
agpl-3.0
-8,661,965,260,870,383,000
27.279412
103
0.590744
false
3.473806
false
false
false
madformuse/client
src/config/__init__.py
1
3284
from . import version import os import sys import logging import trueskill from logging.handlers import RotatingFileHandler from PyQt4 import QtCore trueskill.setup(mu=1500, sigma=500, beta=250, tau=5, draw_probability=0.10) _settings = QtCore.QSettings("ForgedAllianceForever", "FA Lobby") class Settings(object):...
gpl-3.0
6,883,092,143,821,505,000
35.488889
117
0.631851
false
3.86808
false
false
false
AkashiSN/CHUNITHM-Rate-Calculator-Python
common/Function.py
1
8140
#!/usr/bin/env python3 import json,requests,math #ポストデータからUserIdを取得 def userId_Get(userId): tmp = userId.split(';') for tmp1 in tmp: if 'userId' in tmp1: return tmp1.split('=')[1] return None #ログインしてUserIdを取得 def Get_userId(SegaId,password): url = 'https://chunithm-net...
mit
-7,070,387,989,513,748,000
28.490272
70
0.547984
false
2.918436
false
false
false
mizhi/tictic
tictic.py
1
1412
# Copyright (c) - 2013 Mitchell Peabody. # See COPYRIGHT.txt and LICENSE.txt in the root of this project. import datetime import jinja2 import os import webapp2 # some google apis from google.appengine.api import users # application apis from nl import parser from model import User, Variable, Value from xmpp import X...
gpl-2.0
-76,138,682,328,710,560
29.042553
79
0.594193
false
4.092754
false
false
false
kerryhatcher/PacaBackUp
Paca/windows/main.py
1
1897
from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QDialog): def __init__(self): QtGui.QDialog.__init__(self) self.setWindowTitle("PacaBackUp") # Vertical layout self.layout = QtGui.QVBoxLayout(self) # Create widgets self.main_menu_bar = QtGui.QMenuBar() ...
mit
1,098,742,604,382,671,400
32.875
95
0.638376
false
3.816901
false
false
false
shellydeforte/PDB
pdb/fetch_ss_dis.py
1
17506
# -*- coding: utf-8 -*- """Return dictionary of secondary structure disorder. Validate ss_dis data files. Download and/or regenerate if necessary. Then return a dictionary of ss_dis data. """ from __future__ import ( absolute_import, division, print_function, unicode_literals) import filecmp import os import re ...
mit
6,501,610,826,029,986,000
31.062271
78
0.572718
false
3.818935
false
false
false
ronniehd/repository.ronniehd
plugin.program.super.favourites/quicklaunch.py
1
1868
# # Copyright (C) 2014- # Sean Poyser (seanpoyser@gmail.com) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # Thi...
gpl-3.0
-237,823,475,843,905,440
30.661017
104
0.659529
false
3.627184
false
false
false
tyb0807/angr
angr/state_plugins/callstack.py
1
11906
import collections from itertools import dropwhile import logging from .plugin import SimStatePlugin from ..errors import AngrError, SimEmptyCallStackError l = logging.getLogger("angr.state_plugins.callstack") class CallStack(SimStatePlugin): """ Stores the address of the function you're in and the value of...
bsd-2-clause
8,480,855,515,231,090,000
29.141772
155
0.574164
false
4.071819
false
false
false
pidydx/grr
api_client/python/grr_api_client/types.py
1
1497
#!/usr/bin/env python """Types-related part of GRR API client library.""" from grr_api_client import utils from grr.proto import api_pb2 from grr.proto import flows_pb2 class Error(Exception): pass class UnknownFlowName(Error): pass class Types(object): """Object that helps users to deal with GRR type sys...
apache-2.0
-6,925,641,154,429,404,000
25.263158
73
0.694055
false
3.848329
false
false
false
NeurodataWithoutBorders/api-python
examples/create_scripts/crcns_hc-3.py
1
14024
#!/usr/bin/python import sys import os from nwb import nwb_file from nwb import nwb_utils as ut import numpy as np # dataset to use #BASE = "ec013.156" BASE = "ec013.157" print ("Warning -- experiment time is hard-coded. Needs to be read from file") if BASE == "ec013.156": DATE = "Sat Jul 08 2006 12:00:00" else:...
bsd-3-clause
-5,595,763,936,140,551,000
38.064067
332
0.579863
false
2.784197
false
false
false
taiwenko/python
mfg_ais.py
1
2340
#!/usr/bin/env python # rffe functional test # Author: TaiWen Ko import xpf6020 import bk8500 import math import os from time import sleep from blessings import Terminal t = Terminal() print "Accessing the Power Supply" ps_path = '/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A403OT39-if00-port0' ps = xpf6020.Xpf602...
mit
3,477,558,722,247,931,400
24.16129
82
0.626068
false
2.5
false
false
false
kadashu/satori
satori-rules/plugin/kestrel/60_kestrel.py
1
1604
#!/usr/bin/python # -*- coding: utf-8 -*- # -- stdlib -- import json import socket import re import telnetlib import time # -- third party -- # -- own -- # -- code -- QUEUE_METRIC = re.compile(r'^queue_(.*?)_(items|bytes|total_items|logsize|expired_items|mem_items|mem_bytes|age|discarded|waiters|open_transactions|tr...
apache-2.0
-6,400,508,524,688,774,000
23.30303
259
0.506234
false
3.31405
false
false
false
dogukantufekci/memo
memo/actions/models.py
1
2810
# from django.db import models # from django.contrib.auth.models import User # from apps.models import App # from objects.models import Object # class Verb(models.Model): # created_by = models.ForeignKey( # User, # related_name='verbs_created_by', # ) # created_on = models.DateTimeField( ...
mit
888,016,638,565,040,400
24.098214
59
0.496085
false
3.157303
false
false
false
chrishas35/django-travis-ci
extras/csrf_migration_helper.py
1
13049
#!/usr/bin/env python # This script aims to help developers locate forms and view code that needs to # use the new CSRF protection in Django 1.2. It tries to find all the code that # may need the steps described in the CSRF documentation. It does not modify # any code directly, it merely attempts to locate it. Deve...
bsd-3-clause
5,438,561,649,150,158,000
34.848901
146
0.626332
false
3.963852
false
false
false
gem/oq-engine
openquake/hazardlib/tests/geo/surface/base_surface_test.py
1
18035
# The Hazard Library # Copyright (C) 2012-2021 GEM 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 option) any later version. #...
agpl-3.0
-3,764,340,368,635,287,600
42.2494
79
0.572054
false
3.218237
true
false
false
robcarver17/pysystemtrade
sysinit/futures/barchart_futures_contract_prices.py
1
2887
from sysdata.csv.csv_futures_contract_prices import ConfigCsvFuturesPrices import os from syscore.fileutils import files_with_extension_in_pathname from syscore.dateutils import month_from_contract_letter from sysinit.futures.contract_prices_from_csv_to_arctic import init_arctic_with_csv_futures_contract_prices def ...
gpl-3.0
232,541,471,550,634,180
44.109375
108
0.521649
false
3.551046
false
false
false
vuolter/pyload
src/pyload/core/datatypes/pyfile.py
1
7497
# -*- coding: utf-8 -*- import time from threading import RLock from ..managers.event_manager import UpdateEvent from ..utils import format from ..utils.struct.lock import lock status_map = { "finished": 0, "offline": 1, "online": 2, "queued": 3, "skipped": 4, "waiting": 5, "temp. offline...
agpl-3.0
6,755,063,355,102,700,000
23.906977
88
0.525277
false
4.101204
false
false
false
lucasdemarchi/python-dbusmock
tests/test_code.py
1
1588
#!/usr/bin/python3 # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) any # later version. See http://www.gnu.org/copyleft/lgpl.html fo...
lgpl-3.0
2,777,595,634,175,996,000
37.731707
87
0.61272
false
3.97
true
false
false
simberaj/interactions
create_color_map.py
1
2420
import os, common, colors, loaders, arcpy BANDS = ('r', 'g', 'b') class ColorDecomposer(loaders.FunctionUpdater): requiredInputSlots = ['color'] requiredOutputSlots = BANDS @staticmethod def translate(inprow={'color' : 'ffffff'}): try: rgb = colors.hexToRGB(inprow['color']) except colors.Color...
mit
-2,213,150,295,886,889,700
37.412698
96
0.706198
false
3.553598
false
false
false
korfuri/python-logging-prometheus
setup.py
1
1373
import os from setuptools import setup LONG_DESCRIPTION = """Logging-Prometheus Exports metrics about the logging of your Python application for Prometheus.io. See https://github.com/korfuri/python-logging-prometheus for usage instructions. """ setup( name="logging-prometheus", version="0.1.0", author="...
apache-2.0
-7,522,032,216,590,312,000
30.930233
66
0.646759
false
4.110778
false
false
false
azlanismail/prismgames
examples/games/car/networkx/algorithms/centrality/eigenvector.py
1
5108
""" Eigenvector centrality. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = "\n".join(['Aric Hagberg (hagberg@lanl.gov)', ...
gpl-2.0
-2,275,223,423,858,998,000
28.224852
74
0.595145
false
3.772526
false
false
false
google-research-datasets/bam
bam/metrics.py
1
9052
"""Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
apache-2.0
-1,864,924,743,223,844,400
37.033613
151
0.671122
false
3.428788
false
false
false
liangzhangleon/dropscontactangle
src/tests/scripts/readtests.py
1
6643
#!/usr/bin/python import classes import sys, glob, os, string, re """ This script is part of the testing environment of the DROPS project of the RWTH-Aachen University Scientific Computing Department This script reads the serial tests from the folder ../specifications/serial and returns a list containing objects of ...
gpl-3.0
-8,992,610,763,774,749,000
43.583893
197
0.532892
false
4.79639
true
false
false
openstack/manila
manila/api/v1/share_types_extra_specs.py
1
7624
# Copyright (c) 2011 Zadara Storage Inc. # Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
apache-2.0
7,383,828,063,358,341,000
39.126316
90
0.629591
false
3.850505
false
false
false
eerimoq/asn1tools
asn1tools/codecs/der.py
1
14949
"""Distinguished Encoding Rules (DER) codec. """ from . import DecodeTagError from . import ber from . import restricted_utc_time_to_datetime from . import restricted_utc_time_from_datetime from . import restricted_generalized_time_to_datetime from . import restricted_generalized_time_from_datetime from . import add_...
mit
713,639,696,334,870,100
31.287257
81
0.541106
false
4.362124
false
false
false
rischanlab/research_tw_politic
tw_rischan_py/unfollow_nonfollowers.py
1
1711
__author__ = 'rischan' import constants from datetime import datetime import time from util import setup_api import tweepy from tweepy import Cursor, TweepError import sys # constants consumer_key = constants.consumer_key consumer_secret = constants.consumer_secret access_key = constants.access_key access_secret = co...
bsd-3-clause
-1,593,721,580,286,870,500
28
82
0.641146
false
3.695464
false
false
false
ryanfobel/microdrop
microdrop/dmf_device.py
1
16921
""" Copyright 2011-2015 Ryan Fobel and Christian Fobel This file is part of MicroDrop. MicroDrop 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 ver...
gpl-3.0
-1,410,601,461,141,783,300
36.939462
79
0.585604
false
4.256855
false
false
false
dgk/django-business-logic
tests/test_frame.py
1
2594
# -*- coding: utf-8 -*- # from .common import * class FrameTest(TestCase): def test_context_init(self): context = Context() self.assertTrue(context.frame is None) self.assertEqual(context.frames, []) def test_single_expression(self): root = tree_1plus2mul3() context ...
mit
-9,061,659,371,714,226,000
34.534247
78
0.561295
false
4.034215
false
false
false
PyRadar/pyradar
setup.py
1
3512
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2012 - 2013 # Matías Herranz <matiasherranz@gmail.com> # Joaquín Tita <joaquintita@gmail.com> # # https://github.com/PyRadar/pyradar # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
lgpl-3.0
-2,407,502,351,600,490,000
27.770492
80
0.497436
false
4.301471
false
false
false
EmreAtes/spack
lib/spack/spack/cmd/pkg.py
1
5175
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
8,711,075,685,436,003,000
33.046053
78
0.625894
false
3.649506
false
false
false
alonsebastian/TilapiaProject
tilapia.py
1
14443
# -*- encoding: utf-8 -*- #!/usr/bin/python """Este modulo lanza todos los procesos del programa, maneja todas las funciones y administra todos los recursos.' El programa se encarga de levantar datos del puerto serie de forma constante. Esos datos los sube a internet, los guarda en la base de datos, hace graficos de l...
gpl-2.0
8,544,758,988,371,364,000
31.288591
246
0.572715
false
3.421764
false
false
false
tensorflow/estimator
tensorflow_estimator/python/estimator/canned/timeseries/head.py
1
21379
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-3,726,086,368,253,177,000
44.198732
126
0.669629
false
4.169885
false
false
false
apophys/freeipa
ipatests/test_xmlrpc/test_netgroup_plugin.py
1
49827
# Authors: # Rob Crittenden <rcritten@redhat.com> # Pavel Zuna <pzuna@redhat.com> # # Copyright (C) 2009 Red Hat # see file 'COPYING' for use and warranty information # # 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 # th...
gpl-3.0
5,152,753,925,490,330,000
34.288244
94
0.38732
false
4.894116
true
false
false
edeposit/isbn_validator
docs/conf.py
1
2664
#! /usr/bin/env python # -*- coding: utf-8 -*- # import os import sys import urllib import os.path sys.path.insert(0, os.path.abspath('../src/')) extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.graphviz', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', 'sphinxcontrib.napoleon...
mit
8,139,959,444,814,851,000
28.285714
78
0.706081
false
3.496063
false
false
false
jelly/calibre
src/calibre/gui2/convert/txt_input.py
2
2232
# -*- coding: utf-8 -*- __license__ = 'GPL 3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' from PyQt5.Qt import QListWidgetItem, Qt from calibre.gui2.convert.txt_input_ui import Ui_Form from calibre.gui2.convert import Widget from calibre.ebooks.conversion.plugin...
gpl-3.0
-5,295,739,437,149,754,000
38.157895
112
0.609767
false
3.492958
false
false
false
MalloyDelacroix/DownloaderForReddit
DownloaderForReddit/guiresources/export_wizard_auto.py
1
4372
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Resources\ui_files\export_wizard.ui' # # Created by: PyQt5 UI code generator 5.14.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ExportWizard(object): def setupUi(self, ...
gpl-3.0
2,716,783,172,640,093,700
57.293333
348
0.717063
false
4.003663
false
false
false
ENCODE-DCC/encoded
src/encoded/tests/test_upgrade_software.py
1
2678
import pytest from unittest import TestCase def test_software_upgrade(upgrader, software_1): value = upgrader.upgrade('software', software_1, target_version='2') assert value['schema_version'] == '2' assert value['lab'] == "cb0ef1f6-3bd3-4000-8636-1c5b9f7000dc" assert value['award'] == "b5736134-3326-...
mit
-3,664,232,772,370,065,400
38.382353
108
0.647872
false
3.385588
true
false
false
BirchJD/RPiTimer
PiTimer_Step-10/Schedule.py
1
7582
# PiTimer - Python Hardware Programming Education Project For Raspberry Pi # Copyright (C) 2015 Jason Birch # # 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 ...
gpl-3.0
6,128,160,088,723,247,000
40.206522
117
0.493933
false
4.792668
false
false
false
casacore/python-casacore
tests/test_quanta.py
1
1838
import unittest from casacore.quanta import * class TestQuanta(unittest.TestCase): def test_quanta(self): q0 = quantity('1deg') self.assertTrue(is_quantity(q0)) q1 = quantity(1.0, 'deg') self.assertTrue(is_quantity(q1)) self.assertEqual(q1, q0) q2 = quantity([180.0...
gpl-2.0
-3,487,990,664,895,422,000
37.291667
76
0.57617
false
2.936102
false
false
false
bourdeau/Blog
config.py
1
1064
import os from dotenv import load_dotenv load_dotenv() BASE_DIR = os.path.abspath(os.path.dirname(__file__)) # General Flask THREADS_PER_PAGE = 2 DEBUG = os.getenv("DEBUG") # Database MYSQL_HOST = os.getenv("MYSQL_HOST") MYSQL_DATABASE = os.getenv("MYSQL_DATABASE") MYSQL_USER = os.getenv("MYSQL_USER") MYSQL_PASSWORD...
mit
-3,626,913,660,513,050,600
29.428571
118
0.742481
false
2.963788
false
true
false
tLDP/python-tldp
tldp/utils.py
1
10832
#! /usr/bin/python # -*- coding: utf8 -*- # # Copyright (c) 2016 Linux Documentation Project from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import os import time import errno import codecs import hashlib import subprocess import functools from functools import...
mit
-2,440,997,448,539,123,000
29.426966
91
0.621861
false
3.80872
false
false
false
aquemy/HCBR
data/merge_datasets.py
1
1890
import csv import os import sys def read_cases(path): cases = [] headers = [] with open(path, 'rb') as csvfile: reader = csvfile.readlines() n = len(reader[0].split()) m = 0 for i, row in enumerate(reader): r = row.split() cases.append(r) ...
mit
9,043,348,548,347,988,000
24.90411
73
0.56455
false
3.068182
false
false
false
juanka1331/VAN-applied-to-Nifti-images
lib/vae/CVAE_3layers.py
1
3659
from lib.vae.CVAE import CVAE import tensorflow as tf import numpy as np import lib.neural_net.kfrans_ops as ops class CVAE_3layers(CVAE): def __init__(self, hyperparams, test_bool=False, path_to_session=None): super(CVAE_3layers, self).__init__(hyperparams, test_bool=test_bool, ...
gpl-2.0
769,845,659,925,720,600
37.526316
92
0.509429
false
3.748975
false
false
false
totalgood/nlpia
src/nlpia/book/examples/ch06_w2v_10_us_cities_visualization_.py
1
6170
# Manually load w2v # import os # from nlpia.data.loaders import BIGDATA_PATH # from gensim.models import KeyedVectors # path = os.path.join(BIGDATA_PATH, 'GoogleNews-vectors-negative300.bin.gz') # wv = KeyedVectors.load_word2vec_format(path, binary=True) # nlpia can now automatically download and load w2v from nlpia...
mit
3,272,567,092,354,114,600
35.247059
117
0.618143
false
2.894317
false
false
false
IljaGrebel/OpenWrt-SDK-imx6_HummingBoard
staging_dir/host/lib/scons-2.3.5/SCons/Tool/rpm.py
1
4526
"""SCons.Tool.rpm Tool-specific initialization for rpm. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. The rpm tool calls the rpmbuild command. The first and only argument should a tar.gz consisting of the sourc...
gpl-2.0
-5,255,313,577,404,336,000
33.287879
102
0.655988
false
3.87832
false
false
false
pcrews/rannsaka
rannsaka/locust_files/heat_update.py
1
1899
import os import random import time import json from locust import HttpLocust, TaskSet, task from task_sets.baseTaskSet import baseTaskSet import task_funcs.keystone_v2_base as keystone_base import task_funcs.heat_v1_base as heat_base import task_funcs.heat_v1_utility as heat_util import task_funcs.nova_v2_utility as...
apache-2.0
5,730,426,626,160,705,000
31.186441
80
0.609795
false
3.379004
false
false
false
GaloisInc/hacrypto
src/C++/Mozilla/old_snapshots/manager/ssl/tests/unit/test_ev_certs/ev_root_generate.py
1
2125
#!/usr/bin/python # after runing this file you MUST modify nsIdentityinfo.cpp to change the # fingerprint of the evroot import tempfile, os, sys import random import pexpect import subprocess import shutil libpath = os.path.abspath('../psm_common_py') sys.path.append(libpath) import CertUtils dest_dir = os.getcwd(...
bsd-3-clause
2,845,523,998,052,206,000
35.016949
78
0.609882
false
3.33595
false
false
false
tjanson/heuristic_optimization
heuristic_optimization/util/position_initializers.py
1
1525
"""Various spawn patterns within the given bounds.""" import numpy as np from heuristic_optimization.util.util import clamp_into_bounds def random(num_points, lower_bound, upper_bound): """Return random locations.""" return np.random.uniform(low=lower_bound, high=upper_bound, size=(num_points, len(lower_bou...
mit
1,198,829,521,867,080,700
43.852941
110
0.731148
false
3.648325
false
false
false
dormbase/dormbase
dormbase/core/populate.py
1
2949
# Dormbase -- open-source dormitory database system # Copyright (C) 2012 Alex Chernyakhovsky <achernya@mit.edu> # Drew Dennison <dennison@mit.edu> # Isaac Evans <ine@mit.edu> # Luke O'Malley <omalley1@mit.edu> # # This program is free software...
gpl-3.0
6,648,228,074,256,247,000
34.53012
115
0.59783
false
3.636252
false
false
false
huntxu/neutron
neutron/tests/functional/agent/test_ovs_flows.py
1
22662
# Copyright (c) 2015 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
544,842,488,182,187,200
45.438525
79
0.573471
false
3.388457
true
false
false
NORDUnet/opennsa
opennsa/protocols/rest/resource.py
1
15204
""" REST API for connections. Author: Henrik Thostrup Jensen <htj@nordu.net> Copyright: NORDUnet (2015) """ import time import json from twisted.python import log from twisted.internet import defer from twisted.web import resource, server from opennsa import nsa, error, state, constants as cnt, database from openns...
bsd-3-clause
-3,503,938,503,318,925,000
36.264706
179
0.61964
false
4.061982
false
false
false
zappyk-github/zappyk-python
lib/lib_external/postgresql/types/io/pg_geometry.py
2
1284
from .. import POINTOID, BOXOID, LSEGOID, CIRCLEOID from ..geometry import Point, Box, Lseg, Circle from ...python.functools import Composition as compose from . import lib oid_to_type = { POINTOID: Point, BOXOID: Box, LSEGOID: Lseg, CIRCLEOID: Circle, } # Make a pair of pairs out of a sequence of four objects de...
gpl-2.0
-3,358,578,272,449,762,000
28.860465
66
0.656542
false
2.450382
false
false
false
lixun910/pysal
pysal/explore/giddy/util.py
1
1828
""" Utilities for the spatial dynamics module. """ __all__ = ['shuffle_matrix', 'get_lower'] import numpy as np def shuffle_matrix(X, ids): """ Random permutation of rows and columns of a matrix Parameters ---------- X : array (k, k), array to be permutated. ids : array ...
bsd-3-clause
-9,053,226,858,751,927,000
21.024096
79
0.483589
false
3.366483
false
false
false
gokmen/Rasta
rasta_lib/qrstedit.py
1
9107
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Rasta RST Editor 2010 - Gökmen Göksel <gokmeng:gmail.com> ''' # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the Lice...
gpl-2.0
488,356,511,736,639,000
33.358491
105
0.603405
false
3.988173
false
false
false
andrewguy9/farmfs
setup.py
1
1156
#!/usr/bin/env python import sys from setuptools import setup from setuptools.command.test import test as TestCommand requires = ['func_prototypes>=0.5.0', 'docopt', 'delnone', 'future', 'safeoutput>=2.0', 'filetype==1.0.6', "S3Lib>=1.4.0", 'tqdm'] test_requires = ['tox', 'pytest==4.6.8', 'tabulate'] setup( name...
mit
6,166,813,313,921,319,000
31.111111
130
0.614187
false
3.312321
false
true
false
johntanz/ROP
Corr_Dim.py
1
4253
# -*- coding: utf-8 -*- """ Created on Thu Apr 28 11:36:04 2016 @author: J. C. Vasquez-Correa """ import numpy as np import math from statsmodels.tsa.tsatools import lagmat from sklearn.metrics.pairwise import euclidean_distances as dist import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axe...
gpl-2.0
-7,145,401,221,979,247,000
29.058394
118
0.583823
false
2.790682
false
false
false
nurnbeck/project-1-CMPUT-291
driverlicenceregistration.py
1
3933
''' Register one person (sin) with a driver licence. - If that person does not exist in database, user has an option to add that person to the database - If that person already have a driver licence, raise an error message and return ''' import random import cx_Oracle import datetime from addperson import * ...
mit
302,450,345,515,357,500
29.488372
164
0.564963
false
3.909543
false
false
false
ganga-devs/ganga
ganga/GangaCore/Lib/Virtualization/Docker.py
1
4847
########################################################################## # Ganga Project. https://github.com/ganga-devs/ganga # ########################################################################## from GangaCore.GPIDev.Schema import Schema, Version, SimpleItem from GangaCore.Utility.Config import getConfig from...
gpl-2.0
-4,102,511,025,632,554,500
44.726415
128
0.629874
false
3.979475
false
false
false
bingopodcast/bingos
bingo_emulator/graphics/hawaii_2.py
1
57956
import pygame import random pygame.display.set_caption("Multi Bingo") screen = pygame.display.set_mode((0,0)) screen.fill([0,0,0]) pygame.mouse.set_visible(False) meter = pygame.image.load('graphics/assets/black_register_cover.png').convert() odds = pygame.image.load('hawaii_2/assets/odds.png').convert_alpha() eb = ...
gpl-3.0
4,441,043,813,341,395,500
36.97903
191
0.535993
false
3.178284
false
false
false
hal0x2328/neo-python
examples/smart-contract-rest-api.py
1
5548
""" Example of running a NEO node, receiving smart contract notifications and integrating a simple REST API. Smart contract events include Runtime.Notify, Runtime.Log, Storage.*, Execution.Success and several more. See the documentation here: http://neo-python.readthedocs.io/en/latest/smartcontracts.html This example...
mit
-4,724,381,453,996,258,000
28.2
159
0.702956
false
3.659631
false
false
false
AlexStarov/Shop
applications/adminSite/sms_ussd/views.py
1
4101
# -*- coding: utf-8 -*- from django.utils.decorators import method_decorator from django.contrib.admin.views.decorators import staff_member_required from django.views.generic import TemplateView from django.views.generic.edit import CreateView try: from django.urls import reverse, reverse_lazy except ImportError: ...
apache-2.0
395,336,277,482,800,830
34.051282
81
0.658132
false
3.734973
false
false
false
heromod/migrid
mig/shared/iobase.py
1
19223
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # iobase - wrapper to wrap local and dist io in one # Copyright (C) 2003-2014 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of the GNU General P...
gpl-2.0
1,772,200,013,893,076,000
26.15113
83
0.615825
false
3.846908
false
false
false
funtoo/funtoo-overlay
utils/pkglist.py
1
2886
#!/usr/bin/python3.4 from src.merge_utils import * import portage cur_name = sys.argv[1] cur_tree = "/var/git/meta-repo/kits/" + cur_name cur_overlay = GitTree(cur_name, root=cur_tree) env = os.environ.copy() env['PORTAGE_DEPCACHEDIR'] = '/var/cache/edb/%s-%s-meta' % (cur_overlay.name, cur_overlay.branch) env['PORTA...
gpl-2.0
3,194,570,211,958,172,000
26.226415
104
0.585932
false
2.725212
false
false
false
claudyus/LXC-Web-Panel
lwp/authenticators/htpasswd.py
1
1112
# -*- coding: utf-8 -*- import sys import hmac import crypt from lwp.utils import read_config_file class htpasswd: def __init__(self): self.HTPASSWD_FILE = read_config_file().get('htpasswd', 'file') def authenticate(self, username, password): user = None if self.check_htpasswd(self.H...
mit
-8,295,446,616,862,364,000
26.8
85
0.540468
false
3.985663
false
false
false
baidu/Paddle
python/paddle/fluid/tests/unittests/test_imperative_gnn.py
1
5283
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
-9,138,645,465,481,413,000
36.468085
80
0.582813
false
3.927881
true
false
false
jazzycamel/pushy
PushySDK/__init__.py
1
3161
import requests, logging, json, collections, six, logging from functools import wraps if six.PY3: basestring=str logging.basicConfig() def _processRequest(fn): @wraps(fn) def wrapper(self, tokens, *args, **kwargs): request=fn(self, tokens, *args, **kwargs) if request.status_code==requests.cod...
mit
-3,529,846,974,155,343,000
31.255102
108
0.58684
false
4.203457
false
false
false
marado/shellpic
setup.py
1
1320
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Lars Jørgen Solberg <supersolberg@gmail.com> 2014 # from distutils.core import setup import pkg_resources setup( name='Shellpic', version='1.4.1', author='Lars Jørgen Solberg', author_email='supersolberg@gmail.com', packages=['shellpic'], scr...
gpl-3.0
-2,478,624,379,373,334,500
29.651163
75
0.591806
false
3.887906
false
true
false
do-mpc/do-mpc
examples/CSTR/template_model.py
1
3901
# # This file is part of do-mpc # # do-mpc: An environment for the easy, modular and efficient implementation of # robust nonlinear model predictive control # # Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean # TU Dortmund. All rights reserved # # do-mpc is free sof...
lgpl-3.0
-6,095,027,796,552,743,000
39.635417
145
0.591387
false
2.747183
false
false
false
duyuan11/glumpy
examples/transform-log-polar.py
1
1058
#! /usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------...
bsd-3-clause
5,918,767,291,865,419,000
29.228571
88
0.594518
false
3.401929
false
false
false
smathot/opensesame_questionnaire_plugins
multiple_choice/pgu/gui/dialog.py
1
4244
""" """ import os from .const import * from . import table, area from . import basic, input, button from . import pguglobals class Dialog(table.Table): """A dialog window with a title bar and an "close" button on the bar. Example: title = gui.Label("My Title") main = gui.Container() #add stuff to the contai...
gpl-2.0
-7,029,926,698,889,740,000
26.205128
90
0.626767
false
2.72926
false
false
false
ehudmagal/robotqcapp
Utils/RobotQAUtils/graphics/print3Dgraph.py
2
1096
import textwrap import sys import os import matplotlib.pyplot as plt lib_path = os.path.abspath(r'E:\Tamuz\Utils\RobotQAUtils') sys.path.append(lib_path) import plateReader tinyNum = 0.000001 def print3DGraph(listOfaxisLists = None,Xlabel = None,Ylable = None,Zlabel = None,title = None): '''for each expiriment pr...
bsd-3-clause
3,114,583,523,729,382,000
32.242424
112
0.659672
false
3.122507
false
false
false
mussum-devis/botis
src/plugins/Spam/plugin.py
1
2473
### # Copyright (c) 2011, Rodrigo Dias Cruz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condit...
gpl-3.0
-2,700,603,661,166,797,000
34.328571
82
0.695512
false
4.369258
false
false
false
trevorarjeski/russian_language_tools
russian_get_stress.py
1
2096
# -*- coding: UTF-8 -*- from lxml import etree import lxml import requests import csv import codecs import sys # This script is going to scrape Slovari.Yandex.com for stressed # letters for a given word def inputFromCSV(csvfile_name): indexed_csv = [] csvfile = open(csvfile_name,'rb') output_file = open(csvf...
gpl-2.0
-8,898,479,567,278,984,000
25.723684
194
0.647783
false
2.56962
false
false
false
emilydolson/forestcat
pyrobot/gui/plot/simple.py
2
3674
# ------------------------------------------------------- # Sample Plotter # ------------------------------------------------------- import Tkinter import random from pyrobot.robot.device import Device import pyrobot.system.share as share class SimplePlot(Device): COLORS = ['blue', 'red', 'tan', 'yellow', 'orang...
agpl-3.0
-1,670,094,524,805,230,000
35.74
86
0.496734
false
4.073171
false
false
false
tedlaz/pyted
tests/pyappgen/pyappgen/dbutils.py
1
7367
# -*- coding: utf-8 -*- ''' Created on Nov 8, 2013 @author: tedlaz ''' import sqlite3 import os import num_txt_etc as nm import model zdb = None debuging = False def dprint(val): if debuging: print(val) def executeScript(script,db): ''' Generic sql script execution ...
gpl-3.0
-6,351,713,460,855,505,000
24.810219
101
0.52709
false
3.445591
false
false
false
gfyoung/scipy
tools/win32/build_scripts/pavement.py
4
8579
from __future__ import print_function import os from os.path import join as pjoin, normpath, exists as pexists, dirname import subprocess from shutil import rmtree, move as shmove import re from zipfile import ZipFile from lib import get_svn_version, get_scipy_version BUILD_MSI = False SRC_ROOT = normpath(pjoin(os.ge...
bsd-3-clause
-7,401,795,485,874,810,000
27.220395
79
0.608346
false
3.22883
false
false
false
jmwenda/hypermap
hypermap/aggregator/tests/mocks/warper.py
1
1063
# -*- coding: utf-8 -*- """ Mocks for testing a WARPER service type. """ from httmock import response, urlmatch import os NETLOC = r'(.*\.)?warper\.example\.com$' HEADERS = {'content-type': 'application/json'} GET = 'get' API_PATH = os.path.abspath(os.path.dirname(__file__)) class Resource: """ A WARPER resou...
mit
-2,696,005,604,505,854,000
23.72093
78
0.600188
false
3.485246
false
false
false
openstack/horizon
horizon/test/selenium/selenium_tests.py
1
3995
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
2,674,853,154,437,767,000
38.95
78
0.671089
false
3.615385
true
false
false
rivasd/djPsych
djexperiments/admin.py
1
4719
from django.contrib import admin from django.contrib.auth.models import Group, Permission from .models import Experiment from djmanager.utils import get_subclass_ct_pk, get_allowed_exp_for_user from djsend.models import BaseGlobalSetting, BaseSettingBlock from django.contrib.contenttypes.models import ContentType from ...
gpl-3.0
6,232,383,362,324,751,000
38.008264
132
0.655435
false
3.945652
false
false
false
JonathanOsAlc/openacademy-project
openacademy/model/openacademy_course.py
1
1362
# -*- coding: utf-8 -*- ''' This module is to create model of Course ''' from openerp import models, fields, api, _ class Course(models.Model): ''' This class create model of Course ''' _name = 'openacademy.course' # model odoo course name = fields.Char(string='Title', required=True) # Fileds res...
apache-2.0
6,932,961,786,779,834,000
30.674419
94
0.5837
false
3.83662
false
false
false
Cryptoc1/sotheresthisgirl
tweet.py
1
1999
#!/usr/bin/env python # Shitty code, deal with it. import twitter import time, sys def main(): consumer_key = "v8xVBZlXBp2AJoWI3VjDjzDkC" consumer_secret = "Wpoom4N6tpTgfywzCt6y83gvZubbYoT0vL0V8FXzhyXA74218D" api = twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret, ...
mit
1,954,938,939,408,985,300
34.070175
127
0.584792
false
3.089645
false
false
false
kirienko/gourmet
src/gourmet/plugins/import_export/website_import_plugins/foodnetwork_plugin.py
1
1996
import re from gourmet.plugin import PluginPlugin from .state import WebsiteTestState class FoodNetworkPlugin(PluginPlugin): target_pluggable = 'webimport_plugin' def test_url(self, url, data): if 'foodnetwork.co.uk' in url: return WebsiteTestState.SUCCESS return WebsiteTestSta...
gpl-2.0
6,622,503,042,185,172,000
33.413793
99
0.531563
false
4.445434
false
false
false
monapayjp/monapay
monapay/forms.py
1
4871
# -*- coding: utf-8 -*- import logging import socket from decimal import Decimal from django import forms from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.core.validators import RegexValidator, MinLengthValidator from django.utils.translation import u...
bsd-3-clause
-7,275,446,681,768,836,000
40.632479
116
0.656128
false
4.314438
false
false
false
ecell/ecell4
ecell4/util/ports.py
1
14244
import itertools import copy import warnings import re import ecell4_base from ecell4.extra import unit def replace_parseobj(expr, substitutes=None): substitutes = substitutes or {} import ecell4.util.decorator_base obj = ecell4.util.decorator_base.just_parse().eval(expr) from ecell4.util.model_pa...
gpl-3.0
2,844,659,052,508,244,000
33.656934
146
0.563536
false
3.68062
false
false
false
pcoutin/blargh
greenhat.py
1
1239
#!/usr/bin/env python # Copyright (c) 2015 Angus H. (4148) # Distributed under the GNU General Public License v3.0 (GPLv3). # FILTHY COMMUNIST^^^^ from datetime import date, timedelta from random import randint from time import sleep import sys import subprocess import os # returns a date string for the date that is ...
gpl-3.0
-1,726,259,830,769,019,100
29.975
216
0.653753
false
2.74115
false
false
false
wackou/bts_tools
bts_tools/feeds.py
1
13208
#!/usr/bin/env python # -*- coding: utf-8 -*- # # bts_tools - Tools to easily manage the bitshares client # Copyright (c) 2014 Nicolas Wack <wackou@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softwa...
gpl-3.0
327,733,550,431,656,260
37.284058
193
0.588356
false
3.80634
false
false
false
tartley/cbeams
cbeams/terminal.py
1
1687
import contextlib import sys import random from blessings import Terminal terminal = Terminal() @contextlib.contextmanager def noop(): yield def on_entry(overwrite): sys.stdout.write(terminal.civis + terminal.normal) if not overwrite: sys.stdout.write(terminal.clear) def on_exit(overwrite): ...
bsd-3-clause
-1,789,965,637,564,087,800
21.493333
78
0.615293
false
3.757238
false
false
false
tejal29/pants
src/python/pants/backend/codegen/tasks/ragel_gen.py
1
5140
# coding=utf-8 # Copyright 2014 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 re ...
apache-2.0
30,247,071,890,254,050
33.965986
114
0.663424
false
3.700504
false
false
false
galaxy-genome-annotation/galaxy-tools
tools/chado/chado.py
1
14766
import collections import os import time from abc import abstractmethod import chado ############################################# # BEGIN IMPORT OF CACHING LIBRARY # ############################################# # This code is licensed under the MIT # # License and is a copy of code publicly # # ...
mit
-4,371,529,897,609,154,000
27.560928
80
0.537112
false
4.017959
false
false
false
msshapira/yowsup
yowsup/layers/auth/layer_authentication.py
1
6117
from yowsup.common import YowConstants from yowsup.layers import YowLayerEvent, YowProtocolLayer from .keystream import KeyStream from yowsup.common.tools import TimeTools from .layer_crypt import YowCryptLayer from yowsup.layers.network import YowNetworkLayer from .autherror import AuthError from .protocolentities imp...
gpl-3.0
-4,302,772,220,128,635,400
40.053691
121
0.687102
false
3.891221
false
false
false