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
JasonDeving/python_game
character.py
1
1119
import random from combat import Combat class Character(Combat): attack_limit = 10 experience = 0 base_hit_points = 10 def attack(self): roll = random.randint(1, self.attack_limit) if self.weapon == 'sword': roll += 1 elif self.weapon == 'axe': roll +=2 return roll > 4 def ...
mit
-2,028,627,748,923,431,400
22.829787
83
0.572833
false
NMGRL/pychron
pychron/lasers/laser_managers/chromium_laser_manager.py
1
9853
# =============================================================================== # Copyright 2015 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/licenses...
apache-2.0
1,684,627,198,782,123,500
30.580128
115
0.533036
false
b52/lala
setup.py
1
1548
#!/usr/bin/env python # Copyright (C) 2010 Oliver Mader <b52@reaktor42.de> # # 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 # t...
mit
83,876,511,869,762,020
39.736842
79
0.742248
false
zamzterz/Flask-pyoidc
tests/test_pyoidc_facade.py
1
13038
import time import base64 import pytest import responses from oic.oic import AuthorizationResponse, AccessTokenResponse, TokenErrorResponse, OpenIDSchema, \ AuthorizationErrorResponse from urllib.parse import parse_qsl, urlparse from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata...
apache-2.0
-6,834,126,658,428,720,000
48.954023
118
0.613208
false
django-stars/pytest-yapf
pytest_yapf.py
1
2014
import os from yapf.yapflib import file_resources from yapf.yapflib.style import CreateStyleFromConfig from yapf.yapflib.yapf_api import FormatFile import pytest def pytest_addoption(parser): group = parser.getgroup('yapf') group.addoption('--yapf', action='store_true', help='run yapf on *.py files.') g...
mit
5,730,433,035,302,565,000
34.333333
116
0.634062
false
tupes/School
CS333/utilities.py
1
1130
from string import ascii_letters import re NONLETTERS_PATTERN = re.compile('[^A-Z]') def removeTextNonLetters(message): return NONLETTERS_PATTERN.sub('', message.upper()) def removeBinaryNonLetters(message): return ''.join([chr(b).upper() for b in message if chr(b) in ascii_letters]) def getInBothCount(s1, s2):...
gpl-3.0
2,740,902,373,908,748,300
20.730769
77
0.653982
false
shakedel/tensorboard
tensorboard/plugins/distribution/distributions_plugin.py
1
2702
# Copyright 2017 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
3,228,192,643,375,584,000
34.552632
80
0.699852
false
alip/pinktrace
python/TEST_socket.py
1
1433
#!/usr/bin/env python # coding: utf-8 import os, signal, socket, sys, unittest sys.path.insert(0, '.') import pinktrace import pinktrace.event import pinktrace.socket import pinktrace.syscall import pinktrace.trace UNAME = os.uname() class TestSocket_01_Invalid(unittest.TestCase): def test_01_name(self): ...
bsd-3-clause
-1,387,399,357,694,751,200
32.325581
101
0.701326
false
vismartltd/edx-platform
common/lib/capa/capa/tests/test_input_templates.py
1
39385
""" Tests for the logic in input type mako templates. """ import unittest import capa import os.path import json from lxml import etree from mako.template import Template as MakoTemplate from mako import exceptions from capa.inputtypes import Status class TemplateError(Exception): """ Error occurred while re...
agpl-3.0
-6,188,294,893,259,739,000
39.686983
113
0.551708
false
bburan/psiexperiment
tests/test_expression.py
1
3838
import pytest import unittest import numpy as np from atom.api import Atom, Bool from psi.context.expression import Expr, ExpressionNamespace class TestExpression(unittest.TestCase): def test_eval(self): context = dict(a=1, b=2, c=3) test_cases = [ ('1+2', 3), ...
mit
-7,155,792,216,147,302,000
29.459016
79
0.563835
false
nuclon/gnlpy
taskstats.py
1
3337
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """Taskstats module Thi...
bsd-3-clause
2,638,740,090,719,133,000
32.707071
78
0.64519
false
adaptivdesign/odooku-compat
odooku/services/wsgi/server.py
1
1636
from gevent.wsgi import WSGIServer as BaseWSGIServer from werkzeug.debug import DebuggedApplication from werkzeug.contrib.fixers import ProxyFix import odoo.http from odoo.service.wsgi_server import application_unproxied as odoo_application from odoo.tools import config import logging import greenlet import gevent ...
apache-2.0
-1,330,788,283,459,864,000
29.867925
78
0.659535
false
rvlad1987/repository.rvlad1987.xbmc-addons
matrix/source/plugin.video.filmix.net.dev/core/image_loader.py
1
8009
# -*- coding: utf-8 -*- # Used in # http.py - format_poster_link() # list.py - add_movies() import xbmcvfs import xbmcup.app, xbmcup.net from .xbmcup.db import SQL from .xbmcup.system import FS from .image_size import get_image_size_from_bytesio from .auth import Auth from .defines import * # https://githu...
gpl-2.0
-6,628,772,293,520,631,000
36.083333
182
0.637408
false
Ruide/angr-dev
cle/cle/backends/elf/symbol.py
1
2191
from ..symbol import Symbol from ...address_translator import AT class ELFSymbol(Symbol): """ Represents a symbol for the ELF format. :ivar str elftype: The type of this symbol as an ELF enum string :ivar str binding: The binding of this symbol as an ELF enum string :ivar section: ...
bsd-2-clause
-9,152,794,862,424,601,000
44.645833
96
0.584665
false
featherweightweb/django-composer
composer/templatetags/composer.py
1
5201
""" composer.py """ from django import template from django.conf import settings from django.core.urlresolvers import reverse from ..models import Element register = template.Library() class LazyContent: """ Wrapper around a `NodeList` that is lazily-evaluated to a string. """ def __init__(self, no...
mit
-3,234,653,981,534,419,500
29.775148
99
0.592386
false
openaid-IATI/OIPA
OIPA/api/country/tests/test_country_serializers.py
1
3343
from unittest import skip from django.contrib.gis.geos import Point from django.test import RequestFactory, TestCase from api.country import serializers from geodata.factory import geodata_factory class TestCountrySerializers(TestCase): request_dummy = RequestFactory().get('/') @skip def test_CountrySe...
agpl-3.0
-422,782,868,062,683,260
31.77451
78
0.512115
false
russross/codegrinder
files/python3unittest/tests/asttest.py
1
9348
import ast import os import sys import trace import unittest class ASTTest(unittest.TestCase): def setUp(self, filename, parse_file=True): """Stores the raw text of the student submission, the lines that were printed when executing the student submission, and the AST tree of the submission...
agpl-3.0
-8,695,240,081,531,041,000
38.443038
126
0.607082
false
navjeet0211/Mara
ANN/Learn.py
1
2320
#!/usr/bin/python # -*- coding: ISO-8859-1 -*- """ Mara.ANN.Learn (v. 0.1): Learning algorithms for neural networks. Author: Martti Louhivuori (martti.louhivuori@helsinki.fi) Date: 14.2.2006 """ class Teacher: def __init__(self, net, method='bp', targets=None, rate=1, gradient_delta=...
gpl-2.0
3,202,342,299,023,073,000
30.351351
105
0.496552
false
lutris/lutris
lutris/util/wine/wine.py
1
15483
"""Utilities for manipulating Wine""" import os from collections import OrderedDict from functools import lru_cache from gettext import gettext as _ from lutris import runtime, settings from lutris.gui.dialogs import DontShowAgainDialog, ErrorDialog from lutris.runners.steam import steam from lutris.util import linux,...
gpl-3.0
8,157,385,588,169,447,000
33.950339
105
0.639346
false
dkamotsky/program-y
src/programy/brain.py
1
12686
""" Copyright (c) 2016 Keith Sterling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
mit
-2,240,654,620,025,691,600
40.188312
126
0.67271
false
Inmersa/Utilities
crontab/inmersa/scheduler/__init__.py
1
25463
__author__="tite" __date__ ="$Jul 18, 2014 7:48:18 AM$" import os import sys import string import datetime import traceback from types import * import ConfigParser import smtplib import logging import logging.config import extractors import formatters from email.MIMEMultipart import MIMEMultipart from email.MIMETex...
gpl-2.0
-723,263,891,476,053,800
44.307829
171
0.535365
false
small-yellow-rice/qt
quokka_themes/__init__.py
1
18620
# -*- coding: utf-8 -*- """ Quokka-Themes ============= This provides infrastructure for theming support in your Quokka applications. It takes care of: - Loading themes - Rendering their templates - Serving their static media - Letting themes reference their templates and static media :based in: 2013 Christopher Car...
mit
-4,202,205,206,850,931,700
33.609665
124
0.614017
false
Disguisenberg/Metastasis-Framework
template/template.py
1
2293
import ctypes # ctypes makes it very simple to interact with the Windows API in a python script,so it will be a required import for this script. It provides C compatible data types and allows calling functions in DLLs or shared libraries shellcode = ( ); # Shellcode - This is the shellcode that will be injected into me...
mit
2,696,099,267,623,453,000
90.72
277
0.685565
false
JudoWill/glue
glue/core/tree.py
1
9288
from __future__ import absolute_import, division, print_function import numpy as np __all__ = ['Tree', 'NewickTree', 'DendroMerge'] class Tree(object): """ Base class for hierarchical segmentations of data sets. The tree is represented by its root node, which contains reference to 0 or more childre...
bsd-3-clause
-7,541,047,189,419,370,000
26.560831
75
0.502369
false
lemieuxl/pyGenClean
pyGenClean/__init__.py
1
1723
# This file is part of pyGenClean. # # pyGenClean 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. # # pyGenClean is distributed in the...
gpl-3.0
-5,714,978,892,215,041,000
29.767857
79
0.69704
false
trevor/calendarserver
calendarserver/tools/shell/cmd.py
1
21936
## # Copyright (c) 2011-2014 Apple 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 l...
apache-2.0
-2,939,539,558,737,499,600
24.388889
90
0.532914
false
sckasturi/saltlake
commands/creffett.py
1
1622
# Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser # # 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 Licen...
gpl-2.0
4,373,758,906,741,645,000
40.589744
112
0.660296
false
IntegratedAlarmSystem-Group/ias
CompElement/src/main/python/IasTransferFunction/TransferFunction.py
1
4513
import logging class TransferFunction(object): ''' Base (and abstract) class to provide TFs in python programming language. Usage: python TF implementations must extend this class and provide, as a minimum, the implementation of the transfer method. It is the python equivalent of the JavaTransfer...
lgpl-3.0
4,129,720,936,681,593,300
36.305785
104
0.637049
false
ajportier/djauction
models.py
1
3333
from django.db import models STATE_CHOICES = ( ('pa', 'Pennsylvania'), ('nj', 'New Jersey'), ) ITEM_CHOICES = ( ('event','Event'), ('food','Food'), ('goods','Goods'), ('service','Service'), ('other','Other'), ) PAYMENT_CHOICES = ( ('none','None'), ('cash','Cash'), ('check','Ch...
gpl-3.0
-4,610,285,118,682,957,000
29.861111
93
0.663366
false
heprom/pymicro
pymicro/external/YappsStarParser_2_0.py
1
21486
# To maximize python3/python2 compatibility from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from .StarFile import StarBlock,StarFile,StarList,StarDict from io import StringIO # An alternative specification for the Cif ...
mit
7,016,748,564,123,988,000
57.227642
479
0.602066
false
dafrito/trac-mirror
trac/wiki/tests/wikisyntax.py
1
35299
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
bsd-3-clause
8,973,763,177,520,281,000
43.363032
346
0.642247
false
jexhson/rbx
rbx/parser/component.py
1
4537
from .base import RbxBaseParser class RbxComponentParser(RbxBaseParser): def build_parser(self): parser = self.subparsers.add_parser('component', help='Manage Run in the Box components') parser.add_argument('name', help='Component\'s name to work on') self.componen...
gpl-2.0
4,179,731,277,519,826,000
38.452174
73
0.623099
false
andre-richter/pcie-lat
all_in_one.py
1
6054
#!/usr/bin/python import sys import os import numpy as np import matplotlib import matplotlib.mlab as mlab import matplotlib.pyplot as plt import subprocess import traceback pci_dev ={ "name" : "", "loc" : "", "class" : "", "vender" : "", "device" : "", "vd" : "", ...
gpl-2.0
-6,173,611,715,893,738,000
31.202128
88
0.49042
false
michaelBenin/sqlalchemy
lib/sqlalchemy/engine/interfaces.py
1
30297
# engine/interfaces.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Define core interfaces used by the engine system.""" from .. import util, eve...
mit
-8,414,418,792,345,684,000
29.727181
84
0.658844
false
oyisre/discordbottery
cogs/tasks.py
1
2963
from discord.ext import commands from cogs import queries import aiohttp import asyncio import random import time # global vars session = aiohttp.ClientSession() class Tasks: """auto""" def __init__(self, bot: commands.Bot): self.bot = bot async def zooboys(self): """ sends a message to ...
unlicense
598,148,637,547,744,300
41.328571
91
0.498819
false
swprojects/Advanced-Action-Scheduler
advancedactionscheduler/schedulemanager.py
1
12301
# -*- coding: utf-8 -* """ @author Simon Wu <swprojects@runbox.com> Copyright (c) 2018 by Simon Wu <Advanced Action Scheduler> 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...
gpl-2.0
7,758,715,840,575,937,000
37.077399
111
0.553947
false
Karandash8/CLAUDE
framework/message.py
1
8861
''' Created on May 4, 2017 @author: andrei ''' import logging import abc from framework.misc import exception class PRTCL_SIGNATURE: CLAUDE_SYS_PRTCL = 'CLAUDE-SYS-PRTCL' CLAUDE_DSCVRY_PRTCL = 'CLAUDE-DSCVRY-PRTCL' CLI_TO_JM_PRTCL = 'CLI-TO-JM-PRTCL' JM_TO_JS_PRTCL = 'JM-TO-JS-PRTCL' JS_TO_RD_...
gpl-3.0
3,793,492,110,004,785,000
28.638796
156
0.574879
false
mitmedialab/MediaCloud-Web-Tools
server/__init__.py
1
9337
import json import logging.config import os import sys import tempfile from flask import Flask, render_template from flask_webpack import Webpack from flask_mail import Mail import flask_login from raven.conf import setup_logging from raven.contrib.flask import Sentry from raven.handlers.logging import SentryHandler im...
apache-2.0
5,585,641,705,978,839,000
35.615686
113
0.682339
false
ideanotion/infoneigeapi
api/serializers.py
1
3425
from __future__ import unicode_literals from api.models import * from rest_framework_mongoengine.serializers import MongoEngineModelSerializer import warnings from django.core.exceptions import ValidationError from mongoengine.errors import ValidationError from rest_framework import serializers from rest_framework impo...
gpl-2.0
-2,298,330,859,549,157,400
34.319588
143
0.770511
false
hthiery/python-lacrosse
pylacrosse/lacrosse.py
1
8422
# Copyright (c) 2017 Heiko Thiery # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distrib...
lgpl-2.1
5,584,597,985,003,810,000
32.420635
80
0.553906
false
open-synergy/opnsynid-account-payment
account_payment_import_no_move_line/tests/base.py
1
2437
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp.tests.common import TransactionCase from datetime import datetime class BaseTest(TransactionCase): def setUp(self, *args, **kwargs): super(BaseTest, self).setUp(*arg...
agpl-3.0
2,740,612,655,803,864,600
35.924242
75
0.587608
false
grypyrg/mha-helper
mha_helper/vip_metal_helper.py
1
4494
# (c) 2015, Ovais Tariq <me@ovaistariq.net> # # This file is part of mha_helper # # 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...
gpl-3.0
-1,085,869,760,472,651,600
39.125
118
0.613262
false
dcneeme/droidcontroller
cchannels.py
1
20840
# to be imported to access modbus registers as counters # 04.04.2014 OOP # 05.04.2014 OOP # 06.04.2014 counter grousp with sequential regadd range, optimized read done # 15.04.2014 added ask_counters() from sqlgeneral import * # SQLgeneral / vaja ka time,mb, conn jne s=SQLgeneral() # init sisse? from counter2power im...
gpl-3.0
-895,499,548,288,928,400
47.240741
182
0.517658
false
ramusus/django-facebook-ads
facebook_ads/migrations/0014_auto__add_field_adstatistic_reach__add_field_adstatistic_frequency__ad.py
1
14442
# 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 'AdStatistic.reach' db.add_column('facebook_ads_adstatistic', 'reach', self.gf('django.db.m...
bsd-3-clause
7,205,643,682,640,550,000
76.645161
183
0.567304
false
Alwnikrotikz/kegbot
pykeg/src/pykeg/core/migrations/0046_session_stats.py
1
26297
# 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 model 'SessionStats' db.create_table('core_sessionstats', ( ('stats', self.gf('py...
gpl-2.0
-7,894,830,673,467,085,000
78.207831
179
0.541088
false
apache/airflow
airflow/providers/google/cloud/operators/pubsub.py
2
40994
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
2,101,356,312,022,905,300
42.058824
103
0.64576
false
ubc/compair
compair/tests/learning_records/test_assignment_events.py
1
11445
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import pytz from data.fixtures.test_data import SimpleAssignmentTestData, LTITestData from compair.tests.test_compair import ComPAIRLearningRecordTestCase from compair.core import db from flask_login import current_app from compair.learning_...
gpl-3.0
5,911,816,738,190,630,000
43.019231
137
0.54574
false
usc-isi-i2/WEDC
spark_dependencies/python_lib/nose2/suite.py
1
3721
import sys import inspect import logging from nose2 import util from nose2.compat import unittest log = logging.getLogger(__name__) __unittest = True # # Layer suite class # class LayerSuite(unittest.BaseTestSuite): def __init__(self, tests=(), layer=None): super(LayerSuite, self).__init__(tests) ...
apache-2.0
8,640,215,469,874,628,000
27.623077
82
0.536415
false
alphagov/notifications-admin
app/main/views/new_password.py
1
2001
import json from flask import ( current_app, flash, redirect, render_template, request, session, url_for, ) from itsdangerous import SignatureExpired from notifications_utils.url_safe_token import check_token from app.main import main from app.main.forms import NewPasswordForm from app.mod...
mit
-857,660,782,628,308,500
36.055556
111
0.648176
false
yochow/autotest
client/bin/harness_unittest.py
1
1129
#!/usr/bin/python import unittest import common import harness, harness_standalone, harness_ABAT from autotest_lib.client.common_lib.test_utils import mock class harness_unittest(unittest.TestCase): def setUp(self): self.god = mock.mock_god() def tearDown(self): self.god.unstub_all() d...
gpl-2.0
-4,472,820,272,422,862,000
24.088889
69
0.649247
false
harigov/newsalyzer
shared/summarizer.py
1
1055
from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer as Summarizer from sumy.nlp.stemmers import Stemmer from sumy.utils import get_stop_words # summarizer requires this to work import nltk nltk.download('punkt') class ArticleSumma...
mit
8,104,878,361,753,222,000
32
82
0.653081
false
crflynn/fbm
setup.py
1
1318
"""Setup.""" import io from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) # io.open for py27 with io.open(path.join(here, "README.rst"), encoding="utf-8") as f: long_description = f.read() # import __version__ attributes about = {} with open(path.join(here, "fbm", "__...
mit
2,899,985,746,063,158,300
27.652174
71
0.60698
false
assamite/TwatBot
tweets/migrations/0008_auto__add_urltweetimage.py
1
10052
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'URLTweetImage' db.create_table(u'tweets_urltweetimage', (...
mit
7,883,426,377,490,909,000
68.8125
163
0.540788
false
salspaugh/splparser
splparser/rules/strcatrules.py
1
1210
#!/usr/bin/env python from splparser.parsetree import * from splparser.exceptions import SPLSyntaxError from splparser.rules.common.fieldrules import * from splparser.rules.common.fieldlistrules import * from splparser.rules.common.valuerules import * from splparser.lexers.strcatlexer import precedence, tokens star...
bsd-3-clause
7,799,196,665,154,092,000
30.842105
65
0.670248
false
funkbit/django-payex
djpayex/views.py
1
1610
import logging from django.conf import settings from django.http import HttpResponse, HttpResponseNotAllowed from payex.service import PayEx from djpayex.models import TransactionStatus logger = logging.getLogger(__name__) # Initialize PayEx service service = PayEx( merchant_number=settings.PAYEX_MERCHANT_NUMBE...
bsd-2-clause
-4,014,406,681,933,296,000
30.568627
131
0.68882
false
pjuren/pyokit
src/pyokit/io/repeatmaskerAlignments.py
1
38860
""" Date of Creation: 11th Dec 2014 Description: Classes and functions for IO of repeatmasker pairwise alignments. Copyright (C) 2010-2015 Philip J. Uren, Authors: Philip J. Uren This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gener...
lgpl-2.1
2,046,055,904,560,101,600
40.561497
90
0.56526
false
adborden/swagger-py
swaggerpy_test/loader_test.py
2
1213
#!/usr/bin/env python # # Copyright (c) 2013, Digium, Inc. # import unittest import swaggerpy from swaggerpy import swagger_model class TestProcessor(swagger_model.SwaggerProcessor): def process_resource_listing(self, resources, context): resources['processed'] = True class LoaderTest(unittest.TestCa...
bsd-3-clause
4,569,353,490,463,303,700
27.880952
72
0.619126
false
garvenshen/zeda-swift
swift/account/auditor.py
1
5227
# Copyright (c) 2010-2012 OpenStack, 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 ...
apache-2.0
-9,029,602,981,438,420,000
41.153226
79
0.55309
false
chaserhkj/PyComicCast
ComicCast.py
1
3515
#!/usr/bin/env python2 # Copyright (c) 2014 Chaserhkj # This software is licensed under the MIT license. # See LICENSE for more details. import tornado.web as web import tornado.template as template import tornado.ioloop as ioloop import os,sys,mimetypes import rarfile,zipfile supported_archive = [".zip", ".rar"] su...
mit
7,905,393,709,264,332,000
27.346774
106
0.565576
false
vpistis/soapfish
soapfish/py2xsd.py
1
11116
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import imp import inspect import itertools import logging import six import textwrap from lxml import etree from . import namespaces as ns from . import xsd, xsdspec from .compat import basestring from .utils import ...
bsd-3-clause
-7,496,999,152,012,229,000
37.199313
121
0.66004
false
GoogleCloudPlatform/PerfKitExplorer
server/perfkit/explorer/handlers/data.py
1
10892
"""Copyright 2014 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 agreed to in ...
apache-2.0
-780,532,374,467,009,900
32.826087
87
0.685274
false
GenericMappingTools/gmt-python
examples/tutorials/vectors.py
1
13414
""" Plotting vectors ================ Plotting vectors is handled by :meth:`pygmt.Figure.plot`. """ # sphinx_gallery_thumbnail_number = 6 import numpy as np import pygmt ######################################################################################## # Plot Cartesian Vectors # ---------------------- # # Crea...
bsd-3-clause
3,405,470,525,067,376,000
29.27991
96
0.601387
false
fredmorcos/attic
projects/plantmaker/archive/20100707/src/extra/schedule.py
1
2899
from printer import pretty, GREEN, YELLOW, CYAN class Schedule(object): def __init__(self): self.schedule = [] self.startTimes = [] self.finishTimes = [] self.report = {} self.fitness = None self.startTime = (2,0,0) def maxTime(self): if len(self.schedule) > 0: maxTime = self.schedule[0][2] for ...
isc
3,933,606,255,565,375,000
24.429825
99
0.549845
false
all-of-us/raw-data-repository
rdr_service/alembic/versions/5a1b1f7b4761_add_columns_to_genomic_member_.py
1
2128
"""add columns to genomic_set_member Revision ID: 5a1b1f7b4761 Revises: f3fdb9d05ab3 Create Date: 2019-09-17 16:06:00.824574 """ from alembic import op import sqlalchemy as sa import rdr_service.model.utils from sqlalchemy.dialects import mysql from rdr_service.participant_enums import PhysicalMeasurementsStatus, Qu...
bsd-3-clause
2,115,397,206,497,490,700
33.322581
125
0.74765
false
ohanar/PolyBoRi
pyroot/polybori/intersect.py
1
1391
# # intersect.py # PolyBoRi # # Created by Michael Brickenstein on 2008-09-24. # Copyright 2008 The PolyBoRi Team # from polybori.gbcore import groebner_basis from polybori.statistics import used_vars_set from itertools import chain def intersect(i, j, **gb_opts): """ This functions intersects two ideals...
gpl-2.0
2,140,742,197,082,218,500
29.23913
110
0.632638
false
denys-duchier/Scolar
ZScoDoc.py
1
35299
# -*- mode: python -*- # -*- coding: iso8859-15 -*- ############################################################################## # # Gestion scolarite IUT # # Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the ter...
gpl-2.0
-8,725,492,649,563,317,000
37.161081
191
0.58962
false
sajao/CrisisLex
src-create/build.py
1
9212
# CrisisLex # Author: Alexandra Olteanu # Check LICENSE for details about copyright. #TO-DO: further testing and code cleaning will be done import nltk import math import os import glob import networkx as nx from optparse import OptionParser from nltk.stem.porter import PorterStemmer import read import config import...
mit
-338,848,510,721,207,400
38.371795
201
0.615176
false
Kriechi/mitmproxy
test/mitmproxy/addons/test_dumper.py
1
8019
import io import shutil from unittest import mock import pytest from mitmproxy import exceptions from mitmproxy.addons import dumper from mitmproxy.http import Headers from mitmproxy.test import taddons from mitmproxy.test import tflow from mitmproxy.test import tutils def test_configure(): d = dumper.Dumper() ...
mit
5,039,793,679,587,431,000
31.204819
100
0.605188
false
ruud-v-a/rhythmbox
plugins/lyrics/lyrics.py
2
13937
# -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*- # # Copyright (C) 2006 Jonathan Matthew # Copyright (C) 2007 James Livingston # Copyright (C) 2007 Sirio Bolaños Puchet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
gpl-2.0
-9,014,837,923,013,151,000
27.853002
132
0.693456
false
dayongxie/mod-pbxproj
pbxproj/pbxextensions/ProjectGroups.py
2
6229
from pbxproj.pbxsections import * class ProjectGroups: """ This class provides separation of concerns, this class contains all methods related to groups manipulations. This class should not be instantiated on its own """ def __init__(self): raise EnvironmentError('This class cannot be ins...
bsd-3-clause
-8,915,274,105,796,946,000
39.448052
124
0.630599
false
relet/phenny-games
modules/taboo.py
1
8756
#!/usr/bin/env python """a taboo extension for phenny (c)opyleft 2008-2009 Thomas Hirsch Licence: GPL""" import bz2, random, time, yaml, re from operator import itemgetter from math import floor dico = {} DEFINE_NONE = None DEFINE_DEFINE = 1 #status codes for the define game DEFINE_SELECT = 2 commonwords = [] #co...
mit
-4,444,352,367,475,145,000
30.049645
147
0.6254
false
priyaganti/rockstor-core
src/rockstor/storageadmin/views/pool_balance.py
1
4945
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
gpl-3.0
4,099,229,094,232,960,000
40.90678
79
0.611325
false
xzzy/statdev
approvals/migrations/0001_initial.py
1
3974
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-08-06 02:49 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
apache-2.0
4,364,313,000,562,383,000
66.355932
326
0.617011
false
CospanDesign/nysa-demo-platform
local_install.py
1
3208
#! /usr/bin/python # Copyright (c) 2015 Dave McCoy (dave.mccoy@cospandesign.com) # # Nysa 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 # any later version. # # Nysa is d...
mit
-4,583,748,255,007,478,300
28.431193
85
0.645262
false
amarin/oupyc
oupyc/application/__init__.py
1
6562
# -*- coding: utf-8 -*- from threading import RLock from oupyc.application.condition import ConditionGenerator from oupyc.application.generator import GeneratorThread from oupyc.application.processor import ProcessorThread from oupyc.application.router import RouterThread from oupyc.application.transformer import Tran...
gpl-2.0
-5,474,336,323,609,977,000
32.309645
116
0.594636
false
tropp/acq4
acq4/analysis/dataModels/PatchEPhys/PatchEPhys.py
1
32235
# -*- coding: utf-8 -*- import acq4.util.DataManager as DataManager import acq4.util.SequenceRunner as SequenceRunner from collections import OrderedDict import functools from acq4.util.metaarray import * import numpy as np protocolNames = { 'IV Curve': ('cciv.*', 'vciv.*'), 'Photostim Scan': (), 'Photosti...
mit
6,986,205,411,136,417,000
38.455324
131
0.58452
false
danthedeckie/streetsign
streetsign_server/logic/feeds_and_posts.py
1
5888
# -*- coding: utf-8 -*- # StreetSign Digital Signage Project # (C) Copyright 2013 Daniel Fairhead # # StreetSign 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, o...
gpl-3.0
-3,678,719,408,436,776,400
34.257485
79
0.60411
false
ngsutils/ngsutils
ngsutils/bam/check.py
1
1354
#!/usr/bin/env python ## category Misc ## desc Checks a BAM file for corruption ''' Checks a BAM file for corruption ''' import sys import os import ngsutils.bam def bam_check(fname, quiet=False): if not quiet: sys.stdout.write('%s: ' % fname) sys.stdout.flush() fail = False i = 1 try...
bsd-3-clause
1,421,671,888,555,323,100
18.623188
60
0.512555
false
jmercier/Codebench
threads.py
1
2394
import threading import Queue import traceback from functools import wraps class Worker(threading.Thread): stopevent = False def __init__(self, *args, **kw): threading.Thread.__init__(self, *args, **kw) self.q = Queue.Queue() self.start() def run(self): o = self.q.get() while not self.stopevent: fct, ...
mit
-5,936,050,376,260,728,000
22.70297
68
0.597744
false
Open-I-Beam/swift-storlets
Engine/swift/storlet_gateway/storlet_runtime.py
1
24362
'''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 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/...
apache-2.0
412,615,498,885,021,600
37.305031
112
0.578729
false
irinabov/debian-pyngus
pyngus/sockets.py
1
4044
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use thi...
apache-2.0
-6,626,798,108,324,280,000
32.421488
78
0.612018
false
grahamhayes/designate
designate/dnsutils.py
1
11985
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # Author: Endre Karlson <endre.karlson@hpe.com> # # 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/lic...
apache-2.0
-2,717,896,543,009,347,000
31.131367
79
0.583229
false
stevec7/iointegrity
contrib/mpi/mpi_create_files.py
1
3537
#!/usr/bin/env python import datetime import logging import os import sys from mpi4py import MPI from optparse import OptionParser from iointegrity.iotools import create_random_file, FileMD5 from iointegrity.dbtools import IOIntegrityDB def main(options, args): comm = MPI.COMM_WORLD rank = comm.Get_rank() ...
bsd-3-clause
8,793,834,149,230,574,000
27.756098
73
0.559796
false
ctxis/django-admin-view-permission
tests/tests/helpers.py
1
4472
from __future__ import unicode_literals from django.conf.urls import url from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.test import Client, TestCase from model_mommy import mommy from model_mommy.recipe import seq SIMPLE_USERNAME = seq('simple_user_') SUPE...
bsd-2-clause
-5,763,516,324,128,774,000
31.405797
77
0.641547
false
veselosky/siteqa
siteqa/__about__.py
1
1122
# vim: set fileencoding=utf-8 : # # Copyright 2017 Vince Veselosky and contributors # # 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....
apache-2.0
1,655,158,620,334,144,500
30.166667
76
0.658645
false
ClearCorp/odootools
odootools/odootools/install/update.py
1
2076
#!/usr/bin/python2 # -*- coding: utf-8 -*- ######################################################################## # # Odoo Tools by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-5,720,672,702,035,555,000
34.186441
101
0.63632
false
skosukhin/spack
var/spack/repos/builtin/packages/r-tiff/package.py
1
1775
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,270,702,897,405,814,300
43.375
78
0.673239
false
blaiseli/p4-phylogenetics
p4/node.py
1
9111
import func from var import var import sys import pf class NodeBranchPart(object): def __init__(self): self.rMatrixNum = -1 self.gdasrvNum = -1 #self.bigP = None class NodeBranch(object): def __init__(self): self.len = 0.1 # self.textDrawSymbol = '-' # See var.mode...
gpl-2.0
-8,003,872,318,049,479,000
32.619926
93
0.537482
false
madre/analytics_nvd3
analytics/settings.py
1
5979
# Django settings for analytics project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG APPLICATION_DIR = os.path.dirname(globals()['__file__']) PROJECT_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), ".."), ) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATAB...
apache-2.0
4,597,947,349,156,701,700
28.024272
127
0.662151
false
Carroll-Lab/scram
scram_modules/srnaseq.py
1
5630
''' Small RNA storage class Stores unique sequence and read count in an internal dictionary. Automatic normalisation to RPMR once loaded from file ''' from scram_modules.dna import DNA import time class SRNASeq(object): def __init__(self): self._internal_dict = {} # internal dictionary for class ...
mit
7,421,789,612,106,621,000
41.659091
119
0.561634
false
sergiohzlz/complejos
JdelC/jdelc.py
1
2211
#!/usr/bin/python import numpy as np import numpy.random as rnd import sys import matplotlib matplotlib.use('TkAgg') from matplotlib import pyplot as plt from numpy import pi poligono_p = lambda n,rot: [(1,i*2*np.pi/n+rot) for i in range(1,n+1)] pol2cart = lambda ro,te: (ro*np.cos(te),ro*np.sin(te)) poligono_...
gpl-2.0
6,357,678,241,620,429,000
23.032609
103
0.517413
false
akretion/l10n-brazil
l10n_br_account_product/models/wizard_account_product_fiscal_classification.py
1
4195
# -*- coding: utf-8 -*- # Copyright (C) 2012 Renato Lima - Akretion # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import models, api class WizardAccountProductFiscalClassification(models.TransientModel): _inherit = 'wizard.account.product.fiscal.classification' @api.multi d...
agpl-3.0
-2,054,643,602,962,127,600
36.455357
77
0.476996
false
jbenden/ansible
lib/ansible/modules/cloud/amazon/lightsail.py
1
15824
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], 'sup...
gpl-3.0
8,156,596,528,285,752,000
32.525424
157
0.63132
false
Shadowtags/ModularRiggingTool
nwModularRiggingTool/Modules/System/controlModule.py
1
13045
import pymel.core as pm import System.utils as utils reload(utils) from functools import partial class ControlModule: def __init__(self, _moduleNamespace): # Class variables self.moduleContainer = None self.blueprintNamespace = '' self.moduleNamespace = '' self.characterNamespace = '' self.publishe...
mit
7,539,544,142,091,455,000
34.840659
164
0.722269
false
gooddata/openstack-nova
nova/tests/unit/test_context.py
1
22297
# Copyright 2011 OpenStack Foundation # # 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 l...
apache-2.0
8,326,044,055,298,230,000
45.068182
79
0.562407
false
qedsoftware/commcare-hq
corehq/apps/smsbillables/tests/generator.py
1
10417
import calendar import random import datetime import string import uuid from collections import namedtuple from decimal import Decimal from dimagi.utils.data import generator as data_gen from corehq.apps.accounting.models import Currency from corehq.apps.sms.models import INCOMING, OUTGOING, SMS from corehq.apps.sms....
bsd-3-clause
2,373,299,158,017,722,400
34.431973
117
0.633388
false
openstack/blazar
blazar/tests/api/v1/oshosts/test_v1_0.py
1
10633
# Copyright (c) 2013 Bull. # # 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, sof...
apache-2.0
-7,405,516,285,143,847,000
43.48954
78
0.583373
false
maxive/erp
addons/purchase/tests/test_average_price.py
1
6253
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import time from .common import TestPurchase class TestAveragePrice(TestPurchase): def test_00_average_price(self): """ Testcase for average price computation""" self._load('account', 'test', 'ac...
agpl-3.0
-4,236,642,677,800,138,000
47.773438
161
0.591062
false
lvh/maxims
maxims/test/test_creation.py
1
2711
from axiom import attributes, errors, item, store from datetime import timedelta from epsilon import extime from twisted.trial import unittest from maxims import creation class SimpleItem(item.Item): activations = attributes.integer(default=0) def activate(self): self.activations += 1 def _get...
isc
-3,160,057,430,640,151,600
26.383838
77
0.692733
false
WhileRomeBurns/VEX_Syntax
src/vcc_utils.py
1
4987
import os import sys import re import subprocess import json VCC_PATH = 'C:/Program Files/Side Effects Software/Houdini 16.0.600/bin/vcc.exe' SYN_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..') COMP_PATH = os.path.join(SYN_PATH, 'VEX.sublime-completions') FUNC_PATH = os.path.join(os.path.join(S...
mit
7,458,347,255,674,271,000
33.393103
97
0.560056
false