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
SKA-ScienceDataProcessor/legion-sdp-clone
language/test.py
1
8005
#!/usr/bin/env python # Copyright 2015 Stanford University # # 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 applicabl...
apache-2.0
-2,264,833,039,945,196,000
36.060185
115
0.587008
false
wdbm/shijian
shijian_examples_clocks.py
1
5541
#!/usr/bin/env python """ ################################################################################ # # # shijian_examples_clocks # # ...
gpl-3.0
-61,446,250,638,534,950
43.328
80
0.484931
false
tstapler/Access-Plus-Schedule-Parser
web/ScheduleViewer/migrations/0001_initial.py
1
2389
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Course', fields=[ ('id', models.AutoField(auto_...
mit
3,464,933,900,472,990,700
39.491525
183
0.52951
false
cumc-dbmi/pmi_sprint_reporter
webapi.py
1
2220
""" Utilities to configure WebAPI (backend for Atlas) to work with the database(s) loaded by reporter and achilles. This module makes the following assumptions: * WebAPI section of settings is valid * The WebAPI database (referred to by `settings.webapi_conn_str`) already contains the application tables """ from sq...
mit
1,704,027,627,111,090,700
36
111
0.703604
false
Yelp/pgctl
pgctl/fuser.py
1
2200
#!/usr/bin/env python2.7 """\ usage: pgctl-fuser [-d] file [file ...] Shows the pids (of the current user) that have this file opened. This is useful for finding which processes hold a file lock (flock). This has the same behavior as `lsof -t file`, but is *much* faster. """ from __future__ import absolute_import from...
mit
-5,979,769,641,141,754,000
25.506024
97
0.581818
false
skosukhin/spack
var/spack/repos/builtin/packages/ea-utils/package.py
1
2144
############################################################################## # 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
620,051,369,482,476,400
41.039216
82
0.67444
false
MehdiSfr/tensor-flow
tensorflow/python/training/input.py
1
24193
# 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 a...
apache-2.0
-4,704,024,588,663,581,000
42.201786
80
0.69144
false
rsenk330/Flask-Cake
flask_cake/tests/test_cake.py
1
1572
import pytest try: from unittest import mock # Python 3 except ImportError: import mock @pytest.fixture def app(tmpdir): from flask import Flask root_path = tmpdir.ensure("test-proj", dir=True) tmpdir.ensure("test-proj/static/coffee", dir=True) p = tmpdir.join("test-proj/static/coffee", "C...
bsd-2-clause
9,065,584,534,477,928,000
26.103448
103
0.670483
false
OpenTrons/opentrons_sdk
api/tests/opentrons/calibration/tip_length/test_tip_length_calibration.py
1
1461
import pytest from typing import List, Tuple from opentrons.calibration.tip_length import state_machine valid_transitions: List[Tuple[str, str, str]] = [ ('loadLabware', 'sessionStarted', 'labwareLoaded'), ('moveToMeasureNozzleOffset', 'labwareLoaded', 'measuringNozzleOffset'), ('jog', 'measuringNozzleOffset',...
apache-2.0
4,413,712,137,367,218,000
44.65625
75
0.740589
false
jackliusr/scrapy-crawlers
crawlers/crawlers/spiders/lq7m.py
1
2098
import scrapy from selenium import webdriver from scrapy.http import JsonRequest, Request from scrapy import Selector import time import json class Lq7mSpider(scrapy.Spider): name = 'lq7m' start_urls = ['http://lq.7m.com.cn/list/3/2.shtml'] custom_settings = { 'DATABASEPIPELINE_ENABLED': True, ...
apache-2.0
6,463,469,120,809,064,000
36.464286
111
0.531935
false
ColdenCullen/d2dl
enki2/enkilib/python/parser.py
1
5204
# # Copyright (c) 2008 Eric Anderton # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, # ...
mit
5,033,403,532,751,314,000
32.939597
123
0.511337
false
davibe/cerbero
cerbero/build/filesprovider.py
1
10801
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
-8,284,127,028,015,997,000
37.852518
79
0.561522
false
unioslo/cerebrum
Cerebrum/modules/cis/NMHIndividuation.py
1
5117
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 t...
gpl-2.0
7,199,006,522,862,516,000
58.348837
149
0.619122
false
benwebber/ansible-tap
library/callback_plugins/tap.py
1
4807
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import ( absolute_import, unicode_literals, ) import collections from enum import Enum import sys import yaml from ansible import constants as C from ansible.executor.task_queue_manager import TaskQueueManager from ansible.parsing.yaml.dumper imp...
mit
1,714,229,715,713,902,000
29.232704
94
0.620137
false
benagricola/exabgp
lib/exabgp/bgp/message/update/nlri/qualifier/etag.py
1
1397
# encoding: utf-8 """ etag.py Created by Thomas Mangin on 2014-06-26. Copyright (c) 2014-2015 Orange. All rights reserved. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ # TODO: take into account E-VPN specs that specify the role of the first bit of ESI # (since draft-ietf-l2vpn-evpn-05) from struct ...
bsd-3-clause
3,194,523,706,247,964,000
21.174603
83
0.67287
false
fbradyirl/home-assistant
homeassistant/components/smartthings/smartapp.py
1
16136
"""SmartApp functionality to receive cloud-push notifications.""" import asyncio import functools import logging from urllib.parse import urlparse from uuid import uuid4 from aiohttp import web from pysmartapp import Dispatcher, SmartAppManager from pysmartapp.const import SETTINGS_APP_ID from pysmartthings import ( ...
apache-2.0
-1,182,386,507,876,220,700
33.042194
88
0.649417
false
kimberlythegeek/axe-selenium-python
axe_selenium_python/tests/conftest.py
1
1081
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from datetime import datetime import pytest from py.xml import html @pytest.mark.optionalhook def pytest_html_results...
mpl-2.0
-323,944,129,504,433,200
33.870968
73
0.719704
false
deprecated/nebulio
nebulio/tests/test_synphot.py
1
2699
"""These tests compare filter parameters from pysynphot with the ones I have calculated myself.""" from __future__ import (print_function, absolute_import, division, unicode_literals) import os import pytest import nebulio from nebulio.tests.utils import this_func_name from nebulio.legacy import wfc3_utils from matpl...
mit
-8,268,557,955,996,119,000
30.752941
95
0.675806
false
ayepezv/GAD_ERP
openerp/report/render/rml2pdf/trml2pdf.py
1
45686
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import sys import copy import reportlab import re from reportlab.pdfgen import canvas from reportlab import platypus import utils import color import os import logging import traceback from lxml import etree import base...
gpl-3.0
-7,056,118,041,523,852,000
41.777154
238
0.545506
false
MediaKraken/MediaKraken_Deployment
source/test_asyncpg_json.py
1
1574
import asyncio import datetime import json import asyncpg ### # fully working for DICT of row along with auto json decode/encode ### async def main(): conn = await asyncpg.connect(user='postgres', password='metaman', database='postgres', ...
gpl-3.0
375,246,508,988,305,300
33.217391
87
0.52986
false
PaulEcoffet/megamachineacaoua
test_machine.py
1
6484
import unittest from machine import Machine, InvalidOrderException, NotEnoughStockException from drink import Drink from coins import Coins, NoChangePossibleException import copy class MachineTestCase(unittest.TestCase): """ Test for MMC, to test use in cmd: python.exe -m unittest test_XXXXX.py ...
apache-2.0
-3,239,018,861,716,547,000
36.918129
80
0.572949
false
ujdhesa/unisubs
apps/videos/views.py
1
40464
# Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
agpl-3.0
1,893,509,965,617,708,800
38.670588
121
0.627051
false
ToontownUprising/src
toontown/nametag/Nametag2d.py
1
10929
from direct.task.Task import Task import math from panda3d.core import PGButton, VBase4, DepthWriteAttrib, Point3 from toontown.chat.ChatBalloon import ChatBalloon from toontown.margins import MarginGlobals from toontown.margins.MarginVisible import MarginVisible from toontown.nametag import NametagGlobals from toonto...
mit
4,598,167,220,696,883,700
33.805732
94
0.620093
false
lucastheis/cmt
code/cmt/python/tests/stm_test.py
1
8330
import sys import unittest from numpy import * from numpy import max, min from numpy.random import * from pickle import dump, load from tempfile import mkstemp from cmt.models import STM, GLM, Bernoulli, Poisson from cmt.nonlinear import LogisticFunction, ExponentialFunction from scipy.stats import norm class Tests(u...
mit
-6,274,521,801,595,028,000
25.957929
90
0.655582
false
d0c-s4vage/pipless
docs/conf.py
1
9492
# -*- coding: utf-8 -*- # # pipless documentation build configuration file, created by # sphinx-quickstart on Fri Sep 2 01:39:02 2016. # # 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. # # A...
mit
6,915,282,151,394,304,000
31.731034
150
0.70807
false
tommyogden/maxwellbloch
setup.py
1
2118
"""MaxwellBloch MaxwellBloch is a Python package for solving the coupled Maxwell-Bloch equations describing the nonlinear propagation of near-resonant light through thermal atomic vapours. """ import os import textwrap from setuptools import setup, find_packages import subprocess DESCRIPTION = "A Python package f...
mit
-6,282,543,788,265,770,000
29.695652
80
0.660057
false
signalfx/maestro-ng
maestro/entities.py
1
35993
# Copyright (C) 2013-2014 SignalFuse, Inc. # Copyright (C) 2015-2019 SignalFx, Inc. # # Docker container orchestration utility. import bgtunnel import collections import datetime import time import os # Import _strptime manually to work around a thread safety issue when using # strptime() from threads for the first t...
apache-2.0
8,911,041,435,713,636,000
36.847529
97
0.572
false
percival-detector/odin-data
tools/python/odin_data/meta_listener_adapter.py
1
7328
import logging from tornado import escape from odin.adapters.adapter import ApiAdapterResponse, \ request_types, response_types from odin_data.odin_data_adapter import OdinDataAdapter class MetaListenerAdapter(OdinDataAdapter): """An OdinControl adapter for a MetaListener""" def __init__(self, **kwarg...
apache-2.0
4,103,719,632,012,855,000
37.978723
99
0.593068
false
Kronuz/pyXapiand
xapiand/search.py
1
11782
from __future__ import unicode_literals, absolute_import import base64 import logging import xapian from . import json from .core import get_slot, get_prefix, expand_terms, find_terms, DOCUMENT_CUSTOM_TERM_PREFIX from .serialise import normalize, serialise_value from .exceptions import XapianError MAX_DOCS = 10000 ...
gpl-2.0
5,752,482,212,671,406,000
36.28481
121
0.496605
false
luigiberrettini/Kiln-to-GitHub
kiln_repo_list.py
1
1422
import requests from anvil import Anvil def main(): requests.packages.urllib3.disable_warnings() in_file = open("./kiln_base_url.txt", "r") base_url = in_file.read().replace('\n', '') in_file.close() anvil = Anvil(base_url, False) anvil.create_session_by_prompting() repo_indices = set() ...
mit
3,321,808,101,163,100,700
33.682927
93
0.489451
false
AlexandreDecan/multiwords
rims.py
1
1223
#!/usr/bin/python """ Module that provides several functions to handle (un)rimmed words. """ import words def rims_of(word): """ Return the rims for the given word. A rim is a (nonempty) word u such that w = u.s = p.u' for some s,p,u' such that |u'| = |u|, and u' and u agree on every position except ...
apache-2.0
-7,824,436,984,240,739,000
29.575
78
0.609975
false
cemarchi/biosphere
Src/BioDataManagement/DataAccess/Repositories/DnaMethylationSampleRepository.py
1
1967
from typing import List, Dict from Src.BioDataManagement.CrossCutting.Contracts.DnaMethylationSampleRepositoryBase import \ DnaMethylationSampleRepositoryBase from Src.BioDataManagement.CrossCutting.DTOs.DnaMethylationSampleDto import DnaMethylationSampleDto from Src.BioDataManagement.CrossCutting.Filters import F...
bsd-3-clause
-3,809,271,948,774,501,400
41.76087
99
0.646162
false
xiaohan2012/snpp
tests/test_signed_graph.py
1
1749
""" For the utilities """ import contexts as ctx import numpy as np from scipy.sparse import csr_matrix, isspmatrix_csr from snpp.utils.signed_graph import symmetric_stat, \ fill_diagonal, \ make_symmetric, \ matrix2graph def test_symmetric_stat(Q1_d): c_sym, c_consis = symmetric_stat(Q1_d) asser...
mit
6,050,825,672,574,178,000
27.672131
86
0.532876
false
sandeez/lino-book_locator
locate/locate/lib/books/models.py
1
4811
from lino.api import dd from django.db import models class Floor(dd.Model): number = models.IntegerField('Number', null=False) def __unicode__(self): return 'Floor: {0}'.format(self.number) class Meta: verbose_name = 'Floor' verbose_name_plural = 'Floors' class Room(dd.Model): ...
bsd-2-clause
1,497,361,167,193,368,000
27.467456
104
0.561214
false
ryos36/polyphony-tutorial
Life/life_one.py
1
2840
import polyphony from polyphony import module, pure from polyphony import testbench from polyphony.io import Port from polyphony.typing import bit, uint3, uint4, List from polyphony.timing import clksleep, clkfence, wait_rising, wait_falling @module class life: def __init__(self): self.i_bit4 = Port(uin...
mit
7,964,215,205,951,401,000
21.362205
74
0.415493
false
bytedance/fedlearner
web_console_v2/api/test/fedlearner_webconsole/scheduler/workflow_commit_test.py
1
5229
# Copyright 2021 The FedLearner 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
-1,008,619,520,266,837,200
36.489209
76
0.617156
false
xmxjq/phoneyc-SjtuISADTeam
phoneyc.py
1
6820
#!/usr/bin/env python """ Synopsis: PHoneyC: Pure python honeyclient implementation. Usage: python phoneyc.py [ options ] url Options: -h , --help Display this help information. -l <filename> , --logfile=<filename> Output file name for logs. -v ...
gpl-2.0
8,244,649,507,720,224,000
32.431373
129
0.516422
false
itucsdb1621/itucsdb1621
tags.py
1
2795
import psycopg2 from flask import Flask from flask import render_template, request from flask import Blueprint, current_app,session,redirect, url_for #declaring sub app with blueprint tags_app = Blueprint('tags_app', __name__) @tags_app.route('/add_tag/<photo_id>/', methods=["POST"]) def add_tag(photo_id): # a po...
gpl-3.0
-8,171,542,644,453,910,000
41.348485
179
0.647227
false
changhoonhahn/centralMS
centralms/tests/test_sfrs.py
1
1027
''' Test functions for handling star formation rates ''' import numpy as np from scipy.integrate import odeint import sfrs as SFR def IntegrationTest(): ''' Simple test the integration ''' logsfr = lambda mstar, t: np.log10(t**2) for tt in np.arange(1., 11., 1.): M_int = SFR.integ...
mit
-3,111,330,352,351,419,400
19.54
76
0.555015
false
robosafe/mc-vs-bdi
models/pta_models/table/legible_full/extract.py
1
8357
#!/usr/bin/env python # This script translates and separates the traces computed with UPPAAL model checking and the tracer tool (libutap). The traces are originally in a *.xtr file format. The specified automata transitions are separated from the global traces (the human, the setting of gaze, pressure and location), an...
gpl-3.0
51,145,047,482,889,110
34.261603
463
0.630848
false
akshayka/bft2f
bft2f.py
1
3641
#!/usr/bin/python import sys import os from mininet.topo import Topo from mininet.node import CPULimitedHost from mininet.link import TCLink from mininet.net import Mininet from mininet.log import lg, info from mininet.util import dumpNodeConnections from mininet.cli import CLI from mininet.util import pmonitor from s...
gpl-2.0
563,290,887,564,789,900
32.1
193
0.61192
false
alexanderAustin/PythonGame
test.py
1
2259
# This was built from the tutorial https://www.raywenderlich.com/24252/beginning-game-programming-for-teens-with-python import pygame, math, random from pygame.locals import * import pyganim # 2 - Initialize the game pygame.init() width, height = 640, 480 screen=pygame.display.set_mode((width, height)) pygame.display...
apache-2.0
5,823,003,622,661,369,000
29.958904
119
0.678619
false
Caian/ostools
oslib/__init__.py
1
1251
#!/usr/bin/env python3 # MIT License # # Copyright (c) 2017 Caian Benedicto # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights #...
mit
-590,005,395,829,594,500
45.333333
80
0.77458
false
michel-slm/0install
tests/testescaping.py
1
2832
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import basetest from basetest import BaseTest import sys, os, re import unittest sys.path.insert(0, '..') from zeroinstall.injector import model from zeroinstall.support import escaping safe = re.compile('^[-.a-zA-Z0-9_]*$') class ...
lgpl-2.1
-8,598,118,403,903,593,000
31.906977
123
0.674205
false
imtapps/django-dynamic-validation
dynamic_validation/migrations/0002_auto__add_field_violation_silent.py
1
3111
# -*- 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): # Adding field 'Violation.silent' db.add_column('dynamic_validation_violation', 'silent', ...
bsd-2-clause
6,311,877,027,371,380,000
56.62963
166
0.569913
false
hodgestar/graas
graas/cli.py
1
1213
""" Command for launching GRaaS. """ import sys import click from twisted.internet import reactor from twisted.python import log from twisted.web.server import Site from .api import GraasApi from .devserver import GraasServerFactory @click.command("graas") @click.version_option() @click.option( '--host', '-h'...
bsd-3-clause
7,179,159,240,244,600,000
24.808511
69
0.658697
false
infobloxopen/infoblox-client
infoblox_client/object_manager.py
1
21402
# Copyright 2015 Infoblox 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...
apache-2.0
-3,936,074,170,078,028,300
43.40249
79
0.48944
false
plantigrade/geni-tools
src/gcf-gch.py
1
6022
#!/usr/bin/env python #---------------------------------------------------------------------- # Copyright (c) 2012-2015 Raytheon BBN Technologies # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and/or hardware specification (the "Work") to # deal in the Work without ...
mit
-3,464,075,406,930,950,000
36.874214
106
0.639489
false
IvIePhisto/ECoXiPy
ecoxipy/pyxom/_document.py
1
17879
# -*- coding: utf-8 -*- import collections from xml.sax.xmlreader import AttributesImpl from ecoxipy import _python2, _unicode from ecoxipy import _helpers from ._common import XMLNode, ContainerNode, _string_repr from ._content_nodes import Text from .indexing import (IndexDescriptor, ElementByUniqueAttributeValueIn...
mit
-2,128,559,108,914,202,400
37.534483
86
0.606578
false
status-im/status-react
test/appium/tests/conftest.py
1
13196
import requests import pytest import re from _pytest.runner import runtestprotocol from http.client import RemoteDisconnected from support.device_stats_db import DeviceStatsDB from support.test_rerun import should_rerun_test from tests import test_suite_data, appium_container from datetime import datetime from os impor...
mpl-2.0
520,488,454,995,145,340
40.2375
138
0.554032
false
Yangqing/caffe2
caffe2/python/layers/fc.py
1
3042
# Copyright (c) 2016-present, Facebook, 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
-1,604,963,854,280,311,300
40.108108
80
0.589415
false
janpipek/boadata
boadata/gui/qt/views/histogram_view.py
1
1199
from .view import View from ..backends.matplotlib import MatplotlibBackend from boadata import unwrap import seaborn as sns # @View.register_view class HistogramView(View): def accepts(cls, data_object): return True def create_widget(self, parent=None, xcol=None, bins=50, **kwargs): if xcol i...
mit
-1,467,702,614,424,234,500
30.578947
88
0.57548
false
mycointest/owncoin
share/seeds/generate-seeds.py
1
4297
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
mit
6,910,685,491,095,861,000
30.82963
98
0.575983
false
fhqgfss/MoHa
moha/posthf/ci/configuration.py
1
1441
import numpy as np import copy import itertools from moha.system.basis import SlaterDeterminant,NElectronBasisSet class Configuration(object): """ """ def __init__(self): """ """ pass @classmethod def truncated(cls,hfwavefunction,excitation_level): """ excit...
mit
-5,836,256,464,177,644,000
32.511628
75
0.485774
false
jcfr/girder
tests/test_plugins/test_plugin/server.py
1
1795
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
4,997,767,409,729,860,000
30.491228
79
0.630641
false
mkobos/tree_crawler
concurrent_tree_crawler/tree_accessor.py
1
3966
import logging import threading from concurrent_tree_crawler.abstract_tree_accessor import \ AbstractTreeAccessor, NodeAction from concurrent_tree_crawler.abstract_node import NodeState class TreeAccessor(AbstractTreeAccessor): """ An interface for the tree made of L{AbstractNode}s. Access to sensitive methods i...
mit
-5,910,058,468,039,156,000
30.736
76
0.688603
false
danakj/chromium
services/shell/public/tools/manifest/manifest_collator.py
1
2806
#!/usr/bin/env python # Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ A collator for Service Manifests """ import argparse import json import os import shutil import sys import urlparse eater_relativ...
bsd-3-clause
4,538,789,842,080,426,000
25.980769
76
0.650036
false
skevy/django
django/db/models/fields/related.py
1
54908
from django.conf import settings from django.db import connection, router, transaction from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from dja...
bsd-3-clause
-3,232,830,973,483,323,000
45.889838
222
0.602153
false
noironetworks/heat
heat/engine/resources/openstack/designate/zone.py
1
5889
# # 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, software # ...
apache-2.0
857,568,286,610,432,500
31.716667
78
0.587366
false
selboo/starl-mangle
webvirtmgr/webvirtmgr/server.py
1
30677
# Utility functions used for guest installation # import libvirt from libvirt import VIR_DOMAIN_XML_SECURE from network.IPy import IP import re import time import libxml2 from datetime import datetime import string def get_xml_path(xml, path=None, func=None): """ Return the content from the passed xml xpath,...
apache-2.0
-4,393,413,968,680,874,500
29.800201
148
0.478991
false
mitodl/open-discussions
open_discussions/authentication.py
1
2405
"""Custom authentication for DRF""" import logging from django.contrib.auth import get_user_model import jwt from rest_framework.authentication import BaseAuthentication from rest_framework_jwt.authentication import JSONWebTokenAuthentication User = get_user_model() HEADER_PREFIX = "Token " HEADER_PREFIX_LENGTH = l...
bsd-3-clause
-7,893,392,934,490,459,000
30.233766
90
0.656133
false
UnitedThruAction/Data
Tools/StandardizeAddress.py
1
4188
"""Standardize a list of addresses using the USPS API. Multi-threaded, since the API response time is slow. Get an API key at https://registration.shippingapis.com. """ from __future__ import print_function import threading import sys import pandas as pd from tqdm import tqdm from collections import deque from pyusp...
apache-2.0
227,579,348,872,957,340
32.504
92
0.546323
false
pombredanne/pytype
pytype/pyc/opcodes_test.py
1
52430
from pytype.pyc import opcodes import unittest class Python2Test(unittest.TestCase): """Test bytecodes.dis for Python 2 opcodes.""" PYTHON_VERSION = (2, 7, 6) def dis(self, data): return opcodes.dis(data, self.PYTHON_VERSION) def test_stop_code(self): self.assertEquals(self.dis('\x00')[0].name, 'ST...
apache-2.0
-2,192,197,559,645,915,400
35.034364
79
0.625424
false
ikargis/horizon_fod
openstack_dashboard/api/glance.py
1
3362
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
2,677,192,707,964,886,500
29.844037
78
0.649018
false
alex/changes
changes/api/project_test_history.py
1
2669
from __future__ import absolute_import, division, unicode_literals from flask.ext.restful import reqparse from sqlalchemy.orm import contains_eager, joinedload from changes.api.base import APIView from changes.constants import Status from changes.models import Project, TestCase, Job, Source class ProjectTestHistory...
apache-2.0
2,706,287,891,616,317,400
37.128571
86
0.606969
false
masfaraud/volmdlr
scripts/distance/tore_tore.py
1
4675
# -*- coding: utf-8 -*- """ Created on Tue Jun 2 14:15:50 2020 @author: Mack Pro """ import numpy as npy import volmdlr as volmdlr import volmdlr.primitives3D as primitives3D import volmdlr.primitives2D as primitives2D import matplotlib.pyplot as plt import random import math rmin, rmax = 100, 1000 posmin, posmax =...
gpl-3.0
296,104,524,173,989,760
45.75
239
0.73861
false
thinkobscure/PantheROV
topside/SDL/endian.py
1
1027
#!/usr/bin/env python '''Functions for converting to native byte order ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import sys import SDL.constants def SDL_Swap16(x): return (x << 8 & 0xff00) | \ (x >> 8 & 0x00ff) def SDL_Swap32(x): return (x << 24 & 0xff000000) | \ ...
gpl-3.0
-3,626,432,104,365,442,600
21.326087
49
0.584226
false
gmariotti/lassim
source/core/lassim_context.py
1
4587
from logging import Logger from typing import Dict, Type, Callable, List, Optional import psutil from core.base_solution import BaseSolution from core.core_system import CoreSystem from core.utilities.type_aliases import Vector __author__ = "Guido Pio Mariotti" __copyright__ = "Copyright (C) 2016 Guido Pio Mariotti"...
gpl-3.0
5,525,869,121,874,791,000
30.417808
80
0.615871
false
jingriver/stocktracker
pytoolkit/randombitmap/bitmap.py
1
1072
from PIL import Image import random size = (640, 640) black = (0,0,0) white = (255,255,255) def draw(size): im = Image.new("RGB", size) ll = [] for i in range(size[0]): for j in range(size[1]): if random.random()>0.5: ll.append(white) else: ...
mit
6,033,678,608,516,749,000
20.375
91
0.476679
false
wangkua1/sportvu
sportvu/data/extractor.py
1
17452
from __future__ import division import cPickle as pickle import yaml import os from sportvu import data import numpy as np import yaml from utils import (pictorialize_team, pictorialize_fast, make_3teams_11players, make_reference, scale_last_dim) game_dir = data.constant.game_dir class ExtractorExcep...
mit
1,836,699,956,899,260,200
43.182278
169
0.527962
false
CollabQ/CollabQ
.google_appengine/google/appengine/api/images/images_stub.py
1
15868
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
-8,046,123,606,114,034,000
33.051502
79
0.664104
false
chappers/sklearn-recipes
streaming_take2/dpp_classifier_dpp_only.py
1
13063
import sklearn from sklearn.datasets import make_regression, make_classification from sklearn.linear_model import SGDRegressor, SGDClassifier from sklearn.preprocessing import MinMaxScaler from sklearn.metrics.pairwise import euclidean_distances import pandas as pd import numpy as np from scipy import stats from sci...
mit
1,082,041,100,579,539,800
35.8
136
0.569318
false
sony/nnabla
python/test/communicator/test_all_reduce.py
1
4846
# Copyright 2017,2018,2019,2020,2021 Sony Corporation. # # 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,594,287,679,990,989,000
30.673203
100
0.645894
false
ym2050/pythonpractice
CF_SVD++_K-means/refine/utils.py
1
4130
from __future__ import (absolute_import, division, print_function, unicode_literals) # 下一个新版本的特性导入到当前版本,可以在当前版本中使用一些新版本的特性,必须放在文档开头 ''' 工具类与工具方法 ''' # from builtins import * # 引入内建模块,该模块中有一些常用函数;而该模块在Python启动后、且没有执行程序员所写的任何代码前, # Python会首先加载该内建函数到内存,如str(),min(),max()等常用函数,不是必要 import t...
gpl-3.0
-5,676,998,464,668,595,000
25.495798
96
0.564792
false
eeshangarg/zulip
zerver/lib/email_notifications.py
1
28170
# See https://zulip.readthedocs.io/en/latest/subsystems/notifications.html import re from collections import defaultdict from datetime import timedelta from email.headerregistry import Address from typing import Any, Dict, Iterable, List, Optional, Tuple import html2text import lxml.html import pytz from bs4 import B...
apache-2.0
-4,329,368,778,265,539,600
39.416069
123
0.625204
false
Guiiix/ip150_interfacer
classes/Interfacer.py
1
5394
from classes.Parser import Parser from classes.Paracrypt import Paracrypt from threading import Thread import urllib2 import time import random class Interfacer: def __init__(self, ip, port, username, password, verbose_level, zones_identifier, area_identifier, ses_identifier, status_identifier, states_identifier, ...
gpl-3.0
2,701,808,814,002,473,000
25.975
117
0.673526
false
markgw/jazzparser
lib/nltk/tokenize/api.py
1
2128
# Natural Language Toolkit: Tokenizer Interface # # Copyright (C) 2001-2010 NLTK Project # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT """ Tokenizer Interface """ from nltk.internals import overridden from util import string_span_tokeni...
gpl-3.0
3,250,222,746,014,356,000
27
75
0.600094
false
koomik/CouchPotatoServer
couchpotato/core/media/_base/providers/torrent/torrentday.py
1
3584
from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider log = CPLog(__name__) class Base(TorrentProvider): urls = { 'test': 'http://www.td.af/', 'login': 'http://www.td.af/torre...
gpl-3.0
-641,086,129,201,212,200
30.716814
99
0.429129
false
bitmovin/bitmovin-python
bitmovin/resources/models/encodings/muxings/information/progressive_ts_information.py
1
4987
from bitmovin.resources import Resource from bitmovin.resources.models.encodings.muxings.information import ByteRange from bitmovin.errors import InvalidTypeError from bitmovin.utils.serialization import Serializable from .muxing_information_video_track import MuxingInformationVideoTrack from .muxing_information_audio...
unlicense
-5,852,554,402,090,742,000
39.544715
116
0.594947
false
bosichong/17python.com
thread/threadlock.py
1
2692
#codeing=utf-8 # @Time : 2017-10.04 # @Author : J.sky # @Mail : bosichong@qq.com # @Site : www.17python.com # @Title : Python多线程编程(2)多线程锁 threading.Lock # @Url : http://www.17python.com/blog/33 # @Details : Python多线程编程(2)多线程锁 threading.Lock # @Other : OS X 10.11.6 # Python 3.6.1 # ...
apache-2.0
8,619,549,271,112,287,000
21.21519
96
0.607184
false
gaetano-guerriero/eyeD3-debian
src/eyed3/utils/console.py
1
18555
# -*- coding: utf-8 -*- from __future__ import print_function import os import struct import sys import time from . import formatSize, formatTime from .. import LOCAL_ENCODING, compat from .log import log try: import fcntl import termios import signal _CAN_RESIZE_TERMINAL = True except ImportError: ...
gpl-3.0
7,526,668,568,266,435,000
31.031088
80
0.463496
false
NicoSantangelo/sublime-gulp
base_command.py
1
5042
import sublime import sublime_plugin import os.path is_sublime_text_3 = int(sublime.version()) >= 3000 if is_sublime_text_3: from .settings import Settings from .status_bar import StatusBar from .insert_in_output_view import insert_in_output_view from .timeout import set_timeout, defer_sync else: ...
mit
4,268,979,282,055,752,000
36.626866
154
0.639825
false
loonycyborg/scons-plusplus
python_modules/Tool/lex.py
1
4870
"""SCons.Tool.lex Tool-specific initialization for lex. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to...
gpl-3.0
1,416,306,155,329,501,000
33.539007
114
0.674127
false
attm2x/m2x-python
m2x/tests/test_utils.py
1
3024
from datetime import datetime from iso8601 import iso8601 from m2x import utils class TestUtils(object): def test_to_utc(self): dtime = datetime.now() utc_dtime = utils.to_utc(dtime) assert utc_dtime.tzinfo == iso8601.UTC def test_to_iso(self): dtime = iso8601.parse_date('20...
mit
-6,358,644,146,657,331,000
36.333333
78
0.549934
false
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_12_01/models/virtual_machine_scale_set_vm.py
1
7939
# 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 ...
mit
385,435,582,843,014,660
50.219355
170
0.666835
false
ryansb/tremendous
tremendous/colors.py
1
12059
from functools import partial from tremendous.api import ( apply_color, apply_256, apply_256_bg, apply_256_hl, ) from tremendous.bindings import lib as __lib from tremendous.bindings import ffi colors_16 = dict( bold=__lib.BOLD, italic=__lib.ITALIC, under=__lib.UNDER, under2=__lib.UNDE...
mit
2,573,298,628,492,698,000
37.404459
74
0.43992
false
kuba/letsencrypt
acme/acme/messages.py
1
13660
"""ACME protocol messages.""" import collections from acme import challenges from acme import errors from acme import fields from acme import jose from acme import util class Error(jose.JSONObjectWithFields, errors.Error): """ACME error. https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00 :i...
apache-2.0
6,495,732,572,067,539,000
30.693735
82
0.651171
false
tstenner/bleachbit
tests/TestInit.py
1
1924
# vim: ts=4:sw=4:expandtab # coding=utf-8 # BleachBit # Copyright (C) 2008-2020 Andrew Ziem # https://www.bleachbit.org # # 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...
gpl-3.0
-5,291,252,514,280,642,000
30.032258
71
0.648649
false
Marzona/rig-remote
test/test_queuecomms.py
1
2132
#!/usr/bin/env python # import modules import pytest from rig_remote.queue_comms import QueueComms from rig_remote.constants import QUEUE_MAX_SIZE from Queue import Queue, Empty, Full def test_queued_for_parent1(): qc=QueueComms() qc.parent_queue.put("2") qc.parent_queue.get() assert(qc.queued_for_par...
mit
-5,075,182,294,116,822,000
24.082353
47
0.643996
false
GoogleCloudPlatform/functions-framework-python
tests/test_functions/http_flask_render_template/main.py
1
1531
# 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 agreed to in writing, ...
apache-2.0
-5,523,064,124,783,055,000
34.604651
80
0.713259
false
dims/cinder
cinder/volume/drivers/vmware/volumeops.py
1
68569
# Copyright (c) 2013 VMware, 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...
apache-2.0
7,185,271,924,319,432,000
42.646722
79
0.567895
false
bireme/isisdm
isis/model/tests/test_ordered.py
1
2207
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Em Python os atributos de uma classe são armazenados em um `dict`, portanto sua ordem não é preservada. Normalmente a ordem não é realmente importante. Note no exemplo abaixo que a lista devolvida por `dir(l)` não preserva a ordem em que foram declarados os atributo...
gpl-2.0
2,476,869,298,126,630,000
28.621622
92
0.612049
false
willblev/RNA_TwiZe
rna_twize.py
1
12512
import Tkinter import tkFileDialog import tkMessageBox from Tkinter import * import os import sys from math import factorial class Unbuffered(object): """Attempts to create an unbuffered STDOUT""" def __init__(self, stream): self.stream = stream def write(self, data): self.stream.write(data) self.stream.fl...
gpl-3.0
-2,537,356,710,290,258,400
39.7557
352
0.706682
false
nriley/NewsBlur
apps/rss_feeds/icon_importer.py
2
13539
import urllib2 import lxml.html import numpy import scipy import scipy.misc import scipy.cluster import urlparse import struct import operator import gzip import datetime import requests import httplib from PIL import BmpImagePlugin, PngImagePlugin, Image from socket import error as SocketError from boto.s3.key import ...
mit
-3,460,954,564,688,705,500
35.395161
128
0.532609
false
johnnoone/aiovault
tests/test_ldap.py
1
1590
from aiovault import Vault from conftest import async_test import pytest @async_test def test_ldap(dev_server): client = Vault(dev_server.addr, token=dev_server.root_token) backend = yield from client.auth.enable('ldap') configured = yield from backend.configure(url='ldap://ldap.forumsys.com', ...
bsd-3-clause
9,064,265,453,553,204,000
32.829787
78
0.579245
false
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/write_concern.py
1
4561
# Copyright 2014-2015 MongoDB, 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 writin...
bsd-3-clause
2,093,304,799,596,190,200
40.463636
82
0.623328
false
HHSIDEAlab/hhs_ansible
lib/mark_deployment.py
1
1988
import argparse import json import sys import urllib.request from argparse import RawTextHelpFormatter DESCRIPTION = """ Mark a new deployment in New Relic Example: python ./lib/mark_deployment.py \\ --api_key API_KEY_GOES_HERE \\ --app_id APP_ID_GOES_HERE \\ --version VERSION_STRING_GO...
gpl-2.0
9,018,319,330,410,440,000
24.818182
83
0.607646
false
wking/pygrader
pygrader/model/assignment.py
1
1233
# Copyright (C) 2012 W. Trevor King <wking@tremily.us> # # This file is part of pygrader. # # pygrader is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any l...
gpl-3.0
-1,820,910,119,033,053,400
36.363636
79
0.6691
false
avastjohn/maventy_new
growthcalc/growthcalc.py
1
22700
''' Created on Sep 18, 2011 @author: mike ''' import logging import healthdb.util import math from xml.dom import minidom import time from datetime import datetime from google.appengine.ext import db from google.appengine.api import datastore_errors import urllib2 import urllib from xml.parsers.expat import ExpatE...
bsd-3-clause
5,793,959,453,705,045,000
36.959866
202
0.662643
false
dladd/pyFormex
pyformex/compat_2k.py
1
1618
# $Id$ ## ## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012) ## pyFormex is a tool for generating, manipulating and transforming 3D ## geometrical models by sequences of mathematical operations. ## Home page: http://pyformex.org ## Project page: http://savannah.nongnu.org/projects/pyformex/ ##...
gpl-3.0
-7,526,737,087,426,599,000
38.463415
77
0.747837
false