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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
felixwidmaier/bull | setup.py | 1 | 1095 | """
Copyright 2017 Felix Widmaier
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 wr... | apache-2.0 | -2,376,815,182,173,399,600 | 35.5 | 88 | 0.697717 | false | 3.775862 | false | false | false |
dannysellers/django_orders | load_accts.py | 1 | 1434 | import os
import csv
def fix_date(datestr):
"""
Dates in the account_list are MM/DD/YYYY, but Django's DateField
requires YYYY-MM-DD format
"""
_createdate = datestr.split('/')
if len(_createdate[2]) == 2:
_createdate[2] = '20' + str(_createdate[2])
_createdate = [_createdate[2], _createdate[0], _createdate[... | gpl-2.0 | -726,519,760,493,132,400 | 29.531915 | 76 | 0.677824 | false | 3.064103 | false | false | false |
zjj/trac_hack | trac/db_default.py | 1 | 13648 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Daniel Lundin <daniel@edgewall.com>
# 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... | bsd-3-clause | -2,227,831,291,867,234,300 | 32.698765 | 80 | 0.543083 | false | 4.071599 | false | false | false |
sredmond/menlo-mathsci-help | db_repository/versions/006_migration.py | 1 | 1180 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
user = Table('user', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('email', String(length=120)),
Column('hashed_password', String(length=60)),
C... | mit | -7,481,781,320,161,326,000 | 32.714286 | 68 | 0.689831 | false | 3.757962 | false | false | false |
abalakh/robottelo | docs/conf.py | 1 | 3707 | """Sphinx documentation generator configuration file.
The full set of configuration options is listed on the Sphinx website:
http://sphinx-doc.org/config.html
"""
import sys
import os
# pylint:disable=invalid-name
# Add the Robottelo root directory to the system path. This allows references
# such as :mod:`robottelo... | gpl-3.0 | 2,605,090,931,222,616,600 | 29.138211 | 79 | 0.661991 | false | 3.4873 | true | false | false |
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 | 3.281525 | false | false | 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 | 3.783794 | false | false | 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 | 4.020779 | false | false | 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 | 4.262177 | true | false | 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 | 3.454545 | true | false | 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 | 2.965879 | false | false | 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 | 3.956076 | false | false | 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 | 3.4038 | true | false | 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 | 3.751711 | true | false | 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 | 3.370707 | false | false | 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 | 4.173469 | false | false | 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 | 2.392174 | false | false | 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 | 3.83042 | false | false | 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 | 3.9763 | false | false | 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 | 4.084507 | false | false | 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 | 3.652512 | false | false | 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 | 4.263797 | false | false | 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 | 4.285981 | false | false | 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 | 4.362612 | false | false | 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 | 3.238722 | false | false | 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 | 4.543496 | false | false | 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 | 4.549395 | false | false | 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 | 3.587729 | false | false | 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 | 3.07338 | false | false | 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 | 4.980602 | false | false | 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 | 3.853056 | false | false | 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 | 4.277913 | false | false | 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 | 3.32745 | false | false | 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 | 3.843996 | false | false | 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 | 3.630172 | false | false | 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 | 3.61037 | false | false | 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 | 4.105595 | false | false | 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 | 3.723125 | false | false | 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 | 3.63419 | false | false | 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 | 3.754221 | false | false | 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 | 3.754448 | false | false | 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 | 3.96988 | false | false | 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 | 3.461433 | false | false | 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 | 3.086735 | false | false | 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 | 4.014963 | false | false | 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 | 3.45945 | true | false | 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 | 3.755418 | true | false | 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 | 4.456095 | false | false | 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 | 3.354008 | false | false | 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 | 3.916843 | false | false | 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 | 3.358538 | false | false | 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 | 2.614067 | false | false | 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 | 3.471452 | false | false | 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 | 3.384428 | false | false | 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 | 3.511639 | false | false | 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 | 2.894289 | false | false | 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 | 4.500723 | false | false | 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 | 2.906074 | false | false | 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 | 4.36067 | false | false | 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 | 3.865759 | false | false | 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 | 4.04064 | false | false | 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 | 3.930139 | false | false | 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 | 3.98916 | false | false | 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 | 3.471795 | false | false | 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 | 2.985037 | false | false | 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 | 3.868212 | false | false | 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 | 4.320513 | false | false | 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 | 4.180328 | false | false | 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 | 3.903974 | false | false | 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 | 3.495327 | false | false | 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 | 4.10036 | false | false | 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 | 3.694226 | false | false | 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 | 2.4787 | false | false | 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 | 4.302564 | false | false | 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 | 4.021347 | false | false | 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 | 3.47311 | false | false | 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 | 3.707245 | true | false | 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 | 3.390211 | false | false | false |
rsmuc/health_monitoring_plugins | test/testagent/snmp_fd.py | 1 | 1194 | import ctypes
import netsnmpapi
class fd_set(ctypes.Structure):
_fields_ = [('fds_bits', ctypes.c_long * 32)]
class Timeval(ctypes.Structure):
_fields_ = [("tv_sec", ctypes.c_long), ("tv_usec", ctypes.c_long)]
def FD_SET(fd, fd_set):
"""Set fd in fd_set, where fd can may be in range of 0..FD_SE... | gpl-2.0 | 7,479,397,408,930,141,000 | 29.421053 | 106 | 0.582077 | false | 2.863309 | false | false | false |
trujunzhang/djzhang-targets | cwfuqs/cwfuqs/settings.py | 1 | 2988 | # -*- coding: utf-8 -*-
# Scrapy settings for cwfuqs project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest/... | mit | -8,708,439,694,906,147,000 | 34.152941 | 109 | 0.772758 | false | 3.276316 | true | false | false |
letsgoexploring/economicData | usConvergenceData/stateIncomeData.py | 1 | 5246 |
# coding: utf-8
# In[1]:
from __future__ import division,unicode_literals
# get_ipython().magic('matplotlib inline')
import numpy as np
import pandas as pd
import json
import runProcs
from urllib.request import urlopen
import matplotlib.pyplot as plt
# In[2]:
# 0. State abbreviations
# 0.1 dictionary:
stateAbbr... | mit | 3,401,800,098,482,707,500 | 23.745283 | 188 | 0.683378 | false | 2.495718 | false | false | false |
gw0/myhdl | myhdl/test/conversion/toVerilog2/test_loops.py | 1 | 1068 | from __future__ import absolute_import
import os
path = os.path
from random import randrange
from myhdl import *
from myhdl.conversion import verify, analyze
from myhdl import ConversionError
from myhdl.conversion._misc import _error
def ForLoopError1(a, out):
@instance
def logic():
while 1:
... | lgpl-2.1 | -6,276,304,458,649,507,000 | 20.36 | 64 | 0.56367 | false | 3.708333 | false | false | false |
ymorired/s4backup | filelister.py | 1 | 1541 | __author__ = 'mori.yuichiro'
import os
import fnmatch
class FileLister():
def __init__(self, target_path, ignore_dirs=None, ignore_file_patterns=None):
abs_path = os.path.abspath(target_path)
if not os.path.isdir(abs_path):
raise Exception('Invalid target path!')
self.target_... | mit | -2,292,767,076,066,646,300 | 29.82 | 81 | 0.578845 | false | 3.881612 | false | false | false |
ant-Korn/math_tournaments | math_tournaments/users/migrations/0001_initial.py | 1 | 2701 | # -*- coding: utf-8 -*-
# Generated by Django 1.11b1 on 2017-09-23 23:21
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import users.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_use... | mit | 6,238,913,713,545,542,000 | 57.727273 | 323 | 0.618808 | false | 3.772263 | false | false | false |
teoliphant/scipy | scipy/stats/distributions.py | 2 | 215895 | # Functions to implement several important functions for
# various Continous and Discrete Probability Distributions
#
# Author: Travis Oliphant 2002-2011 with contributions from
# SciPy Developers 2004-2011
#
import math
import warnings
from copy import copy
from scipy.misc import comb, derivative
from s... | bsd-3-clause | -8,934,573,509,199,556,000 | 29.322331 | 94 | 0.531027 | false | 3.124521 | false | false | false |
Zurfazz/BiSci | SIZExWEIGHT/SIZExWEIGHT.py | 1 | 1141 | # @Author: Vegard S. <BioVegas>
# @Date: 17-Nov-2016
# @Email: vegard.stuerzinger@gmail.com
# @Project: BiSci
# @Filename: SIZExWEIGHT.py
# @Last modified by: BioVegas
# @Last modified time: 17-Nov-2016
# @Copyright: Open Source
import numpy as np
from Tkinter import *
#saving entry fields
filename="SIZExWEIGHT.... | mit | -3,762,574,506,191,383,000 | 22.285714 | 60 | 0.678352 | false | 2.417373 | false | false | false |
CTcue/CTcUMLS | _scripts/dbc_treatments.py | 2 | 2239 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from elasticsearch import Elasticsearch, helpers
import csv
import argparse
import time
import json
import os
def read_rows(filename, delimiter=";"):
with open(filename, "rb") as f:
datareader = csv.reader(f, delimiter=str(... | mit | -1,460,594,322,885,049,900 | 29.671233 | 142 | 0.599375 | false | 3.807823 | false | false | false |
dimara/synnefo | snf-cyclades-app/synnefo/volume/util.py | 1 | 6444 | # Copyright (C) 2010-2015 GRNET S.A. and individual contributors
#
# 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 version.
#
# T... | gpl-3.0 | 2,165,029,334,500,874,500 | 32.915789 | 78 | 0.665115 | false | 3.792819 | false | false | false |
ambrosef/HLx_Examples | Acceleration/memcached/regressionSims/testgen/memtest_regressions.py | 1 | 5540 | #!/usr/bin/python
import memlib
## EDIT HERE ###################################################################
keySizes = [1,3,4,5,7,8,9,10,12,13,15,16,17,24,25,28,84,128]
#valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208,1024]
valueSizes = [1,3,4,5,8,9,10,12,13,16,17,24,28,184,208, 256]
seq1repeat = 5
key... | bsd-3-clause | 1,551,864,709,077,715,000 | 30.657143 | 117 | 0.609567 | false | 2.611975 | false | false | false |
imk1/IMKTFBindingCode | selectFIMOCutoff.py | 1 | 5703 | import sys
import argparse
from itertools import izip
import pybedtools as bt
import os
def parseArgument():
# Parse the input
parser = argparse.ArgumentParser(description="Select the FIMO cutoff by maximizing F1 for a list of FIMO files")
parser.add_argument("--FIMOFileListFileName", required=True, \
help="List ... | mit | 4,666,782,831,651,699,000 | 46.525 | 174 | 0.761003 | false | 3.234827 | false | false | false |
coreycb/horizon | openstack_dashboard/api/keystone.py | 1 | 33412 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 OpenStack Foundation
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use t... | apache-2.0 | 4,896,837,129,714,877,000 | 34.620469 | 79 | 0.645127 | false | 4.160379 | false | false | false |
henrysher/imagefactory | imagefactory-plugins/OpenStackCloud/OpenStackCloud.py | 1 | 4825 | #!/usr/bin/python
import logging
import zope
import libxml2
from imgfac.BuildDispatcher import BuildDispatcher
from imgfac.ImageFactoryException import ImageFactoryException
from imgfac.CloudDelegate import CloudDelegate
from glance import client as glance_client
def glance_upload(image_filename, creds = {'auth_url':... | apache-2.0 | 2,142,119,869,268,620,800 | 40.956522 | 158 | 0.654301 | false | 4.12041 | false | false | false |
adityahase/frappe | frappe/contacts/doctype/contact/contact.py | 1 | 8077 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, has_gravatar, cint
from frappe import _
from frappe.model.document import Document
from frappe.core.doctype... | mit | 281,877,966,277,661,250 | 30.306202 | 110 | 0.684413 | false | 3.047925 | false | false | false |
blacksburg98/dyplot | dyplot/hist.py | 1 | 2203 | from dyplot.c3 import C3 as Core
import numpy as np
class Hist(Core):
"""
Compute the histogram of a set of data.
"""
def __init__(self, a, bins=10, r=None, weights=None, density=None, xlabel = "", **kwargs):
"""
:param a: input data. The histogram is computed over the flat... | mit | -297,714,197,932,587,460 | 51.731707 | 295 | 0.585111 | false | 4.204198 | false | false | false |
ucsd-ccbb/Oncolist | src/restLayer/models/SearchResult.py | 1 | 1295 | __author__ = 'aarongary'
class SearchResultModel():
def __init__(self):
self.clusterNodeName = ''
self.searchTab = ''
self.geneScoreRangeMax = 100
self.geneSuperList = []
self.items = []
self.geneScoreRangeStep = 0.1
self.geneScoreRangeMin = 5
self.se... | mit | -6,604,879,068,015,613,000 | 32.205128 | 58 | 0.59305 | false | 4.034268 | false | false | false |
alej0varas/django-o2o_tagging | o2o_tagging/models.py | 1 | 2048 | from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db import models
from model_utils.managers import PassThroughManager
from .managers import O2OTagQuerySet
class O2OTag(models.Model):
# The object that is tagging
tagger_content_type = mode... | gpl-3.0 | 4,474,573,030,350,421,500 | 34.929825 | 76 | 0.625 | false | 4.293501 | false | false | false |
Titan-C/selfspy | selfspy/activity_store.py | 1 | 9740 | # Copyright 2012 David Fendrich
# Copyright 2017 Oscar Najera
# This file is part of Selfspy
# Selfspy 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) a... | gpl-3.0 | 3,251,141,156,850,954,000 | 33.295775 | 97 | 0.558419 | false | 3.91794 | false | false | false |
demonchild2112/travis-test | grr/server/grr_response_server/databases/mem_paths.py | 1 | 14025 | #!/usr/bin/env python
"""The in memory database methods for path handling."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from future.builtins import filter
from future.utils import iteritems
from future.utils import iterkeys
from typing import Dict
f... | apache-2.0 | -6,259,611,104,042,401,000 | 32.313539 | 80 | 0.636791 | false | 3.996865 | false | false | false |
s40523220/2016fallcp_hw | pelicanconf.py | 1 | 2015 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = 'KMOL'
SITENAME = '2016Fall 課程網誌 (虎尾科大MDE)'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is u... | agpl-3.0 | -3,259,234,573,316,339,700 | 25.28169 | 88 | 0.63397 | false | 2.795094 | false | false | false |
aspose-pdf/Aspose.Pdf-for-Java | Plugins/Aspose-Pdf-Java-for-Jython/asposepdf/WorkingWithDocumentObject/AddJavascript.py | 1 | 1156 | from asposepdf import Settings
from com.aspose.pdf import Document
from com.aspose.pdf import JavascriptAction
class AddJavascript:
def __init__(self):
dataDir = Settings.dataDir + 'WorkingWithDocumentObject/AddJavascript/'
# Open a pdf document.
doc = Document(dataDir +... | mit | 1,258,187,660,439,364,600 | 36.6 | 109 | 0.66436 | false | 4.25 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.