repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
fr0uty/oartm
tests/kao/test_db_kamelot_fifo.py
1
1412
# coding: utf-8 from __future__ import unicode_literals, print_function import pytest from oar.lib import db from oar.kao.job import insert_job from oar.kao.platform import Platform from oar.kao.kamelot_fifo import main, schedule_fifo_cycle @pytest.yield_fixture(scope='function', autouse=True) def minimal_db_initi...
bsd-3-clause
5,573,465,817,564,996,000
23.344828
76
0.626062
false
3.306792
false
false
false
grlee77/numpy
numpy/lib/tests/test_stride_tricks.py
1
18890
import numpy as np from numpy.core._rational_tests import rational from numpy.testing import ( assert_equal, assert_array_equal, assert_raises, assert_, assert_raises_regex, assert_warns, ) from numpy.lib.stride_tricks import ( as_strided, broadcast_arrays, _broadcast_shape, broadcast_to, broadcast_...
bsd-3-clause
-1,454,254,805,155,908,400
33.981481
82
0.521122
false
3.101806
true
false
false
SamuelDauzon/Improllow-up
tasks/migrations/0006_auto_20151022_1917.py
1
1081
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tasks', '0005_auto_20151018_1303'), ] operations = [ migrations.CreateModel( name='TaskType', fields...
mit
-790,270,236,375,810,000
32.6875
114
0.55102
false
4.294821
false
false
false
virajkanwade/plugin.video.zeetv
resources/lib/slimit/lexer.py
1
15051
############################################################################### # # Copyright (c) 2011 Ruslan Spivak # # 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, inc...
gpl-3.0
7,872,050,808,526,940,000
33.441648
79
0.431732
false
3.751496
false
false
false
h4ck3rm1k3/gcc_py_introspector
gcc/tree/tnode.py
1
1044
class TNode : def __init__(self, node_id, node_type, o): self.node_id=node_id self.node_type=node_type #self.o=o def nid(self): return self.node_id.n def pstack(self): r = "" debug( "Stack:%s" % pprint2.pformat(self.o.stack)) #debug(pprint2.pformat(di...
gpl-2.0
5,055,035,353,580,054,000
31.625
96
0.45977
false
3.293375
false
false
false
GutenkunstLab/SloppyCell
Example/PC12/PC12Run.py
1
1172
from SloppyCell.ReactionNetworks import * import Nets reload(Nets) import Experiments as Expts import Calculations as Calcs m = Model([ Expts.ErkMekTraverse2EGF.expt, Expts.ErkMekTraverse2NGF.expt, Expts.Raf1LandrethEGF.expt, Expts.Rap1YorkNGF.expt, Expts.RasGree...
bsd-3-clause
5,435,433,293,142,724,000
24.478261
66
0.685154
false
2.751174
false
false
false
lehmannro/translate
storage/xml_extract/unit_tree.py
1
4885
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2008-2010 Zuza Software Foundation # # This file is part of translate. # # translate 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 ...
gpl-2.0
5,338,542,481,059,170,000
39.371901
102
0.641146
false
3.795649
false
false
false
ayepezv/GAD_ERP
addons/website/models/ir_ui_view.py
2
8995
# -*- coding: ascii -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from itertools import groupby from lxml import etree from odoo import api, fields, models from odoo import tools from odoo.addons.website.models import website from odoo.http import request _logger = lo...
gpl-3.0
412,984,447,094,891,260
39.886364
135
0.572318
false
4.199346
false
false
false
bcstack/btsdk
shell/shell.py
1
3000
import sys, atexit import pickle import bluetooth as bt from cmd import Cmd from service import SerialPortService import socket banner = '''Welcome to btsdk shell. \tType 'help()' for help ''' class Shell(Cmd): prompt = 'btsdk> ' intro = "btsdk shell" def __init__(self): Cmd.__init__(self) ...
apache-2.0
7,593,908,226,832,237,000
26.027027
78
0.507
false
3.778338
false
false
false
kinsights/django-contrib-comments
tests/testapp/tests/test_templatetags.py
1
7995
from __future__ import absolute_import from django.contrib.contenttypes.models import ContentType from django.template import Template, Context from django_comments.forms import CommentForm from django_comments.models import Comment from testapp.models import Article, Author from . import CommentTestCase class Com...
bsd-3-clause
-1,461,776,287,184,920,800
39.378788
114
0.637398
false
3.810772
true
false
false
colinfong/AICombat
AICombat/battle.py
1
1488
# global imports import pygame # local imports import resource from definitions import terrain, action from square import Square from realbot import Realbot from dumbbot import Dumbbot class Battle(): def __init__(self): # Load terrain tiles self.terrainImages = {} self.terrainImages[ter...
gpl-2.0
2,995,180,122,049,652,700
29.367347
106
0.623656
false
3.665025
false
false
false
Zephor5/mypika
pooled_pika.py
1
7002
# coding=utf-8 import logging import threading from contextlib import contextmanager from pika.adapters.twisted_connection import TwistedChannel from pika.adapters.twisted_connection import TwistedProtocolConnection from pika.connection import Parameters from twisted.internet import defer from twisted.internet import ...
bsd-3-clause
-3,714,928,351,200,007,700
28.795745
86
0.517138
false
4.148104
false
false
false
lsaffre/lino-welfare
lino_welfare/modlib/integ/models.py
1
23340
# -*- coding: UTF-8 -*- # Copyright 2013-2018 Rumma & Ko Ltd # License: BSD (see file COPYING for details) """ The :xfile:`models` module for the :mod:`lino_welfare.modlib.integ` app. """ from __future__ import unicode_literals from builtins import str import logging logger = logging.getLogger(__name__) import date...
agpl-3.0
-1,453,504,115,902,986,000
35.333333
89
0.612664
false
3.648108
false
false
false
tensorflow/datasets
tensorflow_datasets/image/symmetric_solids/symmetric_solids.py
1
5595
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # 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 appl...
apache-2.0
5,088,339,265,059,656,000
36.3
87
0.690974
false
3.72008
false
false
false
bobmyhill/burnman
burnman/data/input_raw_endmember_datasets/HGP633data_to_burnman.py
2
9875
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2019 by the BurnMan team, released under the GNU # GPL v2 or later. # This is a standalone program that converts the Holland and Powell data format # into the standard burnman format ...
gpl-2.0
526,628,182,742,594,200
41.564655
121
0.458937
false
3.607965
false
false
false
hackerkid/zulip
zerver/lib/response.py
1
2912
from typing import Any, List, Mapping, Optional import orjson from django.http import HttpResponse, HttpResponseNotAllowed from django.utils.translation import ugettext as _ from zerver.lib.exceptions import JsonableError class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, re...
apache-2.0
1,714,913,067,446,472,200
32.860465
93
0.674107
false
4.038835
false
false
false
USGSDenverPychron/pychron
pychron/pipeline/plot/panels/ideogram_panel.py
1
1951
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
apache-2.0
-1,805,856,260,850,883,000
37.254902
81
0.509995
false
4.269147
false
false
false
blurstudio/cross3d
cross3d/classes/fcurve.py
1
17768
import os import math import hashlib import xml.dom.minidom from framerange import FrameRange from valuerange import ValueRange from cross3d.constants import ControllerType, TangentType, ExtrapolationType class Key(object): def __init__(self, **kwargs): self.value = float(kwargs.get('value', 0.0)) ...
mit
-7,578,486,437,210,674,000
33.967611
106
0.675203
false
3.157633
false
false
false
tunix/raptiye-django
raptiye/blog/widgets.py
1
2592
# raptiye # Copyright (C) 2009 Alper Kanat <alperkanat@raptiye.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gpl-3.0
-3,215,278,082,990,815,700
33.506849
97
0.567515
false
3.84
false
false
false
foresthz/fusion5.1
www/scm/viewvc/lib/viewvc.py
1
127915
# -*-python-*- # # Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved. # # By using this file, you agree to the terms and conditions set forth in # the LICENSE.html file which can be found at the top level of the ViewVC # distribution or at http://viewvc.org/license-1.html. # # For more information, visit h...
gpl-2.0
1,117,488,272,726,977,000
34.277165
172
0.585365
false
3.641397
false
false
false
spikeekips/txmongo2
setup.py
1
1049
# -*- coding: utf-8 -*- from setuptools import setup setup( name='txmongo2', description='another mongodb driver for twisted.', long_description=''' mongodb driver for twisted, forked from `https://github.com/oubiwann/txmongo.git`. still need for testing. ''', author='Spike^ekipS', author...
apache-2.0
-3,390,687,502,465,538,000
27.351351
89
0.570067
false
3.958491
false
false
false
iambrettstar/wemake
api/routes/polls_api.py
1
1487
from flask import abort, request from flask_restful import Resource from mysql.connector import Error from models.schemas import PollSchema from models import Poll class PollsAPI(Resource): @staticmethod def get(poll_id=None): """HTTP GET method - returns a list of polls if no id specified, ...
gpl-3.0
-3,734,023,964,343,934,000
26.537037
72
0.549428
false
4.478916
false
false
false
michaelwang/SlackImageStorage
SlackImageStorage/encryptedTools.py
1
1075
import string import base64 from Crypto.Cipher import AES import time class CryptoTool(object): def __init__(self): self.padding = '{' self.block_size = 32 self.pad = lambda s : s + (self.block_size - len(s) % self.block_size) * self.padding self.encodedAES = lambda c,s : base64.b6...
gpl-3.0
-3,576,943,901,784,612,000
34.833333
93
0.64186
false
3.77193
false
false
false
asockman/treemechanics
vtrees23.py
1
4109
""" trees v0.2 procedurally generated foliage (implicitly happy) agrippa kellum : june 2013 """ __all__ = ['Branch', 'Trunk'] import sys, random, math, time, visual as v, numpy as np class Branch(object): def __init__(self,inc,az,parent,origin): self.parent = parent self.size = 1 self.c...
mit
946,289,153,943,667,300
26.77027
114
0.563641
false
3.370796
false
false
false
AnykeyNL/uArmProPython
svg_example.py
1
1467
# Example made by OssiLehtinen # from svgpathtools import svg2paths, wsvg import numpy as np import uArmRobot import time #Configure Serial Port #serialport = "com3" # for windows serialport = "/dev/ttyACM0" # for linux like system # Connect to uArm myRobot = uArmRobot.robot(serialport,0) # user 0 for ...
gpl-3.0
5,763,393,511,411,950,000
23.45
92
0.69257
false
2.843023
false
false
false
Castronova/EMIT
wrappers/odm2_data.py
1
6423
__author__ = 'tonycastronova' import datetime as dt from api_old.ODM2.Core.services import readCore from api_old.ODM2.Results.services import readResults # from shapely import wkb import stdlib, uuid from utilities.status import Status import datatypes from utilities import geometry class odm2(object): def __init...
gpl-2.0
4,727,562,517,179,709,000
29.590476
107
0.589288
false
4.22844
false
false
false
openstack/manila
manila/common/constants.py
1
9242
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
7,765,387,853,528,770,000
30.222973
79
0.719325
false
3.048153
false
false
false
zjuchenyuan/BioWeb
Lib/Bio/SeqIO/SwissIO.py
1
6309
# Copyright 2006-2013 by Peter Cock. # Revisions copyright 2008-2009 by Michiel de Hoon. # All rights reserved. # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Bio.SeqIO support for the "swiss" ...
mit
-5,726,444,842,499,396,000
42.212329
90
0.606911
false
4.128927
false
false
false
jayrambhia/SimpleCV2
SimpleCV/Features/Superpixels.py
1
10945
from SimpleCV.base import cv2, np, LazyProperty, copy from SimpleCV.ImageClass import Image from SimpleCV.Features import Blob, FeatureSet from SimpleCV.Color import Color class SLIC: """ **SUMMARY** This class contains an implementation of the SLIC Superpixel algorithm by Achanta et al. (PAMI'12, vol...
bsd-3-clause
-863,911,276,328,462,000
35.605351
104
0.522979
false
3.77544
false
false
false
tectronics/faint-graphics-editor
python/generate/set_and_get.py
1
14757
# Copyright 2012 Lukas Kemmer # # 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 writ...
apache-2.0
-5,173,521,413,677,159,000
33.135714
89
0.530257
false
3.639211
false
false
false
aqavi-paracha/coinsbazar
qa/pull-tester/pull-tester.py
1
8761
#!/usr/bin/python import json from urllib import urlopen import requests import getpass from string import Template import sys import os import subprocess class RunError(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) def run(command, **kwar...
mit
-2,317,701,358,058,249,700
45.354497
260
0.647415
false
3.460111
true
false
false
Merlin71/Aria
schedule.py
1
11148
## @file ## @brief schedule implementation import ConfigParser import Queue import logging import threading import uuid from multiprocessing import Pool from time import sleep, time from pubsub import pub ## @class Schedule ## @brief Schedule for periodic task ## @details Allow creation start periodic tasks ## @warn...
gpl-3.0
-5,195,212,340,877,595,000
40.288889
117
0.63267
false
4.30591
true
false
false
unioslo/cerebrum
Cerebrum/modules/hostpolicy/HostPolicyConstants.py
1
3539
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of th...
gpl-2.0
6,810,090,009,265,447,000
36.252632
83
0.695677
false
3.701883
false
false
false
deapplegate/wtgpipeline
coadd_CR_removal.py
1
128247
#! /usr/bin/env python from __future__ import division #3/2=1.5 and 3//2=1 #adam-does# makes REMS masks #adam-use # use on clusters where we have wayyyy to many exposures in the lensing band to make masks by hand (i.e. RXJ2129) import sys #from import_tools import * import imagetools_light as imagetools import astropy ...
mit
4,366,150,895,433,374,000
52.369538
368
0.682698
false
2.630654
false
false
false
PaulWay/spacewalk
client/solaris/rhnclient/rhn/client/rhnLog.py
1
1423
#!/usr/bin/python # import time import string import config class Log: """ attempt to log all interesting stuff, namely, anything that hits the network any error messages, package installs, etc """ # " emacs sucks def __init__(self): self.app = "rhn client" self.cfg = config.initUp...
gpl-2.0
3,413,463,565,188,236,000
23.964912
79
0.529866
false
3.324766
false
false
false
clayz/crazy-quiz-web
src/entities/audit.py
1
1313
from google.appengine.ext import ndb from entities import BaseEntity class Purchase(BaseEntity): goods_id = ndb.IntegerProperty(required=True) version = ndb.StringProperty(required=True) date = ndb.DateTimeProperty(required=True) @classmethod def get_last(cls, user_key): return cls.query(...
apache-2.0
-4,952,125,220,807,724,000
28.2
60
0.71211
false
3.698592
false
false
false
kubeflow/examples
github_issue_summarization/pipelines/components/t2t/t2t-app/app/main.py
1
5290
# -*- coding: utf-8 -*- # Copyright 2018 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...
apache-2.0
-3,029,379,828,580,967,400
31.857143
88
0.681285
false
3.428386
false
false
false
hamicornfury/storyscape.django-
src/medialibrary/models.py
1
4634
""" Design of this model is influnced by Dublin Core Element Set Metadata. """ from django.db import models from django.contrib.auth.models import User from django.conf import settings import tagging from tagging.fields import TagField from django.forms import ModelForm, BooleanField # registered with tagging, de...
mit
-747,592,366,850,270,500
32.832117
101
0.672421
false
4.015598
false
false
false
Ghini/ghini.desktop
bauble/plugins/garden/accession.py
1
117889
# -*- coding: utf-8 -*- # # Copyright 2008-2010 Brett Adams # Copyright 2015-2016 Mario Frasca <mario@anche.no>. # Copyright 2017 Jardín Botánico de Quito # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-2.0
-6,980,470,676,698,707,000
39.042459
193
0.580702
false
3.865209
false
false
false
bluedynamics/activities.runtime
setup.py
1
1857
# -*- coding: utf-8 -*- # # Copyright 2009: Johannes Raggam, BlueDynamics Alliance # http://bluedynamics.com # GNU Lesser General Public License Version 2 or later __author__ = """Johannes Raggam <johannes@raggam.co.at>""" __docformat__ = 'plaintext' from setuptools import setup, find_packages import ...
lgpl-3.0
-5,878,272,516,904,475,000
31.578947
91
0.58643
false
3.951064
false
false
false
lukasgarcya/django-tutorial
financeiro/financeiro/settings.py
1
3178
""" Django settings for financeiro project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os...
gpl-3.0
2,011,637,693,139,170,300
25.264463
91
0.690686
false
3.535039
false
false
false
yashpungaliya/MailingListParser
lib/input/check_headers.py
1
11571
import email import imaplib import json from input.imap.connection import open_connection from input.imap.header import get_mail_header from util.read_utils import lines_per_n def get_unavailable_uid(): """ This function returns a list of UIDs that are not available in the IMAP server :retu...
gpl-3.0
2,200,656,162,760,982,300
42.164122
124
0.626739
false
3.922373
false
false
false
arnehilmann/sunstone-rest-client
src/main/python/sunstone_rest_client/__init__.py
1
8210
#!/usr/bin/env python from __future__ import print_function import json import logging import re import time import requests from bs4 import BeautifulSoup try: from logging import NullHandler except ImportError: from sunstone_rest_client.util import NullHandler class LoginFailedException(Exception): pas...
apache-2.0
-761,745,019,978,906,100
33.351464
119
0.583191
false
4.060336
false
false
false
TommyN94/CodeEvalSolutions
SwapCase.py
1
1155
# Swap Case # # https://www.codeeval.com/open_challenges/96/ # # Challenge Description: Write a program which swaps letters' case in a # sentence. All non-letter characters should remain the same. import string import sys def swap_case(input_string): swapped_string = '' for char in input_string: if c...
mit
-7,641,557,907,283,652,000
25.25
72
0.636364
false
3.586957
false
false
false
EmanueleCannizzaro/scons
test/Batch/up_to_date.py
1
3025
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # 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 us...
mit
5,646,750,723,889,606,000
31.526882
98
0.696529
false
2.813953
true
false
false
rroart/stockstat
tensorflow/flasktfmain.py
1
7375
#!/usr/bin/python3 from flask import Flask, request import sys from multiprocessing import Process, Queue import json from werkzeug.wrappers import Response def classifyrunner2(queue, request): cl.do_learntestclassify(queue, request) def predictrunner(queue, request): import predict pr = predict.Predic...
agpl-3.0
165,869,653,316,749,470
34.800971
237
0.588068
false
3.895932
true
false
false
zielmicha/pyjvm
tests/pystone/pystone.py
1
7376
#! /usr/bin/python2.7 """ "PYSTONE" Benchmark Program Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes) Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013. Translated from ADA to C by Rick Richardson. Every method to preserve ADA-likeness ha...
mit
2,755,744,318,415,412,700
26.318519
74
0.599919
false
3.298748
false
false
false
jwlin/web-crawler-tutorial
ch4/ptt_gossiping_ip.py
1
4276
import requests import time import json import re from bs4 import BeautifulSoup API_KEY = 'YOUR_KEY' # 須先到 ipstack.com 網頁右上角 GET FREE API KEY 註冊帳號取得 API KEY PTT_URL = 'https://www.ptt.cc' def get_web_page(url): resp = requests.get( url=url, cookies={'over18': '1'} ) if resp.status_code ...
mit
6,299,184,830,573,667,000
30.825
88
0.515191
false
2.766667
false
false
false
hakancelik96/coogger
core/threaded_comment/serializers.py
1
1282
from rest_framework import serializers from .models import ThreadedComments class ReplySerializer(serializers.ModelSerializer): username = serializers.ReadOnlyField(source="user.username") title = serializers.ReadOnlyField(source="user.userprofile.title") avatar_url = serializers.ReadOnlyField(source="us...
mit
-7,206,508,981,116,535,000
29.52381
83
0.561622
false
4.498246
false
false
false
palfrey/coherence
misc/Rhythmbox-Plugin/upnp_coherence/__init__.py
1
6137
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright 2008, Frank Scholz <coherence@beebits.net> # Copyright 2008, James Livingston <doclivingston@gmail.com> # # Licensed under the MIT license # http://opensource.org/licenses/mit-license.php import rhythmdb, rb import gobject, gtk i...
mit
8,870,718,566,587,604,000
33.672316
157
0.588398
false
3.809435
false
false
false
AddonScriptorDE/plugin.audio.vorleser_net
default.py
1
5734
#!/usr/bin/python # -*- coding: utf-8 -*- import urllib,urllib2,re,xbmcplugin,xbmcgui,sys,xbmcaddon,base64 pluginhandle = int(sys.argv[1]) addon = xbmcaddon.Addon(id='plugin.audio.vorleser_net') translation = addon.getLocalizedString def index(): addDir(translation(30001),"","listAllAuthors","") addDi...
gpl-2.0
-4,045,338,597,446,359,000
44.792
286
0.604298
false
3.19598
false
false
false
ihydrogen/hydrogen-chat-bot-py
utils/print_hook.py
1
2278
import sys # this class gets all output directed to stdout(e.g by print statements) # and stderr and redirects it to a user defined function class PrintHook: # out = 1 means stdout will be hooked # out = 0 means stderr will be hooked def __init__(self, out=1): self.func = None ##self.func is user...
apache-2.0
1,491,615,391,979,086,000
29.373333
83
0.514925
false
4.380769
false
false
false
artur-shaik/qutebrowser
qutebrowser/config/config.py
1
32194
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
gpl-3.0
-538,014,497,136,559,600
36.304751
79
0.571846
false
4.352305
true
false
false
thangbui/geepee
examples/dgpr_aep_examples.py
1
8718
print "importing stuff..." import numpy as np import pdb # import matplotlib # matplotlib.use('Agg') import matplotlib.pylab as plt from scipy import special from .context import aep from .datautils import step, spiral from .context import config def run_regression_1D(): np.random.seed(42) print "create dat...
mit
7,320,144,237,141,424,000
30.247312
76
0.503441
false
2.728638
false
false
false
jdemon519/cfme_tests
cfme/cloud/instance/gce.py
1
3774
from utils import version, deferred_verpick from cfme.exceptions import OptionNotAvailable from cfme.web_ui import fill, flash from cfme.fixtures import pytest_selenium as sel from . import Instance, select_provision_image class GCEInstance(Instance): # CFME & provider power control options START = "Start" ...
gpl-2.0
-7,548,639,809,491,895,000
36.366337
99
0.622152
false
4.226204
false
false
false
jbloom/mapmuts
scripts/mapmuts_inferdifferentialpreferences.py
1
19811
#!python """Infers differential preferences for each amino acid at each site. Written by Jesse Bloom, 2014. """ import re import sys import os import time import tempfile import math import copy import traceback import multiprocessing import warnings import cPickle import mapmuts import mapmuts.io import mapmuts.se...
gpl-3.0
-2,978,101,380,568,323,600
56.257225
377
0.63177
false
3.651124
false
false
false
lcostantino/healing-os
healing/actionexecutor/rpcapi.py
1
2386
# Copyright 2013, 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
1,756,752,875,997,406,200
36.28125
82
0.661358
false
3.905074
false
false
false
tridesclous/tridesclous
tridesclous/jobtools.py
1
5604
""" Some help function to compute in parallel processing at some stage: * CatalogueConstructor.run_signalprocessor = preprocessing + peak detection Used only for offline computation. This is usefull mainlly when the IO are slow. """ import time import os import loky #~ import concurrent.futures.ThreadPoolExecuto...
mit
-7,212,987,108,487,900,000
31.022857
143
0.627944
false
3.6366
false
false
false
klen/peewee_migrate
peewee_migrate/router.py
1
11193
"""Migration router.""" import os import pkgutil import re import sys from importlib import import_module from types import ModuleType from unittest import mock import peewee as pw from peewee_migrate import LOGGER, MigrateHistory from peewee_migrate.auto import diff_many, NEWLINE from peewee_migrate.migrator import...
bsd-3-clause
-2,340,202,740,054,259
32.713855
96
0.590994
false
4.139423
false
false
false
Aloomaio/googleads-python-lib
examples/ad_manager/v201805/order_service/create_orders.py
1
1807
#!/usr/bin/env python # # Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
3,779,387,657,084,411,000
29.627119
74
0.706696
false
3.522417
false
false
false
moneta-project/moneta-2.0.1.0
contrib/linearize/linearize-data.py
1
8603
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Moneta developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_functi...
mit
-2,063,092,180,579,883,300
27.772575
108
0.673835
false
2.794997
false
false
false
gear11/G11AWSTools
g11awstools/ec2.py
1
3772
__author__ = 'jenkins' import logging from subprocess import Popen, PIPE, STDOUT import json import itertools from g11pyutils import IndexedDictList, StopWatch import sys import argparse import time LOG = logging.getLogger("ec2") class ec2: """A base class for EC2 tools, including utility functions, and also a m...
gpl-3.0
4,127,796,341,156,811,000
38.302083
119
0.604454
false
3.904762
false
false
false
ghickman/djangopypi
djangopypi/models.py
1
6237
import os from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import simplejson as json from django.utils.datastructures import MultiValueDict from django.contrib.auth.models import User class PackageInfoField(models.Field): desc...
bsd-3-clause
-8,300,209,897,284,802,000
32.713514
87
0.636043
false
4.237092
false
false
false
aqisnotliquid/aqbot
aqbot/plugins/javascript.py
1
1061
import json import urllib3 from urllib.parse import quote, urlparse from aqbot.lib.plugins.plugin import PluginObject __all__ = ["JavascriptPlugin"] class JavascriptPlugin(PluginObject): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def setup(self): self.command_ma...
mit
-7,890,583,089,124,650,000
24.878049
61
0.576814
false
3.524917
false
false
false
ppyordanov/HCI_4_Future_Cities
Server/src/virtualenv/Lib/_weakrefset.py
1
5922
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
mit
4,164,580,266,749,653,500
26.544186
92
0.555049
false
4.138365
false
false
false
cowhi/HFO
experiments/agents/adhoc.py
1
8788
# -*- coding: utf-8 -*- """ Created on Thu Sep 8 09:21:38 2016 @author: Felipe Leno This file implements our advisor-advisee proposal. This agent act as SARSA, and the exploration strategy is changed according to our proposal """ from sarsatile import SARSATile from threading import Thread from advice_util import ...
mit
-6,799,699,553,853,046,000
36.241525
178
0.572827
false
4.091248
false
false
false
eReuse/DeviceHub
ereuse_devicehub/documents/documents.py
1
2092
from eve.auth import requires_auth from flask import Blueprint, request, render_template, Response, make_response from flask_weasyprint import HTML, render_pdf from pydash import identity from ereuse_devicehub.exceptions import WrongQueryParam from ereuse_devicehub.header_cache import header_cache from ereuse_devicehu...
agpl-3.0
-6,992,374,593,629,774,000
37.036364
87
0.659656
false
3.888476
false
false
false
IceCTF/ctf-platform
api/achievements/stage2/stage2.py
1
1105
def process(api, data): pid = data["pid"] stage = { "Open Sesame": "026cd71be5149e4c645a45b4915d9917", "Overflow 1": "0b944e114502bd1af14469dbb51b9572", "Overflow 2": "ee876f0736c4fe1b5607b68098f4cc1c", "Simple": "1fbb1e3943c2c6c560247ac8f9289780", "Diary": "edcf7eb3a7d5e...
mit
6,360,206,171,100,581,000
43.24
64
0.673303
false
2.278351
false
false
false
Landver/netmon
apps/customers/scripts.py
1
1047
import subprocess import os import pexpect def create_sub_folder(sub_folder, ftp_login, ftp_password, name_for_site_folder): '''create site_folder and subfolders''' path_to_backup_file = "/home/%s/%s/%s" % (ftp_login, name_for_site_folder, sub_folder) if not os.path.exists(path_to_backup_file): #...
mit
-130,851,163,906,361,420
37.814815
108
0.585482
false
3.525253
false
false
false
sosey/ginga
ginga/util/iohelper.py
1
2078
# # iohelper.py -- misc routines used in manipulating files, paths and urls. # # Eric Jeschke (eric@naoj.org) # # Copyright (c) Eric R. Jeschke. All rights reserved. # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # import os import re from ginga.misc import...
bsd-3-clause
-1,321,144,616,752,803,300
27.465753
76
0.586141
false
3.582759
false
false
false
shippableSamples/sample_python_coveralls
setup.py
1
1683
import sys from setuptools.command.test import test as TestCommand from setuptools import setup class PyTest(TestCommand): def finalize_options(self): TestCommand.finalize_options(self) self.test_args = [] self.test_suite = True def run_tests(self): import pytest errno...
mit
503,579,127,926,410,430
32.66
91
0.607249
false
3.950704
true
false
false
unreal666/outwiker
src/outwiker/gui/controls/texteditorbase.py
2
24214
# -*- coding: utf-8 -*- import codecs import html import wx import wx.lib.newevent from wx.stc import StyledTextCtrl, STC_CP_UTF8 import outwiker.core.system from outwiker.core.textprinter import TextPrinter from outwiker.gui.searchreplacecontroller import SearchReplaceController from outwiker.gui.searchreplacepanel...
gpl-3.0
5,251,865,995,897,898,000
40.134948
130
0.590974
false
3.074218
false
false
false
akvo/akvo-rsr
akvo/rsr/management/commands/fix_project_qualitative_narrative_text_update.py
1
1964
# -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from django.core.management.base...
agpl-3.0
-6,030,668,272,118,436,000
40.787234
116
0.678208
false
3.904573
false
false
false
MSchnei/py_pRF_motion
pyprf_feature/analysis/prepro/prepro_get_temp_info.py
1
1502
# -*- coding: utf-8 -*- """ Created on Wed Jul 11 18:51:28 2018 @author: marian """ import os import numpy as np import pickle # %% set parameters # set input path strPthPrnt = "/media/sf_D_DRIVE/MotionLocaliser/UsedPsychoPyScripts/P02/Conditions" # provide names of condition files in the order that they were show...
gpl-3.0
-3,106,941,908,621,377,000
23.225806
83
0.702397
false
2.992032
false
false
false
brendannee/Bikesy-Backend
pygs/graphserver/ext/osm/osmdb.py
2
14297
import sqlite3 import os try: import json except ImportError: import simplejson as json import sys import xml.sax import binascii from vincenty import vincenty from struct import pack, unpack from rtree import Rtree def cons(ary): for i in range(len(ary)-1): yield (ary[i], ary[i+1]) def pack_coord...
bsd-3-clause
7,347,071,993,847,417,000
28.417695
174
0.505491
false
3.657457
false
false
false
amlight/ofp_sniffer
libs/core/filters.py
1
6233
""" Filters to be used Any customized print filters should be inserted in this file Filters are provided via CLI option -F json-file """ from libs.core.printing import PrintingOptions from libs.core.sanitizer import Sanitizer from libs.tcpiplib.tcpip import get_ofp_version from libs.tcpiplib.process_data ...
apache-2.0
6,529,931,816,268,576,000
27.331818
78
0.589604
false
4.097962
false
false
false
dhahaj/py
sell.py
1
3010
import sys, subprocess from time import * from common import * from pprint import * def error(error=''): print 'Error:',error sys.exit(1) def parse_csv(what): if what.count(',') == 0: return list([what]) return val.split(',') a = sys.argv var = {'-s' : 'btc'} d = {} for i in range(a.__len__()): ...
mit
5,539,414,901,882,223,000
24.294118
84
0.544518
false
3.068298
false
false
false
Tesora-Release/tesora-trove
trove/common/single_tenant_remote.py
1
4173
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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
-379,479,486,372,407,360
33.204918
78
0.686556
false
3.773056
false
false
false
hpcloud-mon/monasca-perf
influx_test/test_305.py
1
1366
from testbase import TestBase from influxparawrite import InfluxParaWrite class test_305(TestBase): def run(self): self.env.sendSingleMetric(1,self.name,1) self.env.sendSingleMetric(2,self.name,2) self.env.sendSingleMetric(3,self.name,3) if self.env.countMetrics(1,self.name) != 3: ...
apache-2.0
-3,526,152,816,272,863,000
46.103448
123
0.5959
false
3.260143
false
false
false
x10an14/overtime-calculator
old-sanic/calculations.py
1
3169
"""Module containing majory of calulation functions and their helpers.""" from datetime import datetime from datetime import timedelta from collections import defaultdict from . import default_parse_fmt from . import log_function_entry_and_exit @log_function_entry_and_exit def parse_row(row, field_names, datetime_pa...
mit
6,430,448,965,321,955,000
33.824176
89
0.654465
false
3.706433
false
false
false
tundish/blue_monday_78
bluemonday78/utils/publisher.py
1
3924
#!/usr/bin/env python3 # encoding: UTF-8 # This file is part of Addison Arches. # # Addison Arches is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option)...
agpl-3.0
8,140,897,638,692,505,000
31.429752
84
0.612385
false
3.813411
false
false
false
ondrejch/FSM
MCNP/scripts/OLD/HexCore.py
1
4054
''' @ author: James Ghawaly Jr. @ version: 1.2 ''' import numpy import os class HexCore(): def __init__(self,side,hexSpace,coreRadius,coreHeight,rodRadius,rodHeight,radiusLimiter): # generics self.surfaceNumber = 0 self.cellNumber = 0 self.materNumber = 0 self.cente...
gpl-3.0
-8,050,590,374,423,078,000
35.196429
185
0.53404
false
3.274637
false
false
false
readline/btb
sortMatrix.py
1
2782
#!/usr/bin/env python # ============================================================================= # Filename: sortMatrix.py # Version: 1.0 # Author: Kai Yu - finno@live.cn # https://github.com/readline # Last modified: 2015-05-22 15:01 # Description: # This script can sort a matrix either by row or by column, e...
gpl-2.0
-5,350,637,548,227,602,000
29.23913
148
0.574407
false
3.512626
false
false
false
gfyoung/numpy
numpy/core/einsumfunc.py
2
51329
""" Implementation of optimized einsum. """ from __future__ import division, absolute_import, print_function import itertools from numpy.compat import basestring from numpy.core.multiarray import c_einsum from numpy.core.numeric import asanyarray, tensordot from numpy.core.overrides import array_function_dispatch _...
bsd-3-clause
551,246,019,888,227,500
34.995091
118
0.586043
false
3.859904
false
false
false
fnp/wolnelektury
src/wolnelektury/management/commands/localepack.py
1
9451
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # import os import shutil import sys import tempfile import allauth from django.conf import settings from django.core.management.base import BaseCommand from django.c...
agpl-3.0
127,870,635,041,599,140
33.23913
111
0.56709
false
3.78
false
false
false
sidus-dev/poseidon
include/theme.py
1
2058
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Poseidon. # # Poseidon 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
6,193,077,838,437,735,000
33.881356
104
0.69242
false
3.441472
false
false
false
mihaisoloi/conpaas
conpaas-services/contrib/libcloud/compute/drivers/opennebula.py
1
42567
# Copyright 2002-2009, Distributed Systems Architecture Group, Universidad # Complutense de Madrid (dsa-research.org) # # 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 ...
bsd-3-clause
2,607,744,555,827,277,300
33.355932
87
0.558743
false
4.413375
false
false
false
kkoci/orthosie
inventory/api_views.py
1
6650
# This file is part of Orthosie. # # Orthosie 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. # # Orthosie is distrib...
gpl-3.0
-2,889,850,686,731,528,000
30.818182
73
0.633835
false
3.93026
false
false
false
Eldinnie/python-telegram-bot
telegram/inline/inlinequeryresultcachedmpeg4gif.py
1
3903
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2018 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
gpl-3.0
4,835,468,741,908,030,000
45.464286
99
0.65898
false
4.187768
false
false
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_hub/models.py
1
205148
# -*- coding: utf-8 -*- """Application models.""" import copy import csv import os import random import re import secrets import string import uuid from collections import namedtuple from datetime import datetime from enum import IntEnum, IntFlag from functools import lru_cache from hashlib import md5 from io import S...
mit
-7,884,738,462,338,003,000
37.16707
117
0.521994
false
4.26317
false
false
false
vlfedotov/django-business-logic
tests/test_reference.py
1
2699
# -*- coding: utf-8 -*- from .common import * class ReferenceDescriptorTest(TestCase): def setUp(self): self.content_type = ContentType.objects.get_for_model(Model) def test_reference_descriptor_search_fields_empty(self): reference_descriptor = ReferenceDescriptor.objects.create(content_typ...
mit
-730,975,050,206,971,100
36.486111
102
0.685069
false
3.774825
true
false
false
krisawatson/plugin.video.genesis
modules/sources/xmovies8_mv.py
1
3436
# -*- 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 option) any ...
gpl-3.0
-7,435,579,324,462,938,000
35.553191
176
0.575378
false
3.639831
false
false
false
snehasi/servo
components/script/dom/bindings/codegen/CodegenRust.py
1
284971
# 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/. # Common codegen classes. from collections import defaultdict from itertools import groupby import operator import os ...
mpl-2.0
6,758,460,289,241,190,000
38.911905
120
0.569563
false
4.22392
false
false
false
john-tornblom/llvm-p86
llvm_p86/compiler.py
1
11818
# encoding: utf-8 # Copyright (C) 2013 John Törnblom # # This file is part of LLVM-P86. # # LLVM-P86 is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
-1,454,283,402,078,824,400
28.105911
78
0.556148
false
3.73601
false
false
false
weblyzard/weblyzard_api
src/python/weblyzard_api/model/__init__.py
1
18549
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Created on May 14, 2018 .. codeauthor: Max Göbel <goebel@weblyzard.com> ''' from __future__ import print_function from __future__ import unicode_literals from builtins import map from builtins import str from builtins import object import json import hashlib import logging...
apache-2.0
-1,612,660,601,922,884,600
35.511811
90
0.520649
false
4.111727
false
false
false
jsirois/pants
src/python/pants/engine/unions.py
1
4665
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from collections import defaultdict from dataclasses import dataclass from typing import DefaultDict, Iterable, Mapping, Type, TypeVar from pants.util....
apache-2.0
-1,717,259,079,218,027,300
38.533898
98
0.673955
false
4.049479
false
false
false
ZeitOnline/zeit.content.article
src/zeit/content/article/interfaces.py
1
7135
from zeit.content.article.i18n import MessageFactory as _ import zeit.cms.content.contentsource import zeit.cms.content.interfaces import zeit.cms.section.interfaces import zeit.content.article.source import zeit.content.cp.source import zeit.content.image.interfaces import zope.schema ARTICLE_NS = 'http://namespaces....
bsd-3-clause
6,100,495,689,345,631,000
26.548263
76
0.643588
false
4.019718
false
false
false
doge-search/webdoge
liqian/rice/scrap_professors.py
1
2173
#!/usr/bin/python #coding=utf-8 import urllib2 import HTMLParser import sys import xml.dom.minidom as minidom from htmlentitydefs import entitydefs import glob import requests.packages.urllib3.util.ssl_ requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = 'ALL' reload(sys) sys.setdefaultencoding('utf-8') class MyPar...
unlicense
446,444,873,430,418,800
23.426966
59
0.69075
false
2.936486
false
false
false
hivesolutions/appier
src/appier/test/util.py
1
46210
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Appier Framework # Copyright (c) 2008-2021 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apach...
apache-2.0
8,092,827,500,867,253,000
36.913997
181
0.5725
false
3.642908
true
false
false
kengz/Unity-Lab
slm_lab/agent/algorithm/hydra_dqn.py
1
6241
from slm_lab.agent import net from slm_lab.agent.algorithm import policy_util from slm_lab.agent.algorithm.sarsa import SARSA from slm_lab.agent.algorithm.dqn import DQN from slm_lab.lib import logger, util from slm_lab.lib.decorator import lab_api import numpy as np import torch logger = logger.get_logger(__name__) ...
mit
-135,697,500,058,434,270
49.739837
178
0.627784
false
3.578555
false
false
false