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
stevecshanks/trello-next-actions
nextactions/card.py
1
1191
from urllib.parse import urlparse class Card: AUTO_GENERATED_TEXT = 'Auto-created by TrelloNextActions' def __init__(self, trello, json): self._trello = trello self.id = json['id'] self.name = json['name'] self.board_id = json['idBoard'] self.description = json['desc'...
mit
3,288,807,941,837,223,400
28.04878
78
0.596977
false
petrjasek/superdesk-core
superdesk/sequences.py
1
2026
import superdesk import traceback from superdesk import get_resource_service from .resource import Resource from .services import BaseService import logging logger = logging.getLogger(__name__) def init_app(app): endpoint_name = "sequences" service = SequencesService(endpoint_name, backend=superdesk.get_bac...
agpl-3.0
-385,703,106,562,796,540
32.766667
104
0.616486
false
jiaxiaolei/pycate
pycate/model/refresh_model.py
1
1488
# -*- coding:utf-8 -*- # 预约更新 # import tornpg import libs import peewee from core.base_model import BaseModel class phpmps_refresh(BaseModel): uid = peewee.CharField(max_length=36, null=False, unique=True, help_text='类别的ID', primary_key=True) refresh_time = peewee.IntegerField(null=False) i...
mit
27,952,428,316,652,670
24.472727
103
0.531593
false
scanner-research/scanner
examples/how-tos/caffe/resnet.py
1
1333
from scannerpy import Database, DeviceType, Job from scannerpy.stdlib import NetDescriptor import numpy as np import cv2 import struct import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..') import util video_path = util.download_video() if len(sys.argv) <= 1 else sys.argv[1] print('Pe...
apache-2.0
-8,819,657,042,652,358,000
31.512195
79
0.658665
false
bd-j/sedpy
sedpy/photometer.py
1
10083
# Simple Aperture photometry. kind of a stupid class dependence. # Ideally a photometer object should take an image and a region object # as arguments, where the region object is an instance of a particualr aperture class and # can return an in_region boolean (or perhaps a 'fraction') for # any position(s). As it is ...
gpl-2.0
1,693,906,440,199,580,000
33.064189
113
0.60726
false
MCME/WebStatus
mcmeAPI/db/models.py
1
1641
from sqlalchemy import Column, String, Integer, DateTime, PickleType, Boolean from mcmeAPI.db import Base class User(Base): __tablename__ = 'users' name = Column(String(20), primary_key=True) group = Column(String(15)) #rank updated = Column(DateTime()) ob = Column(Boolean) staff = Column(Bool...
gpl-3.0
-4,360,253,035,946,446,300
29.407407
77
0.575868
false
JioCloud/oslo.messaging
oslo/messaging/opts.py
1
2535
# Copyright 2014 Red Hat, 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 agr...
apache-2.0
-180,154,284,497,711,870
32.8
78
0.7357
false
ubuntunux/JumpJump
PyInterpreter/Tutorial.py
1
6321
import Utility as Util from Utility import * from Constants import * from collections import OrderedDict import browser #---------------------# # CLASS : Tutorial layout class #---------------------# class TutorialLayout: def __init__(self, ui): self.ui = ui self.tutorialMap = OrderedDict({}) layou...
gpl-3.0
-1,433,163,130,658,457,600
40.592105
156
0.626325
false
kerwinxu/barcodeManager
zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Node/Alias.py
1
4400
"""scons.Node.Alias Alias nodes. This creates a hash of global Aliases (dummy targets). """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associat...
bsd-2-clause
1,780,583,719,408,763,100
26.947368
95
0.623409
false
zubinshah/algorithms
data-structures/python/sorting.py
1
11069
#!/usr/local/bin/python """ SORTING ALGORITHMS + Bubble Sort + Selection Sort This program will test *num* entries as an unsorted array, and sort them as well as log the time taken to understand the performances of varous sorting algorithms. """ #******************************************************************...
apache-2.0
6,825,287,574,014,931,000
32.340361
109
0.437348
false
hackfestca/cnb
cnb/modAvailable/CNBMMEncode.py
1
5840
#!/usr/bin/python # -*- coding: utf-8 -*- ''' CNB Matrix Module - encode ''' import string import urllib import base64 from cnb.cnbMatrixModule import CNBMatrixModule class CNBMMEncode(CNBMatrixModule): """ """ name = 'encode' usage = '' desc = 'Encode a string using different algorithm' al...
gpl-3.0
-2,542,247,868,136,886,000
31.087912
98
0.474315
false
drnextgis/QGIS
tests/src/python/test_qgsrelationeditwidget.py
1
12071
# -*- coding: utf-8 -*- """QGIS Unit tests for edit widgets. .. 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 Software Foundation; either version 2 of the License, or (at your option) any later version. """ __au...
gpl-2.0
-7,272,650,242,732,273,000
34.60767
263
0.634247
false
tseaver/gcloud-python
pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py
1
40338
# -*- coding: utf-8 -*- # # Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
2,759,004,533,117,325,300
44.838636
175
0.574768
false
robwarm/gpaw-symm
gpaw/test/lcao_pair_and_coulomb.py
1
2151
import numpy as np import cPickle as pickle from ase.structure import molecule from gpaw.lcao.tools import makeU, makeV from gpaw import GPAW, FermiDirac, restart from gpaw.lcao.pwf2 import LCAOwrap from gpaw.lcao.tools import remove_pbc, get_bfi2, get_bf_centers from gpaw.mpi import world, rank, MASTER, serial_comm fr...
gpl-3.0
945,840,178,704,066,600
33.142857
75
0.655974
false
rdeits/cryptics
pycryptics/grammar/cfg.py
1
3899
import nltk.grammar as gram import pycryptics.grammar.nodes as nd from pycryptics.utils.indicators import INDICATORS """ A Context Free Grammar (CFG) to describe allowed substructures of cryptic crossword clues and how to solve each substructure. """ # The basic wordplay transforms top = gram.Nonterminal(nd.TopNode) ...
mit
3,835,686,781,258,495,000
37.22549
132
0.598872
false
DanielMSchmidt/kombinatorik
source/conf.py
1
9565
# -*- coding: utf-8 -*- # # Kombinatorik documentation build configuration file, created by # sphinx-quickstart on Wed Jul 24 17:58:33 2013. # # 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. # ...
mit
5,717,283,508,492,965,000
30.25817
80
0.704757
false
Yanivs24/AutoPA
experiments/python_scripts/avg_results_files.py
1
1420
#!/usr/bin/python # This file is part of AutoPA - automatic extraction of pre-aspiration # from speech segments in audio files. # # Copyright (c) 2016 Yaniv Sheena import os import re import sys import numpy as np if __name__ == "__main__": if len(sys.argv) != 2: raise ValueError("expected 1 value - r...
lgpl-3.0
410,955,419,383,036,100
24.818182
73
0.620423
false
xuweiliang/Codelibrary
nova/policies/licence.py
1
1502
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
apache-2.0
-5,257,845,597,965,646,000
29.04
78
0.675766
false
srinath29/pyView
helper.py
1
2537
from PyQt4 import QtGui, uic, QtCore, Qt import PyQt4 import pandas import sys import os viewBase, viewForm = uic.loadUiType(os.path.join(os.path.dirname(os.path.realpath(__file__)),"view.ui")) class Helper(viewBase, viewForm): def __init__(self, parent = None): super(viewBase,self).__init__...
gpl-3.0
-1,201,301,448,810,805,500
29.7125
105
0.592826
false
FFMG/myoddweb.piger
monitor/api/python/Python-3.7.2/Lib/test/test_pickletools.py
3
4333
import pickle import pickletools from test import support from test.pickletester import AbstractPickleTests import unittest class OptimizedPickleTests(AbstractPickleTests): def dumps(self, arg, proto=None): return pickletools.optimize(pickle.dumps(arg, proto)) def loads(self, buf, **kwds): re...
gpl-2.0
7,697,367,086,105,588,000
41.480392
81
0.55412
false
PietroPasotti/AutomatedTagger
analyzers.py
1
1493
#analyzers.py from main import _export,test,x2,RESULTS,evaluation def overlap(dic1,dic2): summ = len(set(dic1).union(set(dic2))) # if it's a dic, here we take the mere keys() # if it's a list, we take all overlapOfPlaindics = len(set(dic1)) + len(set(dic2)) - summ return overlapOfPlaindics def unpack...
agpl-3.0
4,131,902,085,462,726,700
23.883333
87
0.698593
false
KeyWeeUsr/plyer
plyer/compat.py
1
1120
''' Compatibility module for Python 2.7 and > 3.3 ============================================= ''' # pylint: disable=invalid-name __all__ = ('PY2', 'string_types', 'queue', 'iterkeys', 'itervalues', 'iteritems', 'xrange') import sys try: import queue except ImportError: import Queue as queue #: T...
mit
-9,110,793,413,409,874,000
24.454545
69
0.633929
false
SimonSapin/tinycss
tinycss/tests/test_api.py
2
1340
# coding: utf-8 """ Tests for the public API ------------------------ :copyright: (c) 2012 by Simon Sapin. :license: BSD, see LICENSE for more details. """ from __future__ import unicode_literals from pytest import raises from tinycss import make_parser from tinycss.page3 import CSSPage3Parser def...
bsd-3-clause
-7,873,681,417,298,320,000
28.777778
77
0.64403
false
noironetworks/heat
heat/tests/openstack/keystone/test_service.py
1
10694
# # 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
-5,912,710,049,060,024,000
36.391608
78
0.601085
false
iulian787/spack
var/spack/repos/builtin/packages/ppopen-appl-fdm-at/package.py
2
1685
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PpopenApplFdmAt(MakefilePackage): """ppOpen-APPL/FDM with Auto-Tuning""" homepage = "...
lgpl-2.1
2,089,136,601,130,362,000
33.387755
73
0.587537
false
benhunter/py-stuff
misc/csgo-stats.py
1
12345
# https://old.reddit.com/r/GlobalOffensive/comments/8mjqgc/i_made_a_python_script_that_generates_stats_using/ # https://pastebin.com/LLpym05c import datetime import matplotlib.pyplot as plt def min_to_sec(line): # converts minutes in string format 'XXX:XX' to seconds seconds = 0 seconds += (int(line[-1])) ...
mit
500,048,332,103,682,240
35.202346
119
0.580154
false
fusionbox/mezzanine
mezzanine/core/templatetags/mezzanine_tags.py
1
23919
from __future__ import absolute_import, division, unicode_literals from future.builtins import int, open, str from hashlib import md5 import os try: from urllib.parse import quote, unquote except ImportError: from urllib import quote, unquote from django.contrib import admin from django.contrib.auth import RE...
bsd-2-clause
290,233,697,215,057,200
34.435556
79
0.609641
false
ActiveState/code
recipes/Python/511508_Binomial_Queues/recipe-511508.py
1
4907
""" BinomialQueue.py Meldable priority queues Written by Gregoire Dooms and Irit Katriel """ class LinkError(Exception): pass class EmptyBinomialQueueError(Exception): pass class BinomialTree: "A single Binomial Tree" def __init__(self, value): "Create a one-node tree. value is the priority of thi...
mit
-1,932,582,368,276,943,000
27.864706
77
0.509069
false
1000ideas/sublime_redmine
Redmine.py
1
6831
import re import json import functools import urllib, urllib2 import sublime, sublime_plugin, threading import webbrowser class RedmineError(Exception): pass def main_thread(callback, *args, **kwargs): # sublime.set_timeout gets used to send things onto the main thread # most sublime.[something] calls need to b...
mit
-6,297,098,791,352,698,000
31.528571
128
0.631386
false
ekansa/open-context-py
opencontext_py/apps/about/views.py
1
20142
import json from django.conf import settings from django.http import HttpResponse, Http404 from django.template import RequestContext, loader from opencontext_py.libs.general import LastUpdatedOrderedDict from opencontext_py.libs.rootpath import RootPath from opencontext_py.libs.requestnegotiation import RequestNegotia...
gpl-3.0
8,155,570,767,275,034,000
38.887129
84
0.578642
false
polyaxon/polyaxon
core/polyaxon/utils/string_utils.py
1
2468
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
apache-2.0
7,351,634,692,586,380,000
29.469136
97
0.651945
false
Azure/azure-sdk-for-python
sdk/testbase/azure-mgmt-testbase/azure/mgmt/testbase/operations/_os_updates_operations.py
1
9891
# 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
2,570,028,533,368,190,500
48.954545
236
0.645233
false
squidboylan/apt-package-mirror
apt_package_mirror/__main__.py
1
2647
from __future__ import print_function import yaml import os from apt_package_mirror.mirror import Mirror import sys import argparse def main(): # When files are created make them with a 022 umask os.umask(022) # Add commandline options and help text for them parser = argparse.ArgumentParser() par...
apache-2.0
4,230,655,349,344,754,000
27.771739
79
0.59728
false
ruddra/django-oscar
oscar/apps/basket/abstract_models.py
1
28617
from decimal import Decimal import zlib from django.db import models from django.db.models import Sum from django.conf import settings from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ObjectDoesNotExist, PermissionDenied from oscar.apps.b...
bsd-3-clause
7,346,142,169,669,723,000
33.067857
89
0.587029
false
trezor/python-trezor
trezorlib/tests/device_tests/test_msg_verifymessage.py
1
8823
# This file is part of the Trezor project. # # Copyright (C) 2012-2018 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
lgpl-3.0
-2,778,977,320,289,823,000
37.36087
265
0.643092
false
chrislit/abydos
abydos/distance/_clement.py
1
4649
# Copyright 2018-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
-6,004,276,056,573,090,000
28.238994
78
0.562056
false
maxzheng/remoteconfig
test/test_remoteconfig.py
1
1183
import time import httpretty from remoteconfig import config, RemoteConfig class TestRemoteConfig(object): @httpretty.activate def test_read(self): config_url = 'http://test-remoteconfig.com/config.ini' config_content = '[section]\n\nkey = value\n' httpretty.register_uri(httpretty.G...
mit
5,379,055,401,091,969,000
31.861111
86
0.64497
false
5agado/intro-ai
src/test/basicTest.py
1
2831
from neural_network.perceptron import Perceptron from neural_network.neural_net import NeuralNet from util import utils import os from bitstring import BitArray import random from genetic_algorithm.population import Population def testPerceptron(): p = Perceptron(2) #p.useStepFunction = True p.t...
apache-2.0
345,943,458,821,668,500
33.860759
98
0.590957
false
thethythy/Mnemopwd
mnemopwd/client/corelayer/protocol/StateS33R.py
1
2965
# -*- coding: utf-8 -*- # Copyright (c) 2016, Thierry Lemeunier <thierry at lemeunier dot net> # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain th...
bsd-2-clause
3,113,484,126,458,670,000
40.760563
83
0.651939
false
jlane9/selenium_data_attributes
setup.py
1
1363
"""setup.py ..codeauthor:: John Lane <jlane@fanthreesixty.com> """ from setuptools import setup, find_packages from sda import __author__, __email__, __license__, __version__ setup( name='sda', version=__version__, packages=find_packages(), scripts=[], description='A wrapper for Selenium. This ...
mit
7,108,862,239,312,840,000
39.088235
101
0.598679
false
maxfierke/dotcom-flask
app.py
1
6299
import datetime, os, socket from flask import abort, Flask, json, jsonify, redirect, request, render_template, Response, send_from_directory, url_for from flask.ext.admin import Admin from flask.ext.mongoengine import MongoEngine from flask.ext.mongorest import MongoRest from flask.ext.mongorest.views import ResourceV...
mit
5,754,946,228,814,816,000
35.622093
121
0.711542
false
AstroPrint/AstroBox
src/octoprint/timelapse.py
1
12285
# coding=utf-8 __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import logging import os import threading import urllib import time import subprocess import fnmatch import datetime import sys import shutil import octoprint.util as uti...
agpl-3.0
7,949,570,891,765,914,000
29.403465
180
0.707726
false
davidwhogg/HoneyComb
superpgram/code/header_time.py
1
1992
import numpy as np import pyfits import glob import matplotlib.pyplot as plt def real_footprint(t): """ # `real_footprint` Takes real Kepler (BJD) time values for a certain target and returns estimates of the starts, stops and centres """ dt = 0.02043359821692 # interval between observations ...
mit
-7,558,977,120,474,102,000
25.918919
77
0.603916
false
LRGH/amoco
amoco/arch/v850/env.py
1
3017
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2018 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license # import expressions: from amoco.cas.expressions import * # registers : # ----------- # main reg set: R = [reg("r%d" % r, 32) for r in range(32)] with is_reg_flags: PSW = ...
gpl-2.0
-6,677,247,967,779,939,000
27.462264
87
0.551541
false
ychenracing/Spiders
onesixnine/onesixnine/middlewares.py
1
1908
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals class OnesixnineSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scrap...
apache-2.0
-8,819,020,306,805,128,000
33.035714
78
0.664218
false
arthurdk/gk-analysis
GKVisualizer.py
1
7581
import plotly from plotly.graph_objs import Scatter, Layout, Bar, Figure from wordcloud import WordCloud import matplotlib.pyplot as plt import plotly.graph_objs as go ''' class VisualizationStrategy: def __init__(self): pass # Homemade enumeration Plot, CSV, ASCII = range(3) ''' import random c...
mit
-1,554,547,537,877,476,000
28.729412
113
0.460361
false
edx/ecommerce
ecommerce/extensions/analytics/tests/test_analytics.py
1
1737
# -*- coding: utf-8 -*- """Unit tests for the analytics app.""" from django.apps import apps from django.test import override_settings from oscar.core.loading import get_model from ecommerce.tests.mixins import BasketCreationMixin from ecommerce.tests.testcases import TestCase ProductRecord = get_model('analytics',...
agpl-3.0
4,935,367,456,486,433,000
38.477273
85
0.715026
false
HuStmpHrrr/gjms
clickonce/publish.py
1
3780
from __future__ import print_function import subprocess import os import sys import shutil import datetime import distutils.dir_util if sys.version_info < (3,): input = raw_input str = unicode pwd = os.getcwd() appver_file = r'.\AppVer' target_shares = { 'release': [], 'test' : [], 'dev' : ...
lgpl-2.1
2,146,401,426,755,421,700
34.327103
186
0.589153
false
0x6768/fqdn
setup.py
1
1144
from setuptools import setup setup( name='fqdn', packages=['fqdn'], version='1.1.0', description=('Validate fully-qualified domain names compliant ' 'to RFC 1035 and the preferred form in RFC 3686 s. 2.'), author='Guy Hughes', author_email='0x6768@gmail.com', url='https://gi...
mpl-2.0
-8,930,818,900,220,796,000
37.133333
74
0.59965
false
piappl/robrex_mapping
img_tools/scripts/trajectory_capture.py
1
1683
#!/usr/bin/env python ## # @file trajectory_capture.py # @author Artur Wilkowski <ArturWilkowski@piap.pl> # # @section LICENSE # # Copyright (C) 2015, Industrial Research Institute for Automation and Measurements # Security and Defence Systems Division <http://www.piap.pl> import roslib roslib.load_manifest('img_to...
gpl-2.0
3,916,604,659,894,667,000
30.166667
167
0.619727
false
Kane610/axis
axis/streammanager.py
1
3280
"""Python library to enable Axis devices to integrate with Home Assistant.""" import asyncio import logging from typing import Callable, List, Optional from .configuration import Configuration from .rtsp import SIGNAL_DATA, SIGNAL_FAILED, SIGNAL_PLAYING, STATE_STOPPED, RTSPClient _LOGGER = logging.getLogger(__name__...
mit
-2,756,108,687,357,434,400
28.818182
87
0.588415
false
dit/dit
dit/inference/counts.py
1
6393
""" Non-cython methods for getting counts and distributions from data. """ import numpy as np __all__ = ( 'counts_from_data', 'distribution_from_data', 'get_counts', ) try: # cython from .pycounts import counts_from_data, distribution_from_data except ImportError: # no cython from boltons....
bsd-3-clause
-8,556,384,628,051,415,000
33.556757
98
0.613796
false
alex-am/pyalgo
pyalgo/play/sum.py
1
1135
# Given a list of positive integers S = [s_i] and a positive integer t # find if t can be written as the sum of a subset of elements of S import numpy as np def is_sum(t, S): # is it np hard ? # O(n**2 t) # brute force 2**n S = list(filter(lambda x:x>0, S)) n = len(S) m = np.zeros((n, t), dtyp...
gpl-3.0
438,430,288,067,461,700
22.666667
70
0.414978
false
thomas-hori/Repuge-NG
ludicrous/ScrollingInterface.py
1
2538
from ludicrous.SimpleInterface import SimpleInterface __copying__=""" Written by Thomas Hori 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/.""" class ScrollingInte...
mpl-2.0
6,258,991,873,130,474,000
34.782609
93
0.520489
false
felixsch/mkcrowbar
tests/test_network.py
1
5238
from pytest import raises from mkcrowbar import network from fake import * def test_iface_has_ipv4_addr(capsys, monkeypatch): local = LocalCommands() monkeypatch.setattr('mkcrowbar.network.local', local) args = ['-f', 'inet', 'addr', 'show', 'eth0'] local.has('ip', expect_args(args, load_fixture('i...
apache-2.0
-4,987,254,012,026,377,000
34.391892
109
0.685567
false
kamladi/textback-web
twilio/rest/resources/__init__.py
1
1752
import twilio from twilio import TwilioException, TwilioRestException from twilio.rest.resources.imports import ( parse_qs, json, httplib2 ) from twilio.rest.resources.util import ( transform_params, format_name, parse_date, convert_boolean, convert_case, convert_keys, normalize_dates, UNSET_TIMEOUT ) fro...
mit
-1,907,901,667,675,662,600
35.5
78
0.811073
false
xhochy/g-octave
g_octave/description_tree.py
1
3391
# -*- coding: utf-8 -*- """ g_octave.description_tree ~~~~~~~~~~~~~~~~~~~~~~~~~ This module implements a Python object with the content of a directory tree with DESCRIPTION files. The object contains *g_octave.Description* objects for each DESCRIPTION file. :copyright: (c) 2009-2010 by Rafael...
gpl-2.0
-2,548,059,103,229,188,600
29.54955
76
0.555883
false
alphagov/notifications-api
tests/app/db.py
1
42588
import random import uuid from datetime import date, datetime, timedelta import pytest from app import db from app.dao import fact_processing_time_dao from app.dao.email_branding_dao import dao_create_email_branding from app.dao.inbound_sms_dao import dao_create_inbound_sms from app.dao.invited_org_user_dao import sa...
mit
-4,070,065,704,934,377,500
33.794118
544
0.630483
false
stephen-hoover/Arignote
arignote/nnets/nets.py
1
40064
"""This module describes fully-functioning networks created from the pieces in `layer`. """ from __future__ import division, print_function import collections import inspect import numpy as np import six import theano import theano.tensor as T from theano.tensor.shared_randomstreams import RandomStreams from ..data ...
mit
-1,436,817,007,690,568,200
42.929825
117
0.592202
false
zeffii/BlenderLSystem3D
sverchok_script_node_version/3dlsystem.py
1
6593
import math from math import radians import random from random import randint import ast import bmesh import mathutils from mathutils import Vector, Euler """ lifted from: http://www.4dsolutions.net/ocn/lsystems.html """ class Lturtle: import mathutils from mathutils import Vector, Euler Xvec = Vector...
gpl-3.0
-1,039,659,748,590,810,900
25.162698
83
0.502654
false
apple/swift-lldb
packages/Python/lldbsuite/test/commands/watchpoints/hello_watchlocation/TestWatchLocation.py
1
4428
""" Test lldb watchpoint that uses '-s size' to watch a pointed location with size. """ from __future__ import print_function import re import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class HelloWatchLocationTestCase(TestBase): mydi...
apache-2.0
-3,877,249,198,937,931,000
38.185841
98
0.610659
false
hoburg/gpkit
docs/source/examples/boundschecking.py
1
1592
"Verifies that bounds are caught through monomials" from gpkit import Model, parse_variables from gpkit.exceptions import UnboundedGP, UnknownInfeasible class BoundsChecking(Model): """Implements a crazy set of unbounded variables. Variables --------- Ap [-] d D [-] e F ...
mit
1,190,010,389,241,384,700
23.492308
75
0.476131
false
daniel-noland/MemoryOracle
gdbwatch/gdbtest/mem/DynamicBreak.py
1
3858
#!/usr/bin/env python # -*- encoding UTF-8 -*- # THIS CODE DERIVED FORM cma.py import gdb import signal import re import threading from .Heap import Heap #----------------------------------------------------------------------- #Archs # TODO: Update all arch classes to use gdb.Architecture checks instead of this # ...
lgpl-3.0
-5,980,768,733,821,877,000
24.215686
81
0.550544
false
sha-red/django-shared-utils
shared/utils/fields.py
1
1882
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .text import slugify # TODO Remove deprecated location from .models.slugs import AutoSlugField def uniquify_field_value(instance, field_name, value, max_length=None, queryset=None): """ Makes a char field value unique by append...
mit
-4,836,092,466,750,654,000
33.218182
97
0.644527
false
HubbleStack/Hubble
hubblestack/extmods/returners/splunk_pulsar_return.py
1
13369
# -*- encoding: utf-8 -*- ''' HubbleStack Pulsar-to-Splunk returner Deliver HubbleStack Pulsar event data into Splunk using the HTTP event collector. Required config/pillar settings: .. code-block:: yaml hubblestack: returner: splunk: - token: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX ...
apache-2.0
-5,617,588,501,900,962,000
42.689542
112
0.480814
false
gnarayan/WDmodel
WDmodel/main.py
1
11665
# -*- coding: UTF-8 -*- """ The WDmodel package is designed to infer the SED of DA white dwarfs given spectra and photometry. This main module wraps all the other modules, and their classes and methods to implement the alogrithm. """ from __future__ import absolute_import from __future__ import print_function from __f...
gpl-3.0
8,631,514,802,882,615,000
37.754153
121
0.61123
false
drfraser/django-paypal
paypal/standard/forms.py
1
10801
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging from django import forms from django.conf import settings from django.utils.safestring import mark_safe from django.utils import timezone from paypal.standard.widgets import ValueHiddenInput, ReservedValueHiddenInput from paypal.standard.conf import (POSTBACK...
mit
-8,756,174,441,328,358,000
39.912879
103
0.634386
false
CaliopeProject/CaliopeServer
src/cid/forms/siim2/Company/models.py
1
1821
# -*- encoding: utf-8 -*- """ @authors: Nelson Daniel Ochoa ndaniel8a@gmail.com Sebastián Ortiz V. neoecos@gmail.com @license: GNU AFFERO GENERAL PUBLIC LICENSE SIIM Models are the data definition of SIIM2 Framework Copyright (C) 2013 Infometrika Ltda. This program is free software: you can redistribu...
agpl-3.0
-4,010,117,498,692,730,000
36.040816
89
0.698456
false
jdotjdot/django-apptemplates
apptemplates/__init__.py
1
2709
""" Django template loader that allows you to load a template from a specific Django application. """ from os.path import dirname, join, abspath from django.conf import settings from django.template.base import Origin from django.template.loaders.filesystem import Loader as FilesystemLoader try: from impor...
mit
-5,958,066,998,723,027,000
34.12
107
0.627907
false
browseinfo/odoo_saas3_nicolas
addons/website_quote/controllers/main.py
1
8818
# -*- 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 ...
agpl-3.0
2,026,008,436,371,959,300
50.567251
129
0.61658
false
dgoodwin/rounder
src/rounder/ui/gtk/main.py
1
11733
# encoding=utf-8 # # Rounder - Poker for the GNOME Desktop # # Copyright (C) 2008 Devan Goodwin <dgoodwin@dangerouslyinc.com> # Copyright (C) 2008 James Bowes <jbowes@dangerouslyinc.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-2.0
-6,898,350,797,561,719,000
36.244444
78
0.629304
false
terzeron/FeedMakerApplications
test/test.py
1
2410
#!/usr/bin/env python import sys import os import filecmp from feed_maker_util import exec_cmd def test_script(feed, script, work_dir, test_dir, index): os.chdir(work_dir) cmd = "cat %s/input.%d.txt | %s > %s/result.%d.temp" % (test_dir, index, script, test_dir, index) #print(cmd) (result, error) = ...
gpl-2.0
6,115,003,064,114,718,000
39.166667
156
0.56473
false
rflamary/POT
ot/stochastic.py
1
24589
""" Stochastic solvers for regularized OT. """ # Author: Kilian Fatras <kilian.fatras@gmail.com> # # License: MIT License import numpy as np ############################################################################## # Optimization toolbox for SEMI - DUAL problems ##############################################...
mit
-1,453,941,329,542,792,700
31.568212
126
0.563057
false
jmikkola/Lexington
src/lexington/__init__.py
1
3175
import collections from werkzeug.wrappers import Response from lexington.util import di from lexington.util import route from lexington.util import view_map from lexington.util import paths def default_dependencies(settings): dependencies = di.Dependencies() dependencies.register_value('settings', settings) ...
mit
-8,198,006,270,251,723,000
32.421053
79
0.656693
false
111pontes/ydk-py
cisco-ios-xr/ydk/models/cisco_ios_xr/_meta/_Cisco_IOS_XR_infra_infra_locale_cfg.py
1
10790
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI...
apache-2.0
-6,472,914,570,276,750,000
24.56872
197
0.260519
false
HaebinShin/tensorflow
tensorflow/contrib/losses/python/losses/loss_ops_test.py
1
34080
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in 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
-7,149,207,294,253,049,000
38.813084
80
0.604079
false
kevin-intel/scikit-learn
sklearn/feature_extraction/text.py
2
70670
# -*- coding: utf-8 -*- # Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Lars Buitinck # Robert Layton <robertlayton@gmail.com> # Jochen Wersdörfer <jochen@wersdoerfer.de> # Roman Sinayev <roman.sinayev@gmail.com> # # License: B...
bsd-3-clause
227,654,248,893,633,020
36.609367
79
0.595432
false
jameslyons/pycipher
tests/test_simple.py
1
1950
from pycipher.simplesubstitution import SimpleSubstitution import unittest class TestSimple(unittest.TestCase): def test_encipher(self): keys = ('abronjdfuetchiszlgwqvxkymp', 'mufykewgqtnrlopcbadsvxzijh', 'rtuzesbxjaniypqclghmvwodkf', 'ymdsvtxizewurqfnbgjlck...
mit
7,769,010,517,048,307,000
49
77
0.663077
false
graik/biskit
archive_biskit2/Biskit/Dock/settings.py
1
3174
## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner ## ## 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 v...
gpl-3.0
-4,584,866,479,027,789,300
29.815534
74
0.694707
false
BioSeq/Genetics-of-Race-Analysis
gORAnalysis.py
1
9988
#!/usr/bin/env python # # gORAnalysis.py # Author: Philip Braunstein # Copyright (c) 2015 BioSeq # # This is the analysis for the BioSeq Genetics of Race Experiment. It uses VCF # files generated from MiSeq to create a FASTA file of what each sample would # have looked like. This output file can be run easily analyzed...
mit
3,348,724,493,650,054,000
28.376471
79
0.575891
false
uwosh/uwosh.fieldworkflow
uwosh/fieldworkflow/tests.py
1
1490
import unittest from zope.testing import doctestunit from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import zcml from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPlo...
gpl-2.0
-3,443,589,749,189,728,000
26.592593
61
0.64698
false
hologram-io/hologram-python
Hologram/Authentication/CSRPSKAuthentication.py
1
2419
# CSRPSKAuthentication.py - Hologram Python SDK CSRPSKAuthentication interface # # Author: Hologram <support@hologram.io> # # Copyright 2016 - Hologram (Konekt, Inc.) # # This CSRPSKAuthentication file implements the CSRPSK authentication interface. # # LICENSE: Distributed under the terms of the MIT License # import j...
mit
5,625,506,043,620,905,000
35.104478
95
0.649442
false
dspmeng/code
scripts/GopBitRate.py
1
1764
import csv import itertools import numpy as np import getopt from os import path from os import system from sys import argv try: opts, args = getopt.getopt(argv[1:], 'f:') except getopt.GetoptError: print 'GopBitRate.py -f <frame rate> <stats csv>' print opts print args frameRate = 30 for opt, arg in opts: ...
apache-2.0
3,685,222,563,568,351,000
27
144
0.607143
false
Nekroze/librarian
docs/conf.py
1
8158
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # 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. # # ...
mit
-157,021,622,559,134,340
31.122047
80
0.706546
false
iandees/all-the-places
locations/spiders/hihostels.py
1
1934
# -*- coding: utf-8 -*- import scrapy import re from locations.items import GeojsonPointItem class HiHostelsSpider(scrapy.Spider): name = "hihostels" allowed_domains = ['hihostels.com'] start_urls = ( 'https://www.hihostels.com/sitemap.xml', ) def parse(self, response): response....
mit
2,543,737,011,314,564,600
45.047619
146
0.542399
false
senttech/Cura
cura/Settings/MachineManager.py
1
50213
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import QObject, pyqtSlot, pyqtProperty, pyqtSignal from PyQt5.QtWidgets import QMessageBox from UM.Application import Application from UM.Preferences import Preferences from UM.Logger import Logger from U...
agpl-3.0
-7,270,229,336,275,078,000
49.012948
192
0.669548
false
hustbeta/openstack-juno-api-adventure
examples/nova/v2/11_create_server.py
1
1380
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import keystoneclient import keystoneclient.auth.identity.v3 import keystoneclient.session import keystoneclient.v3.client import novaclient.client import local_settings auth = keystoneclient.auth.identity.v3.Password(auth_url=local_settings.a...
mit
-8,997,592,995,425,463,000
43.516129
93
0.544203
false
Foggalong/scraps
files/cc/game.py
1
2715
#!/usr/bin/python3 import time from random import randint # Game Vars # Health hvar = 100 svar = 100 # Fight # stats not final # player # weapons weaponls = ['bare hands', 'sword', 'axe', 'staff'] wpninpackls = [1, 1 ,1, 0] wpnhealthls = [100, 20, 30, 50] wpndamagels = [5, 7, 10, 20] wpnchancels = [8, 7, 5, 6] #...
gpl-2.0
-3,856,779,248,668,732,000
22.617391
88
0.624309
false
lavish/drs
robot/ev3dev_utils.py
1
3416
import time, ev3dev def run_for(motor, power=75, ever=None, seconds=None, degrees=None): """ Run motor for specified amount of seconds, degrees, or forever Examples: run_for(motor, ever=True) run_for(motor, seconds=0.5) run_for(motor, degrees=270, power=100) Power is specified in percents in ...
mit
-6,067,089,681,917,996,000
34.583333
87
0.657201
false
ZeroQI/Hama.bundle
Contents/Code/common.py
1
55275
### common ### # https://www.python.org/dev/peps/pep-0008/ # Usage: "common.GetPosters" = "from common import GetPosters" ### Imports ### ### Functions used ### # Python Modules # import os # path.abspath, join, dirname import time # datetime.datetime.now() import r...
gpl-3.0
8,189,609,514,421,203,000
68.007491
382
0.627191
false
flynx/pli
pli/pattern/proxy/_callproxy.py
1
9071
#======================================================================= #======================================================================= __version__ = '''0.1.00''' __sub_version__ = '''20040223152229''' __copyright__ = '''(c) Alex A. Naanou 2003''' #----------------------------------------------------------...
bsd-3-clause
6,048,693,589,287,850,000
27.615142
127
0.578216
false
djtotten/workbench
setup.py
1
1964
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, sys from setuptools import setup readme = open('README.rst').read() long_description = readme doclink = ''' Documentation ------------- The full documentation is at http://workbench.rtfd.org. ''' history = open('HISTORY.rst').read().replace('.. :changelog:', ...
mit
-9,168,152,055,158,455,000
37.509804
95
0.611507
false
heeraj123/oh-mainline
mysite/missions/svn/views.py
1
7651
# This file is part of OpenHatch. # Copyright (C) 2010 Jack Grigg # Copyright (C) 2010 John Stumpo # Copyright (C) 2011 Krzysztof Tarnowski (krzysztof.tarnowski@ymail.com) # Copyright (C) 2010, 2011 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
agpl-3.0
-5,017,947,890,406,898,000
39.696809
109
0.665534
false
saullocastro/structMan
structmanager/sas.py
2
2784
""" Structural Assemblies - SAs (:mod:`structmanager.sas`) ====================================================== .. currentmodule:: structmanager.sas """ class FrameAssembly(object): """Frame Assembly""" def __init__(self, name, args): args = outerflange, web, innerflange self.name = name ...
bsd-3-clause
789,567,808,038,623,600
27.408163
75
0.510057
false
revolutionarysystems/merge
merge/views.py
1
12454
import os import zipfile from django.shortcuts import render from django.http import JsonResponse, HttpResponse from .docMerge import mergeDocument from .xml4doc import getData from random import randint from datetime import datetime from django.views.decorators.csrf import csrf_exempt #from .merge_utils import get_loc...
bsd-3-clause
-295,670,679,078,170,500
43.320285
238
0.648306
false
fumitoh/modelx
modelx/tests/testdata/pandas_compat/fastlife/Projection/Policy/__init__.py
1
10940
"""Source module to create ``Policy`` space from. This module is a source module to create ``Policy`` space and its sub spaces from. The formulas of the cells in the ``Policy`` space are created from the functions defined in this module. The ``Policy`` space is the base space of the policy spaces for individual polic...
gpl-3.0
-2,055,454,818,524,421,000
25.300481
111
0.577148
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/connectivity_parameters_py3.py
1
1429
# 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
-6,371,394,010,488,108,000
34.725
81
0.610917
false
projectshift/shift-memory
setup.py
1
2472
#!/usr/bin/env python import os from setuptools import setup, find_packages # ---------------------------------------------------------------------------- # Building # # Create source distribution: # ./setup.py sdist # # # Create binary distribution (non-univeral, python 3 only): # ./setup.py bdist_wheel --python-tag=...
mit
-3,527,569,901,544,307,700
21.472727
78
0.565534
false
lyst/lightfm
doc/conf.py
1
9601
# -*- coding: utf-8 -*- # # LightFM documentation build configuration file, created by # sphinx-quickstart on Thu Apr 21 12:26:52 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...
apache-2.0
-3,776,953,285,276,997,600
31.326599
80
0.706385
false
aranzgeo/properties
docs/conf.py
1
10385
# -*- coding: utf-8 -*- # # properties documentation build configuration file, created by # sphinx-quickstart on Thu May 12 10:22:17 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. ...
mit
-6,904,015,504,437,077,000
30.75841
79
0.702744
false