repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
mrcmrcmrc/SpotifyPlaylistGenerator
lastFM.py
1
14394
#!/usr/bin/env python # -*-coding=utf-8 -*- import requests import json import ConfigParser config = ConfigParser.RawConfigParser() config.read('config.ini') API_KEY = config.get('Last.FM', 'API_KEY') URL = "https://ws.audioscrobbler.com/2.0/" def getLovedTracks(username): result = [] page = ...
mit
1,623,251,519,970,669,000
26.390533
158
0.547242
false
tinyalpha/CaptchaPredictor
Database/crop.py
1
3127
import os import numpy as np import os.path as op from PIL import Image,ImageDraw from sklearn.cluster import KMeans def bin_or(_mat, _thr): # 二值化并取反 for i in range(_mat.shape[0]): for j in range(_mat.shape[1]): _mat[i,j] = 0 if _mat[i,j] > _thr else 1 return _mat def antinoise...
gpl-3.0
5,422,969,923,806,787,000
22.417323
74
0.51295
false
unt-libraries/catalog-api
django/sierra/utils/helpers.py
1
11435
''' Contains various utility functions and classes for Sierra API project code. ''' from __future__ import unicode_literals import operator import re from django.db.models import Q def reduce_filter_kwargs(filters): ''' Given a list of filter_kwargs, where each list should be 'ORed' with each other, thi...
bsd-3-clause
-2,409,805,396,795,840,500
37.501684
78
0.567993
false
40223148/2015cd_midterm
wsgi.py
1
20092
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
gpl-3.0
4,986,122,798,459,517
28.573712
137
0.564925
false
johnmee/Flask-FlatPages
flask_flatpages/utils.py
1
2018
""" ===================== flask_flatpages.utils ===================== Utility functions to render Markdown text to HTML. """ import markdown from . import compat from .imports import PygmentsHtmlFormatter def force_unicode(value, encoding='utf-8', errors='strict'): """Convert bytes or any other Python instanc...
bsd-3-clause
-6,164,980,766,246,221,000
27.828571
77
0.655104
false
Forage/Gramps
gramps/plugins/sidebar/expandersidebar.py
1
8117
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2005-2007 Donald N. Allingham # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2009 Benny Malengier # Copyright (C) 2010 Nick Hall # Copyright (C) 2011 Tim G L Lyons # # This program is free software; you can redistribute...
gpl-2.0
3,791,798,576,737,270,000
33.83691
87
0.56203
false
VDBWRAIR/bactpipeline
docs/conf.py
1
10250
# -*- coding: utf-8 -*- # # build configuration file, created by # sphinx-quickstart on Fri Mar 27 15:46:28 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration value...
gpl-2.0
87,986,014,636,188,580
30.538462
79
0.69522
false
vsilent/smarty-bot
core/brain/what/do/you/know/about/me/reaction.py
1
5764
#!/usr/bin/env python # -*- coding: utf-8 -*- # Example # ============================================================================= # # # You can access main configuration module or better create your own in the # config module: # # from core.config.settings import DEMO_MUSIC_DIR # # # Simple command example...
mit
4,580,753,491,343,806,000
35.025
137
0.546322
false
brucelok/ucs
cimc/get_cimc_hardware.py
1
8669
#! /usr/bin/python ''' require install of ImcSdk (0.7.1)the script is to login CIMC server, and get the details of common & enabled hardware components, & health brief [ CIMC hostname, Firmware, CPU, MEM, Server Model, Serial number, NIC card, storage controller and physical disks or onbroad SATA disks] syntax: python ...
apache-2.0
5,395,877,867,665,101,000
42.782828
250
0.661668
false
trichter/sito
util/main.py
1
10876
# by TR from helper import add_doc from obspy.core.util import gps2DistAzimuth from scipy.signal import get_window import logging import numpy as np import warnings from scipy.signal import iirfilter, freqz log = logging.getLogger(__name__) r_earth = 6371 def sind(x): return np.sin(x / 180. * np.pi) def cosd(x): re...
mit
-7,689,614,701,378,093,000
30.433526
110
0.583854
false
paramite/kanzo
tests/plugins/sql.py
1
6136
# -*- coding: utf-8 -*- """ Example plugin for tests. This plugin should be able to install SQL database server. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import uuid from kanzo.core.puppet import update_manifest_inline from kanzo.utils.shell im...
lgpl-3.0
-8,357,320,543,788,225,000
37.835443
80
0.689048
false
ninehills/Eden
t/paninatort.py
1
1635
from eden.paginator import Paginator import unittest class PaginatorTest(unittest.TestCase): def setUp(self): result = [_ for _ in range(1, 10)] self.p = Paginator(result, 100, 10, 5, '/test') def test_next_link(self): self.assertEqual(self.p.next_link('next'), '<a href="/test?page=1...
lgpl-3.0
-5,719,531,516,996,608,000
36.159091
207
0.570642
false
foremap/IoT_demo
test.py
1
2213
#!/usr/bin/env python #-*- coding:utf-8 -*- import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # NOTE: this example requires PyAudio because it uses the Microphone class import speech_recognition as sr import requests import config1 as config try: # Obtain audio from the mi...
apache-2.0
-5,704,372,732,357,906,000
36.907407
151
0.589643
false
whatisjasongoldstein/django-draftin
draftin/models.py
1
8482
from __future__ import absolute_import, unicode_literals import re import os import lxml.html import uuid import datetime import requests import markdown import hashlib try: import urlparse except ImportError: from urllib import parse as urlparse from PIL import Image from django.db import models from django...
mit
-2,017,509,488,085,836,000
34.195021
106
0.631573
false
vaibhavi-r/CSE-415
Assignment3/EightPuzzleWithHeuristics.py
1
11083
'''Vaibhavi Rangarajan, UWNetID = vaibhavi EightPuzzle with Heuristics.py A QUIET2 Solving Tool problem formulation. QUIET = Quetzal User Intelligence Enhancing Technology. The XML-like tags used here serve to identify key sections of this problem formulation. It is important that COMMON_CODE come before all the othe...
mit
5,388,645,340,959,985,000
30.485795
156
0.574393
false
mclarke-icr/scripts
opex/opex_series_old.py
1
8130
#!/usr/bin/env python2.7 """ Last updated: 30/09/2015 """ import os import argparse from collections import OrderedDict import pysam # delim object class Delim(object): def __init__(self,path,hea,dlm): self.path = path file_matrix = [] file_lines = [] header = "NA" with ope...
gpl-3.0
-2,422,047,881,065,171,000
32.187755
172
0.533948
false
sthenc/nc_packer
tools/run_score_batch2.py
1
5055
#!/usr/bin/python import os run_root="/mnt/data/Fer/diplomski/training_currennt/speech_autoencoding_chime/mreze-2015-05-28/" index = 1100 # 178 # 142 # 73 nets =""" run10/autosave_run10_epoch181.autosave run10/autosave_run10_epoch182.autosave run10/autosave_run10_epoch183.autosave run10/autosave_run10_epoch184.aut...
mit
9,014,712,173,010,497,000
33.155405
96
0.84095
false
dufferzafar/critiquebrainz
critiquebrainz/frontend/mapping/views.py
1
6564
from flask import Blueprint, render_template, request, url_for, redirect, flash from flask_login import login_required, current_user from flask_babel import gettext from werkzeug.exceptions import NotFound import critiquebrainz.frontend.apis.spotify as spotify_api from critiquebrainz.frontend.apis import musicbrainz, m...
gpl-2.0
1,506,756,935,405,627,100
42.76
174
0.688909
false
osigaud/ArmModelPython
MotorControlModel/Regression/RunRegressionNN.py
1
3752
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Author: Olivier Sigaud Module: RunRegressionNN Description: Functions to run a neural net to create a controller ''' import os import numpy as np import random as rd from Utils.ReadSetupFile import ReadSetupFile from Utils.FileReading import getStateAndCommandData, ...
gpl-2.0
-2,273,377,246,047,174,700
32.5
130
0.675373
false
GroSte/feumgmt
base/urls.py
1
1090
from django.conf.urls import url from django.contrib.auth.views import login, logout_then_login from django.core.urlresolvers import reverse_lazy from django.utils.translation import ugettext_lazy as _ import views urlpatterns = [ url(r'^login/$', login, {'template_name': 'base/login.html'}, name='login'), url...
apache-2.0
1,364,396,181,402,575,400
56.368421
101
0.659633
false
COEXCZ/django-translation-manager
translation_manager/models.py
1
4991
import polib import os from django.db import models from django.template.defaultfilters import capfirst as cf from django.utils.translation import ugettext_lazy as _ from .settings import get_settings class TranslationEntry(models.Model): created = models.DateTimeField(auto_now_add=True, verbose_name=_(u"admin-...
mpl-2.0
-5,552,993,586,791,371,000
46.533333
199
0.676017
false
arkatebi/DynamicalSystems
toggleSwitch/tSwitch-burst-pSet-1.py
1
11816
#/usr/bin/env python ''' Mutually Inhibitory Toggle Switch with protein burst. X ---| Y; Y ---| X DEs for the toggle switch system: The equivalent chemical system: R1: R2: R3: R4: System variables: X, Y, Px, and Py Dummy variable: phi System parameters: gX, gY, ...
gpl-3.0
8,824,304,135,415,339,000
30.425532
80
0.52302
false
HeisenCore/heisen
heisen/rpc/run.py
1
1890
import sys import os import io import signal import traceback import socket from twisted.internet import reactor from twisted.web import server from twisted.logger import Logger, textFileLogObserver from txjsonrpc.auth import wrapResource from heisen.config import settings from heisen.core.log import logger from heis...
mit
-2,584,779,763,184,559,600
23.545455
76
0.705291
false
rzr/synapse
synapse/handlers/register.py
1
11895
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
7,104,856,400,417,512,000
35.712963
88
0.576545
false
JarrettR/FPGA-Cryptoparty
FPGA/tests/test_wpa2compare.py
1
7563
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # test_wpa2compare.py # Tests for calculating PMK from MK and comparing - Modify Makefile to run # Copyright (C) 2016 Jarrett Rainier # # This prog...
gpl-3.0
-3,423,585,798,348,419,600
32.221719
185
0.562343
false
arunkgupta/gramps
gramps/plugins/tool/mediamanager.py
1
25419
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2006 Donald N. Allingham # Copyright (C) 2008 B. Malengier # Copyright (C) 2008 Brian G. Matherly # Copyright (C) 2010 Jakim Friant # Copyright (C) 2012 Nick Hall # # This program is free software; you can redistribute it ...
gpl-2.0
625,880,641,516,139,300
35.364807
86
0.542311
false
SurveyMan/SMPy
surveyman/test/__main__.py
1
1425
__author__ = 'etosch' import unittest import BlockTests import ConstraintTests import SurveyTests import surveyman.examples.SimpleSurvey as simple import surveyman.examples.example_survey as example import surveyman.examples.subblock_example as sub import surveyman.jsonValidator as validator import json unittest.TextT...
apache-2.0
4,601,337,369,889,501,700
46.533333
118
0.814035
false
quattor/aquilon
tests/broker/test_add_netdev.py
1
22948
#!/usr/bin/env python # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2010,2011,2012,2013,2014,2015,2016,2017,2018 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
apache-2.0
2,838,842,637,646,993,000
49.995556
99
0.528456
false
napalm-automation/napalm
napalm/base/helpers.py
1
18149
"""Helper functions for the NAPALM base.""" # std libs import os import re import sys import itertools import logging from collections.abc import Iterable # third party libs import jinja2 import textfsm from netaddr import EUI from netaddr import mac_unix from netaddr import IPAddress from ciscoconfparse import CiscoC...
apache-2.0
-9,110,618,816,944,250,000
34.586275
98
0.613422
false
Hydrosys4/Master
hardwaremod.py
1
60328
# -*- coding: utf-8 -*- """ selected plan utility """ from __future__ import print_function from __future__ import division from builtins import str from builtins import range from past.utils import old_div import shutil import logging import re import os import os.path import sys import string import random...
gpl-3.0
4,244,937,412,445,981,700
28.876663
244
0.687044
false
ReddyLab/1000Genomes
mine-dbsnp.py
1
1777
#!/usr/bin/env python #========================================================================= # This is OPEN SOURCE SOFTWARE governed by the Gnu General Public # License (GPL) version 3, as described at www.opensource.org. # Copyright (C)2017 William H. Majoros (martiandna@gmail.com). #==============================...
gpl-2.0
6,726,144,192,897,049,000
39.386364
74
0.564434
false
jungtaekkim/GPflowBO
GPflowBO/gp.py
1
1088
try: import GPflow except: import gpflow GPflow = gpflow import numpy as np import tensorflow as tf def build_model_gp(X_train, Y_train, fun_ker, fun_mean=GPflow.mean_functions.Zero()): model = GPflow.gpr.GPR(X_train, Y_train, fun_ker, mean_function=fun_mean) model.optimize() return model def predict_t...
mit
-986,154,614,128,614,100
31
151
0.648897
false
zielmicha/satori
satori.tools/satori/tools/problems/__init__.py
1
5093
# vim:ts=4:sts=4:sw=4:et import logging from satori.client.common import want_import want_import(globals(), '*') from satori.tools import catch_exceptions, options, setup from satori.tools.params import parser_from_xml from satori.tools.problems.common import copy_file from satori.tools.problems.download_problem imp...
mit
-3,485,869,449,155,792,000
41.798319
95
0.673081
false
zhester/hzpy
examples/plot.py
1
4869
#******************************************************************************* # plot.py # # Zac Hester <zac.hester@gmail.com> # 2012-07-27 # # Minimal plotting reference using numpy + matplotlib # #******************************************************************************* import matplotlib import matplotlib...
bsd-2-clause
4,124,870,981,822,003,700
25.461957
80
0.486342
false
cinepost/Copperfield_FX
copper/renderers/workbench/renderer.py
1
10265
import logging import math import time import moderngl from OpenGL.GL import * from OpenGL.arrays.vbo import VBO import moderngl import ghalton from PIL import Image from time import sleep from enum import IntEnum from ctypes import c_float import numpy as np from pyrr import Matrix44 from PyQt5 import QtCore from ...
unlicense
3,690,176,061,576,465,400
32.993377
129
0.626206
false
amluto/libseccomp
tests/23-sim-arch_all_basic.py
1
1564
#!/usr/bin/env python # # Seccomp Library test program # # Copyright (c) 2012 Red Hat <pmoore@redhat.com> # Author: Paul Moore <pmoore@redhat.com> # # # This library is free software; you can redistribute it and/or modify it # under the terms of version 2.1 of the GNU Lesser General Public License as # published by t...
lgpl-2.1
-4,946,780,229,859,976,000
28.509434
78
0.692455
false
release-engineering/fedmsg_meta_umb
fedmsg_meta_umb/metaxor.py
1
4588
# Copyright (C) 2018 Red Hat, Inc. # # fedmsg_meta_umb 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 2.1 of the License, or (at your option) any later version. # # fedmsg_meta_umb is ...
lgpl-2.1
-917,140,697,857,994,500
42.283019
85
0.606146
false
Passw/gn_GFW
base/android/jni_generator/jni_generator_tests.py
1
43224
#!/usr/bin/env python # 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. """Tests for jni_generator.py. This test suite contains various tests for the JNI generator. It exercises the low-level parser all...
gpl-3.0
755,478,131,235,091,000
36.326425
80
0.574981
false
ghchinoy/tensorflow
tensorflow/python/keras/integration_test.py
1
10239
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-3,879,100,118,004,718,000
39.792829
80
0.643911
false
BigTone2009/sms-tools
workspace/A4/A4Part3.py
1
4965
import os import sys import numpy as np from scipy.signal import get_window import matplotlib.pyplot as plt sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../software/models/')) import stft import utilFunctions as UF eps = np.finfo(float).eps """ A4-Part-3: Computing band-wise energy e...
agpl-3.0
123,446,834,812,321,090
57.423529
104
0.746828
false
mintar/ros-infrastructure-rosdistro
src/rosdistro/external/appdirs.py
1
21065
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2005-2010 ActiveState Software Inc. # Copyright (c) 2013 Eddy Petrișor # This is the MIT license # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal...
bsd-3-clause
-8,490,286,334,981,794,000
41.297189
122
0.635539
false
LedgerHQ/electrum
plugins/trezor/plugin.py
1
16383
import base64 import re import threading from binascii import hexlify, unhexlify from functools import partial from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey, public_key_to_p2pkh, EncodeBase58Check, TYPE_ADDRESS, TYPE_SCRIPT, ...
gpl-3.0
3,718,949,269,591,163,400
41.664063
119
0.552341
false
abhikeshav/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_infra_syslog_oper.py
1
34742
""" Cisco_IOS_XR_infra_syslog_oper This module contains a collection of YANG definitions for Cisco IOS\-XR infra\-syslog package operational data. This module contains definitions for the following management objects\: logging\: Logging History data syslog\: syslog Copyright (c) 2013\-2015 by Cisco Systems, Inc...
apache-2.0
-6,760,132,726,564,650,000
28.975841
216
0.511312
false
deniclab/pyto_seg_slurm
segmentation/mito_and_pex_seg_nooverlap.py
1
3769
import os import sys sys.path.append('/n/denic_lab/Users/nweir/python_packages/') import argparse from pyto_segmenter import PexSegment, MitoSegment import scipy.ndimage as ndimage parser = argparse.ArgumentParser(description = 'Segment peroxisomes from \ images and return pickled obj...
mit
-471,122,717,096,715,200
44.409639
111
0.578668
false
FAForever/client
src/fa/game_process.py
1
5558
import os import sys from PyQt5 import QtCore, QtWidgets import config import re import util import logging logger = logging.getLogger(__name__) from model.game import GameState __author__ = 'Thygrrr' class GameArguments: pass class GameProcess(QtCore.QProcess): def __init__(self, *args, **kwargs): ...
gpl-3.0
-6,775,463,792,830,862,000
35.090909
120
0.548759
false
statik/grr
gui/api_plugins/flow_test.py
1
8992
#!/usr/bin/env python """This module contains tests for flows-related API renderers.""" from grr.gui import api_test_lib from grr.gui.api_plugins import flow as flow_plugin from grr.lib import aff4 from grr.lib import flags from grr.lib import flow from grr.lib import flow_runner from grr.lib import output_plugin ...
apache-2.0
-8,247,247,425,292,666,000
33.852713
79
0.637789
false
5610110083/Safety-in-residential-project
cgi-bin/loginHistory2.py
1
3953
#!/usr/bin/python # -*- coding: utf-8 -*-f #Import modules for CGI handling import cgi, cgitb import Cookie, os, time cookie = Cookie.SimpleCookie() cookie_string = os.environ.get('HTTP_COOKIE') def getCookies(): if not cookie_string: return False else: # load() parses the cookie string ...
apache-2.0
8,487,867,148,396,669,000
29.415385
130
0.606628
false
lgarren/spack
var/spack/repos/builtin/packages/minife/package.py
1
2517
############################################################################## # Copyright (c) 2013-2017, 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,250,987,460,366,578,000
37.723077
78
0.632896
false
seryl/Python-Cotendo
cotendo/records.py
1
7276
from lxml import etree # DNS Results class DNSResult(object): """Abstract skeleton for every DNS result""" def __init__(self, ttl=1800): self._etree = etree.Element("result") self.ttl = ttl self._result_type = 'dns' def _get_ttl(self): return self._etree.get("ttl") def...
mit
-4,737,799,907,991,581,000
29.316667
82
0.57724
false
JamesLinEngineer/RKMC
addons/plugin.video.salts/scrapers/2ddl_scraper.py
1
8509
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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 later version. T...
gpl-2.0
8,156,028,738,849,760,000
47.622857
191
0.533553
false
alephobjects/Cura
Cura/gui/util/openglGui.py
1
30446
from __future__ import division __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" import wx import traceback import sys import os import time from wx import glcanvas import OpenGL OpenGL.ERROR_CHECKING = False from OpenGL.GL import * from Cura.util import version from Cura...
agpl-3.0
-5,186,768,599,160,233,000
25.660245
140
0.665703
false
SKIRT/PTS
magic/region/region.py
1
12293
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
2,789,864,496,829,080,600
21.430657
147
0.376342
false
thomasem/nova
nova/api/openstack/compute/contrib/aggregates.py
1
10784
# Copyright (c) 2012 Citrix Systems, 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 ...
apache-2.0
-650,431,616,769,187,000
37.791367
79
0.601354
false
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_12_01/aio/operations/_express_route_links_operations.py
1
8708
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
780,192,618,398,003,700
47.921348
198
0.65147
false
leapcode/bitmask-dev
tests/functional/features/steps/common.py
1
4631
import time from selenium.common.exceptions import ( StaleElementReferenceException, TimeoutException) from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait TIMEOUT_IN_S = 30 DEFAULT_IMPLICIT_WAIT_...
gpl-3.0
-1,025,550,972,335,121,000
32.80292
79
0.682142
false
boosh/iceit
tests/unit/test_backends.py
1
7822
import unittest from mock import patch, Mock from StringIO import StringIO from collections import namedtuple from iceit.backends import S3Backend, S3ResponseError, GlacierBackend class TestS3Backend(unittest.TestCase): """ Tests for the S3 backend """ def test_init_valid(self): """ Te...
mit
-5,919,878,963,531,965,000
35.551402
134
0.596139
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/customer_client_service/transports/base.py
1
3740
# -*- coding: utf-8 -*- # Copyright 2020 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 or...
apache-2.0
-5,946,781,270,819,104,000
35.666667
79
0.651872
false
ThaiSmartDev/NineVerLay
line/client.py
1
18048
# -*- coding: utf-8 -*- """ line.client ~~~~~~~~~~~ LineClient for sending and receiving message from LINE server. :copyright: (c) 2014 by Taehoon Kim. :license: BSD, see LICENSE for more details. """ import re import requests import sys from api import LineAPI from models import LineGroup, LineC...
bsd-3-clause
6,073,829,113,201,298,000
29.332773
98
0.515348
false
jabez007/Training_Helpyr
GUI/TabbedUI.py
1
2482
################################################### # Tabbed interface script # www.sunjay-varma.com ################################################### __doc__ = info = ''' This script was written by Sunjay Varma - www.sunjay-varma.com This script has two main classes: Tab - Basic tab used by TabBar for main functio...
mit
7,803,525,082,368,462,000
30.025
94
0.64585
false
aulphar/xworkflows
doc/conf.py
1
7523
# -*- coding: utf-8 -*- # # XWorkflows documentation build configuration file, created by # sphinx-quickstart on Mon Jun 20 14:00:10 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
bsd-2-clause
8,079,808,219,007,393,000
32.127753
122
0.699734
false
emidln/django_roa
examples/django_roa_client/models.py
1
5846
# -*- coding: utf-8 -*- from django.db import models from django.template.defaultfilters import slugify from django_roa import Model class RemotePage(Model): title = models.CharField(max_length=50, blank=True, null=True) def __unicode__(self): return u'%s (%s)' % (self.title, self.pk) @staticmet...
bsd-3-clause
-6,328,251,171,543,402,000
35.5375
136
0.697742
false
inveniosoftware/invenio-search-ui
invenio_search_ui/ext.py
1
1361
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """UI for Invenio-Search.""" from __future__ import absolute_import, print_function ...
mit
-3,813,753,714,434,342,000
25.686275
74
0.606172
false
xapi-project/sm
tests/test_trim_util.py
1
14069
import unittest import trim_util import testlib import mock EMPTY_VG_SPACE = 4 * 1024 * 1024 class AlwaysBusyLock(object): def acquireNoblock(self): return False class AlwaysFreeLock(object): def __init__(self): self.acquired = False def acquireNoblock(self): self.acquired = T...
lgpl-2.1
-5,629,110,894,098,218,000
40.017493
82
0.506575
false
fbradyirl/home-assistant
homeassistant/helpers/restore_state.py
1
9556
"""Support for restoring entity states on startup.""" import asyncio import logging from datetime import timedelta, datetime from typing import Any, Dict, List, Set, Optional # noqa pylint_disable=unused-import from homeassistant.core import ( HomeAssistant, callback, State, CoreState, valid_enti...
apache-2.0
1,522,874,793,953,023,200
35.753846
87
0.616471
false
jnayak1/osf.io
tests/base.py
1
15360
# -*- coding: utf-8 -*- '''Base TestCase class for OSF unittests. Uses a temporary MongoDB database.''' import os import re import shutil import logging import unittest import functools import datetime as dt from json import dumps import blinker import httpretty from webtest_plus import TestApp from webtest.utils impo...
apache-2.0
7,672,840,309,441,264,000
31.268908
105
0.670833
false
ROB-Seismology/oq-hazardlib
openquake/hazardlib/tests/calc/filters_test.py
1
3753
# The Hazard Library # Copyright (C) 2012 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. # # Th...
agpl-3.0
-8,292,938,115,319,625,000
40.7
78
0.624833
false
tst-ppenev/earthenterprise
earth_enterprise/src/fusion/portableglobe/cutter/cgi-bin/geecheck.py
1
7085
#!/usr/bin/env python # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
-5,259,165,739,392,241,000
28.894515
80
0.644601
false
mjschultz/django-tastefulpy
tests/validation/api/resources.py
1
1619
from django.contrib.auth.models import User from tastefulpy import fields from tastefulpy.constants import ALL from tastefulpy.resources import ModelResource from tastefulpy.authorization import Authorization from basic.models import Note, AnnotatedNote, UserForm from django import forms from tastefulpy.validation impo...
bsd-3-clause
-7,156,013,431,193,531,000
29.54717
112
0.702285
false
scholer/instaporter
instaporter/instapaper.py
1
23700
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Rasmus Sorensen, rasmusscholer@gmail.com <scholer.github.io> ## 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, eit...
gpl-3.0
6,717,414,777,101,606,000
39.791738
235
0.613038
false
rs/webassets
tests/test_bundle.py
1
14299
from nose.tools import assert_raises, assert_equals from nose import SkipTest from webassets import Bundle from webassets.bundle import BuildError from webassets.filter import Filter from helpers import BuildTestHelper class TestFilterAssign(BuildTestHelper): """Test the different ways we can assign filters to ...
bsd-2-clause
5,808,265,669,087,123,000
35.760925
102
0.590811
false
dsanno/chainer-neural-style
src/lbfgs.py
1
3159
import numpy from chainer import cuda from chainer import optimizer _default_hyperparam = optimizer.Hyperparameter() _default_hyperparam.lr = 0.01 _default_hyperparam.stack_size = 100 _default_hyperparam.min_ro = 1e-5 class LBFGSRule(optimizer.UpdateRule): """Update rule of L-BFGS. """ ...
mit
-5,455,089,982,834,222,000
31.252632
81
0.497626
false
a-holm/MachinelearningAlgorithms
Regression/RandomForestRegression/regularRandomForestRegression.py
1
2237
# -*- coding: utf-8 -*- """Random Forest Regression for machine learning. Random forest algorithm is a supervised classification algorithm. As the name suggest, this algorithm creates the forest with a number of decision trees. In general, the more trees in the forest the more robust the forest looks like. In the sam...
mit
-3,076,344,223,962,329,600
32.893939
79
0.758605
false
alex-bauer/kelvin-power-challenge
src/features/features_ltdata.py
1
1261
"""Concatenate and resample LTDATA""" import sys sys.path.append("../") from utils.utils import * import os folder=config.features_folder if not os.path.exists(folder): os.makedirs(folder) # Function to read the csv file and converting time def parse_ltdata(filename, dropna=True): df = pd.read_csv(config....
mit
-6,947,092,471,976,165,000
29.780488
104
0.720856
false
kyle8998/Practice-Coding-Questions
leetcode/14-Easy-Longest-Common-Prefix/answer.py
1
1874
#!/usr/bin/python #------------------------------------------------------------------------------ class Solution(object): def longestCommonPrefix(self, strs): """ :type strs: List[str] :rtype: str """ length = len(strs) result = "" charsleft = True i...
unlicense
5,477,318,189,514,164,000
30.762712
79
0.454109
false
rossica/sukiyaki
settings.py
1
3336
# Copyright (C) 2009,2010,2011 Anthony Rossi # For License information regarding this software, see LICENSE # If no LICENSE file was included, see http://www.opensource.org/licenses/mit-license.php # Django settings for sukiyaki project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG PROJECT_ROOT = os.path....
mit
-9,168,518,712,145,051,000
35.066667
108
0.691247
false
aerval/de.rki.proteomic_virus_detection
plugin_source/CountPeptides.py
1
2066
import xml.etree.ElementTree as ET from ntpath import basename # determine name of a file from optparse import OptionParser def filename(file): ''' Return just the name of a file without the path and file format ''' file = basename(file) return file.split('.')[0] def countPept...
gpl-2.0
-236,991,010,081,272,220
29.30303
121
0.590997
false
clreinki/GalaxyHarvester
getResources.py
1
13528
#!/usr/bin/python """ Copyright 2013 Paul Willworth <ioscode@gmail.com> This file is part of Galaxy Harvester. Galaxy Harvester 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 th...
agpl-3.0
-1,941,997,723,988,198,000
39.870091
663
0.691898
false
chrsrds/scikit-learn
sklearn/datasets/lfw.py
2
18994
"""Labeled Faces in the Wild (LFW) dataset This dataset is a collection of JPEG pictures of famous people collected over the internet, all details are available on the official website: http://vis-www.cs.umass.edu/lfw/ """ # Copyright (c) 2011 Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause fro...
bsd-3-clause
6,566,678,556,869,773,000
36.463511
79
0.628567
false
mopidy/pyspotify
spotify/__init__.py
1
3504
from __future__ import unicode_literals import threading import pkg_resources __version__ = pkg_resources.get_distribution('pyspotify').version # Global reentrant lock to be held whenever libspotify functions are called or # libspotify owned data is worked on. This is the heart of pyspotify's thread # safety. _lo...
apache-2.0
-3,343,069,679,174,215,700
28.694915
80
0.684646
false
mbauskar/helpdesk-erpnext
erpnext/accounts/doctype/account/account.py
1
9130
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint from frappe import throw, _ from frappe.model.document import Document class RootNotEditable(frappe.V...
agpl-3.0
304,425,701,387,602,200
37.523207
123
0.698467
false
sjl767/woo
py/pre/depot.py
1
10501
# encoding: utf-8 from woo.dem import * from woo.fem import * import woo.core, woo.dem, woo.pyderived, woo.models, woo.config import math from minieigen import * class CylDepot(woo.core.Preprocessor,woo.pyderived.PyWooObject): ''''Deposition of particles inside cylindrical tube. This preprocessor was created for ...
gpl-2.0
-3,403,541,505,778,690,600
67.188312
389
0.664508
false
adolgert/discretenext
pdfedit.py
1
1081
import logging import os import tempfile import shutil from PyPDF2 import PdfFileWriter, PdfFileReader logger=logging.getLogger("pdfedit") def AddPdfKeys(pdf_file, keydict): """ Add a dictionary of key-value pairs to a pdf file. Adds metadata to PDF files so you know what generated them. """ multi...
mit
-3,994,835,290,101,173,000
30.794118
70
0.688252
false
orionzhou/robin
formats/phylip.py
1
1609
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import os.path as op import sys import logging import re from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from pyfaidx import Fasta from Bio import AlignIO from maize.apps.base import eprint, sh, mkdir from maize.formats.base im...
gpl-2.0
-5,607,621,547,531,732,000
26.741379
78
0.646986
false
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/tests/unit/gapic/googleads.v6/services/test_campaign_extension_setting_service.py
1
38783
# -*- coding: utf-8 -*- # Copyright 2020 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 or...
apache-2.0
1,926,449,949,376,050,700
45.005931
238
0.697935
false
jason-weirather/Au-public
iron/pythonlib/PairwiseAlignmentBasics.py
1
10159
import sys, re from SequenceBasics import rc class PairwiseAlignment: def __init__(self): self.s1 = None self.s2 = None self.a1 = None self.a2 = None self.score = None def load_sequences(self,s1,s2): self.s1 = s1 self.s2 = s2 def do_needleman_wunsch(self): [a1,a2,score] = needlema...
apache-2.0
4,975,802,781,112,445,000
29.599398
125
0.548873
false
uhliarik/rebase-helper
rebasehelper/output_tool.py
1
6781
# -*- coding: utf-8 -*- # # This tool helps you to rebase package to the latest version # Copyright (C) 2013-2014 Red Hat, Inc. # # 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 # he Free Software Foundation; either version 2 ...
gpl-2.0
6,008,069,341,724,772,000
32.403941
116
0.606253
false
jbasko/configmanager
tests/test_extending_library.py
1
3973
import pytest from configmanager import Item, ItemAttribute, Config from configmanager.utils import not_set def test_custom_item_class_as_item_factory(): class CustomItem(Item): is_custom = ItemAttribute(name='is_custom', default=True) config = Config({ 'a': { 'b': 1, ...
mit
-7,507,046,238,957,712,000
26.978873
85
0.620941
false
romanz/electrum
lib/paymentrequest.py
1
17702
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # 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...
mit
6,574,225,516,501,351,000
32.782443
145
0.604451
false
moonso/genmod
tests/vcf_tools/test_sorting.py
1
1691
from tempfile import NamedTemporaryFile from genmod.vcf_tools import sort_variants def setup_csv_file(): """ Print some variants to a vcf file and return the filename """ variant_lines = [ '1\t1\t11900\t.\tA\tT\t100\tPASS\tMQ=1\tGT:GQ\t0/1:60\t0/1:60\t1/1:60\n', '3\t3\t947378\t.\tA\tT\...
mit
5,778,479,325,251,003,000
30.314815
83
0.575991
false
danielfrg/jupyterhub-kubernetes_spawner
kubernetes_spawner/swagger_client/models/v1_component_status.py
1
6278
# coding: utf-8 """ Copyright 2015 SmartBear Software 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
-7,607,108,213,036,513,000
32.216931
272
0.614845
false
fuspu/RHP-POS
table_setup_sql3.py
1
34576
!/bin/python #-*- coding: utf-8 -*- # # # import wxversion wxversion.select('2.8') import sqlite3 import HandyUtilities as HU def CreateTable(sql_file, table_name, column_info): con = None exists = None con = sqlite3.connect(sql_file) print('----------------------------------------') with con: ...
mit
2,537,789,638,118,385,700
35.167364
86
0.550873
false
reflexsc/reflex
src/rfxengine/db/mxsql.py
1
8859
#$#HEADER-START # vim:set expandtab ts=4 sw=4 ai ft=python: # # Reflex Configuration Event Engine # # Copyright (C) 2016 Brandon Gillespie # # 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...
agpl-3.0
1,644,280,727,408,292,600
35.012195
93
0.488656
false
vesellov/bitdust.devel
transport/proxy/proxy_router.py
1
30556
#!/usr/bin/env python # proxy_router.py # # Copyright (C) 2008-2018 Veselin Penev, https://bitdust.io # # This file (proxy_router.py) is part of BitDust Software. # # BitDust 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 ...
agpl-3.0
-8,812,896,494,155,383,000
40.743169
133
0.553836
false
slyfocks/pigs
shortcodes.py
1
1664
from itertools import product, islice from joblib import Parallel, delayed import json import requests from requests.exceptions import ConnectionError, Timeout from simplejson import JSONDecodeError import string CLIENT_ID = 'a48b4d0f6e0745e2ba68902a1f68f8d5' URL = 'https://api.instagram.com/oembed/media/?url=http://i...
apache-2.0
7,701,331,847,887,923,000
27.689655
109
0.641827
false
caktus/django-timepiece
timepiece/crm/tests/test_projects.py
1
15579
from django.core.urlresolvers import reverse_lazy from django.test import TestCase from timepiece.tests import factories from timepiece.tests.base import ViewTestMixin from ..models import Project class TestCreateProject(ViewTestMixin, TestCase): url_name = 'create_project' template_name = 'timepiece/projec...
mit
2,790,450,009,125,710,000
40.879032
82
0.648052
false
StackVista/sts-agent-integrations-core
postgres/check.py
1
31003
"""PostgreSQL check Collects database-wide metrics and optionally per-relation metrics, custom metrics. """ # stdlib import socket # 3rd party try: import psycopg2 except ImportError: psycopg2 = None import pg8000 # project from checks import AgentCheck, CheckException from config import _is_affirmative M...
bsd-3-clause
-291,608,067,800,618,940
38.79846
217
0.559817
false
mvernacc/proptools
docs/source/examples/convection/plots/film_cooling.py
1
1203
"""Film cooting example""" import numpy as np from matplotlib import pyplot as plt from proptools import convection T_aw = 3200 # Adiabatic wall temperature of core flow [units: kelvin]. T_f = 1600 # Film temperature [units: kelvin]. T_w = 700 # Wall temperature [units: kelvin]. x = np.linspace(0, 1) # Dis...
mit
2,538,100,434,209,827,300
34.382353
92
0.636741
false
slogan621/tscharts
queue/models.py
1
2133
#(C) Copyright Syd Logan 2017-2019 #(C) Copyright Thousand Smiles Foundation 2017-2019 # #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 req...
apache-2.0
-6,096,697,637,723,108,000
36.421053
149
0.766995
false
chenshuo/recipes
puzzle/poker/poker2.py
1
1170
#!/usr/bin/python import sys def get_ranks(hand): ranks = ['--23456789TJQKA'.index(r) for r, s in hand] ranks.sort(reverse = True) if ranks == [14, 5, 4, 3, 2]: ranks = [5, 4, 3, 2, 1] return ranks def expand(counts, ranks): cards = [] for i in range(len(counts)): cards.extend((ranks[i], ) * counts[i]) re...
bsd-3-clause
-294,364,423,834,941,060
24.434783
60
0.610256
false
boegel/easybuild-framework
easybuild/framework/extension.py
1
8667
## # Copyright 2009-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
gpl-2.0
2,846,203,081,842,776,600
37.865471
119
0.637937
false