repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
PercyLau/oonSIM
NFD/.waf-tools/websocket.py
18
3039
# encoding: utf-8 from waflib import Options, Logs, Errors from waflib.Configure import conf import re def addWebsocketOptions(self, opt): opt.add_option('--without-websocket', action='store_false', default=True, dest='with_websocket', help='Disable WebSocket face support') ...
gpl-3.0
-5,691,626,072,744,170,000
37.468354
115
0.630141
false
joshpelkey/cmap-parse
cmap_parse.py
1
11702
## # # cmap_parse.py # An attempt to parse concept maps, exported from cmap tools...take one # # Copyright 2016 Josh Pelkey # # 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...
apache-2.0
-3,076,254,453,924,928,000
43.664122
164
0.443941
false
loop1024/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/zipfile.py
4
54030
""" Read and write ZIP files. """ import struct, os, time, sys, shutil import binascii, cStringIO, stat import io import re try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib = None crc32 = binascii.crc32 __all__ = ["BadZipfile", "error", "ZIP_STORED", "Z...
mit
-3,206,429,268,566,563,000
36.599165
103
0.555062
false
nazo/ansible
lib/ansible/modules/windows/win_robocopy.py
72
4833
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Corwin Brown <blakfeld@gmail.com> # # This file is part of Ansible # # Ansible 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
8,080,699,289,279,458,000
30.383117
160
0.683633
false
bis12/pushmanager
tests/test_template_push.py
3
7070
import time import testing as T class PushTemplateTest(T.TemplateTestCase): authenticated = True push_page = 'push.html' push_status_page = 'push-status.html' accepting_push_sections = ['blessed', 'verified', 'staged', 'added', 'pickme', 'requested'] now = time.time() basic_push = { ...
apache-2.0
3,026,572,554,180,221,400
30.846847
95
0.534512
false
dischinator/pyload
module/plugins/hoster/PornhubCom.py
5
2547
# -*- coding: utf-8 -*- import re from module.plugins.internal.Hoster import Hoster class PornhubCom(Hoster): __name__ = "PornhubCom" __type__ = "hoster" __version__ = "0.55" __status__ = "testing" __pattern__ = r'http://(?:www\.)?pornhub\.com/view_video\.php\?viewkey=\w+' __config__...
gpl-3.0
1,785,887,796,485,136,000
26.387097
162
0.522183
false
happyleavesaoc/home-assistant
homeassistant/helpers/event.py
4
11145
"""Helpers for listening to events.""" import functools as ft from homeassistant.helpers.sun import get_astral_event_next from ..core import HomeAssistant, callback from ..const import ( ATTR_NOW, EVENT_STATE_CHANGED, EVENT_TIME_CHANGED, MATCH_ALL) from ..util import dt as dt_util from ..util.async import run_call...
apache-2.0
-4,232,743,945,368,165,000
31.587719
78
0.635083
false
pywikibot-catfiles/file-metadata
setupdeps.py
2
16766
# -*- coding: utf-8 -*- """ Various dependencies that are required for file-metadata which need some special handling. """ from __future__ import (division, absolute_import, unicode_literals, print_function) import ctypes.util import hashlib import os import subprocess import sys from distutil...
mit
5,325,013,657,302,106,000
28.00692
78
0.556543
false
elektito/pybtracker
pybtracker/client.py
1
13320
import asyncio import os import struct import logging import random import cmd import argparse from urllib.parse import urlparse from collections import defaultdict from ipaddress import ip_address from datetime import datetime, timedelta from version import __version__ class ServerError(Exception): pass class Ud...
mit
-665,871,698,634,884,000
32.807107
90
0.555856
false
bmhatfield/Diamond
src/collectors/openstackswift/openstackswift.py
31
3996
# coding=utf-8 """ Openstack swift collector. #### Dependencies * swift-dispersion-report commandline tool (for dispersion report) if using this, make sure swift.conf and dispersion.conf are readable by diamond also get an idea of the runtime of a swift-dispersion-report call and make sure the collect inte...
mit
292,039,663,780,110,000
41.063158
79
0.543293
false
haad/ansible
lib/ansible/modules/network/f5/bigip_monitor_http.py
3
18788
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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
3,511,605,982,378,780,000
29.952224
92
0.601874
false
flavour/cedarbluff
modules/s3/fontmap/SazanamiMincho.py
58
68515
#!/usr/bin/env python SazanamiMincho_map = [ (0, 1), (32, 127), (160, 384), (402, 403), (461, 477), (501, 502), (506, 512), (592, 681), (710, 712), (713, 716), (728, 734), (884, 886), (890, 891), (894, 895), (900, 907), (908, 909), (910, 930), (931, 975), (976, 978), (981, 982), (1013, 1014), (1025, 1037), (1038, 1104)...
mit
-7,270,062,047,885,370,000
14.96342
22
0.624184
false
drammock/mne-python
mne/preprocessing/realign.py
7
3982
# -*- coding: utf-8 -*- # Authors: Eric Larson <larson.eric.d@gmail.com> # License: BSD (3-clause) import numpy as np from ..io import BaseRaw from ..utils import _validate_type, warn, logger, verbose @verbose def realign_raw(raw, other, t_raw, t_other, verbose=None): """Realign two simultaneous recordings. ...
bsd-3-clause
1,552,136,163,736,269,800
36.556604
79
0.620447
false
hef/samba
lib/testtools/testtools/tests/matchers/helpers.py
14
1643
# Copyright (c) 2008-2012 testtools developers. See LICENSE for details. from testtools.tests.helpers import FullStackRunTest class TestMatchersInterface(object): run_tests_with = FullStackRunTest def test_matches_match(self): matcher = self.matches_matcher matches = self.matches_matches ...
gpl-3.0
-6,453,091,210,964,741,000
38.119048
75
0.662203
false
apple/swift-lldb
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py
5
5722
from __future__ import print_function import gdbremote_testcase from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestGdbRemote_vCont(gdbremote_testcase.GdbRemoteTestCaseBase): mydir = TestBase.compute_mydir(__file__) def vCont_supports_...
apache-2.0
3,233,518,604,053,807,600
34.540373
99
0.62985
false
brianwoo/django-tutorial
build/Django/tests/model_meta/results.py
23
26393
from .models import AbstractPerson, BasePerson, Person, Relating, Relation TEST_RESULTS = { 'get_all_field_names': { Person: [ 'baseperson_ptr', 'baseperson_ptr_id', 'content_type_abstract', 'content_type_abstract_id', 'content_type_base', ...
gpl-3.0
-393,506,489,255,478,900
32.240554
74
0.451218
false
indhub/mxnet
example/speech_recognition/stt_layer_batchnorm.py
52
1994
# 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
-5,622,036,292,233,558,000
38.88
65
0.521565
false
MatteoNardi/dyanote-server
api/views.py
1
1637
from django.contrib.auth.models import User from rest_framework import mixins from rest_framework import generics from rest_framework import renderers from rest_framework import permissions from rest_framework import status from rest_framework.decorators import api_view from rest_framework.response import Response from...
mit
2,222,135,767,610,232,600
29.886792
70
0.723274
false
eonpatapon/nova
nova/api/openstack/compute/views/flavors.py
49
3452
# Copyright 2010-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...
apache-2.0
-9,068,043,544,424,487,000
36.11828
78
0.54606
false
tobiasgehring/qudi
hardware/awg/tektronix_awg70k.py
1
63429
# -*- coding: utf-8 -*- """ This file contains the Qudi hardware module for AWG70000 Series. Qudi 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 ve...
gpl-3.0
7,061,621,111,263,829,000
44.081023
119
0.566239
false
sdague/home-assistant
homeassistant/components/smhi/__init__.py
26
1025
"""Support for the Swedish weather institute weather service.""" from homeassistant.config_entries import ConfigEntry from homeassistant.core import Config, HomeAssistant # Have to import for config_flow to work even if they are not used here from .config_flow import smhi_locations # noqa: F401 from .const import DOM...
apache-2.0
-175,163,716,586,589,380
34.344828
85
0.729756
false
OCA/l10n-brazil
l10n_br_purchase_stock/wizards/stock_invocing_onshipping.py
1
2256
# @ 2021 Akretion - www.akretion.com.br - # Magno Costa <magno.costa@akretion.com.br> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models class StockInvoiceOnshipping(models.TransientModel): _inherit = "stock.invoice.onshipping" def _build_invoice_values_fr...
agpl-3.0
1,582,065,237,709,572,900
34.777778
87
0.59583
false
cloudera/recordservice
thirdparty/thrift-0.9.0/test/py/TestServer.py
30
7232
#!/usr/bin/env python # # 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 # "L...
apache-2.0
-2,568,211,774,749,857,300
31.142222
117
0.696626
false
fmacias64/deap
examples/pso/speciation.py
12
6672
# This file is part of DEAP. # # DEAP is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of # the License, or (at your option) any later version. # # DEAP is distributed ...
lgpl-3.0
3,291,423,557,657,767,400
35.861878
102
0.593225
false
RedHatQE/cfme_tests
cfme/scripting/conf.py
1
3763
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Script to encrypt config files. Usage: scripts/encrypt_conf.py confname1 confname2 ... confnameN scripts/encrypt_conf.py credentials """ import io import click import yaycl_crypt from . import link_config from cfme.utils import conf @click.group(help='Functi...
gpl-2.0
-8,515,425,333,429,540,000
34.838095
98
0.667021
false
hippyk/pix2code
model/convert_imgs_to_arrays.py
2
1160
#!/usr/bin/env python from __future__ import print_function from __future__ import absolute_import __author__ = 'Tony Beltramelli - www.tonybeltramelli.com' import os import sys import shutil from classes.Utils import * from classes.model.Config import * argv = sys.argv[1:] if len(argv) < 2: print("Error: not e...
apache-2.0
-2,144,922,168,953,959,700
28
110
0.650862
false
jvkops/titanium_mobile
support/android/tilogger.py
37
1757
from __future__ import with_statement import os, sys class TiLogger: ERROR = 0 WARN = 1 INFO = 2 DEBUG = 3 TRACE = 4 def __init__(self, logfile, level=TRACE, output_stream=sys.stdout): self.level = level self.output_stream = output_stream global _logfile _logfile = logfile if _logfile is not None: l...
apache-2.0
-177,229,503,595,410,940
23.746479
99
0.622652
false
subhacom/moose-core
tests/python/test_function.py
2
2728
# test_function.py --- # # Filename: test_function.py # Description: # Author: subha # Maintainer: # Created: Sat Mar 28 19:34:20 2015 (-0400) # Version: # Last-Updated: # By: # Update #: 0 # URL: # Keywords: # Compatibility: # # # Commentary: # # # # # Change log: # # # # # This pr...
gpl-3.0
6,557,834,612,652,690,000
23.8
67
0.631598
false
remybaranx/qtaste
demo/Testbeds/ControlScripts/controlscript_addon.py
1
2642
## # Control script Addon jython module. # # This module contains extention of the ControlScript class: # - VirtualBox: this extention class is to be used to control Sun VirtualBox images. ## from controlscript import * import time class ControlScriptAddon(ControlScript): """ Control script Addon""" def __init__(s...
gpl-3.0
6,501,847,338,255,054,000
40.28125
116
0.745647
false
colbyga/pychess
lib/pychess/Utils/Piece.py
22
1197
from pychess.Utils.const import KING, QUEEN, ROOK, BISHOP, KNIGHT, PAWN from pychess.Utils.repr import reprSign, reprColor, reprPiece class Piece: def __init__ (self, color, piece, captured=False): self.color = color self.piece = piece self.captured = captured # in crazyho...
gpl-3.0
4,497,102,088,175,651,300
31.351351
76
0.53467
false
mmt/deeprl22
hw2/frozen_lake.py
7
4392
import numpy as np import sys from six import StringIO, b from gym import utils import discrete_env LEFT = 0 DOWN = 1 RIGHT = 2 UP = 3 MAPS = { "4x4": [ "SFFF", "FHFH", "FFFH", "HFFG" ], "8x8": [ "SFFFFFFF", "FFFFFFFF", "FFFHFFFF", "FFFFFHFF...
mit
4,770,754,171,500,952,000
32.526718
95
0.497495
false
felipenaselva/felipe.repository
plugin.video.mrpiracy/resources/lib/AADecoder.py
14
8517
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector for openload.io # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # by DrZ3r0 # ------------------------------------------------------------ # Modified by Shani import re class AADec...
gpl-2.0
8,912,127,611,122,123,000
32.971193
129
0.389582
false
pedrobaeza/project-service
project_baseuser/__openerp__.py
2
3592
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2013 # # 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, eith...
agpl-3.0
-2,656,036,770,505,278,000
37.212766
79
0.697105
false
40123237/w17test
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_setups.py
791
16440
import io import sys import unittest def resultFactory(*_): return unittest.TestResult() class TestSetups(unittest.TestCase): def getRunner(self): return unittest.TextTestRunner(resultclass=resultFactory, stream=io.StringIO()) def runTests(self, *cases...
gpl-3.0
-7,169,274,866,471,545,000
31.426036
106
0.535949
false
tpaszkowski/quantum
quantum/openstack/common/uuidutils.py
159
1106
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel Corporation. # 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.apa...
apache-2.0
-7,504,865,618,342,483
27.358974
78
0.700723
false
Urvik08/ns3-gpcr
src/bridge/bindings/modulegen__gcc_ILP32.py
28
168219
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
9,110,006,713,897,814,000
64.378546
381
0.61688
false
SUSE/kiwi
test/unit/package_manager/init_test.py
1
1854
from mock import ( patch, Mock ) from pytest import raises from kiwi.package_manager import PackageManager from kiwi.exceptions import KiwiPackageManagerSetupError class TestPackageManager: def test_package_manager_not_implemented(self): with raises(KiwiPackageManagerSetupError): Package...
gpl-3.0
1,259,736,474,447,080,400
36.08
66
0.704423
false
mxrrow/zaicoin
src/deps/boost/libs/python/pyste/dist/create_build.py
54
1668
# Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) import os import sys import shutil import fnmatch from zipfile import ZipFile, ZIP_DEFLATED def findfiles(directory, mask)...
mit
-8,359,428,074,779,560,000
29.327273
84
0.615707
false
alibbaba/plugin.video.live.streamspro
plugin.video.live.streamspro/resources/lib/resolvers/cloudtime.py
2
1502
# -*- coding: utf-8 -*- ''' Genesis Add-on Copyright (C) 2015 lambda 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 opt...
gpl-2.0
6,154,396,449,308,847,000
29.957447
85
0.601864
false
solintegra/addons
email_template/__init__.py
381
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
5,029,898,068,977,751,000
41.37037
78
0.628497
false
AIFDR/inasafe
safe/metadata35/property/boolean_property.py
6
1694
# -*- coding: utf-8 -*- """ InaSAFE Disaster risk assessment tool developed by AusAid - **metadata module.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 Sof...
gpl-3.0
1,491,817,624,055,527,700
27.711864
78
0.641677
false
ales-erjavec/scipy
benchmarks/benchmarks/fftpack_basic.py
46
2646
""" Test functions for fftpack.basic module """ from __future__ import division, absolute_import, print_function from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble import numpy.fft from numpy.random import rand try: from scipy.fftpack import ifft, fft, fftn, irfft, rfft except ImportError: ...
bsd-3-clause
-995,884,213,733,752,600
22.625
85
0.538171
false
morenopc/edx-platform
cms/djangoapps/contentstore/views/assets.py
3
11648
import logging from functools import partial import math import json from django.http import HttpResponseBadRequest from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django_future.csrf import ensure_csrf_cookie from django.views.decorators.http...
agpl-3.0
7,785,474,822,139,345,000
38.754266
135
0.677713
false
seanandrews/diskpop
phot/priors.py
1
1143
# # # import numpy as np import pandas as pd from scipy.interpolate import interp1d import matplotlib.pyplot as plt import sys # effective temperature prior # inputs Sbar = 60. eSbar = 1. Tinput = 8700. # load spectral type |-> temperature conversion file dt = {'ST': np.str, 'STix': np.float64, 'Teff':np.float64,...
mit
-8,302,033,829,685,894,000
21.86
78
0.620297
false
liama482/Picture
ggame/sysdeps.py
227
1916
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True if module_exists('browser') and module_exists('javascript'): from browser import window, document from javascript import JSObject, JSConstructor GFX = JSObject(w...
mit
-2,017,000,670,574,898,200
27.597015
92
0.656054
false
youprofit/NewsBlur
utils/munin/newsblur_feed_counts.py
10
2628
#!/usr/bin/env python from utils.munin.base import MuninGraph import redis class NBMuninGraph(MuninGraph): @property def graph_config(self): return { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Feed Counts', 'graph_vlabel' : 'Feeds Feed Counts', ...
mit
7,878,823,341,885,764,000
39.430769
82
0.616819
false
gabrielfalcao/lettuce
tests/integration/lib/Django-1.3/django/contrib/flatpages/admin.py
250
1089
from django import forms from django.contrib import admin from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text = _("Example: ...
gpl-3.0
8,087,098,481,861,207,000
37.892857
133
0.630854
false
lcgong/alchemy
redbean/test/security/serv/secure.py
2
2092
import logging logger = logging.getLogger(__name__) from redbean.secure.identity import SessionIdentity from redbean.secure.keeper import UserIdentityKeeper from redbean.asyncid import AsyncID64 from test.security.app import rest, etcd_endpoint user_id_generator = AsyncID64('/asyncid/user_sn', etcd_endpoint) keeper ...
gpl-3.0
-4,719,006,951,941,784,000
24.848101
79
0.715475
false
Panos512/invenio
modules/bibauthorid/lib/bibauthorid_regression_tests.py
5
8601
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 CERN. # # Invenio 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...
gpl-2.0
436,882,294,439,939,140
44.994652
83
0.537496
false
PyroShark/namebench
libnamebench/nameserver_test.py
175
7015
#!/usr/bin/env python # Copyright 2009 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...
apache-2.0
3,601,934,114,177,076,700
38.189944
84
0.699501
false
soldag/home-assistant
tests/components/rfxtrx/test_light.py
14
6854
"""The tests for the Rfxtrx light platform.""" from unittest.mock import call import pytest from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.rfxtrx import DOMAIN from homeassistant.core import State from tests.common import MockConfigEntry, mock_restore_cache from tests.compon...
apache-2.0
-4,125,882,202,051,886,000
33.27
86
0.662533
false
KenKundert/quantiphy
tests/test_unit_conversion.py
1
13490
# encoding: utf8 from quantiphy import ( Quantity, UnitConversion, QuantiPhyError, IncompatibleUnits, UnknownPreference, UnknownConversion, UnknownUnitSystem, InvalidRecognizer, UnknownFormatKey, UnknownScaleFactor, InvalidNumber, ExpectedQuantity, MissingName, ) Quantity.reset_prefs() import math impo...
gpl-3.0
-8,724,361,906,445,110,000
33.464103
85
0.561119
false
quantumlib/OpenFermion
src/openfermion/transforms/repconversions/operator_tapering_test.py
1
1640
# 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 # distribu...
apache-2.0
7,250,514,672,289,180,000
39.02439
76
0.667683
false
gooftroop/Zeus
contrib/tornado/test/tcpserver_test.py
105
1278
import socket from tornado import gen from tornado.iostream import IOStream from tornado.log import app_log from tornado.stack_context import NullContext from tornado.tcpserver import TCPServer from tornado.testing import AsyncTestCase, ExpectLog, bind_unused_port, gen_test class TCPServerTest(AsyncTestCase): @g...
mit
-8,315,910,516,919,921,000
32.631579
80
0.592332
false
yqm/sl4a
python/src/Lib/commands.py
58
2540
"""Execute shell commands via os.popen() and return status, output. Interface summary: import commands outtext = commands.getoutput(cmd) (exitstatus, outtext) = commands.getstatusoutput(cmd) outtext = commands.getstatus(file) # returns output of "ls -ld file" A trailing newline is remov...
apache-2.0
-7,031,704,543,468,686,000
27.222222
79
0.643307
false
scipsycho/mlpack
linear_regression.py
1
8215
import numpy as np class linear_regression: def __init__(self,batch_size=0,epochs=100,learning_rate=0.001,tolerance=0.00001,show_progress=True): """ The function initiaizes the class Parameters ---------- batch_size: int It defines the number of data se...
mit
-2,167,330,526,561,842,700
30.841085
124
0.589653
false
rabernat/mitgcm-xray
_xgcm/mdsxray.py
2
23927
import operator from glob import glob import os import re import warnings import numpy as np import dask.array as da import xray from xray import Variable from xray.backends.common import AbstractDataStore from xray.core.utils import NDArrayMixin from xray.core.pycompat import OrderedDict from xray.core.indexing impo...
mit
1,379,219,783,563,502,600
38.747508
107
0.539474
false
LxMLS/lxmls-toolkit
lxmls/deep_learning/numpy_models/log_linear.py
1
1802
import numpy as np from lxmls.deep_learning.utils import ( Model, glorot_weight_init, index2onehot, logsumexp ) class NumpyLogLinear(Model): def __init__(self, **config): # Initialize parameters weight_shape = (config['input_size'], config['num_classes']) # after Xavier G...
mit
-5,316,629,383,483,192,000
30.614035
72
0.622642
false
PierreFaniel/openerp-7.0
stock_landed_costs/__init__.py
2
1191
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2014 Elico Corp (<http://www.elico-corp.com>) # Alex Duan <alex.duan@elico-corp.com> # # This program is free software: you can redistribut...
agpl-3.0
2,126,731,422,349,904,400
43.111111
78
0.628044
false
amjad-twalo/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk/corpus/reader/xmldocs.py
9
1313
# Natural Language Toolkit: XML Corpus Reader # # Copyright (C) 2001-2008 University of Pennsylvania # Author: Steven Bird <sb@csse.unimelb.edu.au> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT """ Corpus reader for corpora whose documents are xml files. (note -- not named 'xml' to avoid conf...
gpl-3.0
-7,514,673,354,922,926,000
31.825
70
0.676314
false
bigzz/ZenKernel_Shamu
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
-9,097,885,983,816,448,000
37.842557
162
0.572678
false
Brunux/shityjobs
shityjobs/users/migrations/0001_initial.py
1
2931
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-21 00:17 from __future__ import unicode_literals import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True ...
mit
-8,972,983,870,719,763,000
62.717391
329
0.644831
false
starrybeam/samba
source4/scripting/bin/gen_hresult.py
19
9170
#!/usr/bin/env python # # Unix SMB/CIFS implementation. # # HRESULT Error definitions # # Copyright (C) Noel Power <noel.power@suse.com> 2014 # # 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; e...
gpl-3.0
-7,217,370,936,568,156
39.755556
153
0.609924
false
pkoutsias/SickRage
lib/guessit/language.py
3
11578
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
1,698,536,484,428,574,000
35.278997
150
0.589908
false
azumimuo/family-xbmc-addon
script.module.livestreamer/lib/livestreamer/packages/flashmedia/types.py
42
45802
from .compat import OrderedDict, is_py2, str, bytes, integer_types, string_types from .util import pack_bytes_into from collections import namedtuple from struct import Struct, error as struct_error from inspect import getargspec (SCRIPT_DATA_TYPE_NUMBER, SCRIPT_DATA_TYPE_BOOLEAN, SCRIPT_DATA_TYPE_STRING, SCRIPT_DAT...
gpl-2.0
-2,049,349,614,431,492,400
27.554863
92
0.531614
false
halberom/ansible
lib/ansible/plugins/shell/fish.py
45
4770
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible 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 lat...
gpl-3.0
4,027,931,912,160,198,000
49.210526
394
0.626205
false
MERegistro/meregistro
meregistro/apps/titulos/models/CohorteExtensionAulicaSeguimiento.py
1
1280
# -*- coding: utf-8 -*- from django.db import models from apps.titulos.models.CohorteExtensionAulica import CohorteExtensionAulica import datetime "Seguimiento de cada cohorte de la extensión áulica" class CohorteExtensionAulicaSeguimiento(models.Model): cohorte_extension_aulica = models.ForeignKey(CohorteExtensio...
bsd-3-clause
-3,423,057,151,977,916,400
44.642857
100
0.729264
false
Manexware/medical
oemedical/oemedical_invoice/wizard/wizard_appointment_invoice.py
1
5003
import logging from openerp.osv import osv,fields from openerp import _ #import pooler logging.basicConfig(level=logging.DEBUG) class make_medical_appointment_invoice(osv.osv_memory): _name="oemedical.appointment.invoice" def create_invoice(self, cr, uid, ids, context={}): invoice_obj = self.poo...
gpl-2.0
3,683,135,472,002,146,300
49.03
163
0.556666
false
jadbin/xpaw
tests/test_commands.py
1
1655
# coding=utf-8 import pytest from os.path import join from xpaw.cmdline import main from xpaw import __version__ def test_print_help(capsys): with pytest.raises(SystemExit) as excinfo: main(argv=['xpaw']) assert excinfo.value.code == 0 out, _ = capsys.readouterr() assert out.startswith('usag...
apache-2.0
1,304,430,475,888,588,000
23.338235
63
0.621752
false
pschella/scipy
scipy/special/tests/test_spherical_bessel.py
44
13962
# # Tests of spherical Bessel functions. # import numpy as np from numpy.testing import (assert_almost_equal, assert_allclose, dec, assert_array_almost_equal) from numpy import sin, cos, sinh, cosh, exp, inf, nan, r_, pi from scipy.special import spherical_jn, spherical_yn, spherical_in, sp...
bsd-3-clause
-6,494,177,927,398,915,000
36.232
99
0.537244
false
thinkopensolutions/geraldo
site/newsite/site-geraldo/django/core/serializers/python.py
14
3883
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from django.conf import settings from django.core.serializers import base from django.db import models from django.utils.encodin...
lgpl-3.0
-720,187,402,290,941,600
34.953704
126
0.608293
false
kutenai/django
tests/admin_views/models.py
13
25314
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import os import tempfile import uuid from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from d...
bsd-3-clause
-4,147,450,470,049,681,400
24.848671
110
0.687342
false
SoftwareKing/zstack-woodpecker
integrationtest/vm/multihosts/volumes/test_volumes_robot_2h_wfairly.py
4
2395
''' Robot testing for test volume operations for 2 hours. Will use weight fairly strategy. @author: Youyk ''' import zstackwoodpecker.action_select as action_select import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib ...
apache-2.0
-5,637,509,671,469,078,000
36.629032
99
0.676409
false
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/ipython-2.2.0-py2.7.egg/IPython/qt/rich_text.py
12
8785
""" Defines classes and functions for working with Qt's rich text system. """ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Standard library imports import io import os import re # System librar...
apache-2.0
1,153,889,604,806,744,800
35.911765
80
0.533637
false
jgcaaprom/android_external_chromium_org
tools/telemetry/telemetry/page/actions/scroll.py
45
3747
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.page.actions import page_action class ScrollAction(page_action.PageAction): # TODO(chrishenry): Ignore attributes, to be deleted...
bsd-3-clause
1,665,767,130,861,873,700
38.442105
80
0.634641
false
mclaughlin6464/pylearn2
pylearn2/sandbox/rnn/utils/iteration.py
34
5669
""" Iterator for RNN data """ from functools import wraps import numpy as np from theano import config from pylearn2.sandbox.rnn.space import SequenceDataSpace from pylearn2.sandbox.rnn.space import SequenceMaskSpace from pylearn2.space import CompositeSpace from pylearn2.utils import safe_izip from pylearn2.utils.it...
bsd-3-clause
5,495,454,967,043,676,000
38.368056
79
0.553008
false
susansalkeld/discsongs
discsongs/lib/python2.7/site-packages/setuptools/package_index.py
258
38941
"""PyPI and direct package downloading""" import sys import os import re import shutil import socket import base64 import hashlib from functools import wraps from pkg_resources import ( CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST, require, Environment, find_distributions, safe_name, s...
mit
-7,546,038,247,892,309,000
35.806238
100
0.559796
false
ndingwall/scikit-learn
sklearn/tests/test_build.py
17
1175
import os import pytest import textwrap from sklearn import __version__ from sklearn.utils._openmp_helpers import _openmp_parallelism_enabled def test_openmp_parallelism_enabled(): # Check that sklearn is built with OpenMP-based parallelism enabled. # This test can be skipped by setting the environment varia...
bsd-3-clause
1,773,312,326,618,712,800
35.71875
77
0.701277
false
anilpai/leetcode
BalancedBT/LCA_BT.py
1
3404
from TreeSerialize.TreeSerialize import deserialize, drawtree ''' Needs Python 3+ ''' class Solution_old(object): ''' Lowest Common Ancestor (LCA) in a Binary Tree (BT) : Takes additional space, not space optimized. ''' def findPath(self, root, path, k): ''' A Helper function to ma...
mit
7,009,244,606,261,417,000
29.945455
187
0.568743
false
mpvismer/pyqtgraph
pyqtgraph/widgets/FeedbackButton.py
52
6429
# -*- coding: utf-8 -*- from ..Qt import QtCore, QtGui __all__ = ['FeedbackButton'] class FeedbackButton(QtGui.QPushButton): """ QPushButton which flashes success/failure indication for slow or asynchronous procedures. """ ### For thread-safetyness sigCallSuccess = QtCore.Signal(object, ...
mit
1,070,364,595,558,060,300
38.447853
274
0.618759
false
claneys/shinken
test/shinken_modules.py
13
9693
#!/usr/bin/env python import os import re import copy import time import subprocess import shutil import datetime # not used but "sub-"imported by livestatus test.. (to be corrected..) import sys # not here used but "sub-"imported by livestatus test.. (to be corrected..) # from shinken.modulesctx import modulesctx fr...
agpl-3.0
-2,737,508,186,846,881,300
42.466368
213
0.623955
false
nexusz99/boto
tests/integration/s3/test_mfa.py
136
3629
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 restrict...
mit
-8,621,776,536,053,410,000
37.2
95
0.655277
false
fedorpatlin/ansible
lib/ansible/plugins/lookup/credstash.py
131
1891
# (c) 2015, Ensighten <infra@ensighten.com> # # This file is part of Ansible # # Ansible 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...
gpl-3.0
3,238,813,008,370,005,000
35.365385
107
0.663141
false
arthaud/git-dumper
git_dumper.py
1
21245
#!/usr/bin/env python3 from contextlib import closing import argparse import multiprocessing import os import os.path import re import socket import subprocess import sys import traceback import urllib.parse import urllib3 import bs4 import dulwich.index import dulwich.objects import dulwich.pack import requests impor...
mit
-3,200,989,026,420,141,600
28.343923
85
0.544975
false
gudcjfdldu/volatility
volatility/plugins/netscan.py
44
9924
# Volatility # # Authors: # Michael Hale Ligh <michael.hale@gmail.com> # # This file is part of Volatility. # # Volatility 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 # ...
gpl-2.0
1,029,224,827,781,066,900
37.614786
95
0.561165
false
Slezhuk/ansible
lib/ansible/module_utils/k8s_common.py
62
12599
# # Copyright 2017 Red Hat | Ansible # # This file is part of Ansible # # Ansible 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. # # ...
gpl-3.0
886,119,348,391,915,600
41.420875
109
0.572982
false
alanch-ms/PTVS
Python/Tests/TestData/VirtualEnv/env/Lib/UserDict.py
358
5811
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(self, dict=None, **kwargs): self.data = {} if dict is not None: self.update(dict) if len(kwargs): self.update(kwargs) def __repr__(self): return repr(self.d...
apache-2.0
-679,718,108,906,633,600
31.283333
79
0.553089
false
jonparrott/gcloud-python
securitycenter/google/cloud/securitycenter_v1beta1/proto/securitycenter_service_pb2_grpc.py
2
21413
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.cloud.securitycenter_v1beta1.proto import finding_pb2 as google_dot_cloud_dot_securitycenter__v1beta1_dot_proto_dot_finding__pb2 from google.cloud.securitycenter_v1beta1.proto import organization_settings_pb2 as google_dot_cl...
apache-2.0
6,607,153,752,943,887,000
58.980392
171
0.755009
false
naucoin/VTKSlicerWidgets
Utilities/mrmpi/examples/rmat.py
11
4924
#!/usr/local/bin/python # ---------------------------------------------------------------------- # MR-MPI = MapReduce-MPI library # http://www.cs.sandia.gov/~sjplimp/mapreduce.html # Steve Plimpton, sjplimp@sandia.gov, Sandia National Laboratories # # Copyright (2009) Sandia Corporation. Under the terms of Co...
bsd-3-clause
5,655,260,681,226,999,000
23.019512
75
0.637287
false
xsixing/blaze
samples/basics/array_evaluation.py
10
1121
""" Sample script showing the way to perform computations in blaze This should be executable and result in an out of core execution to generate the result of the expression This illustrates the idea of: - Using large in-disk arrays as operands - Building expressions to evaluate in blaze - Evaluate those expr...
bsd-3-clause
7,816,824,525,097,354,000
23.911111
74
0.688671
false
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/boto/ecs/__init__.py
153
4177
# Copyright (c) 2010 Chris Moyer http://coredumped.org/ # # 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, copy, modify, ...
apache-2.0
1,580,100,225,348,895,000
38.790476
108
0.647594
false
mrkulk/text-world
evennia/server/oob_cmds.py
2
14608
""" Out-of-band default plugin commands available for OOB handler. This module implements commands as defined by the MSDP standard (http://tintin.sourceforge.net/msdp/), but is independent of the actual transfer protocol (webclient, MSDP, GMCP etc). It also implements several OOB commands unique to Evennia (both some ...
bsd-3-clause
-2,748,601,004,682,188,300
37.240838
122
0.622262
false
margguo/python-ivi
ivi/agilent/agilentDSA91204A.py
7
1632
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
mit
298,840,500,654,370,900
36.090909
77
0.734681
false
qwhelan/asv
asv/results.py
1
33074
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import (absolute_import, division, print_function, unicode_literals) import sys import base64 import os import re import zlib import itertools import hashlib import datetime import collectio...
bsd-3-clause
-4,283,705,882,210,736,000
30.893925
99
0.52316
false
killbill/killbill-client-python
killbill/api/credit_api.py
1
10462
# coding: utf-8 # # Copyright 2010-2014 Ning, Inc. # Copyright 2014-2020 Groupon, Inc # Copyright 2020-2021 Equinix, Inc # Copyright 2014-2021 The Billing Project, LLC # # The Billing Project, LLC licenses this file to you under the Apache License, version 2.0 # (the "License"); you may not use this file except in com...
apache-2.0
92,670,078,828,211,540
37.182482
169
0.589849
false
guewen/OpenUpgrade
addons/mass_mailing/models/mass_mailing_stats.py
61
4455
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
2,950,543,937,023,360,000
49.05618
118
0.619978
false
JeffRoy/mi-dataset
mi/dataset/driver/wc_sbe/cspp/wc_sbe_cspp_recovered_driver.py
1
2044
#!/usr/bin/env python """ @package mi.dataset.driver.wc_sbe.cspp @file mi/dataset/driver/wc_sbe/cspp/wc_sbe_cspp_recovered_driver.py @author Jeff Roy @brief Driver for the wc_sbe_cspp instrument Release notes: Initial Release """ from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.dataset.dataset_...
bsd-2-clause
4,576,780,628,206,238,000
29.969697
97
0.718689
false
m11s/MissionPlanner
Lib/rlcompleter.py
61
6036
"""Word completion for GNU readline 2.0. This requires the latest extension to the readline module. The completer completes keywords, built-ins and globals in a selectable namespace (which defaults to __main__); when completing NAME.NAME..., it evaluates (!) the expression up to the last dot and completes its att...
gpl-3.0
1,220,361,793,271,662,600
33.505882
78
0.604374
false
caperren/Archives
OSU Robotics Club/Mars Rover 2017-2018/software/ros_packages/ground_station/src/Framework/MapSystems/RoverMapHelper.py
1
1189
import PIL.Image import math class MapHelper(object): @staticmethod def new_image(width, height, alpha=False): """ Generates a new image using PIL.Image module returns PIL.IMAGE OBJECT """ if alpha is True: return PIL.Image.new('RGBA', (width, height), (0,...
gpl-3.0
6,997,406,587,076,255,000
24.847826
83
0.579479
false
ctmarinas/stgit
stgit/lib/git/objects.py
1
10634
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import re from stgit.compat import text from stgit.config import config from .base import Immutable from .person import Person class GitObject(Immutable): """Base class for all git objects. One git object...
gpl-2.0
-1,564,125,830,605,245,400
31.03012
87
0.544574
false