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
max-leuthaeuser/naoservice
modules/NaoStreamModule.py
1
3770
import StringIO import bottle import base64 import vision_definitions from PIL import Image from bottle import view, static_file, auth_basic from naoqi import ALProxy from NaoService import check_auth app = bottle.Bottle() name = 'NaoStreamModule' path = '/stream' sub = ['/image_latest/1', '/image_stream...
gpl-3.0
-2,909,603,103,536,602,600
26.560606
78
0.671618
false
greginvm/grslicer
grslicer/path_optimization.py
1
5150
import numpy as np from quadtree import Quadtree from grslicer.util.np import get_aabb, to_ndarray, euclidean_dist_square, closest_point_on_edge POINT_AABB = to_ndarray([[-10, -10], [10, 10]]) def follow(paths, get_start_func, closed=True): """ Iterate through paths as they follow by closeness. Yields the ...
mit
-392,566,794,474,796,000
31.802548
105
0.585825
false
budgie333/tingbot-weather_clock
weather.tingapp/main.py
1
14915
import tingbot from tingbot import * import urllib2 import json import time import datetime from collections import deque temperature_str = "n/a" description_str = "" icon_str = "icons/na.png" screen_index = 0 max_screens = 3 # can increase to 4 if log screen is enabled forecast_list = [] update_time_str = "" default...
mit
-8,466,071,929,580,032,000
31.353579
319
0.606705
false
agati/chimera
src/chimera/controllers/xephem.py
1
3142
from chimera.core.chimeraobject import ChimeraObject from chimera.util.position import Position import os import time from select import select class XEphem (ChimeraObject): __config__ = {"telescope": "/Telescope/0", "fifo_dir": "/usr/local/share/xephem/fifos"} def __init__(self): ...
gpl-2.0
1,466,909,973,336,224,300
29.803922
76
0.526098
false
umitproject/openmonitor-desktop-agent
umit/icm/agent/gui/Preference/AdvancedPage.py
1
4940
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA # # Author: Tianwei Liu <liutianweidlut@gmail.com> # # 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...
gpl-2.0
-6,752,057,349,695,062,000
33.48951
90
0.627534
false
dplepage/jugular
jugular/jugular.py
1
7730
from collections import namedtuple Injection = namedtuple("Injection", ("token")) def Inject(*args): def wrap(token): inj = getattr(token, '_injections', []) for arg in args: if not isinstance(arg, Injection): arg = Injection(arg) inj.append(arg) tok...
bsd-2-clause
-3,286,143,294,172,708,000
34.953488
91
0.63467
false
Azure/azure-sdk-for-python
sdk/datamigration/azure-mgmt-datamigration/azure/mgmt/datamigration/operations/_files_operations.py
1
26692
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-1,518,122,571,669,457,400
45.992958
218
0.6321
false
Azure/azure-sdk-for-python
sdk/graphrbac/azure-graphrbac/azure/graphrbac/models/group_get_member_groups_parameters_py3.py
1
1627
# 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
-4,880,007,092,351,924,000
38.682927
101
0.640443
false
jakubtyniecki/pact
tests/test_shell.py
1
1092
""" shell sort tests module """ import unittest import random from sort import shell from tests import helper class ShellSortTests(unittest.TestCase): """ shell sort unit tests class """ max = 100 arr = [] def setUp(self): """ setting up for the test """ self.arr = random.sample(ran...
mit
-5,607,887,628,655,290,000
21.75
80
0.565934
false
htmue/python-autocheck
autocheck/colorizer.py
1
2367
# -*- coding:utf-8 -*- # Created by Hans-Thomas on 2011-05-29. #============================================================================= # colorizer.py --- Colours #============================================================================= from __future__ import absolute_import, unicode_literals import os.pa...
unlicense
2,774,248,385,566,842,400
28.962025
78
0.525137
false
pytorch/fairseq
examples/simultaneous_translation/utils/latency.py
1
14758
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch class LatencyMetric(object): @staticmethod def length_from_padding_mask(padding_mask, batch_first: bool = False): ...
mit
5,185,030,656,978,680,000
31.722838
88
0.553056
false
rohithb/threeSixtyOne
fromRakr/PredictorFuncs.py
1
7692
from predictor.models import DepWords from feedReader.mongoFunctions import Mongo from bs4 import BeautifulSoup from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from math import ceil, sqrt import logging # Get an instance of a logger logger = logging.getLogger(__name__) class Predict...
mit
1,391,004,545,458,817,800
37.189055
94
0.501498
false
kevin8909/xjerp
openerp/addons/Rainsoft_Xiangjie/report/rainsoft_saleout_report.py
1
1739
# -*- coding:utf-8 -*- from report import report_sxw from tools.translate import _ import rml_parse import time class rainsoft_saleout_report(rml_parse.rml_parse): def __init__(self,cr,uid,name,context): super(rainsoft_saleout_report, self).__init__(cr, uid, name, context) self.localcontext.update({ ...
agpl-3.0
1,540,376,732,320,393,200
33.78
91
0.645773
false
sebdah/markdown-docs
markdowndocs/web_server.py
1
1682
# -*- coding: utf-8 -*- """ Embedded web server implementation APACHE LICENSE 2.0 Copyright 2013 Sebastian Dahlgren 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/license...
apache-2.0
-3,753,776,392,870,531,000
32
79
0.682521
false
Lucterios2/core
lucterios/CORE/editors.py
1
7742
# -*- coding: utf-8 -*- ''' Describe database model for Django @author: Laurent GAY @organization: sd-libre.fr @contact: info@sd-libre.fr @copyright: 2015 sd-libre.fr @license: This file is part of Lucterios. Lucterios is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
gpl-3.0
6,148,376,695,377,183,000
41.076087
166
0.64389
false
houssine78/addons
website_event_attendance/models/event.py
1
1085
# -*- coding: utf-8 -*- from openerp import _, api, fields, models import random from urlparse import urljoin class EventEvent(models.Model): _inherit = 'event.event' token = fields.Char(string="Token", readonly=True) event_attendance_url = fields.Char(string="Event attendance url", r...
agpl-3.0
-5,036,463,516,516,101,000
31.96875
85
0.619355
false
flavors/countries
countries/management/commands/loadcountries.py
1
1691
from django.core.management import call_command from ... import models from ...fields import get_one_to_many_fields, get_self_reference_fields from ._base import DumperBaseCommand class Command(DumperBaseCommand): help = 'Load data' def handle(self, **options): self.verbosity = options['verbosity'] ...
mit
2,416,379,053,813,985,300
32.156863
74
0.594323
false
kawamon/hue
desktop/libs/kafka/src/kafka/kafka_api.py
1
3371
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
apache-2.0
-8,102,835,474,430,322,000
24.345865
95
0.681104
false
ssarangi/numba
numba/testing.py
1
1529
from __future__ import print_function, division, absolute_import import sys import functools from numba import config def allow_interpreter_mode(fn): """Temporarily re-enable intepreter mode """ @functools.wraps(fn) def _core(*args, **kws): config.COMPATIBILITY_MODE = True try: ...
bsd-2-clause
2,334,689,474,276,244,500
23.66129
65
0.621321
false
gibil5/openhealth
models/marketing/patient_line.py
1
6758
# -*- coding: utf-8 -*- """ Patient Line - Used by Marketing Only Data model. No functions. Created: 16 May 2018 Last up: 29 mar 2021 """ from openerp import models, fields, api from openerp.addons.openhealth.models.patient import pat_vars #from openerp.addons.openhealth.models.libs import eval_vars...
agpl-3.0
-8,251,336,293,806,691,000
14.627315
133
0.529403
false
adelina-t/nova
nova/virt/libvirt/volume.py
1
68636
# Copyright 2011 OpenStack Foundation # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
apache-2.0
-3,676,450,116,032,374,300
42.167296
79
0.554753
false
pulinagrawal/nupic
tests/swarming/nupic/swarming/experiments/dummy_multi_v2/description.py
1
15322
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
7,200,580,741,374,030,000
37.888325
110
0.589414
false
Sotera/newman
app/__init__.py
1
2068
import os from flask import Flask, json import logging from logging.handlers import RotatingFileHandler UPLOAD_DIRECTORY = 'uploads' app = Flask(__name__, static_url_path='') print 'Newman flask application starting...' # Configure root logging which effects console - dont want newman debug to go to console # TODO ...
apache-2.0
5,997,770,533,530,674,000
30.830769
131
0.770793
false
rembish/mls
setup.py
1
1212
#!/usr/bin/env python from os.path import dirname, abspath, join from setuptools import setup here = abspath(dirname(__file__)) readme = open(join(here, "README.rst")) setup( name="mls", version="1.2.2", py_modules=["mls"], url="https://github.com/rembish/mls", license="BSD", author="Aleksey R...
bsd-2-clause
1,837,715,068,766,620,000
33.628571
71
0.611386
false
miurahr/pinax-teams
pinax/teams/views.py
1
10627
import json from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import render, redirect, get_object_or_404 from django.template import RequestContext from django.template.loader import render_to_string from django.views.decorators.http import require_POST fr...
mit
-2,445,942,896,833,156,000
30.722388
95
0.633951
false
klahnakoski/jx-sqlite
tests/test_jx/test_others.py
1
4861
# encoding: utf-8 # # # 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 __future__ import absolute_import, division, unicode_literals from unittest import skip f...
mpl-2.0
4,083,705,525,367,496,700
30.564935
113
0.495577
false
Arkapravo/morse-0.6
src/morse/actuators/steer_force.py
1
2152
import logging; logger = logging.getLogger("morse." + __name__) import bge import morse.core.actuator class SteerForceActuatorClass(morse.core.actuator.MorseActuatorClass): """ Motion controller using engine force and steer angle speeds This class will read engine force and steer angle (steer, force) as i...
bsd-3-clause
-2,409,979,239,668,718,600
41.196078
75
0.64777
false
moloch/katas
roman_numerals/roman_numerals_test.py
1
3201
import unittest from roman_numerals import RomanNumber class RomanNumeralsTest(unittest.TestCase): def testConvertOneFromDecimalToRoman(self): self.__decimalToRoman("I", 1) def testConvertTwoFromDecimalToRoman(self): self.__decimalToRoman("II", 2) def testConvertThreeFromDecimalToRoman(self): se...
gpl-2.0
1,198,207,360,920,812,300
32.34375
67
0.68666
false
benjamincongdon/CrowdShout
src/TwitchClient.py
1
1317
import json import os import urllib2 def IsChannelOnline(channelName): url ="https://api.twitch.tv/kraken/streams/" + channelName try: contents = urllib2.urlopen(url) except: print "Error: Failed to get status of \"" + channelName + "\"" return False contents = json.load(content...
mit
1,192,647,015,215,459,600
30.380952
113
0.627942
false
zestrada/nova-cs498cc
nova/tests/compute/test_host_api.py
1
14791
# Copyright (c) 2012 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
-834,515,088,002,063,600
42.122449
78
0.540126
false
TuSimple/simpledet
config/efficientnet/efficientnet_b5_fpn_bn_scratch_400_9x.py
1
9297
from symbol.builder import FasterRcnn as Detector from symbol.builder import add_anchor_to_arg from models.efficientnet.builder import EfficientNetB5FPN as Backbone from models.FPN.builder import FPNNeck as Neck from models.FPN.builder import FPNRpnHead as RpnHead from models.FPN.builder import FPNRoiAlign as RoiExtrac...
apache-2.0
4,240,676,931,483,831,300
28.702875
100
0.545767
false
gamechanger/dusty
tests/unit/source_test.py
1
10568
import os import tempfile import shutil import git from mock import Mock, patch from ..testcases import DustyTestCase from dusty.commands.repos import override_repo from dusty.source import Repo, git_error_handling from dusty.compiler.spec_assembler import get_all_repos class TestSource(DustyTestCase): def setUp...
mit
-4,023,575,962,530,667,000
41.785425
110
0.6514
false
goors/flask-microblog
models/Post.py
1
1248
from models import db import time from User import User tags = db.Table('PostTag', db.Column('Tag', db.Integer, db.ForeignKey('Tag.Id')), db.Column('Post', db.Integer, db.ForeignKey('Post.Id')) ) class Post(db.Model): __tablename__ = 'Post' Id = db.Column(db.Integer, primary_...
apache-2.0
-8,783,952,425,001,518,000
29.439024
87
0.609776
false
QinMing/RPC-based_Twitter_Service
src/client/cl.py
1
1976
#!/usr/bin/env python import sys sys.path.append('gen-py') from cse124 import Twitter from cse124.ttypes import * from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: transport = TSocket.TSocket('localhost', 9090) ...
bsd-2-clause
3,937,180,857,933,238,300
25.702703
56
0.730769
false
muk-it/muk_web
muk_web_client_refresh/models/base.py
1
2734
################################################################################### # # Copyright (c) 2017-2019 MuK IT GmbH. # # This file is part of MuK Web Refresh # (see https://mukit.at). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
lgpl-3.0
-6,982,652,058,987,150,000
41.71875
93
0.589247
false
toslunar/chainerrl
chainerrl/misc/prioritized.py
1
12456
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() # NOQA import collections import numpy as np from chainerrl.misc.r...
mit
5,337,231,613,446,384,000
28.516588
79
0.531952
false
pchristos/amqp-middleware
tests/test.py
1
3654
import unittest import pika import json import time import requests import threading import amqpconsumer.components.agent class AMQPTest(unittest.TestCase): def setUp(self): reg = requests.post('http://localhost/api/v1/insights/register', data=json.dumps({'name': 'Unit Teste...
apache-2.0
119,440,002,291,704,400
26.066667
79
0.484127
false
decvalts/cartopy
lib/cartopy/examples/un_flag.py
1
7466
""" UN Flag ------- A demonstration of the power of Matplotlib combined with cartopy's Azimuthal Equidistant projection to reproduce the UN flag. """ import cartopy.crs as ccrs import cartopy.feature as cfeature import matplotlib.pyplot as plt from matplotlib.patches import PathPatch import matplotlib.path import mat...
gpl-3.0
-3,271,768,500,589,883,400
45.6625
77
0.541522
false
VIRL-Open/virl-utils
ports.py
1
2841
#!/usr/bin/env python # # vim: tabstop=4 noexpandtab shiftwidth=4 softtabstop=0 # # Show all ports of all VM instances for # all users and topologies. # Like the console port and the VNC port # # v0.3 18-Feb-2017 # adjusted to Mitaka # v0.2 02-Dec-2015 # adapted to Kilo release # v0.1 24-Nov-2014 # initial release # # ...
isc
8,876,054,256,444,263,000
33.228916
85
0.57339
false
GoogleCloudPlatform/python-docs-samples
iot/api-client/end_to_end_example/cloudiot_pubsub_example_mqtt_device.py
1
9724
# Copyright 2017 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 agre...
apache-2.0
364,725,067,252,978,900
36.544402
79
0.6558
false
NoBodyCam/TftpPxeBootBareMetal
nova/db/sqlalchemy/api.py
1
180163
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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 (t...
apache-2.0
-2,355,571,704,509,729,000
32.941786
79
0.586264
false
titainium/goldmap
segmentwords/segmentWords.py
1
3142
#!/usr/bin/env python """ some configureation parameters list here. Titainium Deng knifewolf@126.com """ import asyncio import os import re import sys from pyArango import connection import jieba import uvloop from config import JIEBA_LOGGER class BaseCutter: """ A word segment class base on jieba librar...
gpl-3.0
6,911,273,856,929,496,000
27.878505
121
0.538038
false
Newsboy-VA/Newsboy-Core
client/user_io/text_io.py
1
2047
#!/usr/bin/env python3 import collections import curses import logging try: from .base_io import BaseIO except SystemError: from base_io import BaseIO class TextIO(BaseIO): ''' An interface with the user via a terminal ''' def __init__(self): super().__init__() self.stdscr = curses.i...
gpl-3.0
859,501,667,479,397,000
22.528736
69
0.508061
false
DarthMaulware/EquationGroupLeaks
Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/os.py
1
24614
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: os.py r"""OS routines for Mac, NT, or Posix depending on what system we're on. This exports: - all functions from posix, nt, os2, or ce, e.g. unli...
unlicense
-4,292,814,936,018,871,300
31.092568
156
0.582717
false
chromium/chromium
components/module_installer/android/module_desc_java.py
6
3310
#!/usr/bin/env python # # Copyright 2019 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. """Writes Java module descriptor to srcjar file.""" import argparse import os import sys import zipfile sys.path.append( os.path...
bsd-3-clause
-5,560,688,175,210,369,000
31.772277
80
0.621148
false
henare/parlparse
wrans-2014/parse.py
1
14143
#!/usr/bin/env python # # UK Parliament Written Answers are now in a new database-driven website. This # site has a nice search, and RSS feeds, but for now we still need a bit of # scraping to fetch the data. Ever so slightly simpler than the past, though! import argparse import datetime import json import os import r...
agpl-3.0
-104,417,759,261,230,430
37.224324
188
0.603267
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/outbound_nat_rule.py
1
2886
# 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
1,449,080,336,148,388,600
43.4
110
0.641026
false
google-research/python-graphs
python_graphs/control_flow_graphviz_test.py
1
1438
# Copyright (C) 2021 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 or agreed to in writing, ...
apache-2.0
7,260,058,033,423,199,000
34.073171
80
0.734353
false
Distrotech/qtjsbackend
src/3rdparty/v8/tools/test-wrapper-gypbuild.py
1
10738
#!/usr/bin/env python # # Copyright 2012 the V8 project 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: # # * Redistributions of source code must retain the above copyright # noti...
gpl-3.0
-550,229,066,310,682,300
39.067164
102
0.624884
false
rmallermartins/graphun
src/python/main.py
1
1088
import sys sys.path.append("Structures/") sys.path.append("Algorithms/") from sys import argv from bfs import Bfs from bf import Bf from fw import Fw from scc import Scc from dk import Dk from graph import Graph def main(): G = Graph() G.buildGraph(argv[2]) if argv[1] == 'bfs': s = G.getInitVe...
mit
-3,409,868,393,373,458,000
19.528302
50
0.47886
false
encukou/samba
selftest/tests.py
1
6811
#!/usr/bin/python # This script generates a list of testsuites that should be run as part of # the Samba test suite. # The output of this script is parsed by selftest.pl, which then decides # which of the tests to actually run. It will, for example, skip all tests # listed in selftest/skip or only run a subset during ...
gpl-3.0
-4,331,787,086,124,022,300
45.972414
125
0.713698
false
chunweiyuan/xarray
xarray/coding/variables.py
1
10849
"""Coders for individual Variable objects.""" from typing import Any import warnings from functools import partial import numpy as np import pandas as pd from ..core import dtypes, duck_array_ops, indexing from ..core.pycompat import dask_array_type from ..core.variable import Variable class SerializationWarning(Ru...
apache-2.0
-5,412,761,502,272,440,000
37.066667
79
0.620241
false
seehuhn/py-jvplot
jvplot/param.py
1
7154
# param.py - default parameters for the jvplot package # Copyright (C) 2014 Jochen Voss <voss@seehuhn.de> # # 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 # ...
gpl-3.0
2,827,255,526,208,211,500
45.75817
122
0.599105
false
Vauxoo/stock-logistics-warehouse
stock_cycle_count/reports/report_stock_location_accuracy.py
1
1289
# Copyright 2017 Eficent Business and IT Consulting Services S.L. # (http://www.eficent.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import api, models class LocationAccuracyReport(models.AbstractModel): _name = "report.stock_location_accuracy" _description = "Locati...
agpl-3.0
6,055,364,514,302,601,000
32.921053
77
0.596587
false
romain-li/edx-platform
openedx/core/djangoapps/course_groups/tests/test_cohorts.py
1
33663
""" Tests for cohorts """ # pylint: disable=no-member import ddt from mock import call, patch from nose.plugins.attrib import attr import before_after from django.contrib.auth.models import User from django.db import IntegrityError from django.http import Http404 from django.test import TestCase from opaque_keys.edx....
agpl-3.0
-8,324,525,248,245,647,000
37.384265
119
0.617681
false
Azure/azure-sdk-for-python
sdk/search/azure-mgmt-search/azure/mgmt/search/models/_search_management_client_enums.py
1
7042
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
6,232,084,900,551,837,000
43.853503
105
0.710026
false
likit/gimme
src/utils/find_MXE.py
1
7910
'''The script identifies mutually exclusive exons from a BED file. Output is written in GFF format suitable for differential exon usage analysis using MISO. ''' import sys import csv import networkx as nx from bx.intervals import IntervalTree class Exon(object): def __init__(self, chrom, start, end, transcript...
gpl-3.0
1,385,375,321,500,569,300
34.3125
79
0.48445
false
crazy-canux/xplugin_nagios
plugin/plugins/license_manager_plugins/config.py
1
1403
# -*- coding: utf-8 -*- # Copyright (C) Canux CHENG <canuxcheng@gmail.com> # # 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 ...
gpl-2.0
-8,058,601,612,106,630,000
45.766667
78
0.764077
false
mbohlool/client-python
kubernetes/client/models/v1_group_version_for_discovery.py
1
4487
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
-8,085,997,802,482,238,000
27.762821
136
0.573211
false
corochann/chainerex
examples/sklearn_wrapper/mnist_classification/train_mnist.py
1
5271
#!/usr/bin/env python """ Originally from https://github.com/chainer/chainer/blob/master/examples/mnist/train_mnist.py But SklearnWrapperClassifier is used instead of L.Classifier """ from __future__ import print_function import os import sys try: import matplotlib matplotlib.use('Agg') except ImportError:...
mit
-4,928,916,235,757,543,000
35.604167
79
0.639158
false
goldsborough/lnk
tests/bitly/test_bitly_command.py
1
1756
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import pytest import requests import tests.paths import lnk.bitly.command import lnk.config import lnk.errors VERSION = 3 API = 'https://api-ssl.bitly.com' with open(os.path.join(tests.paths.TEST_PATH, 'bitly', 'token')) as source: ACCESS_TOKEN = source.read(...
mit
-2,061,581,385,568,514,000
23.388889
75
0.715262
false
michaellaier/pymor
src/pymor/operators/cg.py
1
28361
# -*- coding: utf-8 -*- # This file is part of the pyMOR project (http://www.pymor.org). # Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) # # Contributors: lucas-ca <lucascamp@web.de> """ This module provides some operators for ...
bsd-2-clause
-5,337,526,238,773,474,000
42.280916
119
0.611838
false
google-research/falken
service/common/generate_protos.py
1
4766
# 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 agreed to in writing, ...
apache-2.0
-8,586,384,013,007,797,000
33.788321
84
0.698279
false
tordable/XlsxReports
table.py
1
1515
"""A table which holds the data of the report.""" __author__ = 'jt@javiertordable.com' __copyright__ = "Copyright (C) 2014 Javier Tordable" class Table(object): """A table which holds the data of the report. The table has a series of rows and columns, the columns have to be defined on construction and the row...
apache-2.0
7,262,745,502,388,254,000
25.12069
79
0.640924
false
hanwenyan/ud858
Lesson_2/000_Hello_Endpoints/helloworld_api.py
1
1854
"""Hello World API implemented using Google Cloud Endpoints. Contains declarations of endpoint, endpoint methods, as well as the ProtoRPC message class and container required for endpoint method definition. """ import endpoints from protorpc import messages from protorpc import message_types from protorpc import remot...
gpl-3.0
4,659,189,719,289,631,000
29.9
65
0.683387
false
NOAA-ORR-ERD/gridded
gridded/tests/test_projected_ugrid.py
1
3919
#!/usr/bin/env python """ tests loading a UGRID file with projected coords This is also a very complete UGRID dataset, with data on nodes, edges, etc... this test uses a data file auto-downloaded from ORR: http://gnome.orr.noaa.gov/py_gnome_testdata/ Questions about this data; there is a node_z variable: dou...
unlicense
122,381,572,760,498,530
29.617188
103
0.590712
false
torepublic/torepublic
torshammer/torshammer.py
1
7620
#!/usr/bin/python # this assumes you have the socks.py (http://phiral.net/socks.py) # and terminal.py (http://phiral.net/terminal.py) in the # same directory and that you have tor running locally # on port 9050. run with 128 to 256 threads to be effective. # kills apache 1.X with ~128, apache 2.X / IIS with ~256 # n...
gpl-2.0
-9,130,051,862,714,684,000
37.484848
135
0.551312
false
c00w/bitHopper
bitHopper/Tracking/__init__.py
1
1777
from getwork_store import Getwork_Store from bitHopper.util import * import Tracking import bitHopper.LongPoll_Listener import json, logging __store = False def __patch(): global __store if not __store: __store = Getwork_Store() def headers(headers, server): """ Deals with headers fro...
mit
940,368,637,148,643,600
24.028169
63
0.615644
false
FundedByMe/django-uc
uc/uc.py
1
2620
from __future__ import print_function from django.conf import settings from suds.client import Client from suds.plugin import MessagePlugin import sys def get_client(product_code): url = "https://www.uc.se/UCSoapWeb/services/ucOrders2" client = Client(url + "?wsdl", plugins=[VersionPlugin(product_code)]) ...
mit
8,922,698,252,316,484,000
33.933333
116
0.683588
false
buzzsurfr/lbm
ltm/structures.py
1
2224
class VirtualServerType: RESOURCE_TYPE_POOL = 0 RESOURCE_TYPE_IP_FORWARDING = 1 RESOURCE_TYPE_L2_FORWARDING = 2 RESOURCE_TYPE_REJECT = 3 RESOURCE_TYPE_FAST_L4 = 4 RESOURCE_TYPE_FAST_HTTP = 5 RESOURCE_TYPE_STATELESS = 6 RESOURCE_TYPES = ( 'Standard', 'Forwarding (IP)', 'Forwarding (Layer 2)', 'Reject',...
mit
7,843,954,073,265,745,000
22.166667
54
0.689748
false
liqd/a4-meinberlin
tests/maptopicprio/rules/test_rules_rate.py
1
4613
import pytest import rules from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_u...
agpl-3.0
5,939,222,180,058,478,000
40.1875
76
0.671147
false
adamfeuer/surveytool
sms/migrations/0002_auto__add_field_membership_messages_generated.py
1
8806
# encoding: 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 'Membership.messages_generated' db.add_column('sms_membership', 'messages_generated', self....
gpl-3.0
3,860,900,022,988,038,700
71.180328
182
0.558142
false
smart-classic/smart_ui_server
admin_ui/views.py
1
4638
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden, HttpRequest from django.core.exceptions import * from django.core.urlresolvers import reverse from django.conf import settings import urllib import urlparse from smart_ui_server import utils from smart_ui_server.ui.views import...
apache-2.0
-2,683,072,347,359,787,000
30.127517
128
0.661492
false
rapidpro/casepro
casepro/backend/rapidpro.py
1
14828
from typing import Tuple from dash.utils import chunks, is_dict_equal from dash.utils.sync import BaseSyncer, SyncOutcome, sync_local_to_changes, sync_local_to_set from django.utils.timezone import now from casepro.contacts.models import Contact, Field, Group from casepro.msgs.models import Label, Message, Outgoing ...
bsd-3-clause
8,467,466,680,998,822,000
34.389021
119
0.615187
false
cuthbertLab/bali
taught_questions.py
1
10223
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division #from pprint import pprint as print import bali, itertools fp = bali.FileParser() class PercentList(list): ''' A list where each element is a tuple of (percent, weight), that can calculate certain things... ''' ...
bsd-3-clause
-8,775,167,802,358,571,000
28.292264
96
0.646386
false
pascalc/machine_poetry
db/corpus/syllable.py
1
3648
#!/usr/bin/python # -*- coding: utf-8 -*- """ Lingua::EN::Syllable::syllable() estimates the number of syllables in the word passed to it. Note that it isn't entirely accurate... it fails (by one syllable) for about 10-15% of my /usr/dict/words. The only way to get a 100% accurate count is to do a dictionary look...
mit
8,567,287,578,994,754,000
31
77
0.652686
false
ryanfobel/microdrop
microdrop/core_plugins/zmq_hub_plugin/__init__.py
1
3782
""" Copyright 2015 Christian Fobel This file is part of zmq_hub_plugin. zmq_hub_plugin 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. dmf...
gpl-3.0
-8,469,342,942,459,653,000
34.018519
80
0.64331
false
lmcinnes/umap
setup.py
1
2238
from setuptools import setup def readme(): try: with open("README.rst", encoding="UTF-8") as readme_file: return readme_file.read() except TypeError: # Python 2.7 doesn't support encoding argument in builtin open import io with io.open("README.rst", encoding="UTF-8...
bsd-3-clause
3,011,616,037,234,713,600
29.243243
83
0.542449
false
barbagroup/cuIBM
examples/cylinder/Re40/scripts/createDomainYaml.py
1
1336
""" Creates a YAML file with info about the structured Cartesian mesh that will be parsed by cuIBM. """ from snake.cartesianMesh import CartesianStructuredMesh # info about the 2D structured Cartesian grid width = 0.02 # minimum grid spacing in the x- and y- directions info = [{'direction': 'x', 'start': -15.0, ...
mit
-1,090,379,165,577,650,600
35.108108
78
0.429641
false
risicle/docoskin
docoskin/warping.py
1
6097
from __future__ import absolute_import from collections import namedtuple from itertools import compress import logging import cv2 import numpy from docoskin import defaults from docoskin.dummythreadpoolexecutor import DummyThreadPoolExecutor from docoskin.exceptions import DocoskinInvalidArgumentCombinationError, D...
gpl-3.0
8,729,212,491,408,042,000
39.919463
125
0.685911
false
meteoswiss-mdr/monti-pytroll
scripts/input_cosmo_cronjob.py
1
15477
from __future__ import division from __future__ import print_function def input(in_msg): import inspect in_msg.input_file = inspect.getfile(inspect.currentframe()) print("*** read input from ", in_msg.input_file) in_msg.sat = "cosmo" in_msg.instrument = "cosmo" in_msg.sat_nr="1" in_msg....
lgpl-3.0
366,920,272,479,687,500
41.872576
125
0.591911
false
tatsy/bssrdf-estimate
tests/test_vector3d.py
1
2531
# -*- coding: utf-8 -*- import math try: import unittest2 as unittest except: import unittest from bssrdf_estimate.tools import Vector3D class Vector3DTest(unittest.TestCase): def test_instance(self): v = Vector3D() self.assertEqual(v.x, 0.0) self.assertEqual(v.y, 0.0) se...
mit
-6,291,049,207,758,887,000
25.925532
57
0.526274
false
RedHatInsights/insights-core
insights/parsers/tests/test_installed_product_ids.py
1
2498
import doctest from ...parsers.installed_product_ids import InstalledProductIDs from ...parsers import installed_product_ids from ...tests import context_wrap COMMAND_OUTPUT = """ +-------------------------------------------+ Product Certificate +-------------------------------------------+ Certificate: Path: /e...
apache-2.0
-7,684,916,061,034,135,000
23.732673
91
0.631305
false
ToonTownInfiniteRepo/ToontownInfinite
toontown/racing/DistributedGag.py
1
3931
from pandac.PandaModules import * from direct.distributed import DistributedObject from direct.interval.ProjectileInterval import * from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.racing.DistributedVehicle import DistributedVehicle from DroppedGag import * class D...
mit
2,637,562,723,853,928,400
36.438095
138
0.624777
false
drewvolz/BonApp-Widget
scripts/getData.py
1
2655
#!/usr/bin/env python3 import string, os, time, json, re, unicodedata, html.parser, requests # Bon appetit cafe hours api url url = "http://legacy.cafebonappetit.com/api/2/cafes" # How many cafeterias you want to parse (in order) totalCafes = 2393 # What our file should be named fileName = "data.json" # Parser to cl...
mit
-2,921,243,020,524,299,000
24.04717
69
0.67533
false
metatoaster/mtj.eve.tracker
mtj/eve/tracker/tests/test_cache.py
1
4357
from unittest import TestCase, TestSuite, makeSuite import time import zope.component from zope.component.hooks import getSiteManager from evelink.api import APICache from mtj.eve.tracker.interfaces import IEvelinkCache from mtj.eve.tracker.evelink import Helper, API, EvelinkSqliteCache from mtj.evedb.tests.base im...
gpl-3.0
7,818,584,514,905,570,000
29.683099
79
0.643562
false
ARMmbed/mbedtls
tests/scripts/test_config_script.py
1
7451
#!/usr/bin/env python3 """Test helper for the Mbed TLS configuration file tool Run config.py with various parameters and write the results to files. This is a harness to help regression testing, not a functional tester. Sample usage: test_config_script.py -d old ## Modify config.py and/or mbedtls_config.h #...
apache-2.0
3,701,973,395,728,402,400
39.05914
90
0.626896
false
joanvila/aioredlock
aioredlock/sentinel.py
1
4483
import re import ssl import urllib.parse import aioredis.sentinel class SentinelConfigError(Exception): ''' Exception raised if Configuration is not valid when instantiating a Sentinel object. ''' class Sentinel: def __init__(self, connection, master=None, password=None, db=None, ssl_context=N...
mit
-8,227,899,662,681,304,000
37.982609
101
0.574392
false
Gnarlywhale/wallstweet
RawCodeToolkit/plotBot.py
1
2846
''' wallstweet, February 9th, 2014 Data mining twitter with style. Copyright 2014 Riley Dawson, Kent Rasmussen, Chadwyck Goulet 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
5,430,046,170,541,993,000
31.340909
266
0.706254
false
keshashah/GCompris
src/pythontest-activity/pythontest.py
1
17180
# gcompris - pythontest # # Copyright (C) 2003, 2008 Bruno Coudoin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later ver...
gpl-2.0
-2,329,517,724,009,798,000
30.350365
167
0.604016
false
JayVora-SerpentCS/e-commerce
website_sale_product_brand/controllers/main.py
1
1937
# -*- coding: utf-8 -*- # © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import http from openerp.http import request from openerp.addons.website_sale.controllers.main import QueryURL, website_sale class WebsiteSale...
agpl-3.0
-7,482,239,585,660,215,000
38.510204
79
0.538223
false
AnkitBarik/inermodz
mode.py
1
2269
#!/usr/bin/env python3 # -*- coding: iso-8859-15 -*- import numpy as np import matplotlib.pyplot as plt from .velocity import * from .sigma import * from .grid import * from .libzhang import _find_rad, _find_phi from .plotlib import * class inerMod: def __init__(self,nr=33,nphi=256,ntheta=128,m=0,l=None,N=0,n=1,...
gpl-3.0
7,541,567,142,709,182,000
26.011905
112
0.528427
false
andrewbird/wader
core/contact.py
1
4899
# -*- coding: utf-8 -*- # Copyright (C) 2008-2009 Warp Networks, S.L. # Author: Pablo Martí # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your opt...
gpl-2.0
-4,741,642,807,645,253,000
33.251748
79
0.62107
false
isdal/raspberrypi-fan-controller
fancontroller/fan_controller_test.py
1
5117
''' Created on May 30, 2015 @author: isdal ''' import logging import unittest import sys from fancontroller import Thermostat, STATE_OFF, STATE_ON from fancontroller.filters import MedianFilter from fancontroller.fan_controller import NoaaForecast import json logger = logging.getLogger() logger.level = logging.DEBU...
apache-2.0
-1,090,518,907,630,482,400
35.81295
74
0.547586
false
divio/askbot-devel
askbot/management/commands/fix_revisionless_posts.py
1
1535
"""this management commands will fix corrupted posts that do not have revisions by creating a fake initial revision based on the content stored in the post itself """ from django.core.management.base import NoArgsCommand from django.db.models import signals, Count from askbot import models from askbot import const def...
gpl-3.0
-7,073,818,593,907,466,000
35.547619
78
0.585668
false
rosarior/mayan
apps/documents/models.py
1
23432
from __future__ import absolute_import import os import tempfile import hashlib from ast import literal_eval import base64 import datetime import logging try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.db import models from django.utils.translation import uge...
gpl-3.0
-8,910,533,542,504,607,000
34.719512
212
0.631615
false
agrif/pyquickcheck
quickcheck/tests/__init__.py
1
3947
import quickcheck as qc import unittest class LeafSpec(qc.ArbitrarySpec): def __init__(self, simple_only=False): self.simple_only = simple_only def arbitrary(self): specs = [float, int, bool, str, bytes] if not self.simple_only: specs.append(qc.arbitrary(qc.Float)) ...
mit
9,088,825,566,361,861,000
32.735043
101
0.604003
false
ragavvenkatesan/Convolutional-Neural-Networks
tests/core/test_activations.py
1
8908
""" test_activations.py - Unit tests for YANN core activation functions defined in yann/core/activations.py """ import unittest import numpy as np import theano import theano.tensor as T import yann.core.activations as A try: from unittest.mock import Mock except ImportError: from mock import Mock,patch clas...
mit
3,945,140,281,606,564,400
52.341317
137
0.533565
false
Forage/Gramps
gramps/webapp/grampsdb/views.py
1
63123
# Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the L...
gpl-2.0
-8,317,743,001,590,288,000
40.858753
135
0.507866
false
legoktm/pywikipedia-scripts
fa_bot.py
1
8724
#!/usr/bin/env python from __future__ import unicode_literals import datetime import mwparserfromhell import pywikibot import re site = pywikibot.Site('en', 'wikipedia') GA_SUBPAGES = ['Agriculture, food and drink', 'Art and architecture', 'Engineering and technology', 'Geography and places', 'History...
mit
-2,991,678,182,104,832,000
41.975369
136
0.580124
false