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
mz314/django-sass-processor
sass_processor/management/commands/compilescss.py
1
7090
# -*- coding: utf-8 -*- import os import sass from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django.template.loader import get_template # noqa Leave this in to preload template locations from django.utils.importlib import import_...
mit
-9,080,522,471,985,560,000
44.448718
130
0.621157
false
Nithanaroy/random_scripts
CreateNeoDB.py
1
1357
from py2neo import Graph graph = Graph("http://neo4j:1234@localhost:7474/db/data/") # Insert data insert_query = ''' UNWIND {pairs} as pair MERGE (p1:Person {name:pair[0]}) MERGE (p2:Person {name:pair[1]}) MERGE (p1)-[:KNOWS]-(p2); ''' data = [["Jim", "Mike"], ["Jim", "Billy"], ["Anna", "Jim"], ["Anna", "Mik...
mit
8,349,724,321,448,204,000
24.12963
90
0.640383
false
charanpald/sandbox
sandbox/misc/ClusterExp.py
1
1686
""" Compare the clustering methods in scikits.learn to see which ones are fastest and most accurate """ import time import numpy import sklearn.cluster as cluster from apgl.data.Standardiser import Standardiser import scipy.cluster.vq as vq numExamples = 10000 numFeatures = 500 X = numpy.random.rand(numExamples,...
gpl-3.0
-6,093,461,531,651,391,000
23.1
96
0.747924
false
aularon/meld
setup_win32.py
1
3455
#!/usr/bin/env python import glob import os import site import sys from cx_Freeze import setup, Executable import meld.build_helpers import meld.conf site_dir = site.getsitepackages()[1] include_dll_path = os.path.join(site_dir, "gnome") missing_dll = [ 'libgtk-3-0.dll', 'libgdk-3-0.dll', 'libatk-1.0-0...
gpl-2.0
3,119,004,850,918,130,700
24.404412
85
0.557453
false
afrolov1/nova
nova/tests/image/test_glance.py
1
50675
# Copyright 2011 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 requ...
apache-2.0
-4,568,962,508,668,061,700
38.71395
79
0.582082
false
zstackio/zstack-woodpecker
integrationtest/vm/mini/multiclusters/paths/multi_path196.py
1
2569
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'data_volume=true', 'cluster=cluster1'], [TestAction.create_mini_vm, 'vm2', 'cl...
apache-2.0
-8,610,853,918,201,521,000
37.939394
104
0.688206
false
lypnol/graph-theory
problem-02/submissions/coco-backtracking-improved.py
1
2420
from submission import Submission def calculate_length(permutation, matrix): n = len(permutation) length = 0 for i in range(n-1): length += matrix[permutation[i]][permutation[i+1]] length += matrix[permutation[-1]][permutation[0]] return length def glouton(graphe, depart=None): sommets...
mit
-6,264,765,515,762,897,000
32.611111
115
0.62686
false
z3r0zh0u/pyutls
MyProcLib.py
1
4286
""" My Process Execution Library """ import os import time import Queue import platform import threading import subprocess NewLine = '\n' if platform.system() == 'Windows': NewLine = '\r\n' def queue_output(out, queue): """Queue output""" for line in iter(out.readline, b''): queue.put...
gpl-2.0
-2,528,289,493,108,418,600
20.984615
112
0.519365
false
GammaC0de/pyload
src/pyload/plugins/downloaders/ZippyshareCom.py
1
4071
# -*- coding: utf-8 -*- import re import urllib.parse from bs4 import BeautifulSoup from pyload.core.utils.misc import eval_js from ..anticaptchas.ReCaptcha import ReCaptcha from ..base.simple_downloader import SimpleDownloader class ZippyshareCom(SimpleDownloader): __name__ = "ZippyshareCom" __type__ = "...
agpl-3.0
-8,509,155,195,058,406,000
33.5
110
0.519774
false
mbelmadani/motifgp
motifgp/hammingregex.py
1
6109
import re import numpy def sxor(s1,s2): # convert strings to a list of character pair tuples # go through each tuple, converting them to ASCII code (ord) # perform exclusive or on the ASCII code # then convert the result back to ASCII (chr) # merge the resulting array of characters as a string...
lgpl-3.0
-8,711,762,516,253,431,000
32.201087
187
0.549026
false
daweim0/Just-some-image-features
lib/fcn/config.py
1
5504
# -------------------------------------------------------- # FCN # Copyright (c) 2016 # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- """FCN config system. This file specifies default config options for Fast R-CNN. You should ...
mit
-4,911,511,965,618,673,000
26.247525
85
0.632813
false
johnshiver/football_tools
football/core/models/weekly_stats.py
1
1824
from django.db import models from django.conf import settings from model_utils.models import TimeStampedModel class WeeklyStats(TimeStampedModel): player = models.ForeignKey('core.Player', related_name='player_stats') season = models.ForeignKey('core.Season') week = models.ForeignKey('core.Week', related...
mit
6,390,556,806,062,743,000
37.808511
74
0.655702
false
ikvk/imap_tools
tests/test_utils.py
1
7008
import unittest import datetime from imap_tools import utils from imap_tools.errors import ImapToolsError, UnexpectedCommandStatusError, MailboxCopyError from imap_tools.consts import MailMessageFlags class UtilsTest(unittest.TestCase): def test_clean_uids(self): # *clean_uids tested enough in test_quer...
apache-2.0
-6,395,569,723,169,207,000
56.173554
119
0.551171
false
our-city-app/oca-backend
src/rogerthat/migrations/delete_all_models_by_kind.py
1
1605
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
3,319,584,261,818,788,000
31.755102
107
0.697196
false
agrav/freesif
tests/test_sif2hdf5.py
1
3789
# -*- coding: utf-8 -*- """ Test sif2hdf5 function for different filetypes. """ import unittest import freesif as fs import os import shutil FILES = os.path.join(os.path.dirname(__file__), 'files') class TestSIF2HDF5(unittest.TestCase): """Test *sif2hdf5* function for different filetypes. It is only checked tha...
mit
246,719,434,470,003,000
35.432692
105
0.610715
false
Hornwitser/DiscordLogger
logger/config-example.py
1
1032
# Logger bot configuration. { # These messages will dissapear after the bot has been run # Most of these settings can be changed from within the bot # itself. See the help command. 'active_servers': set(), 'admin_commands': {'help', 'ignore_server', 'listen_on', 'leave', 'join'}, 'admin_roles':...
mit
-6,773,766,223,123,624,000
30.272727
78
0.614341
false
JohnyEngine/CNC
opencamlib/scripts/drop-cutter/drop_cutter_one-triangle_2.py
1
2299
import ocl import pyocl import camvtk import vtk import math def drawPoints(myscreen, clpoints, ccpoints): c=camvtk.PointCloud( pointlist=clpoints, collist=ccpoints) c.SetPoints() myscreen.addActor(c ) if __name__ == "__main__": print ocl.version() myscreen = camvtk.VTKScreen() # tria...
apache-2.0
785,468,906,210,808,400
27.7375
79
0.606351
false
bnoi/scikit-tracker
sktracker/io/tests/test_metadataio.py
1
2350
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function from nose.tools import assert_raises from sktracker import data from sktracker.io import get_metadata from sktracker.io import validate_metad...
bsd-3-clause
3,016,241,812,330,578,000
31.191781
82
0.513191
false
enigmampc/catalyst
catalyst/utils/input_validation.py
1
25568
# Copyright 2015 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
-2,792,091,310,868,139,500
29.620359
79
0.556516
false
iABC2XYZ/abc
Scripts/RFQVane/VaneStructure2.py
1
7067
# -*- coding: utf-8 -*- """ Created on Fri Mar 03 11:11:22 2017 @author: A """ import matplotlib.pyplot as plt import numpy as np from scipy.optimize import fsolve from scipy.special import iv #from scipy.signal import find_peaks_cwt plt.close('all') zStart=0+0.67 zEnd=230.045+0.67 zStep=0.005###...
gpl-3.0
-2,863,287,004,672,663,600
19.009146
93
0.554636
false
cryptoprojects/ultimateonlinecash
test/functional/importmulti.py
1
21761
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Copyright (c) 2017 The UltimateOnlineCash Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the importmulti RPC.""" from test_fram...
mit
4,061,598,657,407,303,700
47.250554
137
0.61601
false
sepeth/relationships
relationships/relationship.py
1
4426
import redis from keys import key_list as default_key_list class Relationship(object): def __init__(self, redis_connection=None, key_list=None, actor=None): if key_list: default_key_list.update(key_list) self.key_list = default_key_list if redis_connection: se...
mit
7,119,113,668,999,396,000
30.614286
108
0.592634
false
martinburchell/crossword_collective
crossword.py
1
11875
import os.path import urllib import smtplib import string import StringIO from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from lxml import etree from lxml.html.soupparser import fromstring from lxml.cssselect import CSSSelector from PIL impor...
gpl-3.0
-6,237,270,378,994,270,000
29.924479
182
0.527663
false
antgonza/qp-shotgun
qp_shogun/filter/tests/test_filter.py
1
8158
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------...
bsd-3-clause
-1,719,745,592,090,536,200
34.914027
79
0.532851
false
martinloland/rov
pc/func.py
1
3401
''' func.py - General classes - Handling events initatied by user input ''' class SENS: def __init__(self): self.press = 1.0 self.temp = 0 self.volt = 0 self.curr = 0 self.roll = 0 self.yaw = 0 self.pitch = 0 self.ax = 0 self.ay = 0 self.az = 0 self.compass = 0 self.depth =...
mit
-3,157,018,102,161,540,600
23.780303
100
0.626286
false
mrcrgl/stockstore
stockstore/wsgi.py
1
1434
""" WSGI config for stockstore2 project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATIO...
mit
5,247,661,201,262,824,000
43.8125
79
0.794979
false
prateek-1708/pg-aws-python
src/ecs-deploy.py
1
4415
#!/usr/bin/python3 import boto3 import argparse import pprint import sys ############################################################################## def debug(args): print('Cluster Name: {}'.format(args.cluster)) print('Service Name: {}'.format(args.service)) print('Image Version: {}'.format(args.imag...
mit
2,897,100,967,628,455,400
28.637584
102
0.560589
false
UdK-VPT/Open_eQuarter
mole3/qgisinteraction/plugin_interaction.py
1
13083
from qgis.PyQt import QtCore from qgis.core import QgsProject, QgsCoordinateReferenceSystem, QgsMapLayer, QgsRasterLayer, QgsVectorLayer from qgis.core import QgsField, QgsFeature, QgsDistanceArea, QgsPoint from qgis import utils from os import path import sys from mole3.qgisinteraction.layer_interaction import find_l...
gpl-2.0
1,665,867,565,011,549,700
39.630435
153
0.595047
false
fugwenna/bunkbot
src/roulette/roulette_cog.py
1
1297
from random import randint from discord.ext.commands import command, Context, Cog from ..bunkbot import BunkBot from ..channel.channel_service import ChannelService from ..core.bunk_exception import BunkException from ..core.bunk_user import BunkUser from ..core.registry import CHANNEL_SERVICE, USER_SERVICE fr...
mit
-3,034,951,817,091,481,600
32.131579
72
0.642251
false
billgertz/FAB-UI
fabui/python/force_reset.py
1
1051
#!/usr/bin/python #Force Totumduino Reset import RPi.GPIO as GPIO import time,sys import serial import ConfigParser import logging config = ConfigParser.ConfigParser() config.read('/var/www/fabui/python/config.ini') trace_file=config.get('macro', 'trace_file') response_file=config.get('macro', 'response_file') log...
gpl-2.0
3,917,042,093,612,731,400
17.438596
80
0.721218
false
kkozarev/mwacme
src/catalog/hek_find_halo_cmes_v2.py
1
4200
# -*- coding: utf-8 -*- import json import os from sunpy.net import hek from pprint import pprint from datetime import datetime,timedelta from time import strftime import numpy as np import matplotlib.pyplot as plt client = hek.HEKClient() #SEARCH FOR FAST AND WIDE CMEs IN THE HEK! #'FAST' means linear speed higher th...
gpl-2.0
-4,243,700,712,274,347,500
38.622642
118
0.689762
false
flavors/countries
setup.py
1
1907
import os import re from setuptools import find_packages, setup def get_long_description(): for filename in ('README.rst',): with open(filename, 'r') as f: yield f.read() def get_version(package): with open(os.path.join(package, '__init__.py')) as f: pattern = r'^__version__ = [...
mit
4,646,107,103,152,200,000
28.796875
71
0.567908
false
russellb/nova
nova/notifier/list_notifier.py
1
2207
# Copyright 2011 OpenStack LLC. # 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 b...
apache-2.0
7,981,357,401,778,414,000
30.084507
79
0.676031
false
lorien/grab
tests/grab_redirect.py
1
4599
# coding: utf-8 from six.moves.urllib.parse import quote, unquote from grab.error import GrabTooManyRedirectsError from tests.util import BaseGrabTestCase, build_grab def build_location_callback(url, counter): meta = { 'counter': counter, 'url': url, } def callback(): if meta['co...
mit
2,294,489,589,820,108,000
31.560284
79
0.557613
false
quarkslab/irma
common/src/plugins/manager.py
1
4896
# # Copyright (c) 2013-2018 Quarkslab. # This file is part of IRMA 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 in the top-level directory # of this distribution and at: # # http:...
apache-2.0
8,253,696,942,616,350,000
42.327434
78
0.520221
false
google/llvm-propeller
lldb/test/API/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
2
2712
""" Test lldb data formatter subsystem. """ import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class DataFormatterBoolRefPtr(TestBase): mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin def test_boolrefptr_with_run_co...
apache-2.0
-4,510,948,938,182,836,700
34.220779
85
0.59587
false
yrchen/CommonRepo
commonrepo/groups_api/permissions.py
1
1342
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
apache-2.0
5,770,680,299,890,904,000
30.209302
74
0.716841
false
menify/sandbox
tags/aql_beta_1_16032008/setup.py
1
3780
import logging import utils import options _Warning = logging.Warning #//===========================================================================// _site_setup = [] _user_setup = {} _tools_setup = {} _tools_post_setup = {} def ResetSetup( site_setup = _site_setup, tools_setup = _tools_se...
mit
3,797,604,539,554,396,000
31.033898
101
0.462169
false
SEL-Columbia/commcare-hq
corehq/apps/users/util.py
1
4131
import re from django.conf import settings from django.contrib.auth.models import User from couchdbkit.resource import ResourceNotFound from corehq import toggles, privileges from dimagi.utils.couch.database import get_db from django.core.cache import cache from django_prbac.exceptions import PermissionDenied from d...
bsd-3-clause
3,465,629,854,168,599
28.719424
95
0.648995
false
richhorace/docker-getpocket-elastic
scripts/reprocess-pocket-raw-data.py
1
2316
#/usr/bin/env python3 import argparse import glob import json import logging import datetime import os from local import DATA_DIR, LOG_DIR, REPROCESS_DIR def parse_files(fnames): for fname in fnames: stat = os.stat(fname) f_date = str(datetime.datetime.utcfromtimestamp(stat.st_birthtime).isoforma...
mit
6,101,022,340,132,048,000
26.903614
103
0.525475
false
WmHHooper/aima-python
submissions/Martinez/vacuum2.py
1
1449
import agents as ag def HW2Agent() -> object: def program(percept): bump, status = percept if status == 'Dirty': action = 'Suck' else: lastBump, lastStatus, = program.oldPercepts[-1] lastAction = program.oldActions[-1] if bump == 'None': ...
mit
-7,472,466,343,766,180,000
26.884615
62
0.507246
false
Novartis/railroadtracks
src/test/test_recipe.py
1
26005
# Copyright 2014-2015 Novartis Institutes for Biomedical Research # 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 applic...
apache-2.0
5,608,266,947,258,619,000
44.304878
133
0.55051
false
smurn/twistit
twistit/test_testing.py
1
1640
# Copyright (C) 2015 Stefan C. Mueller import unittest from twisted.internet import defer import twistit class TestExtract(unittest.TestCase): def test_success(self): d = defer.succeed(42) self.assertEqual(42, twistit.extract(d)) def test_fail(self): d = defer.fail(ValueE...
mit
-6,057,147,474,698,230,000
28.836364
77
0.622561
false
coinbase/coinbase-python
coinbase/wallet/auth.py
1
1718
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import hashlib import hmac from requests.utils import to_native_string import time from requests.auth import AuthBase class HMACAuth(AuthBase): def...
apache-2.0
-6,887,145,672,861,208,000
32.038462
98
0.633295
false
aerospike/aerospike-client-python
examples/client/remove_bin.py
1
4429
# -*- coding: utf-8 -*- ########################################################################## # Copyright 2013-2021 Aerospike, 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 # # ...
apache-2.0
4,883,970,964,990,964,000
32.300752
100
0.470761
false
nitheeshkl/miniPOS
mpos/dlg_add.py
1
6520
#! /usr/bin/python # encoding: -*- utf-8 -*- # dialogs.py # This file is part of miniPOS. # miniPOS 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 ...
gpl-3.0
-6,303,529,669,219,090,000
36.257143
87
0.496472
false
nigelb/gdata-utils
gdata_utils/fs/__init__.py
1
5204
# Helper utils for gdata. # # Copyright (C) 2012 NigelB # # 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. # # This progr...
gpl-3.0
-8,418,994,547,592,379,000
33.236842
106
0.63259
false
saullocastro/pyNastran
pyNastran/utils/__init__.py
1
9338
# -*- coding: utf-8 -*- from __future__ import print_function from types import MethodType import os import io import sys from codecs import open as codec_open from itertools import count from six import PY2, string_types, iteritems, StringIO import numpy as np if PY2: integer_types = (int, long, np.int32, np.in...
lgpl-3.0
-8,305,409,958,395,564,000
31.996466
112
0.57507
false
freezas/hy
tests/compilers/test_ast.py
1
18450
# Copyright 2017 the authors. # This file is part of Hy, which is free software licensed under the Expat # license. See the LICENSE. from __future__ import unicode_literals from hy import HyString from hy.models import HyObject from hy.compiler import hy_compile from hy.importer import import_buffer_to_hst from hy.er...
mit
6,325,422,572,845,489,000
28.472843
78
0.600542
false
SWLBot/electronic-blackboard
board.py
1
2049
import tornado.ioloop import tornado.web import tornado.httpserver from tornado.options import define, options, parse_command_line import os.path from broadcast_api import load_schedule import argparse import config.settings define('port',default=4000,help='run the server on the given port',type=int) #define('log_fil...
apache-2.0
-8,772,363,605,874,281,000
33.728814
84
0.65349
false
denys-duchier/django-wiki-py3
wiki/core/plugins/registry.py
1
1646
# -*- coding: utf-8 -*- from django.utils.importlib import import_module _cache = {} _settings_forms = [] _markdown_extensions = [] _article_tabs = [] _sidebar = [] def register(PluginClass): """ Register a plugin class. This function will call back your plugin's constructor. """ if PluginClass in...
gpl-3.0
4,763,319,060,811,272,000
28.945455
88
0.647631
false
licon02/pnn
pruebas/prueba04_b.py
1
2843
#!/usr/bin/python #prueba de red LSTM #genera grafica de las senales de entrada y la respuesta de la redes #entrada senoidal from __future__ import division import numpy as np from pybrain.datasets import SequentialDataSet from itertools import cycle from pybrain.supervised import RPropMinusTrainer from sys import std...
gpl-3.0
2,559,812,335,112,786,400
29.569892
90
0.687654
false
google/prettytensor
prettytensor/train.py
1
1183
# Copyright 2015 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed ...
apache-2.0
-369,588,201,578,420,300
50.434783
74
0.803888
false
google/verible
bazel/build-version.py
1
1343
#!/usr/bin/env python3 # Copyright 2020-2021 The Verible Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
apache-2.0
656,127,483,831,813,100
24.826923
133
0.679821
false
dimka665/vk
tests/conftest.py
1
1967
import requests from pytest import fixture from vk.session import APIBase @fixture('session') def v(): """ Actual vk API version """ return '5.80' class Attributable(object): def set_attrs(self, attributes): for attr_name, attr_value in attributes.items(): setattr(self, att...
mit
8,648,724,391,978,122,000
21.101124
61
0.608541
false
WadeHsiao/B
3rd/yuv/libyuv/setup_links.py
1
17186
#!/usr/bin/env python # Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
lgpl-3.0
-4,101,265,656,489,156,600
32.897436
80
0.636216
false
ProjectBabbler/ebird-api
src/ebird/api/statistics.py
1
2558
"""Functions for fetching basic statistics about observers and observations.""" from ebird.api.utils import call from ebird.api.validation import ( clean_area, clean_date, clean_max_observers, clean_rank, clean_region, ) TOP_100_URL = "https://ebird.org/ws2.0/product/top100/%s/%s" TOTALS_URL = "ht...
mit
-4,960,243,422,118,333,000
27.422222
110
0.681392
false
diggcoin/diggcoin
contrib/linearize/linearize-hashes.py
1
3037
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import pr...
mit
-6,657,036,970,384,412,000
25.876106
90
0.663813
false
openstack/surveil
surveil/api/handlers/status/live_host_handler.py
1
2622
# Copyright 2014 - Savoir-Faire Linux inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
-4,852,115,580,305,140,000
31.37037
76
0.606789
false
scott-w/view-helpers
test_project/test_project/authtest/tests.py
1
3128
"""Test the auth mixins. """ from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client class LoginRequiredTestCase(TestCase): """Test the LoginRequiredMixin. """ def setUp...
bsd-3-clause
-8,050,070,320,160,211,000
31.247423
77
0.623082
false
Fewbytes/cosmo-plugin-openstack-sg-provisioner
openstack_sg_provisioner/tests/test_openstack_sg_provisioner.py
1
1906
#!/usr/bin/env python # vim: ts=4 sw=4 et import logging import random import string import unittest import openstack_sg_provisioner.tasks as tasks RANDOM_LEN = 3 # cosmo_test_nova_XXX_something PORT = 65000 CIDR = '1.2.3.0/24' class OpenstackSGProvisionerTestCase(unittest.TestCase): def setUp(self): ...
apache-2.0
-5,024,366,868,894,776,000
30.766667
99
0.593389
false
aptivate/sarpaminfohub
django/sarpaminfohub/infohub/tests/drug_searcher_tests.py
1
5964
# -*- coding: iso-8859-15 -*- from sarpaminfohub.infohub.tests.sarpam_test_case import SarpamTestCase from sarpaminfohub.infohub.test_backend import TestBackend from sarpaminfohub.infohub.drug_searcher import DrugSearcher class DrugSearcherTest(SarpamTestCase): def setUp(self): test_backend = TestBackend()...
gpl-3.0
7,975,553,864,656,356,000
37.980392
100
0.642354
false
patrick91/pycon
backend/integrations/tests/test_tasks.py
1
1179
from unittest.mock import MagicMock, patch from django.test import override_settings from integrations.tasks import notify_new_submission, switchable_task def test_notify_new_submission(): with patch("integrations.slack.send_message") as m1: notify_new_submission( "test_title", "t...
mit
500,003,179,471,033,660
27.756098
79
0.615776
false
jpopelka/osbs-client
setup.py
1
1520
#!/usr/bin/python """ Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import re import sys from setuptools import setup, find_packages data_files = { "share/osbs": [ "inputs/image...
bsd-3-clause
2,019,618,046,527,079,000
27.679245
84
0.644737
false
dethi/duhpy
duhpy.py
1
3987
#!/usr/bin/env python from __future__ import print_function from __future__ import unicode_literals import sys import time import argparse from os import getenv from os.path import expanduser from threading import Thread try: from Queue import Queue except: from queue import Queue import dropbox PY2 = (s...
mit
1,625,170,860,030,826,800
26.308219
78
0.536494
false
thp44/delphin_6_automation
pytest/test_weather_models.py
1
1932
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import pytest import numpy as np # RiBuild Modules from delphin_6_automation.delphin_setup import weather_modeling from ...
mit
-7,866,846,956,237,236,000
39.25
120
0.621118
false
grave-w-grave/zulip
confirmation/models.py
2
5962
# -*- coding: utf-8 -*- # Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $' import re from django.db import models from django.core.urlresolvers import reverse from django.core.mail import send_mail from django.conf import settings from dj...
apache-2.0
4,702,718,434,550,939,000
38.746667
122
0.643911
false
julienawilson/data-structures
src/test_linked_list.py
1
4803
"""Tests for linked_list.py.""" import pytest @pytest.fixture def sample_linked_list(): """Create testing linked list.""" from linked_list import LinkedList one_llist = LinkedList([1]) empty_llist = LinkedList() new_llist = LinkedList([1, 2, 3, 4, 5]) return (one_llist, empty_llist, new_llist...
mit
-5,856,760,384,943,909,000
30.188312
75
0.673746
false
bsamseth/project-euler
094/94.py
1
1451
""" It is easily proved that no equilateral triangle exists with integral length sides and integral area. However, the almost equilateral triangle 5-5-6 has an area of 12 square units. We shall define an almost equilateral triangle to be a triangle for which two sides are equal and the third differs by no more than on...
mit
-7,009,995,585,974,352,000
29.702128
79
0.544006
false
flopp/airports_map
airports/db.py
1
3270
import os import random import typing from airports.airport import Airport, AirportType from airports.airportstable import AirportsTable from airports.download import download from airports.runwaystable import RunwaysTable from airports.wikipediahelper import get_wikipedia_articles class DB: def __init__(self) -...
mit
-1,287,605,393,672,882,000
41.467532
101
0.62263
false
opencb/cellbase
cellbase-client/src/main/python/tests/test_cbrestclients.py
1
7814
import unittest import pycellbase.cbrestclients as cbfts from pycellbase.cbconfig import ConfigClient from requests import Session class GeneClientTest(unittest.TestCase): """Tests the GeneClient class""" def setUp(self): """Initializes the gene client""" self._gc = cbfts.GeneClient(Session()...
apache-2.0
-8,429,973,344,240,424,000
36.033175
76
0.584848
false
arcan1s/git-etc
sources/ctrlconf/aboutwin.py
1
5647
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'aboutwin.ui' # # Created: Mon Feb 18 04:26:37 2013 # by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attrib...
gpl-3.0
-5,526,175,977,805,946,000
67.217949
589
0.713588
false
suutari/shoop
shuup_tests/front/test_carousel.py
1
7375
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shuup Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from datetime import datetime, timedelta import pytest from django.utils im...
agpl-3.0
-3,138,957,484,464,057,300
37.411458
112
0.701966
false
DXCanas/content-curation
contentcuration/contentcuration/node_metadata/annotations.py
1
8076
from django.contrib.postgres.aggregates.general import ArrayAgg from django.contrib.postgres.aggregates.general import BoolOr from django.db.models import BooleanField from django.db.models import CharField from django.db.models import IntegerField from django.db.models.aggregates import Count from django.db.models.agg...
mit
-4,523,287,446,646,386,000
33.810345
97
0.616518
false
lipis/github-stats
main/api/v1/repo.py
1
1840
# coding: utf-8 from __future__ import absolute_import from google.appengine.ext import ndb import flask_restful import flask from api import helpers import auth import model import util from main import api_v1 @api_v1.resource('/repo/', endpoint='api.repo.list') class RepoListAPI(flask_restful.Resource): def g...
mit
9,207,477,670,009,611,000
31.280702
79
0.646196
false
twilio/twilio-python
twilio/rest/accounts/__init__.py
1
1547
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base.domain import Domain from twilio.rest.accounts.v1 import V1 class Accounts(Domain): def __init__(self, twilio): """ Initialize the Accounts Domain :re...
mit
7,574,503,216,198,596,000
22.089552
83
0.5585
false
flavoi/diventi
diventi/products/migrations/0060_auto_20200901_1950.py
1
3075
# Generated by Django 2.2.13 on 2020-09-01 17:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0059_auto_20200830_1804'), ] operations = [ migrations.AlterField( model_name='chapter', name='title', ...
apache-2.0
258,824,874,770,298,750
33.943182
83
0.555122
false
erdc/proteus
proteus/tests/LS_with_edgeBased_EV/MCorr/thelper_cons_ls.py
1
3450
from __future__ import division from past.utils import old_div from proteus import Domain from proteus import Context ct=Context.Options([ # General parameters # ("T",0.1,"Final time"), ("nDTout",1,"Number of time steps to archive"), ("refinement",0,"Level of refinement"), ("unstructured",False,"Us...
mit
-2,499,542,141,089,966,600
29.263158
146
0.71913
false
frePPLe/frePPLe
freppledb/common/report.py
1
134827
# # Copyright (C) 2007-2019 by frePPLe bv # # This library 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. # # This library is d...
agpl-3.0
-1,733,423,649,352,162,600
39.234855
148
0.454501
false
ph1l/halo_radio
HaloRadio/UserSongStatsListMaker.py
1
3143
# # # Copyright (C) 2004 Philip J Freeman # # This file is part of halo_radio # # 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...
gpl-2.0
6,443,673,913,120,863,000
35.126437
239
0.646834
false
zstackio/zstack-woodpecker
integrationtest/vm/multihosts/invalid_path/snapshot/paths/invalid_path4.py
1
1360
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, faild_point=13, path_list=[ [TestAction.create_vm, 'vm1', ], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1...
apache-2.0
2,703,161,563,352,621,600
34.815789
161
0.7
false
liqd/adhocracy3.mercator
src/adhocracy_meinberlin/adhocracy_meinberlin/sheets/test_kiezkassen.py
2
1796
import colander from pyramid import testing from pytest import mark from pytest import fixture from pytest import raises @mark.usefixtures('integration') def test_includeme_register_proposal_sheet(registry): from .kiezkassen import IProposal context = testing.DummyResource(__provides__=IProposal) assert r...
agpl-3.0
4,342,760,450,687,123,000
29.965517
60
0.671492
false
philscher/gkc
Benchmarks/IntegralCode/SolveOK.py
1
8023
from pylab import * import scipy #import math import mpmath as mp import traceback import random import numpy import Dispersion_ConstTheta #import fpectl #fpectl.turnon_sigfpe() import scipy.linalg as la import scipy.sparse.linalg as sla import SlepcDet import gkcStyle import iCode class Species: def __init__(se...
gpl-3.0
5,590,745,320,015,303,000
27.756272
150
0.510408
false
TomAugspurger/DSADD
setup.py
1
1281
from setuptools import setup, find_packages # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) setup( name='dsadd', version='0.0.2', description='A python package for defensive data analysis.', long_description='A python package for defensive data analysis...
mit
-496,449,566,151,237,250
26.255319
70
0.622951
false
schuhumi/timetravel
timetravel-gui.py
1
3226
#!/usr/bin/env python3 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the ho...
gpl-3.0
7,090,185,540,407,805,000
28.87037
87
0.599814
false
Adista-ste/metabaseparser
script2012r2.py
1
1237
#!/usr/bin/env python # -*- coding: utf-8 -*- from lxml import etree import argparse, sys, os, re arguments = argparse.ArgumentParser() arguments.add_argument("-s","--https",help="Traite également les domaines HTTPS", action='store_true') arguments.add_argument("-f","--fichier",help="Définit le fichierxml utilise") ...
agpl-3.0
-6,761,721,896,002,896,000
23.176471
102
0.6691
false
guyrt/court-reminder
server/admin_app.py
1
1277
""" Flask Admin App """ import os from flask import Flask, flash, render_template, request from flask_admin import Admin from flask_basicauth import BasicAuth from azure.storage.blob import BlockBlobService, ContentSettings from storage.models import Database from storage.secrets import blob_key, blob_accountname, b...
mit
-6,595,723,578,014,805,000
28.697674
84
0.703994
false
jantaylor/road-home-time-tracker
timetracker/models.py
1
3525
from django.db import models from django.contrib import admin from django.db.models import signals class Volunteer(models.Model): first_name = models.CharField(max_length=50) last_name = models.CharField(max_length=50) email = models.EmailField(max_length=254, unique=True) is_group = models.BooleanFie...
mit
-9,162,268,426,743,387,000
36.5
114
0.670355
false
etherealpost/etherealpost.com
etherealpost/__init__.py
1
3480
from urllib.parse import urlparse from etherealpost.db.filters import JinjaFilters from pymongo import MongoClient from pyramid.config import Configurator from pyramid.httpexceptions import HTTPMovedPermanently # http://stackoverflow.com/a/15705778 def add_auto_route(config, name, pattern, **kw): config.add_rout...
mit
1,368,858,778,148,236,000
34.876289
78
0.64569
false
Squishymedia/feedingdb
src/feeddb/feed/migrations/0087_auto__add_field_setup_technique.py
1
41850
# -*- 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 field 'Setup.technique' db.add_column(u'feed_setup', 'technique'...
gpl-3.0
-7,785,624,208,790,066,000
82.869739
203
0.548053
false
SeungGiJeong/SK_FastIR
dump/mbr.py
1
6740
from construct import * from distorm3 import Decode, Decode16Bits import hexdump import os class Mbr: def __init__(self, path): self.mbrHexa = "" self.mbrStruct = "" self.bootloaderCode = "" self.offset = 0 self.partition = {"name": []} self.signature = "" s...
gpl-3.0
5,784,401,525,415,355,000
49.676692
100
0.327448
false
caderache2014/django-rest-tutorial
tutorial/tutorial/settings.py
1
2075
""" Django settings for tutorial project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) i...
mit
-1,510,887,145,338,488,600
22.590909
71
0.697831
false
beiko-lab/gengis
bin/Lib/site-packages/scipy/optimize/tests/test_regression.py
1
1237
"""Regression tests for optimize. """ from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import TestCase, run_module_suite, assert_almost_equal, \ assert_raises import scipy.optimize class TestRegression(TestCase): def test_newton_x0_is...
gpl-3.0
797,545,178,663,493,000
25.488889
76
0.515764
false
saga-project/bliss
setup.py
1
5145
# -*- coding: utf-8 -*- """ Bliss setup script. """ import os import sys import shutil import fileinput from distutils.core import setup from distutils.command.install_data import install_data from distutils.command.sdist import sdist from bliss import version scripts = [] # ["bin/bliss-run"] import sys if sys.he...
mit
3,389,903,422,821,095,400
30.181818
219
0.620214
false
EmmaIshta/QUANTAXIS
QUANTAXIS/QAData/proto/stock_min_pb2.py
1
5509
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: stock_min.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _ref...
mit
-5,573,104,706,046,568,000
38.633094
494
0.679797
false
chrisrink10/mumpy
mumpy/interpreter.py
1
5105
"""MUMPy Interpreter The functions in this module represent various functions that may need to be carried out from the command line (including starting the REPL and compiling and executing a routine file). Licensed under a BSD license. See LICENSE for more information. Author: Christopher Rink""" try: # Used by ...
bsd-3-clause
-7,555,515,970,046,993,000
32.149351
80
0.543389
false
Kozea/pygal
pygal/graph/xy.py
1
4016
# -*- coding: utf-8 -*- # This file is part of pygal # # A python svg graph plotting library # Copyright © 2012-2016 Kozea # # This library 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...
lgpl-3.0
-429,799,592,630,257,700
29.648855
79
0.537983
false
matichorvat/pydmrs
dmrs_preprocess/label.py
1
4339
def create_label(dmrs_xml, carg_clean=False): """ Create an identifying label attribute for each node and link, consisting of its arguments and properties. :param dmrs_xml: Input DMRS XML :return: Modified DMRS XML """ for entity in dmrs_xml: if entity.tag == 'node': ...
mit
-1,478,493,958,019,896,300
29.342657
97
0.558424
false
jonaustin/advisoryscan
django/django/middleware/cache.py
1
4057
from django.conf import settings from django.core.cache import cache from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers class CacheMiddleware(object): """ Cache middleware. If this is enabled, each Django-powered page will be cached for CACHE_MIDDLEWARE_SECONDS seconds. C...
mit
901,742,829,478,083,500
47.297619
301
0.685975
false
dgwartney-io/import-io-api-python
tests/unit/importio2/test_api_call.py
1
1773
# # Copyright 2016 Import.io # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
5,221,499,926,267,727,000
27.142857
74
0.658206
false