repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
acassis/lintouch | lintouch/src/lintouch-server/src/lt/server/LintouchHTTPServer.py | 1 | 3642 | # $Id: LintouchHTTPServer.py 481 2005-03-16 13:21:00Z mman $
#
# FILE: LintouchHTTPServer.py --
# AUTHOR: Jiri Barton <jbar@swac.cz>
# DATE: 01 February 2004
#
# Copyright (c) 2001-2005 S.W.A.C. GmbH, Germany.
# Copyright (c) 2001-2005 S.W.A.C. Bohemia s.r.o., Czech Republic.
#
# This application is free software; ... | gpl-2.0 | 2,060,748,066,571,183,000 | 31.810811 | 84 | 0.664195 | false | 3.81761 | false | false | false |
cjlee112/socraticqs2 | mysite/pages/migrations/0032_auto_20181114_1351.py | 1 | 6943 | from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('pages', '0031_auto_20180529_0847'),
]
operations = [
migrations.AlterField(
model_name='activelearningratesplugin',
name='cmsplugin_... | apache-2.0 | 823,025,478,234,727,000 | 60.991071 | 225 | 0.67262 | false | 3.931484 | false | false | false |
jonfoster/pyxb1 | pyxb/namespace/resolution.py | 1 | 29459 | # Copyright 2009, Peter A. Bigot
#
# 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 | -2,478,787,138,147,570,700 | 45.760317 | 156 | 0.635426 | false | 4.649463 | false | false | false |
jvbridge/Audio-Research | play.py | 1 | 1052 | #!/usr/bin/python
'''
Created on May 6, 2014
@author: jonathan
'''
import wave
import pyaudio
class Play(object):
'''
this is a class with functions to play audio files both in real time as well
as sound is input
'''
def __init__(self):
'''
Constructor
'''
def play_fi... | gpl-2.0 | -6,444,550,686,783,141,000 | 20.489796 | 80 | 0.562738 | false | 3.495017 | false | false | false |
stroucki/tashi | src/tashi/utils/pseudoDes.py | 2 | 2511 | #!/usr/bin/python
# 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
# "Licens... | apache-2.0 | 574,612,169,293,070,600 | 32.039474 | 103 | 0.670251 | false | 2.750274 | false | false | false |
dpausp/arguments | src/ekklesia_portal/lib/propositions.py | 1 | 1762 | import csv
from dataclasses import dataclass
import io
from ekklesia_common import md
from ekklesia_portal.datamodel import Proposition
from eliot import log_call, start_task, log_message
@dataclass
class TableRowOptionalFields:
content: bool = True
motivation: bool = True
submitters: bool = False
tag... | agpl-3.0 | 157,160,452,868,390,560 | 31.62963 | 130 | 0.699773 | false | 3.670833 | false | false | false |
IainMcManus/ReportHarvester | HarvestReports/Common.py | 1 | 3687 | #!/usr/bin/python
# Harvest Reports v0.1.5
# Copyright (c) 2014-2015 Iain McManus. All rights reserved.
#
# Harvest Reports is a wrapper around Apple's AutoIngestion Java Class.
# Harvest Reports can download all of the recent daily data and will produce
# a summary of the sales, updates and a breakdown of region wher... | mit | 6,707,435,782,017,627,000 | 47.513158 | 131 | 0.714131 | false | 4.033917 | false | false | false |
datapythonista/pandas | pandas/tests/groupby/test_quantile.py | 2 | 9542 | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
)
import pandas._testing as tm
@pytest.mark.parametrize(
"interpolation", ["linear", "lower", "higher", "nearest", "midpoint"]
)
@pytest.mark.parametrize(
"a_vals,b_vals",
[
# Ints
([1, 2, ... | bsd-3-clause | -2,529,024,597,078,393,300 | 32.017301 | 88 | 0.538566 | false | 2.804821 | true | false | false |
droodle/kansha | kansha/alembic/versions/6cb3c668d65_add_column_archive_flag.py | 4 | 1038 | """Add column archive flag
Revision ID: 6cb3c668d65
Revises: 36d972f11e3e
Create Date: 2014-03-03 16:07:47.321713
"""
# revision identifiers, used by Alembic.
revision = '6cb3c668d65'
down_revision = '36d972f11e3e'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('column', sa.Column... | bsd-3-clause | 2,316,699,984,747,822,600 | 31.4375 | 88 | 0.682081 | false | 3.052941 | false | false | false |
ReactiveX/RxPY | rx/core/operators/timeinterval.py | 1 | 1228 | from typing import Callable, NamedTuple, Any, Optional
from datetime import timedelta
from rx import operators as ops
from rx.core import Observable, typing
from rx.scheduler import TimeoutScheduler
class TimeInterval(NamedTuple):
value: Any
interval: timedelta
def _time_interval(scheduler: Optional[typin... | mit | 5,583,359,660,995,743,000 | 28.95122 | 103 | 0.640065 | false | 4.99187 | false | false | false |
heefan/MdCharm | src/MdCharm/version_h.py | 2 | 1572 | import os
import sys
from datetime import datetime
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit(1)
if sys.argv[1] == "debug":
if os.path.isfile("version.h"):
print 'Already Exist'
sys.exit(0)
version_h = open('../../src/MdCharm/version.h.in').read()
... | bsd-3-clause | -7,721,861,585,240,240,000 | 38.3 | 95 | 0.493639 | false | 3.439825 | false | true | false |
dougthor42/GDWCalc | archive/build.py | 1 | 2004 | # -*- coding: utf-8 -*-
"""
@name: build.py
@vers: 0.1
@author: dthor
Usage:
build.py
build.py (-h | --help)
build.py --version
Options:
-h --help # Show this screen.
--version # Show version.
"""
from __future__ import print_function
import subprocess... | gpl-2.0 | 3,086,087,273,739,985,400 | 24.367089 | 50 | 0.474551 | false | 3.565836 | false | false | false |
Omar-Saleh/Tomasulo-Processor | cache.py | 1 | 1235 | import math
class Cache(object):
"""docstring for cache"""
def __init__(self, size, length, associativity, cycle_time, writing_policy,parent ):
#super(cache, self).__init__()
#self.arg = arg
self.index = int(math.log(size / (length * associativity),2))
self.offset = int(math.log(length,2))
self.tag ... | mit | 3,585,665,001,110,132,700 | 23.235294 | 94 | 0.631579 | false | 2.650215 | false | false | false |
simianhacker/code-by-voice | macros/_vim.py | 2 | 10006 | from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic, Playback)
vi = AppContext(title="vi")
gvim = AppContext(title="GVIM")
grammar = Grammar("vim", context=(vi | gvim))
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "vim... | mit | 4,563,232,134,861,190,000 | 53.588889 | 284 | 0.415351 | false | 3.571021 | false | false | false |
manmax31/MaterialRecognition | src/Others/Tutorial1.py | 1 | 1174 | __author__ = 'manabchetia'
import matplotlib.pyplot as plt
# Make sure that caffe is on the python path:
# caffe_root = '../' # this file is expected to be in {caffe_root}/examples
import sys
# sys.path.insert(0, caffe_root + 'python')
sys.path.append("/Users/manabchetia/Downloads/caffe/python/")
import caffe
# Set... | apache-2.0 | 2,684,970,013,684,837,000 | 36.870968 | 106 | 0.694208 | false | 3.225275 | false | false | false |
tmerrick1/spack | var/spack/repos/builtin/packages/r-gseabase/package.py | 3 | 2007 | ##############################################################################
# Copyright (c) 2013-2018, 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 | -5,314,945,014,099,737,000 | 45.674419 | 126 | 0.664175 | false | 3.675824 | false | false | false |
isis2304/python-server | main.py | 1 | 2106 | #!/usr/bin/env python
import os
import sys
import routes
import logging
import listeners
import cx_Oracle
import coloredlogs
import tornado.web
import tornado.ioloop
import db.dbconn as db
from tornado import gen
import tornado.platform.twisted
tornado.platform.twisted.install()
from amqp import client, publisher
from... | mit | -2,938,120,219,363,591,000 | 27.849315 | 104 | 0.67094 | false | 3.353503 | false | false | false |
MediciPrime/lcdb_website | update.py | 1 | 7021 | #!/usr/bin/env python
import argparse
import hashlib
import os
import re
import sqlite3
import yaml
class Update:
def __init__(self, user, dirloc, organism, technique, afactor=None, wld=None,
dld=None, tissue=None, cline=None):
self.user = user
self.dirloc = dirloc
self.o... | mit | 2,321,733,067,637,110,300 | 32.593301 | 113 | 0.434696 | false | 4.137301 | false | false | false |
rcbrgs/tuna | tuna/tools/phase_map/find_image_center_by_arc_segmentation.py | 1 | 13497 | """
This module's scope are the procedures necessary to find the center in a
spectrograph using the arc segmentation method.
"""
__version__ = "0.1.0"
__changelog = {
"0.1.1": {"Tuna": "0.16.5", "Change": "PEP8 and PEP257 compliance."},
"0.1.0": {"Tuna": "0.14.0", "Change": "improved documentation, silenced log... | gpl-3.0 | -5,145,304,623,682,698,000 | 39.653614 | 102 | 0.5336 | false | 4.006233 | false | false | false |
jvicu2001/alexis-bot | bot/modules/commands_config.py | 1 | 1991 | from bot import Command, categories
from bot.utils import unserialize_avail, serialize_avail
class CommandConfig(Command):
def __init__(self, bot):
super().__init__(bot)
self.name = 'cmd'
self.help = '$[cmd-help]'
self.format = '$[cmd-format]'
self.owner_only = True
... | mit | 2,728,239,882,838,733,300 | 38.039216 | 101 | 0.536414 | false | 3.749529 | false | false | false |
vspitsyn/python_taining | test/test_phones.py | 1 | 1388 | import re
def test_phones_on_home_page(app):
contact_from_home_page = app.contact.get_contact_list()[0]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(0)
assert contact_from_home_page.all_phones_from_home_page == merge_phones_like_on_home_page(contact_from_edit_page)
#assert conta... | apache-2.0 | 2,640,211,491,831,502,000 | 56.875 | 161 | 0.699568 | false | 3.037199 | false | false | false |
ColinBrosseau/BicikloBabac | babac2biciklo.py | 1 | 7412 | # -*- coding: utf-8 -*-
#
# Copyright © 2011 Colin-Nadeau Brosseau
# GNU General Public License version 2
# (see Licence.txt for details)
"""
Created on Apr 27 2012
Developped and maintained by Colin-N. Brosseau
Copyright © 2012 Colin-Nadeau Brosseau
GNU General Public License version 2
(see Licence.txt for details)... | bsd-3-clause | 4,724,794,367,446,120,000 | 31.208696 | 138 | 0.50243 | false | 3.551294 | false | false | false |
rozap/arb | src/watcher.py | 1 | 2047 | from util import Logger
import sys
import time
'''
Watch the exchanges specified in settings and if a trade is possible, make it
'''
class Watcher(object):
exchanges = {}
def __init__(self, settings):
self.set_settings(settings)
self.L = Logger(settings)
self.L.log('Setup watcher f... | mit | -5,385,224,302,295,261,000 | 34.912281 | 128 | 0.597948 | false | 3.541522 | false | false | false |
suriyan/aldryn-icon | aldryn_icon/cms_plugins.py | 1 | 1283 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .models import Icon
from .forms import IconPluginForm
class IconPlugin(CMSPluginBase):
model = Icon
name = ... | bsd-3-clause | 4,721,395,704,489,146,000 | 24.66 | 82 | 0.570538 | false | 4.034591 | false | false | false |
ewtoombs/python-calc | calc/constants.py | 1 | 9124 | # The canonical constants of science, with an emphasis on physics.
tau = 6.283185307179586
sqrttau = 2.5066282746310002
sqrt1_tau = 0.3989422804014327
sqrt2 = 1.4142135623730951
sqrt1_2 = 0.7071067811865476
sqrt3 = 1.7320508075688772
# To keep things clear, in this context, the noun "quantity" will be used to
# refer... | mit | 4,399,658,920,659,862,500 | 33.957854 | 80 | 0.732573 | false | 2.977807 | false | false | false |
dirkmoors/drf-tus | rest_framework_tus/storage.py | 1 | 1346 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
from django.core.files import File
from six import with_metaclass
from django.utils.module_loading import import_string
from rest_framework_tus import signals
from .settings import TUS_SAVE_HANDLER_CLASS
class ... | mit | -7,226,951,264,855,629,000 | 24.396226 | 90 | 0.677563 | false | 3.970501 | false | false | false |
rbaumg/trac | tracopt/ticket/deleter.py | 1 | 5413 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2019 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 | 7,858,749,145,704,924,000 | 40.007576 | 78 | 0.600776 | false | 4.232213 | false | false | false |
AdamISZ/joinmarket-clientserver | jmclient/jmclient/taker.py | 1 | 45433 | #! /usr/bin/env python
import base64
import pprint
import random
from twisted.internet import reactor, task
import jmbitcoin as btc
from jmclient.configure import jm_single, validate_address
from jmbase import get_log, bintohex, hexbin
from jmclient.support import (calc_cj_fee, weighted_order_choose, choose_orders,
... | gpl-3.0 | -1,758,179,612,268,755,000 | 47.487727 | 106 | 0.569872 | false | 4.128771 | true | false | false |
kgaughan/dreque | dreque/stats.py | 1 | 1102 | class StatsCollector(object):
def __init__(self, store, prefix=''):
self.store = store
self.prefix = prefix
def incr(self, key, delta=1):
key = self._key(key)
try:
return int(self.store.incr(key, delta))
except ValueError:
if not self.store.add(ke... | bsd-3-clause | -2,395,787,470,541,860,000 | 28.783784 | 55 | 0.53539 | false | 3.735593 | false | false | false |
imwithye/git-ignore | git-ignore/git_ignore_add.py | 1 | 1551 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Ciel, http://ciel.im
# Distributed under terms of the MIT license.
from config import USER_PATH, SYS_PATH, GITHUB_PATH
from file_operation import find_all_files
from file_operation import read_all_from_file
from file_operation import search_file
# git ignor... | mit | 1,605,455,390,411,617,300 | 26.696429 | 51 | 0.720181 | false | 3.071287 | false | false | false |
pandeyadarsh/sympy | sympy/functions/special/bessel.py | 35 | 42703 | from __future__ import print_function, division
from sympy import S, pi, I, Rational, Wild, cacheit, sympify
from sympy.core.function import Function, ArgumentIndexError
from sympy.core.power import Pow
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.trigonometric import ... | bsd-3-clause | 4,259,860,488,833,242,600 | 28.593209 | 113 | 0.540243 | false | 3.121793 | false | false | false |
xuhcc/zets | gradient.py | 1 | 2566 | import math
import colorsys
def hsv360_to_hsv(h, s, v):
"""
Hue: 0...360
Saturation: 0...100
Value: 0...100
"""
h_ = h / 360
s_ = s / 100
v_ = v / 100
return h_, s_, v_
def rgb_to_rgb256(r, g, b):
r_ = math.floor(r * 255)
g_ = math.floor(g * 255)
b_ = math.f... | mit | -5,842,203,954,448,931,000 | 25.729167 | 79 | 0.510912 | false | 2.780065 | false | false | false |
cindy820219/milsss | UI/new_menu.py | 1 | 20144 | ### import tk
import tkinter as tk
from tkinter import *
from tkinter import ttk, Tk, StringVar
import tkinter.filedialog as filedialog
from tkinter import messagebox
### import keyboard and thread
from threading import Thread
import _thread
import sys, pygame, pygame.midi, time
from pygame.locals import *
import p... | agpl-3.0 | -3,071,660,385,926,561,000 | 29.936923 | 166 | 0.601402 | false | 3.168111 | false | false | false |
MuckRock/muckrock | muckrock/accounts/migrations/0015_auto_20160208_1923.py | 1 | 1110 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0014_auto_20160120_1644'),
]
operations = [
migrations.AddField(
model_name='statistics',
name='daily_requests_admin',
... | agpl-3.0 | -4,906,438,484,732,178,000 | 27.461538 | 61 | 0.558559 | false | 4.475806 | false | false | false |
endthestart/tinsparrow | tinsparrow/tinsparrow/importer.py | 1 | 6020 | import acoustid
import logging
import os
from . import utils
from .models import Artist, Album, Song
from beets.mediafile import MediaFile, FileTypeError, UnreadableFileError
#LOSSY_MEDIA_FORMATS = ["mp3", "aac", "ogg", "ape", "m4a", "asf", "wma"]
LOSSY_MEDIA_FORMATS = ["mp3", "ogg", "m4a"]
LOSSLESS_MEDIA_FORMATS =... | mit | 3,186,187,136,555,236,400 | 36.861635 | 95 | 0.46412 | false | 4.577947 | false | false | false |
kohnle-lernmodule/KITexe201based | nevow/accessors.py | 14 | 3826 | # Copyright (c) 2004 Divmod.
# See LICENSE for details.
"""Standard IData introspection adapters.
Classes and functions in this module are responsible for resolving
data directives into the actual data to be rendered.
By default, Nevow knows how to I{look inside} Python's mapping (dict)
and sequence (tuple, list) t... | gpl-2.0 | -8,593,285,291,691,017,000 | 28.658915 | 111 | 0.663095 | false | 4.209021 | false | false | false |
jlgelpi/BioPhysics | Exercises/prob217_noclass.py | 1 | 1867 | #! /usr/bin/python
__author__ = "gelpi"
__date__ = "$02-nov-2017 8:21:31$"
import math
#Parameters
SIG = 3.4
EPS = 0.09
dmin = 3.8
def calc_energy(sys):
"""Calculates vdw + elec energy for the whole system"""
eint = 0.
evdw = 0.
for p1 in sys['parts']:
for p2 in sys['parts']:
if... | mit | 9,074,620,127,787,863,000 | 23.565789 | 82 | 0.566149 | false | 2.466314 | false | false | false |
jakobj/UP-Tasks | NEST/microcircuit_task/connectivity.py | 1 | 2712 | class Connectivity:
@staticmethod
def FixedTotalNumberConnect(sim, pop1, pop2, K, w_mean, w_sd, d_mean, d_sd,
conf):
"""
Function connecting two populations with multapses and a fixed
total number of synapses using new NEST implementation of Conne... | gpl-2.0 | 212,227,784,118,672,060 | 39.477612 | 90 | 0.460177 | false | 4.28436 | false | false | false |
julienmalard/Tikon | pruebas/test_central/rcrs/ec_parám.py | 1 | 1790 | from tikon.central import Módulo, SimulMódulo, Modelo, Exper, Parcela, Coso
from tikon.central.res import Resultado
from tikon.ecs import ÁrbolEcs, CategEc, Ecuación, SubcategEc, EcuaciónVacía, Parám
rango = (2.5, 4)
class A(Parám):
nombre = 'a'
unids = None
líms = rango
class B(Parám):
nombre = 'b... | agpl-3.0 | -4,972,727,749,786,420,000 | 20.432099 | 83 | 0.638249 | false | 2.361905 | false | false | false |
piyusgupta/pyscripts | projecteuler/q14_longest_collatz_sequence.py | 1 | 2193 | """
@Author : Piyus Gupta
@email : PiyusGupta01@gmail.com
@created : Feb 5, 2017
ProjectEuler Q-14 : longest collatz sequence
The following iterative sequence is defined for the set of positive integers:
n => n/2 (n is even)
n => 3n + 1 (n is odd)
Using the rule above and starting... | gpl-3.0 | -5,222,759,741,534,893,000 | 30.782609 | 82 | 0.638395 | false | 3.673367 | false | false | false |
navinpai/CS706 | perceptron.py | 1 | 1241 | from numpy import genfromtxt, savetxt
from sklearn import linear_model
from sklearn.linear_model.perceptron import Perceptron
import matplotlib.pyplot as plt
def main():
#create the training & test sets, skipping the header row with [1:]
dataset_T = genfromtxt(open('Data/demoTrain.csv','r'), delimiter=',', ... | mit | 330,916,076,526,054,300 | 24.346939 | 92 | 0.593876 | false | 3.447222 | false | false | false |
usc-isi/extra-specs | tools/clean_file_locks.py | 3 | 1670 | #!/usr/bin/env python
# Copyright 2012 La Honda Research Center, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | apache-2.0 | 1,767,900,535,855,579,400 | 25.507937 | 74 | 0.702994 | false | 3.929412 | false | false | false |
elkingtonmcb/nupic | src/algorithms/anomaly_likelihood.py | 5 | 25045 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 | -3,283,692,913,498,227,700 | 32.572386 | 80 | 0.6775 | false | 3.94907 | false | false | false |
fusionbox/django-widgy-facebook | widgy_facebook/models.py | 1 | 1991 | import logging
from itertools import islice
import datetime
from django.db import models
import facebook
import requests
from fusionbox.decorators import cached
import widgy
from widgy.models import Content
logger = logging.getLogger(__name__)
@widgy.register
class FacebookPosts(Content):
editable = True
... | bsd-2-clause | -8,105,294,422,055,230,000 | 33.327586 | 96 | 0.58664 | false | 4.290948 | false | false | false |
Azure/azure-sdk-for-python | sdk/tables/azure-data-tables/samples/sample_insert_delete_entities.py | 1 | 3405 | # coding: utf-8
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------... | mit | -999,957,470,753,586,300 | 36.01087 | 116 | 0.614097 | false | 4.474376 | false | false | false |
tempson-py/tempson | tempson/RestrictedPython/Eval.py | 1 | 3813 | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | mit | -1,114,500,867,274,236,000 | 31.87069 | 78 | 0.518227 | false | 4.377727 | false | false | false |
bokeh/bokeh | bokeh/io/saving.py | 1 | 6161 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | 5,905,341,506,261,209,000 | 35.02924 | 127 | 0.536439 | false | 4.956557 | false | false | false |
m4rx9/mmfinder | mmfinder/lib/utils.py | 1 | 4061 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import commands
import os
import imp
from os import path, sep, system
from getpass import getuser
LENGTH_OF_THE_SCREEN = 80
CHAR = "#"
def print_blue(text, newline = True):
"""
http://www.siafoo.net/snippet/88
"""
if newline:
print '\033[1;34m' + t... | gpl-3.0 | -2,561,355,398,778,806,300 | 27.201389 | 161 | 0.526718 | false | 3.353427 | true | false | false |
dhomeier/astropy | astropy/timeseries/periodograms/lombscargle/implementations/utils.py | 3 | 5013 | from math import factorial
import numpy as np
def bitceil(N):
"""
Find the bit (i.e. power of 2) immediately greater than or equal to N
Note: this works for numbers up to 2 ** 64.
Roughly equivalent to int(2 ** np.ceil(np.log2(N)))
"""
return 1 << int(N - 1).bit_length()
def extirpolate(x, y... | bsd-3-clause | 9,208,805,311,177,000,000 | 30.727848 | 79 | 0.574706 | false | 3.335329 | false | false | false |
orangefrg/rpfti_bot | models/bot_basic.py | 1 | 2503 | from django.db import models
USER_ROLES = (
("ADMIN", "Administrator"),
("EDIT", "Editor"),
("MOD", "Moderator"),
("USER", "Simple user"),
("BAN", "Banned user")
)
CHAT_TYPES = (
("private", "Private chat"),
("group", "Group chat"),
("supergroup", "Supergroup"),
("channel", "Channe... | apache-2.0 | -2,147,163,469,368,214,000 | 33.287671 | 77 | 0.668398 | false | 3.486072 | false | false | false |
cloudbau/keystone | keystone/auth/plugins/external.py | 1 | 4059 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 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
#
# Unle... | apache-2.0 | -7,049,568,494,303,403,000 | 34.295652 | 76 | 0.625524 | false | 4.263655 | false | false | false |
chokribr/invenio | invenio/modules/workflows/tasks/logic_tasks.py | 15 | 10445 | # -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio 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 l... | gpl-2.0 | -3,841,860,017,716,469,000 | 34.648464 | 105 | 0.574629 | false | 3.78442 | false | false | false |
tekton/DocuCanvas | socialplatform/views.py | 1 | 16554 | import hashlib
import urllib
import urlparse
import json
import subprocess
import facebook
# import tweepy
import oauth2 as oauth
from django.template import RequestContext
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.conf import settings
from django.contrib.aut... | gpl-3.0 | -136,146,382,753,974,400 | 41.015228 | 186 | 0.637067 | false | 3.781179 | false | false | false |
Ircam-Web/mezzanine-organization | organization/network/migrations/0017_auto_20160919_1927.py | 1 | 1378 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-09-19 17:27
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization-network', '0016_auto_20160919_1923'),
]
... | agpl-3.0 | -6,053,517,222,405,404,000 | 43.451613 | 234 | 0.674165 | false | 3.903683 | false | false | false |
stephane-martin/salt-debian-packaging | salt-2016.3.2/tests/integration/states/git.py | 1 | 8866 | # -*- coding: utf-8 -*-
'''
Tests for the Git state
'''
# Import python libs
from __future__ import absolute_import
import os
import shutil
import socket
import subprocess
import tempfile
# Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath, skip_if_binaries_missing
ensure_in_syspath('../../')... | apache-2.0 | -4,577,309,853,445,207,600 | 31.00722 | 86 | 0.522333 | false | 4.05581 | true | false | false |
jmcorgan/bitcoin | test/functional/feature_segwit.py | 4 | 40120 | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the SegWit changeover logic."""
from test_framework.address import (
key_to_p2sh_p2wpkh,
... | mit | 7,338,416,048,412,948,000 | 62.581616 | 199 | 0.665379 | false | 3.034337 | true | false | false |
jspjut/pygauntlet | src/cpucontroller.py | 2 | 2187 | #Copyright 2005-2006 the PyGauntlet Team (See CREDITS for more info)
#http://code.google.com/p/pygauntlet/
#
#This file is part of PyGauntlet.
#
#PyGauntlet 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... | gpl-2.0 | -8,115,597,854,282,000,000 | 29.375 | 75 | 0.711477 | false | 3.850352 | false | false | false |
wodo/WebTool3 | webtool/server/serializers/frontend/instructions.py | 1 | 5010 | # -*- coding: utf-8 -*-
from rest_framework.reverse import reverse
from rest_framework import serializers
from server.models import Instruction, Equipment, Guide, Topic, Category, State
from server.serializers.frontend.core import EventSerializer, MoneyField
class InstructionListSerializer(serializers.ModelSeriali... | bsd-2-clause | -5,157,118,131,301,353,000 | 42.565217 | 103 | 0.693014 | false | 4.147351 | false | false | false |
pombredanne/djangorestframework-camel-case | djangorestframework_camel_case/util.py | 1 | 1165 | from collections import OrderedDict
import re
first_cap_re = re.compile('(.)([A-Z][a-z]+)')
all_cap_re = re.compile('([a-z0-9])([A-Z])')
def underscoreToCamel(match):
return match.group()[0] + match.group()[2].upper()
def camelize(data):
if isinstance(data, dict):
new_dict = OrderedDict()
f... | bsd-3-clause | -2,591,410,132,915,731,500 | 26.761905 | 68 | 0.577682 | false | 3.245125 | false | false | false |
ideascube/ideascube | ideascube/models.py | 1 | 13464 | from collections import OrderedDict
import json
import logging
from django.conf import settings
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.transla... | agpl-3.0 | -3,026,051,068,548,839,400 | 34.713528 | 80 | 0.581625 | false | 4.159407 | false | false | false |
phievo/phievo | phievo/Networks/mutation.py | 1 | 20189 | """ This module adds a layer to the elements defined in :any:`classes_eds2` and creates an extended version of :any:`Species` called :any:`Mutable_Network`.
The addon adds a set of tools for node mutations.
For mutation/removal, effective mutation rate will be the reference mutation rate times the number of instances o... | lgpl-3.0 | -9,009,865,316,264,807,000 | 38.122093 | 195 | 0.618963 | false | 4.283259 | false | false | false |
streed/simpleStore | simpleStore/__init__.py | 1 | 5199 | import json
import random
import requests
import time
import uuid
from flask import Flask, request, jsonify, url_for, g
from functools import wraps
from threading import Thread
app = Flask( __name__ )
app.hosts = []
def decoder( js ):
d = json.loads( js )
return d["value"]
def encoder( v ):
return json.dumps( { "... | mit | -5,621,732,214,106,162,000 | 23.294393 | 116 | 0.623966 | false | 2.914238 | false | false | false |
endlessm/chromium-browser | tools/binary_size/diagnose_bloat.py | 1 | 33003 | #!/usr/bin/env python3
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tool for finding the cause of binary size bloat.
See //tools/binary_size/README.md for example usage.
Note: this tool will perfor... | bsd-3-clause | 8,424,016,490,092,688,000 | 34.75623 | 80 | 0.628246 | false | 3.590405 | false | false | false |
shanot/imp | modules/display/examples/basic_geometry.py | 1 | 1059 | ## \example display/basic_geometry.py
# This example shows how to write basic geometric primitives to a file
# with color and name.
from __future__ import print_function
import IMP.display
import sys
IMP.setup_from_argv(sys.argv,
"Write basic geometric primitives to a file with color and name.")
name = IMP.creat... | gpl-3.0 | -5,606,615,553,238,688,000 | 33.16129 | 70 | 0.660057 | false | 3.114706 | false | false | false |
apache/climate | RCMES/run_RCMES.py | 2 | 14139 | # 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 u... | apache-2.0 | 1,860,446,978,062,015,000 | 41.845455 | 87 | 0.651178 | false | 3.707132 | true | false | false |
biodiv/anycluster | build/lib/anycluster/MapClusterer.py | 2 | 32869 | '''---------------------------------------------------------------------------------------
DJANGO MAP CLUSTERING
- kmeans
- grid
VERSION: 0.1
AUTHOR: biodiv
LICENSE: GPL
---------------------------------------------------------------------------------------'''
'''---------------------------------------------------... | mit | 6,360,316,021,772,126,000 | 36.823936 | 150 | 0.482339 | false | 4.875983 | false | false | false |
Samnsparky/pycotracer | pycotracer/mongo_aggregator.py | 1 | 9453 | """Simple Mongo-DB serialization convienence module for pycotracer.
Convienence / reference implementation for serializing data read from the
pycotracer micro-library to a database. The pycotracer micro-library provides
programatic access to Colorado Transparency in Contribution and Expenditure
Reporting Campaign Fina... | gpl-3.0 | 8,662,078,372,490,370,000 | 33.374545 | 82 | 0.686237 | false | 4.28319 | false | false | false |
smeggingsmegger/impression | impression/controllers/admin.py | 1 | 11302 | import os
import json
from datetime import datetime
from dateutil import parser
from flask import (Blueprint, render_template, flash, request, redirect,
jsonify, url_for, g)
from flask_login import login_user, logout_user, login_required
from flask_themes2 import get_themes_list
from impression.de... | bsd-3-clause | -1,468,777,970,708,249,600 | 29.058511 | 85 | 0.632277 | false | 3.712878 | false | false | false |
gdementen/numba | examples/cuda_mpi.py | 3 | 2882 | # Demonstration of using MPI and Numba CUDA to perform parallel computation
# using GPUs in multiple nodes. This example requires MPI4py to be installed.
#
# The root process creates an input data array that is scattered to all nodes.
# Each node calls a CUDA jitted function on its portion of the input data.
# Output d... | bsd-2-clause | 2,467,548,795,449,519,000 | 29.659574 | 80 | 0.697085 | false | 3.095596 | false | false | false |
LTMana/code | Python/Django/homework/backend/firstapp/models.py | 1 | 1751 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Article(models.Model):
title = models.CharField(max_length=500)
img = models.CharField(null=True, blank=True, max_length=250)
content = models.TextField(null=True, blank=True)
views = models.Int... | mit | 6,809,656,557,702,094,000 | 26.412698 | 75 | 0.648523 | false | 3.447106 | false | false | false |
OCA/multi-company | base_multi_company/models/multi_company_abstract.py | 1 | 2300 | # Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import api, fields, models
class MultiCompanyAbstract(models.AbstractModel):
_name = 'multi.company.abstract'
_description = 'Multi-Company Abstract'
company_id = fields.Many2one(
string... | agpl-3.0 | 5,631,139,268,251,526,000 | 32.823529 | 75 | 0.594783 | false | 3.878583 | false | false | false |
tboudreaux/PHY-2002 | orbitalfitter.py | 1 | 11314 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'orbitalfitter.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8... | lgpl-3.0 | 8,720,589,719,299,827,000 | 54.460784 | 93 | 0.695068 | false | 3.525709 | false | false | false |
Huyuwei/tvm | topi/python/topi/cuda/conv2d.py | 2 | 5904 | # 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 u... | apache-2.0 | -1,455,326,426,527,767,800 | 37.337662 | 99 | 0.602134 | false | 3.708543 | false | false | false |
nuxeh/morph | morphlib/gitindex.py | 1 | 6804 | # Copyright (C) 2013-2015 Codethink Limited
#
# 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but... | gpl-2.0 | 8,130,416,468,425,426,000 | 37.659091 | 75 | 0.610376 | false | 4.164015 | false | false | false |
cnvogelg/fs-uae-gles | launcher/fs_uae_launcher/netplay/Netplay.py | 2 | 26471 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import uuid
import urllib2
import urlparse
import random
from .IRC import IRC
from .Channel import Channel
from .IRCColor import IRCColor
from .IRCBroadcaster import IRCB... | gpl-2.0 | 3,830,688,942,083,254,000 | 35.361264 | 79 | 0.527067 | false | 4.069331 | true | false | false |
code-for-india/sahana_shelter_worldbank | private/templates/Sandy/config.py | 1 | 15024 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
settings = current.deployment_settings
T = current.T
"""
Template settings ... | mit | 5,065,068,333,770,703,000 | 36.748744 | 152 | 0.552716 | false | 4.129742 | false | false | false |
snsokolov/contests | codeforces/604A_forces.py | 1 | 3117 | #!/usr/bin/env python3
# 604A_forces.py - Codeforces.com/problemset/problem/604/A by Sergey 2015
import unittest
import sys
###############################################################################
# Forces Class (Main Program)
###############################################################################
cl... | unlicense | 1,198,494,380,569,623,300 | 28.130841 | 79 | 0.483799 | false | 3.750903 | true | false | false |
Gustry/inasafe | safe/gis/raster/zonal_statistics.py | 2 | 3963 | # coding=utf-8
"""Zonal statistics on a raster layer."""
import logging
from qgis.analysis import QgsZonalStatistics
from qgis.core import QgsFeatureRequest
from safe.gis.sanity_check import check_layer
from safe.gis.vector.tools import copy_layer, create_memory_layer
from safe.gis.vector.prepare_vector_layer import... | gpl-3.0 | 4,612,231,492,047,732,000 | 32.025 | 79 | 0.690638 | false | 3.810577 | false | false | false |
osmanbaskaya/wsid | run/data_load.py | 1 | 1449 | #! /usr/bin/python
# -*- coding: utf-8 -*-
""" Data Loader for Semeval 2013, Semeval 2010 """
from collections import defaultdict as dd
class KeyLoader(object):
def __init__(self, dataset_type):
self.dataset_type = dataset_type
def read_keyfile(self, keyfile):
raise NotImplementedError
c... | mit | 2,914,445,396,635,682,300 | 27.411765 | 75 | 0.536232 | false | 3.568966 | false | false | false |
lucernae/inasafe | safe/common/parameters/default_value_parameter_widget.py | 3 | 4277 | # coding=utf-8
"""Default Value Parameter Widget."""
from qgis.PyQt.QtWidgets import (
QButtonGroup,
QDoubleSpinBox,
QHBoxLayout,
QRadioButton
)
from parameters.qt_widgets.generic_parameter_widget import (
GenericParameterWidget
)
__copyright__ = "Copyright 2016, The InaSAFE Project"
__license__ ... | gpl-3.0 | -6,604,935,686,670,709,000 | 32.677165 | 76 | 0.609306 | false | 4.243056 | false | false | false |
malongge/selenium-pom | pages/base_page.py | 1 | 1346 | from .page import Page
from selenium.webdriver.common.by import By
class BasePage(Page):
def get_cookie_index_page(self, url, cookie):
self.get_relative_path(url)
self.maximize_window()
self.selenium.add_cookie(cookie)
self.selenium.refresh()
def switch_to_second_wi... | apache-2.0 | 5,818,490,255,537,201,000 | 31.65 | 76 | 0.597325 | false | 3.589333 | false | false | false |
astooke/gtimer | gtimer/private/timedloop.py | 1 | 4010 |
"""
Classes which comprise the timed loops.
"""
from __future__ import absolute_import
from gtimer.private import loop
from gtimer.private.focus import get_current_timer
from gtimer.local.util import sanitize_rgstr_stamps
from gtimer.local.exceptions import LoopError
class TimedLoopBase(object):
"""Base class, ... | mit | 513,238,166,991,638,850 | 35.126126 | 121 | 0.544389 | false | 4.247881 | false | false | false |
interDist/pasportaservo | core/forms.py | 1 | 7035 | from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import (
PasswordResetForm, SetPasswordForm, UserCreationForm,
)
from django.core.mail import send_mail
from django.db.models import Q, Value as V
from django.db.models.functions i... | agpl-3.0 | 292,151,228,641,674,900 | 34.175 | 101 | 0.613504 | false | 4.090116 | false | false | false |
Ichaelus/Github-Classifier | Playground/utilities.py | 1 | 8308 | # -*- coding: utf-8 -*-
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
import os
#import nltk
import base64
import random
import json
from urllib2 import Request, urlopen, URLError
import re
from nltk.stem import PorterStemmer
import string
import sklearn
# Constants
max_stars = 1000 # ... | mit | 3,352,495,437,871,071,000 | 35.568282 | 149 | 0.594145 | false | 3.508453 | true | false | false |
suutari-ai/shoop | shuup/core/migrations/0005_shopproduct_visibilty.py | 9 | 2592 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from shuup.core.models._product_shops import ShopProductVisibility
import enumfields.fields
def shop_product_visibility(apps, schema_editor):
ShopProduct = apps.get_model("shuup", "ShopProduct")
for shop_... | agpl-3.0 | 8,983,802,664,642,943,000 | 32.230769 | 134 | 0.623457 | false | 4.55536 | false | false | false |
zombiezen/turbohvz | hvz/forms.py | 1 | 22656 | #!/usr/bin/env python
#
# forms.py
# TurboHvZ
#
# Copyright (C) 2008 Ross Light
#
# 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 opt... | gpl-3.0 | -3,686,759,958,269,864,000 | 38.677758 | 79 | 0.603814 | false | 4.188575 | false | false | false |
joyider/wagtail_comments_xtd | wagtail_comments_xtd/views.py | 1 | 2605 | from django.urls import reverse
from django.contrib import messages
from wagtail.core.models import Page
from django.shortcuts import redirect, render
from django_comments_xtd.models import XtdComment
from django.utils.translation import ugettext as _
from wagtail_comments_xtd.utils import cleaned_tree
def pages(requ... | gpl-3.0 | -181,292,944,503,853,600 | 34.202703 | 133 | 0.65643 | false | 3.764451 | false | false | false |
Udzu/pudzu | dataviz/eugreatsingers.py | 1 | 1480 | from pudzu.charts import *
from PIL import ImageFilter
# generate map
df = pd.read_csv("datasets/eugreatsingers.csv").set_index('country')
def colorfn(c, w, h):
if c == 'Sea':
return '#ffffff'
elif c == 'Borders':
return "#D0D0D0"
elif c not in df.index:
return "#B0B0B0"
elif n... | mit | -5,001,897,676,485,576,000 | 42.294118 | 169 | 0.663043 | false | 2.772128 | false | false | false |
mkieszek/odoo | addons/mail/models/mail_message.py | 1 | 39497 | # -*- coding: utf-8 -*-
from email.header import decode_header
from email.utils import formataddr
import logging
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp import tools
from openerp.exceptions import UserError, AccessError
_logger = logging.getLogger(__name__)
def decode(text):
"""R... | agpl-3.0 | 5,993,638,580,446,407,000 | 49.186785 | 210 | 0.584728 | false | 4.109562 | false | false | false |
sunjerry019/photonLauncher | micron/stagecontrol.py | 1 | 15182 | #!/usr/bin/env python3
# tertiary Helper
# Unless absolutely necessary, do not use self.controller.send(...)
# Implement the method in micron.py and call that instead
# Abstraction yo
# Advanced level functions combining multiple basic functions are to be implemented here
# Methods involving multiple functions in thi... | apache-2.0 | 1,533,129,327,277,699,600 | 35.061758 | 185 | 0.690291 | false | 3.168858 | false | false | false |
rsignell-usgs/notebook | OOI/from_ooi_json-pwrsys-deployment.py | 1 | 2187 |
# coding: utf-8
# # Convert all daily JSON log files for a deployment to a single NetCDF file
# using CF-1.6, Discrete Sampling Geometry (DSG) conventions, **`featureType=timeSeries`**
# In[1]:
get_ipython().magic('matplotlib inline')
import json
import pandas as pd
import numpy as np
import glob
from pyaxiom.netc... | mit | -3,211,730,891,208,305,700 | 18.184211 | 103 | 0.643347 | false | 2.866317 | false | false | false |
infogulch/pyspades | feature_server/networkdict.py | 8 | 2081 | from pyspades.ipaddr import IPNetwork
cache = {}
def get_network(cidr):
try:
return cache[cidr]
except KeyError:
network = IPNetwork(cidr)
cache[cidr] = network
return network
def get_cidr(network):
if network._prefixlen == 32:
return str(network.ip)
return str... | gpl-3.0 | 3,008,715,378,069,275,600 | 25.341772 | 74 | 0.532917 | false | 4.187123 | false | false | false |
Passtechsoft/TPEAlpGen | blender/release/scripts/addons/io_import_dxf/dxfgrabber/pytags.py | 2 | 11951 | # Purpose: tag reader
# Created: 21.07.2012, taken from my ezdxf project
# Copyright (C) 2012, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from io import StringIO
from collections import namedtuple
from itertools import chain, islice
from . import... | gpl-3.0 | -8,656,472,211,399,236,000 | 30.041558 | 106 | 0.524391 | false | 4.011749 | false | false | false |
openmips/stbgui | lib/python/Plugins/SystemPlugins/SoftcamStartup/SoftcamStartup.py | 3 | 6484 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.FileList import FileEntryComponent, FileList
from Components.ConfigList import ConfigListScreen
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Button import Button
from Components.Label import Label
... | gpl-2.0 | -1,525,861,692,629,663,000 | 36.918129 | 150 | 0.723627 | false | 3.136913 | true | false | false |
openstack/nova-solver-scheduler | nova_solverscheduler/scheduler/solvers/constraints/exact_disk_constraint.py | 1 | 2701 | # Copyright (c) 2015 Cisco Systems, 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 r... | apache-2.0 | -7,465,994,840,867,310,000 | 42.564516 | 78 | 0.592003 | false | 4.356452 | false | false | false |
smallyear/linuxLearn | salt/salt/modules/layman.py | 1 | 4272 | # -*- coding: utf-8 -*-
'''
Support for Layman
'''
from __future__ import absolute_import
import salt.utils
import salt.exceptions
def __virtual__():
'''
Only work on Gentoo systems with layman installed
'''
if __grains__['os'] == 'Gentoo' and salt.utils.which('layman'):
return 'layman'
r... | apache-2.0 | 1,557,643,966,416,273,700 | 27.105263 | 78 | 0.620318 | false | 3.626486 | false | false | false |
MRamsay/escort | Main.py | 1 | 13119 | import sys
from asteroid import *
from critters import *
from game import *
from turret import *
from bullet import *
from InterpolateDrawGroup import *
from Spawner import *
import constants
game = Game()
pygame.mixer.pre_init(0, 0, 0, 1024)
pygame.init()
pygame.mouse.set_visible(False)
pygame.display.s... | gpl-3.0 | 2,426,281,741,185,065,000 | 32.984 | 155 | 0.593795 | false | 3.61405 | false | false | false |
tilezen/tilequeue | setup.py | 1 | 2098 | import os.path
from setuptools import setup, find_packages
version_path = os.path.join(os.path.dirname(__file__), 'VERSION')
with open(version_path) as fh:
version = fh.read().strip()
setup(name='tilequeue',
version=version,
description="Queue operations to manage the processes surrounding tile "
... | mit | 2,406,750,501,221,614,600 | 30.313433 | 79 | 0.533365 | false | 4.154455 | false | true | false |
vpv11110000/pyss | tests/test_gate.py | 1 | 8826 | # #!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,missing-docstring,bad-whitespace
import sys
import os
import unittest
DIRNAME_MODULE = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) + os.sep
sys.path.append(DIRNAME_MODULE)
sys.path.append(DIRNAME_MODULE +... | mit | -8,248,177,282,906,256,000 | 38.781395 | 159 | 0.531626 | false | 3.153761 | true | false | false |
imk1/IMKTFBindingCode | makeSequenceInputshdf5.py | 1 | 8874 | def makeSampleMat(sequenceOne, sequenceTwo, sequenceLength, sampleCount):
# Convert the fasta sequence pair to the 4 x 4 alphabet and record it in a 16 x sequence length matrix
# ASSUMES THAT sequenceOne AND sequenceTwo ARE THE SAME LENGTH (no indels)
sequenceArray = numpy.zeros((16, sequenceLength))
for i in r... | mit | -7,804,191,512,265,700,000 | 45.212766 | 155 | 0.679851 | false | 2.902846 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.