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
mogoweb/chromium-crosswalk
build/android/pylib/monkey/test_runner.py
1
2677
# Copyright 2013 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. """Runs a monkey test on a single device.""" import random from pylib.base import base_test_result from pylib.base import base_test_runner class TestRunn...
bsd-3-clause
-4,246,792,533,944,500,700
33.766234
75
0.632798
false
machine-intelligence/rl-teacher-atari
agents/ga3c/ga3c/GA3C.py
1
2331
# Copyright (c) 2016, NVIDIA CORPORATION. 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 conditions a...
mit
7,804,375,501,185,156,000
41.381818
90
0.75547
false
Lisaveta-K/lisaveta-k.github.io
_site/tomat/apps/shops/migrations/0006_transport_company_removal.py
1
3193
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'TransportCompany' db.delete_table(u'shops_transportcompany') def backwards(self, orm...
mit
-2,002,103,304,827,569,700
50.516129
128
0.554964
false
drhoet/marantz-hue-adapter
analysis/color_space_analysis.py
1
5469
import numpy as np from mayavi import mlab from scipy.interpolate import splprep, splev from traits.api import HasTraits, Instance, Button, on_trait_change, Float from traitsui.api import View, Item, HSplit, Group, VGroup from mayavi.core.ui.api import MlabSceneModel, SceneEditor #############################...
mit
1,464,191,938,755,861,800
43.97479
134
0.449991
false
mike-lawrence/actichampy
pycorder/loadlibs.py
1
3137
# -*- coding: utf-8 -*- ''' Load required libraries and check versions PyCorder ActiChamp Recorder ------------------------------------------------------------ Copyright (C) 2010, Brain Products GmbH, Gilching PyCorder is free software: you can redistribute it and/or modify it under the terms of the GN...
gpl-3.0
-9,222,157,332,096,377,000
32.855556
113
0.601211
false
ntymtsiv/tempest
tempest/services/compute/v3/json/servers_client.py
1
16454
# Copyright 2012 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 IBM Corp # 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...
apache-2.0
5,713,543,314,471,721,000
39.034063
79
0.581682
false
FlintHill/SUAS-Competition
UpdatedSyntheticDataset/SyntheticDataset2/ElementsCreator/cross.py
1
1798
from PIL import ImageDraw, Image from SyntheticDataset2.ElementsCreator import Shape class Cross(Shape): def __init__(self, height, color, rotation): """ Initialize a Cross shape :param height: height in pixels :type height: int :param color: color of shape - RGB :...
mit
8,255,110,933,483,183,000
29.474576
118
0.560623
false
amenonsen/ansible
lib/ansible/modules/network/fortios/fortios_system_external_resource.py
1
10703
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
169,487,628,331,970,240
29.234463
109
0.579464
false
pinballwizard/horse
horse/settings.py
1
6060
""" Django settings for horse project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ # Build paths ...
gpl-3.0
4,460,702,238,426,681,000
26.207207
97
0.539493
false
MightyPork/stm32-asm-examples
registers/gen/to_asm_f30x.py
1
4316
from cmsis_svd.parser import SVDParser import json import re # ------------------------------------ svd_name = 'STM32F30x.svd' want_ofs = True want_len = True # Do not print poripheral field definitions (same as first instance) no_print_fields = [ 'GPIOB', 'GPIOC', 'GPIOD', 'GPIOE', 'GPIOF', 'GPIOG', 'USART...
mit
-8,582,438,179,664,634,000
19.951456
105
0.63114
false
biocore/pyqi
pyqi/interfaces/optparse/config/make_command.py
1
2842
#!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2013, The BiPy Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #--------------------------...
bsd-3-clause
3,186,206,807,258,815,000
44.83871
210
0.587262
false
alfredodeza/remoto
remoto/backends/__init__.py
1
11528
import inspect import json import socket import sys import execnet import logging from remoto.process import check class BaseConnection(object): """ Base class for Connection objects. Provides a generic interface to execnet for setting up the connection """ executable = '' remote_import_system...
mit
-5,670,547,759,678,942,000
34.470769
111
0.581974
false
fergalmoran/robotopro
promotions/mixins.py
1
1179
import json from django.http import HttpResponse class AjaxableResponseMixin(object): """ Mixin to add AJAX support to a form. Must be used with an object-based FormView (e.g. CreateView) """ def render_to_json_response(self, context, **response_kwargs): data = json.dumps(context) ...
apache-2.0
-6,176,625,241,103,926,000
34.727273
73
0.622561
false
melqkiades/yelp
source/python/perfomancetest/context_recommender_tests.py
1
16102
import cPickle as pickle import copy import time import itertools import numpy from etl import ETLUtils from evaluation import precision_in_top_n from recommenders.context.baseline.simple_user_baseline_calculator import \ SimpleUserBaselineCalculator from recommenders.context.baseline.user_baseline_calculator impor...
lgpl-2.1
8,918,031,726,753,243,000
34.234136
110
0.679232
false
pyfidelity/zfsbackup
zfsbackup/zfs.py
1
6372
# # Copyright (c) 2010, Mij <mij@sshguard.net> # 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 condi...
bsd-2-clause
4,368,549,535,226,458,600
39.075472
96
0.672003
false
nikodtbVf/aima-si
games.py
1
13492
"""Games, or Adversarial Search (Chapter 5)""" from collections import namedtuple import random from utils import argmax from canvas import Canvas infinity = float('inf') GameState = namedtuple('GameState', 'to_move, utility, board, moves') # _________________________________________________________________________...
mit
-5,513,437,764,375,890,000
33.243655
102
0.549585
false
mnjy/critters
CrittersProto/generator/boxworm_algorithm.py
1
1821
##################################################################### # # hummingloop_algorithm.py # # Copyright (c) 2015, Nick Benson # Modifications by benchan # # Released under the MIT License (http://opensource.org/licenses/MIT) # ##################################################################### import random...
mit
-1,726,495,276,093,130,500
27.46875
69
0.533773
false
warner/magic-wormhole
src/wormhole/journal.py
1
1179
from __future__ import absolute_import, print_function, unicode_literals import contextlib from zope.interface import implementer from ._interfaces import IJournal @implementer(IJournal) class Journal(object): def __init__(self, save_checkpoint): self._save_checkpoint = save_checkpoint self._ou...
mit
-7,589,996,619,548,008,000
25.795455
72
0.64207
false
jhogsett/linkit
python/simon5.py
1
5584
#!/usr/bin/python import serial import time import random import sys s = None num_leds = 93 play_time = 0.0 def flush_input(): s.flushInput() def wait_for_ack(): while s.inWaiting() <= 0: pass ...
mit
4,013,220,484,216,460
37.777778
179
0.344914
false
h4ck3rm1k3/pywikibot-core
tests/tools_tests.py
1
21092
#!/usr/bin/python # -*- coding: utf-8 -*- """Test tools package alone which don't fit into other tests.""" # # (C) Pywikibot team, 2016 # # Distributed under the terms of the MIT license. from __future__ import absolute_import, unicode_literals __version__ = '$Id$' import collections import decimal import inspect im...
mit
-5,386,138,548,688,300,000
33.978441
91
0.601555
false
emccode/HeliosBurn
heliosburn/proxy/modules/server_overload.py
1
4841
import datetime import random from injectors import ExponentialInjector from injectors import PlateauInjector from module import AbstractModule from twisted.python import log from module_decorators import SkipHandler from models import SOProfileModel # ultimately pull from settings file injector_map = { "exponent...
mit
-6,316,699,127,163,408,000
31.059603
72
0.543689
false
robofab-developers/fontParts
Lib/fontParts/test/test_bPoint.py
1
33013
import unittest import collections from fontTools.misc.py23 import basestring from fontParts.base import FontPartsError class TestBPoint(unittest.TestCase): def getBPoint_corner(self): contour, _ = self.objectGenerator("contour") contour.appendPoint((0, 0), "move") contour.appendPoint((10...
mit
-2,513,112,687,653,909,500
28.822042
73
0.565111
false
ayepezv/GAD_ERP
addons/account/wizard/account_invoice_refund.py
1
6614
# -*- coding: utf-8 -*- from odoo import models, fields, api, _ from odoo.tools.safe_eval import safe_eval from odoo.exceptions import UserError class AccountInvoiceRefund(models.TransientModel): """Refunds invoice""" _name = "account.invoice.refund" _description = "Invoice Refund" @api.model d...
gpl-3.0
-2,647,333,404,067,818,500
50.271318
205
0.518597
false
akx/shoop
shoop/core/fields/tagged_json.py
1
3243
# This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop 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. """ "Tagged JSON" encoder/decoder. Objects that are normally not unambiguously representable via J...
agpl-3.0
-1,473,840,330,059,314,200
30.485437
106
0.659574
false
victorduan/ds_usage-collector
collector.py
1
5672
#!/usr/bin/python import sys import logging import config import time import calendar from env import Env from env import MySqlHelper if config.logLevel == "info": logging.basicConfig(format='%(asctime)s | %(levelname)s | %(filename)s | %(message)s', level=logging.INFO, filename=config.logFile) else: logging....
mit
7,862,495,477,375,088,000
37.849315
153
0.515339
false
Gr1N/rainbowrunners
rainbowrunners/result.py
1
5763
# -*- coding: utf-8 -*- import math import unittest from rainbowrunners.utils import Colors, get_terminal_size __all__ = ( 'NyanCatResult', ) class BaseRainbowResult(unittest.TestResult): """A test result class that can print rainbow and awesome pet to a stream. """ separator1 = '\033[{0}m{1:*^70}...
mit
8,010,086,037,771,533,000
30.151351
86
0.585459
false
alsgregory/quasi_geostrophic_model
demos/demo_two_level_variance_reduction.py
1
2299
""" sample variance decay of two level QG system """ from __future__ import division from __future__ import absolute_import from firedrake import * from quasi_geostrophic_model import * import numpy as np import matplotlib.pyplot as plot # define mesh hierarchy mesh = UnitSquareMesh(5, 5) L = 4 mesh_hierarchy ...
mit
1,268,599,031,481,539,800
22.701031
86
0.564158
false
alphagov/notifications-admin
app/navigation.py
1
10999
from itertools import chain from flask import request class Navigation: mapping = {} selected_class = "selected" def __init__(self): self.mapping = { navigation: { # if not specified, assume endpoints are all in the `main` blueprint. self.get_endpoint...
mit
-5,444,905,363,476,817,000
30.15864
87
0.500864
false
adowaconan/Spindle_by_Graphical_Features
duplicate/Generate_Features (adowaconan).py
1
5970
# -*- coding: utf-8 -*- """ Created on Wed May 17 12:35:28 2017 @author: ning """ #import mne import numpy as np import pandas as pd import os from time import time #import networkx as nx from collections import Counter os.chdir('D:\\NING - spindle\\Spindle_by_Graphical_Features') channelList = ['F3','F4','C3','C4','...
mit
4,144,034,402,099,314,700
46.388889
121
0.597655
false
zeekay/elemental
elemental/js.py
1
3175
from sys import modules from core import Element as Element class js(Element): tag = 'js' def __init__(self, script='', url=''): if script: self.format = '<script type="text/javascript">%s</script>' % script elif url: self.format = '<script type="text/javascript" src="%...
mit
-3,511,169,699,096,084,000
28.95283
85
0.654488
false
visipedia/tf_classification
preprocessing/inputs.py
1
29376
# Some of this code came from the https://github.com/tensorflow/models/tree/master/slim # directory, so lets keep the Google license around for now. # # 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 c...
mit
5,512,424,368,205,709,000
41.027182
141
0.625919
false
sunqm/pyscf
pyscf/lo/ibo.py
1
16558
#!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. 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 # # U...
apache-2.0
5,620,724,558,578,377,000
39.583333
155
0.543967
false
raxod502/straight.el
watcher/straight_watch_callback.py
1
2215
#!/usr/bin/env -S python3 -u import os import pathlib import sys WATCHEXEC_VAR_COMMON = "WATCHEXEC_COMMON_PATH" WATCHEXEC_VARS = [ "WATCHEXEC_CREATED_PATH", "WATCHEXEC_REMOVED_PATH", "WATCHEXEC_RENAMED_PATH", "WATCHEXEC_WRITTEN_PATH", "WATCHEXEC_META_CHANGED_PATH", ] def die(message): print...
mit
-3,666,085,764,388,796,400
28.144737
80
0.628894
false
Onager/plaso
plaso/cli/status_view.py
1
18865
# -*- coding: utf-8 -*- """The status view.""" import ctypes import sys import time try: import win32api import win32console except ImportError: win32console = None from dfvfs.lib import definitions as dfvfs_definitions import plaso from plaso.cli import tools from plaso.cli import views from plaso.lib impor...
apache-2.0
-6,684,999,783,999,508,000
33.935185
80
0.660906
false
kleinfeld/medpy
setup.py
1
4152
#!/usr/bin/env python # version: 0.1.2 import os # setuptools >= 0.7 supports 'python setup.py develop' from ez_setup import use_setuptools use_setuptools() from setuptools import setup, Extension def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # The maxflow graphcut wrapper ...
gpl-3.0
-4,711,353,523,098,394,000
33.31405
114
0.589355
false
CARPEM/GalaxyDocker
data-manager-hegp/analysisManager/analysismanager/STARTUP_Add_Workflows_Information.py
1
8085
import os import sys import json from datamanagerpkg import ProtonCommunication_data_manager from datamanagerpkg import GalaxyCommunication_data_manager from sequencer.models import Experiments, GalaxyUsers from sequencer.models import GalaxyJobs, ExperimentRawData from sequencer.models import UserCommonJobs,Supported...
mit
5,939,821,248,430,112,000
48.601227
196
0.590847
false
MMaus/mutils
models/slip_doPri-old.py
1
22110
# -*- coding: utf-8 -*- """ Created on Fri Dec 23 14:46:14 2011 @author: moritz """ # This file implements the SLIP model from scipy.integrate.vode import dvode, zvode from scipy.integrate import odeint, ode from pylab import (zeros, sin, cos, sqrt, array, linspace, arange, ones_like, hstack, vsta...
gpl-2.0
-5,720,251,461,055,179,000
33.332298
89
0.501131
false
rasbt/protein-science
tutorials/substructure_alignment/Scripts/multimol2_rmsd_align.py
1
1043
# Sebastian Raschka 2014 # # Aligns multiple mol2 files to a reference mol2 files and # writes the aligned targets to the hard drive. # # USAGE from command shell command line: # %> python3 multimol2_rmsd_align.py input_dir/ output_dir/ ref.mol2 smiles_string import subprocess import os import sys RMSD_TOOL = "/soft/...
gpl-3.0
2,310,414,354,662,612,000
30.606061
104
0.651007
false
CymricNPG/include_cleaner
dependency_graph.py
1
2889
#!/usr/bin/python import os from common import prepare_include_data, log_block, build_lib_dependencies, find_package_for_file import config __author__ = 'cymric@npg.net' myConfig = config.get_config() def write_lib_graph(data): log_block("writing library dependency graph") dependencies, ignore = build_lib_...
gpl-3.0
-1,794,301,910,090,229,000
32.593023
97
0.553479
false
mensi/cydra
cydra/permission/htpasswd.py
1
3013
# -*- coding: utf-8 -*- import os import hashlib from passlib.apache import HtpasswdFile from cydra.component import Component, implements from cydra.permission import User from cydra.permission.interfaces import IUserTranslator, IUserAuthenticator, IUserStore from cydra.error import InsufficientConfiguration import ...
gpl-3.0
4,904,282,968,786,408,000
31.75
118
0.658812
false
burnpanck/traits
traits/etsconfig/tests/test_etsconfig.py
1
6766
""" Tests the 'ETSConfig' configuration object. """ # Standard library imports. import contextlib import os import shutil import sys import tempfile import time import unittest # Enthought library imports. from traits.etsconfig.api import ETSConfig @contextlib.contextmanager def temporary_directory(): """ ...
bsd-3-clause
-2,372,237,688,121,575,400
22.09215
79
0.557198
false
qxsch/QXSConsolas
examples/CopyThat/copyThat/CTSplunk/Test.py
1
2084
#!/usr/bin/python import logging, os from QXSConsolas.Cli import CliApp from QXSConsolas.Command import SSH, call @CliApp( Name = "Tests something", Description = "A very nice description cannot live without the text", Opts = [ { "argument": "--name:", "default": None, "multiple": True, "desc...
gpl-3.0
-3,096,518,374,377,826,000
41.530612
136
0.573417
false
mozilla/ichnaea
ichnaea/data/tests/test_datamap.py
1
5174
from collections import defaultdict from datetime import timedelta from ichnaea.data.tasks import cleanup_datamap, update_datamap from ichnaea.models.content import DataMap, encode_datamap_grid from ichnaea import util class TestDataMapCleaner(object): @property def today(self): return util.utcnow()....
apache-2.0
-5,722,421,735,843,132,000
32.597403
80
0.529378
false
bmazin/ARCONS-pipeline
flatcal/illuminationCal.py
1
16204
#!/bin/python """ Author: Matt Strader Date:August 19,2012 Opens a twilight flat h5 and makes the spectrum of each pixel. Then takes the median of each energy over all pixels A factor is then calculated for each energy in each pixel of its twilight count rate / median count rate The factors are written out in an...
gpl-2.0
2,251,571,697,630,836,500
43.152589
273
0.630462
false
MateuszG/django-user-example
app/settings.py
1
2129
""" Django settings for app project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import...
mit
5,518,857,587,328,920,000
23.755814
71
0.720996
false
MockyJoke/numbers
ex1/code/monthly_totals.py
1
3064
# coding: utf-8 # In[1]: import numpy as np import pandas as pd def get_precip_data(): return pd.read_csv('precipitation.csv', parse_dates=[2]) def date_to_month(d): return '%04i-%02i' % (d.year, d.month) def pivot_months_pandas(data): """ Create monthly precipitation totals for each station in...
mit
3,098,951,167,550,225,000
27.635514
95
0.620431
false
AsymmetricVentures/asym-logging
asymmetricbase/logging/audit.py
1
4522
# -*- coding: utf-8 -*- # Asymmetric Base Framework - A collection of utilities for django frameworks # Copyright (C) 2013 Asymmetric Ventures 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 # the Free S...
gpl-2.0
5,634,017,856,155,444,000
27.086957
87
0.700796
false
nathanielvarona/airflow
airflow/sensors/bash.py
1
3395
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-6,741,692,652,340,570,000
39.416667
88
0.619735
false
MichaelAquilina/Simple-Calculator
tests/calculate_test.py
1
1141
from calculate import calculate def test_basic_operators(): assert calculate('5+5') == 10 assert calculate('5*5') == 25 assert calculate('10/2') == 5 assert calculate('10-4') == 6 assert calculate('10%4') == 2 assert calculate('6/3') == 2 assert calculate('5-10') == -5 assert calcula...
mit
555,783,336,309,220,540
24.355556
48
0.573181
false
eustislab/horton
horton/meanfield/test/test_scf_ediis.py
1
4344
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2015 The HORTON Development Team # # This file is part of HORTON. # # HORTON 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
470,660,891,456,897,600
31.177778
91
0.65884
false
Leopardob/dice-dev
core_apps/Home/core_app.py
1
1888
import os from PyQt5.QtCore import pyqtSignal, pyqtProperty, qDebug, pyqtSlot from dice.dice_extras.core_app import CoreApp from dice.dice_extras.tools.json_sync import JsonList class Home(CoreApp): def __init__(self, parent=None): super(Home, self).__init__(parent) settings_folder = os.path.joi...
gpl-3.0
-5,843,003,365,226,793,000
39.191489
108
0.652542
false
PressLabs/lithium
lithium/views/base.py
1
1507
from functools import wraps import json from flask import request, Response from flask.ext.classy import FlaskView def get_request_type(): types = { 'application/json': 'json', 'application/xml': 'xml' } if 'Content-Type' in request.headers: if request.headers['Content-Type'] in types: retur...
apache-2.0
7,260,151,536,983,540,000
23.306452
72
0.689449
false
bloem-project/bloem-server
files/tasks.py
1
1132
import hashlib import os import logging from celery import shared_task from .models import File, Directory logger = logging.getLogger() @shared_task def scan_directory(root, type): """Walk through a directory and add files matching a certain pattern to the database.""" for path, dirs, files in os.walk(root)...
gpl-3.0
-8,059,939,730,043,644,000
38.034483
92
0.582155
false
cgwire/zou
zou/app/api.py
1
4415
import os import sys from zou.app.utils import events, api as api_utils from flask import Blueprint from .blueprints.assets import blueprint as assets_blueprint from .blueprints.auth import blueprint as auth_blueprint from .blueprints.breakdown import blueprint as breakdown_blueprint from .blueprints.comments import...
agpl-3.0
-2,686,815,057,494,757,400
34.32
80
0.726614
false
velenux/photofix
photofix.py
1
7000
# encoding: utf-8 import os import sys # for file hash calculation import hashlib # datetime manipulation from datetime import datetime # exif tags from gi.repository import GObject, GExiv2 # for moving files and dirs import shutil import errno # configuration VALID_IMAGES = set(['.cr2', '.cr3', '.crw', '.dng', '...
gpl-2.0
2,211,774,835,877,225,000
31.55814
157
0.632857
false
kyokley/MediaConverter
tests/unit/test_tvrunner.py
1
12299
import unittest import mock from mock import call from tv_runner import TvRunner class TestTvRunner(unittest.TestCase): def setUp(self): self._sort_unsorted_files_patcher = mock.patch('tv_runner.TvRunner._sort_unsorted_files') self.mock_sort_unsorted_files = self._sort_unsorted_files_patcher.start...
mit
1,511,983,220,262,552,000
43.241007
162
0.557362
false
majetideepak/arrow
python/pyarrow/tests/test_serialization.py
1
30729
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
6,047,868,374,056,788,000
32.041935
79
0.607179
false
ANGELHACK-JARVIS/safe-locality
app.py
1
9649
from flask import Flask, render_template, json, request, redirect, session from flask.ext.mysql import MySQL from werkzeug import generate_password_hash, check_password_hash from flask_googlemaps import GoogleMaps from flask_googlemaps import Map import pygal from pygal.style import BlueStyle, NeonStyle,DarkSolarizedS...
mit
-2,559,263,458,218,067,500
36.691406
335
0.611462
false
darren-wang/gl
glance/api/v1/upload_utils.py
1
12541
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-4,218,632,327,757,525,500
41.225589
79
0.553225
false
Hellowlol/plexpy
plexpy/activity_handler.py
1
11652
# This file is part of PlexPy. # # PlexPy 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. # # PlexPy is distributed in the hope t...
gpl-3.0
3,072,818,931,053,455,000
43.30038
123
0.588841
false
olliemath/Python-TinyEvolver
examples/Example3.py
1
1280
from tinyevolver import Population import random try: import matplotlib.pyplot as plt except ImportError: plt = None random.seed(1234) """ For this example we're going to try fiting a power of x to some data: so e.g. d(t) = ax^n + b should resonably approximate some data depending on t. """ # We ...
gpl-2.0
-5,832,435,131,763,731,000
25.666667
82
0.639063
false
scylladb/scylla-cluster-tests
sdcm/results_analyze/test.py
1
18542
import re import typing from datetime import datetime import logging from sdcm.es import ES from test_lib.utils import get_class_by_path from .base import ClassBase, __DEFAULT__ from .metrics import ScyllaTestMetrics LOGGER = logging.getLogger(__name__) ES_LUCENE_ESCAPE_REGEXP = re.compile(r'([^0-9a-zA-Z_.])') c...
agpl-3.0
-765,569,574,074,466,000
32.712727
121
0.594434
false
rgerkin/python-neo
neo/io/asciispiketrainio.py
1
3629
# -*- coding: utf-8 -*- """ Classe for reading/writing SpikeTrains in a text file. It is the simple case where different spiketrains are written line by line. Supported : Read/Write Author: sgarcia """ import os import numpy as np import quantities as pq from neo.io.baseio import BaseIO from neo.core import Segm...
bsd-3-clause
-4,014,761,197,161,626,000
25.683824
97
0.527142
false
op3/hdtv
hdtv/backgroundmodels/exponential.py
1
2206
# -*- coding: utf-8 -*- # HDTV - A ROOT-based spectrum analysis software # Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS) # # This file is part of HDTV. # # HDTV is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # ...
gpl-2.0
4,411,505,221,114,811,400
32.424242
78
0.647325
false
wagnerand/olympia
src/olympia/signing/tests/test_views.py
1
37839
# -*- coding: utf-8 -*- import json import os from datetime import datetime, timedelta from django.conf import settings from django.forms import ValidationError from django.test.utils import override_settings from django.utils import translation import mock import responses from rest_framework.response import Respon...
bsd-3-clause
6,569,520,159,358,038,000
41.135857
79
0.61943
false
manfer/LFP.bundle
Contents/Code/__init__.py
1
2659
# -*- coding: utf-8 -*- TITLE = u'LFP' PREFIX = '/video/lfp' LFP_BASE_URL = 'http://www.laliga.es' LFP_MULTIMEDIA = '%s/multimedia' % LFP_BASE_URL LFP_ICON = 'lfp.png' ICON = 'default-icon.png' LFP_HL_ICON = 'highlights.png' LFP_VIDEO_ICON = 'video.png' LFP_PHOTO_ICON = 'photo...
gpl-3.0
4,681,088,658,285,820,000
27.287234
91
0.608499
false
gooddata/openstack-nova
nova/context.py
1
22746
# Copyright 2011 OpenStack Foundation # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
apache-2.0
-4,422,274,522,955,957,000
39.763441
81
0.636859
false
buzztroll/staccato
staccato/scheduler/simple_thread.py
1
1673
import time import staccato.openstack.common.service as os_service import staccato.xfer.events as s_events import staccato.xfer.executor as s_executor import staccato.xfer.constants as s_constants from staccato.xfer.constants import Events import staccato.db as s_db class SimpleCountSchedler(os_service.Service): ...
apache-2.0
3,352,977,460,077,363,700
33.142857
69
0.616856
false
smlng/bgp-stats
src/python/bgp-rib-stats.py
1
13070
#!/usr/bin/python from __future__ import print_function import argparse import gzip import os import radix import re import sys from bz2 import BZ2File from datetime import datetime, timedelta from multiprocessing import Process, Queue, cpu_count from netaddr import IPSet # own imports import mrtx verbose = False ...
mit
6,659,661,468,522,400,000
34.137097
139
0.53619
false
jtb0/myPiProject
editConffile.py
1
3739
#!/usr/bin/env python #coding: utf8 ############################################################################### # # # python editConfFile.py </location/to/conffile.conf> <set/get> <section> <variable> <value> # # ...
gpl-3.0
-3,766,158,335,119,960,000
35.656863
138
0.577695
false
shadowgamefly/news-Digest
web/web/settings.py
1
2732
""" Django settings for web project. Generated by 'django-admin startproject' using Django 1.8.14. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths i...
mit
1,399,339,844,919,125,500
25.269231
71
0.689239
false
Azure/azure-sdk-for-python
sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py
1
4537
# 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. # --------------------------------------------------------------------...
mit
5,170,395,117,075,362,000
44.37
156
0.707075
false
Miserlou/Zappa
tests/test_handler.py
1
14534
from mock import Mock import sys import unittest from zappa.handler import LambdaHandler from zappa.utilities import merge_headers def no_args(): return def one_arg(first): return first def two_args(first, second): return first, second def var_args(*args): return args def var_args_with_one(fir...
mit
5,811,482,622,813,922,000
32.488479
133
0.521605
false
christiancg/indoor
authenticationdecorator.py
1
1123
from functools import wraps from flask import request, Response from modelos import Usuario from logger import Logger log = Logger(__name__) def check_auth(username, password): """This function is called to check if a username / password combination is valid. """ try: usr = Usuario.query.filter(Usua...
apache-2.0
454,912,826,066,127,740
27.794872
68
0.680321
false
hyperized/ansible
lib/ansible/modules/cloud/azure/azure_rm_lock_info.py
1
8055
#!/usr/bin/python # # Copyright (c) 2019 Yuwei Zhou, <yuwzho@microsoft.com> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
6,295,349,006,659,803,000
35.121076
156
0.611546
false
CanaimaGNULinux/canaimagnulinux.userdata
canaimagnulinux/userdata/userdataschema.py
1
6237
# -*- coding: utf-8 -*- from canaimagnulinux.userdata import _ from plone.app.users.userdataschema import IUserDataSchema from plone.app.users.userdataschema import IUserDataSchemaProvider from zope import schema from zope.interface import implements from zope.schema import ValidationError class TermsNotAccepted(V...
gpl-2.0
-6,964,262,227,185,304,000
39.764706
169
0.601571
false
jessepeterson/commandment
commandment/dep/__init__.py
1
3899
from typing import Set, Dict from enum import Enum class SetupAssistantStep(Enum): """This enumeration contains all possible steps of Setup Assistant that can be skipped. See Also: - `DEP Web Services: Define Profile <https://developer.apple.com/library/content/documentation/Miscellaneous/Reference...
mit
-1,331,331,849,121,758,200
36.057143
250
0.682087
false
ad510/find_pennapps_hackers
find_pennapps_hackers.py
1
3884
#!/usr/bin/env python3 import http.client import re import sys import time def main(): # print info about me :) print("Andrew Downing") print("website: http://andrewd.50webs.com") print("github: ad510") print() # find twitter usernames twitterUsers = set(findbetween(gethttp("twitter.com", ...
mit
-4,278,235,120,225,218,000
40.319149
157
0.558445
false
dhowland/EasyAVR
keymapper/easykeymap/kleparse.py
1
9205
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # # Easy AVR USB Keyboard Firmware Keymapper # Copyright (C) 2013-2017 David Howland # # 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 versi...
gpl-2.0
988,168,901,522,469,400
34.747082
86
0.560684
false
markvoelker/refstack
refstack/db/utils.py
1
1872
# 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
-6,631,642,058,597,606,000
32.428571
78
0.608974
false
Murkantilism/LoL_API_Research
Summoner_Data_Retrieval/DEPRECATED/Generate_Summoners_Hourly.py
1
1818
__author__ = 'Deniz' import time, subprocess, argparse, getopt from sys import argv import sys, os DEFAULT_NUM_SUMMONERS = 250 DEFAULT_LOCATION = os.curdir + "\_out\Random_Summoners_run_"+str(time.time()) def main(): parser = argparse.ArgumentParser(description='Attempt to generate X number' ...
mit
5,609,995,969,163,271,000
38.543478
133
0.59516
false
Intelimetrica/coati
coati/generator.py
1
3847
from coati.powerpoint import open_pptx, runpowerpoint import os import sys import logging from shutil import copyfile from colorlog import ColoredFormatter LOG_LEVEL = logging.DEBUG LOGFORMAT = "%(asctime)s - %(log_color)s%(message)s" logging.root.setLevel(LOG_LEVEL) formatter = ColoredFormatter(LOGFORMAT) stream = lo...
mit
-2,483,990,554,525,858,300
32.452174
109
0.643878
false
samuelpych/Final-Project
finalproject.py
1
5690
""" Finalproject.py Author: Sam Pych Credit: Thomas Kyle Postans, Hagin, My Space Game, David Wilson Assignment: Create a pong game with two movable blocks and the ball either bounces off the wall or appears on the other side. optional: keep score bounde=self.collidingWithSprites(Pongblock1) """ from ggame import App,...
mit
-5,657,514,026,309,861,000
33.70122
104
0.577153
false
zasdfgbnm/tensorflow
tensorflow/contrib/quantize/python/common.py
1
4098
# Copyright 2017 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
-8,926,153,720,807,249,000
32.590164
80
0.704978
false
corradio/electricitymap
test_parser.py
1
4107
#!/usr/bin/env python3 """ Usage: poetry run test_parser FR production """ import time import sys import pprint import datetime import logging import arrow import click from electricitymap.contrib.parsers.lib.parsers import PARSER_KEY_TO_DICT from parsers.lib.quality import ( validate_consumption, validate_p...
gpl-3.0
-8,112,435,090,802,228,000
30.837209
160
0.590699
false
brendanv/nasa-api
nasa/maas.py
1
1543
from nasa import api from nasa.base import NasaApiObject ''' Retrieves the most recent MAAS Report ''' def latest(): response = api.external_api_get( 'http://marsweather.ingenology.com/v1/latest/', {}, ) return MAASReport.from_response(response['report']) ''' Retrieves the set of MAAS Repo...
gpl-3.0
5,404,063,207,014,197,000
32.543478
79
0.615684
false
wkerzendorf/chiantipy
chiantipy/chianti/__init__.py
1
2095
'''the ChiantiPy - CHIANTI Python package calculates various aspects of emission line and continua from the CHIANTI atomic database for astrophysical spectroscopy''' import os import constants import filters import mputil # #try: # chInteractive = int(os.environ['CHIANTIPY_INTERACTIVE']) #except: # chInteractive ...
gpl-3.0
1,139,370,885,466,107,600
33.916667
91
0.702148
false
librasungirl/openthread
tests/toranj/wpan.py
1
61707
#!/usr/bin/env python3 # # Copyright (c) 2018, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
bsd-3-clause
-7,788,658,360,895,456,000
36.195298
121
0.568218
false
filipr/hermes
doc/conf.py
2
11201
# -*- coding: utf-8 -*- # # Hermes documentation build configuration file # # 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 values have a default; values that are commente...
gpl-3.0
-8,940,958,333,252,457,000
28.171875
119
0.67985
false
mjpatter88/mjpython
test/unit/test_virtual_machine.py
1
10066
from virtual_machine import VirtualMachine, BIN_OPS, VirtualMachineError from frame import Frame from block import Block from unittest.mock import MagicMock, patch import pytest class TestVirtualMachine: def setup_method(self): self.vm = VirtualMachine() self.frame = MagicMock() self.frame...
mit
-6,974,837,825,826,239,000
36.281481
106
0.614147
false
realspencerdupre/PoS_Sourcecoin
contrib/linearize/linearize-hashes.py
1
2763
#!/usr/bin/python # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import json import struct impor...
mit
8,287,842,049,013,357,000
25.066038
78
0.6616
false
xsteadfastx/bib-api
app/mod_api/views.py
1
7896
import arrow from flask import current_app, jsonify, request, Response, g from itsdangerous import URLSafeSerializer from app.mod_api import mod_api, schemes from app.mod_api.decorators import valid_facility, valid_token from app.mod_api.errors import InvalidUsage from app.mod_api.ical import build_ical @mod_api.ro...
mit
-5,869,231,872,556,535,000
28.014706
79
0.589965
false
navtejsingh/pychimera
chimera/centroid.py
1
2287
from __future__ import division import numpy as np from photutils.morphology import centroid_com, centroid_1dg, centroid_2dg def recenter(image, pos, window_size = 15, method = "2dg"): """ Recenter each star in each frame of the image cube before performing aperture photometry to take care of slight mis...
bsd-3-clause
6,130,274,085,771,288,000
29.918919
94
0.493223
false
beetbox/beets
beetsplug/web/__init__.py
1
15947
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
mit
7,547,048,632,634,396,000
29.202652
79
0.577475
false
googleapis/python-debugger-client
docs/conf.py
1
12472
# -*- coding: utf-8 -*- # Copyright 2021 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 agr...
apache-2.0
-833,755,084,706,354,800
31.821053
88
0.694917
false
lewisodriscoll/sasview
src/sas/sasgui/guiframe/local_perspectives/plotting/graphAppearance.py
3
10122
#!/usr/bin/python """ Dialog for general graph appearance This software was developed by Institut Laue-Langevin as part of Distributed Data Analysis of Neutron Scattering Experiments (DANSE). Copyright 2012 Institut Laue-Langevin """ import wx from sas.sasgui.plottools.SimpleFont import SimpleFont COLOR = ['black...
bsd-3-clause
4,084,120,535,552,454,700
31.757282
95
0.598202
false
daviewales/pimotion
pimotion/backend.py
1
4082
#!/usr/bin/env python3 import picamera import numpy import io import time def get_png_image(resolution=(640, 480)): width, height = resolution image_stream = io.BytesIO() with picamera.PiCamera() as camera: camera.resolution = resolution camera.start_preview() camera.capture(imag...
bsd-2-clause
-5,974,357,752,693,007,000
32.735537
79
0.656786
false
yukisakurai/hhntup
higgstautau/datasets.py
1
53181
""" This module generates a database of all MC and data datasets """ from rootpy.io import root_open, DoesNotExist #from multiprocessing import Pool, cpu_count import sys from operator import itemgetter import logging import re import glob import os import cPickle as pickle import atexit import fnmatch from collectio...
gpl-3.0
-2,071,067,147,111,899,000
39.565217
92
0.391756
false
sahat/bokeh
bokeh/plot_object.py
1
14108
from __future__ import absolute_import, print_function import os.path from uuid import uuid4 from functools import wraps import warnings import logging logger = logging.getLogger(__file__) from six import add_metaclass, iteritems from six.moves.urllib.parse import urlsplit from .embed import autoload_static, autolo...
bsd-3-clause
4,577,947,309,496,214,000
34.007444
90
0.581372
false
apierleoni/MyBioDb
modules/search_engine.py
1
20410
__author__ = 'pierleonia' DEBUG=True import os, traceback from multiprocessing import Pool class BioentrySearchEngineBackend(object): def rebuild(self, bioentry_ids=[], **kwargs): raise NotImplementedError() def indexes(self, **kwargs): raise NotImplementedError() def after_insert(self...
bsd-3-clause
-3,849,043,284,926,460,400
38.941292
216
0.507937
false