repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MontpellierRessourcesImagerie/openmicroscopy | components/tools/OmeroWeb/omeroweb/webadmin/forms.py | 1 | 23531 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008-2014 University of Dundee.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at... | gpl-2.0 | 3,148,617,623,475,897,000 | 38.283806 | 79 | 0.571119 | false | 4.440649 | false | false | false |
oaelhara/numbbo | code-postprocessing/bbob_pproc/readalign.py | 1 | 16406 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper routines to read in data files.
The terms horizontal and vertical below refer to the horizontal
(fixed-target) and vertical (fixed-budget) views. When considering
convergence graphs of function values over times, we can view it as:
* costs for different fixe... | bsd-3-clause | 387,460,668,223,755,600 | 33.538947 | 109 | 0.61508 | false | 4.178808 | false | false | false |
opencord/voltha | voltha/coordinator.py | 1 | 23681 | #
# Copyright 2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -2,272,918,664,994,395,000 | 38.206954 | 79 | 0.550737 | false | 4.464744 | true | false | false |
deepeshmittal/daytona | Scheduler+Agent/system_metrics_gather.py | 1 | 29943 | # This file implement different thread routines which spaws on agent startup and continue to run until agnet is up.
# These threads continuously query stats from the linux system and write designated log file for a particular test if
# it is currently running on agent
#!/usr/bin/env python
import os
import common
imp... | apache-2.0 | 4,758,093,547,575,734,000 | 44.575342 | 120 | 0.526734 | false | 4.154711 | true | false | false |
exord/activist | tools.py | 1 | 2677 | import numpy as np
import pylab as plt
def integrate(x, y, weight, xmin, xmax, vary=None):
"""
Return integrated flux of array y (already integrated in
each pixel) with respecto to x, with variance vary and
weight function weigth between limits xmin and xmax.
"""
# Keep only elements of x, y,... | mit | 6,237,362,165,617,631,000 | 25.77 | 78 | 0.570041 | false | 3.472114 | false | false | false |
PoornimaNayak/autotest-client-tests | linux-tools/binutils/binutils.py | 1 | 1398 | #!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class binutils(test.test):
"""
Autotest module for testing basic functionality
of binutils
@author Xu Zheng zhengxu@cn.ibm.com
"""
version = 1
nfail = 0
path =... | gpl-2.0 | 1,499,941,769,291,629,800 | 25.884615 | 86 | 0.552217 | false | 3.915966 | true | false | false |
abhishekkr/nix-bootstrapper | commands/__init__.py | 1 | 2456 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2011 Openstack, LLC.
# 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-2.0 | 7,277,540,905,514,252,000 | 31.315789 | 79 | 0.578176 | false | 3.807752 | false | false | false |
Holzhaus/msm | msmgui/assistants/invoicing.py | 1 | 12358 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file is part of MSM.
MSM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... | gpl-3.0 | 7,313,680,218,967,222,000 | 50.920168 | 177 | 0.582423 | false | 4.200204 | false | false | false |
mogria/rtsh | srv/tickSystem.py | 1 | 1024 | import glob
import time
from printWithFlush import p
from model.storage import Storage
from model.builder import Builder
from commandQueueProcessor import CommandQueueProcessor
TICK_INTERVAL_SEC = 1
class TickSystem(object):
def __init__(self, players):
self._players = players
def process_user_co... | gpl-2.0 | -7,344,670,052,374,880,000 | 23.97561 | 65 | 0.586914 | false | 4.079681 | false | false | false |
thunderhoser/GewitterGefahr | gewittergefahr/gg_io/netcdf_io.py | 1 | 2048 | """IO methods for NetCDF files."""
import os
import gzip
import shutil
import tempfile
from netCDF4 import Dataset
from gewittergefahr.gg_utils import error_checking
GZIP_FILE_EXTENSION = '.gz'
def open_netcdf(netcdf_file_name, raise_error_if_fails=False):
"""Attempts to open NetCDF file.
Code for handling... | mit | -2,323,290,946,649,447,400 | 31 | 80 | 0.657715 | false | 3.703436 | false | false | false |
ken-muturi/pombola | pombola/hansard/migrations/0010_auto__add_field_source_list_page.py | 3 | 8132 | # -*- 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 field 'Source.list_page'
db.add_column(u'hansard_source', 'list_... | agpl-3.0 | -8,070,837,183,725,730,000 | 68.504274 | 175 | 0.548942 | false | 3.59823 | false | false | false |
cloudify-cosmo/cloudify-nsx-plugin | tests/platformtests/test_security.py | 1 | 15821 | ########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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... | apache-2.0 | 8,010,831,182,299,763,000 | 29.660853 | 79 | 0.563997 | false | 4.042156 | true | false | false |
TravisCG/SI_scripts | exonreadcount.py | 1 | 1804 | #!/usr/bin/python
"""
This script is an HTSeq alternatives.
It is count reads in regions, but if there
are overlapping regions the read is counted in both
regions. Read also counted if partially overlap
"""
import sys
import gzip
class Exon:
def __init__(self, fields):
self.chrx = fields[0]
self.... | gpl-3.0 | 8,617,532,160,333,807,000 | 25.529412 | 74 | 0.637472 | false | 2.641288 | false | false | false |
fclerg/inora | Gateway/lib/eventsender.py | 1 | 1160 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Lib for handling message sending to the Inora server"""
import time
import requests
import lib.inoralogger
LOGGING = lib.inoralogger.InoraLogger.get_logger()
class EventSender(object):
"""Class to send messages over IP"""
def __init__(self, ip_address, port):
... | gpl-3.0 | 2,685,681,894,963,935,700 | 37.666667 | 115 | 0.602586 | false | 4.09894 | false | false | false |
boltzj/movies-in-sf | app/utils/import_data.py | 1 | 4974 | from app import db
import csv
from app.models.movie import Movie
from app.models.location import Location
from app.models.director import Director
from app.models.writer import Writer
from app.models.actor import Actor
def import_data_from_database():
"""
Build dictionaries from database
:return:
"""
... | mit | 6,835,127,686,174,911,000 | 32.38255 | 87 | 0.484721 | false | 4.847953 | false | false | false |
jason-weirather/py-seq-tools | seqtools/cli/utilities/bam_to_bed_depth.py | 1 | 4235 | """ Convert a BAM or a SAM into a bed depth file
The file is a TSV format with the fields
1. Chromosome
2. Start (0-index)
3. End (1-index)
4. Read depth
The file is ordered and covers all regions covered by alignments
"""
import argparse, sys, os
from shutil import rmtree
from multiprocessing imp... | apache-2.0 | -9,172,658,648,721,654,000 | 30.37037 | 247 | 0.68902 | false | 3.440292 | false | false | false |
BytesGalore/PetersRIOT | dist/tools/compile_test/compile_test.py | 3 | 3666 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2014 René Kijewski <rene.kijewski@fu-berlin.de>
#
# 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... | lgpl-2.1 | 5,454,383,394,964,891,000 | 34.582524 | 120 | 0.629741 | false | 4.023052 | false | false | false |
macarthur-lab/xbrowse | seqr/views/utils/phenotips_utils.py | 1 | 4706 | import json
import logging
import requests
import settings
from seqr.views.utils.proxy_request_utils import proxy_request
logger = logging.getLogger(__name__)
def delete_phenotips_patient(project, individual):
"""Deletes patient from PhenoTips for the given patient_id.
Args:
project (Model): seqr ... | agpl-3.0 | 6,222,624,996,166,021,000 | 34.651515 | 112 | 0.659584 | false | 3.625578 | false | false | false |
codefisher/tbutton_web | lbutton/migrations/0004_auto_20170823_0029.py | 1 | 1045 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-23 00:29
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('lbutton', '0003_auto_20150314_2025'),
]
operations = [... | mit | 5,305,851,959,424,343,000 | 31.65625 | 133 | 0.615311 | false | 3.813869 | false | false | false |
kobotoolbox/kobocat | onadata/apps/restservice/tasks.py | 1 | 1102 | # coding: utf-8
import logging
from celery import shared_task
from django.conf import settings
from onadata.apps.restservice.models import RestService
@shared_task(bind=True)
def service_definition_task(self, rest_service_id, data):
"""
Tries to send data to the endpoint of the hook
It retries 3 times m... | bsd-2-clause | 5,079,829,175,311,263,000 | 30.485714 | 92 | 0.676951 | false | 3.761092 | false | false | false |
jptomo/rpython-lang-scheme | rpython/jit/backend/llsupport/regalloc.py | 1 | 27235 | import os
from rpython.jit.metainterp.history import Const, REF, JitCellToken
from rpython.rlib.objectmodel import we_are_translated, specialize
from rpython.jit.metainterp.resoperation import rop, AbstractValue
from rpython.rtyper.lltypesystem import lltype
from rpython.rtyper.lltypesystem.lloperation import llop
try... | mit | -2,670,520,486,654,573,600 | 34.930079 | 91 | 0.549807 | false | 3.866411 | false | false | false |
raags/ipmitool | ipmi/ipmicli.py | 1 | 5984 | from __future__ import print_function
import re, sys, site, getpass, socket, argparse, collections
from threading import Thread
from ipmi import ipmitool
# Todo: add logging
class Runner(Thread):
"""
Build ipmitool object and run through tasks as per requested command
"""
ipmi_map = { "reboot" : "... | apache-2.0 | -1,883,669,676,904,443,100 | 32.80791 | 117 | 0.550802 | false | 4.243972 | false | false | false |
hkaj/birdy_server | core/auth.py | 1 | 1549 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
import xml.etree.ElementTree as ET
from flask import abort, Flask, escape, request, session
from passlib.hash import sha256_crypt
from core.db import Retriever
def check_auth(session):
if 'username' in session:
xml_res = ET.fromstr... | gpl-3.0 | 8,671,701,160,201,255,000 | 29.98 | 91 | 0.630084 | false | 3.670616 | false | false | false |
bitprophet/releases | tests/_util.py | 1 | 3526 | from docutils.nodes import list_item, paragraph
from mock import Mock
import six
from releases import (
Issue,
issues_role,
Release,
release_role,
construct_releases,
)
from releases.util import make_app, changelog2dict
def inliner(app=None):
app = app or make_app()
return Mock(document=M... | bsd-2-clause | 957,454,023,392,588,300 | 27.435484 | 79 | 0.621384 | false | 3.609007 | false | false | false |
Crespo911/pyspace | pySPACE/missions/operations/shuffle.py | 3 | 13660 | """ Take combinations of datasets in the summary for training and test each
The input of this
operation has to contain several comparable datasets of the same type.
Depending on whether the input datasets contain split data, the behavior
of this operation differs slightly.
.. note:: This operation creates an output d... | gpl-3.0 | 2,813,379,751,357,658,600 | 45.148649 | 114 | 0.49978 | false | 5.07618 | true | false | false |
tinytunafish/PING-Mailbox | Mailbox.py | 1 | 1251 | #!/usr/bin/env python3
import os
import pingTracker
from time import strftime
#Set all variables here
API = "o.fdUi5rBICoNHmCf02ANsN5evuPvmZJDv"
pingTrack = pingTracker.pingTracker()
def addToDayCounter( dayArgs):
if dayArgs == "Monday":
pingTrack.addToMonday()
if dayArgs == "Tuesday":
pingTrack.addToTuesday()... | mit | -6,346,126,935,643,209,000 | 24.02 | 80 | 0.701039 | false | 2.64482 | false | false | false |
dchaplinsky/declarations.com.ua | declarations_site/catalog/management/commands/export_aggregated_csv.py | 1 | 2335 | from csv import DictWriter
from datetime import datetime
from elasticsearch_dsl.query import Q
from django.core.management.base import BaseCommand
from catalog.elastic_models import NACPDeclaration
AGGREGATED_FIELD_NAME = 'aggregated'
class Command(BaseCommand):
help = 'Export aggregated values from NACP decla... | mit | 536,416,296,476,105,340 | 31.333333 | 89 | 0.54811 | false | 4.400756 | false | false | false |
LeiDai/meep_metamaterials | effparam.py | 1 | 46957 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""#{{{
Plots reflection and transmission of a metamaterial structure
Tries to calculate its effective parameters [Smith2002], avoiding branch jumps
Enables to save to several types of output (cartesian graphs, polar graphs, nice PDF graphs...)
Exports the effective paramete... | mit | -5,967,803,258,731,536,000 | 48.063741 | 214 | 0.595008 | false | 2.8792 | false | false | false |
avinetworks/avi-heat | avi/heat/resources/vs.py | 1 | 87514 | # GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD
#pylint: skip-file
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource... | apache-2.0 | -6,141,921,522,261,341,000 | 38.296812 | 726 | 0.634036 | false | 3.9318 | false | false | false |
ikoryakovskiy/grlcfg | divyam_leosim_rl_sym_full.py | 1 | 6605 | from __future__ import division
import multiprocessing
import os
import os.path
import sys
import yaml, collections
import numpy as np
from time import sleep
import math
import argparse
import itertools
counter = None
counter_lock = multiprocessing.Lock()
proc_per_processor = 0;
def flatten(x):
if isinstance(x, c... | gpl-3.0 | 2,749,423,586,040,896,000 | 34.896739 | 142 | 0.539894 | false | 4.13588 | false | false | false |
hbp-brain-charting/public_protocols | rsvp_language/rsvp_language_protocol/langexpy_script/instdisplay.py | 1 | 4700 | # -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
from confparser import load_config
from expyriment import stimuli, misc
def launch_instructions(instructions_ini, exp):
# Select .ini file for instructions
setting = load_config(instructions_ini)
# Define the pathway of the instruc... | bsd-3-clause | -2,440,997,673,011,545,000 | 45.534653 | 78 | 0.494894 | false | 4.567541 | false | false | false |
larsimmisch/capisuite | scons-tools/filesubst.py | 1 | 1231 | # -*- python -*-
"""
File-Content Substitution builder for SCons
"""
__author__ = "Hartmut Goebel <h.goebel@crazy-compilers.com>"
import os, re
import SCons
def _action(target, source, env):
def _substitute(matchobj, env=env):
sym = matchobj.group(1)
try:
return env.subst(str(env[sym... | gpl-2.0 | -7,621,911,325,678,123,000 | 25.191489 | 63 | 0.581641 | false | 3.265252 | false | false | false |
dknlght/dkodi | src/plugin.video.DKEvents/default.py | 1 | 5113 | import httplib
import urllib,urllib2,re,sys
import cookielib,os,string,cookielib,StringIO,gzip
import os,time,base64,logging
from t0mm0.common.net import Net
import xml.dom.minidom
import xbmcaddon,xbmcplugin,xbmcgui
from xml.dom.minidom import Document
__settings__ = xbmcaddon.Addon(id='plugin.video.DKEvents... | gpl-2.0 | 7,934,995,466,692,362,000 | 35.595588 | 145 | 0.582241 | false | 3.59817 | false | false | false |
paulorauber/rl | examples/grid_obstacles.py | 1 | 4292 | #!/usr/bin/python3
import numpy as np
from learning.model_free import Problem
from learning.model_free import sarsa
from learning.model_free import qlearning
from learning.model_free import mc_value_iteration
from learning.model_free import sarsa_lambda
from learning.model_free import q_lambda
from learning.model_bu... | mit | 111,703,887,809,199,260 | 26.512821 | 79 | 0.558714 | false | 3.08777 | false | false | false |
sbranko/Resp1 | IIS_NagiosParser.py | 2 | 2307 | import re,os.path,sys,datetime
#Time
t1 = '{0:%y%m%d}'.format(datetime.datetime.now())
#Files and search string in HTTP request
tmpFile = 'C:\\log\\tmpCounter'+ t1 + '.txt'
logfile = 'C:\\inetpub\\logs\\LogFiles\\W3SVC1\\u_ex' + t1 + '_x.log'
searchString = 'some_string_in_url'
#Creating temp file to tra... | apache-2.0 | 2,022,859,079,128,887,600 | 23.921348 | 109 | 0.619853 | false | 3.177686 | false | false | false |
levinas/assembly | lib/assembly/plugins/swap.py | 3 | 1567 | import os
from plugins import BaseAssembler
from yapsy.IPlugin import IPlugin
class SwapAssembler(BaseAssembler, IPlugin):
def run(self, reads):
## Swap only supports a single FastA file.
# Convert Fastq files
fasta_files = []
for f in self.get_files(reads):
if f.end... | mit | 5,089,824,990,903,519,000 | 37.219512 | 84 | 0.502872 | false | 3.997449 | false | false | false |
angryrancor/ezdmb | View/mainwindow_ui.py | 1 | 11562 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/justinvieira/Documents/ezdmb/View/mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def ... | lgpl-3.0 | -1,747,725,080,580,646,400 | 52.527778 | 109 | 0.695641 | false | 3.645019 | false | false | false |
mensi/cydra | plugins/activedirectory/cydraplugins/activedirectory/__init__.py | 1 | 6880 | # -*- coding: utf-8 -*-
#
# Copyright 2012 Manuel Stocker <mensi@mensi.ch>
#
# This file is part of Cydra.
#
# Cydra 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 yo... | gpl-3.0 | 854,990,746,114,101,500 | 29.043668 | 118 | 0.601744 | false | 3.854342 | false | false | false |
czcorpus/kontext | scripts/fix/fixsubc_0.9-0.12.py | 1 | 1464 | import sys
import os
sys.path.insert(0, os.path.realpath('%s/..' % os.path.dirname(__file__)))
import autoconf
import plugins
from plugins import lindat_db
plugins.install_plugin('db', lindat_db, autoconf.settings)
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='Rena... | gpl-2.0 | -5,520,816,718,659,871,000 | 40.828571 | 103 | 0.623634 | false | 3.168831 | false | false | false |
c22n/ion-channel-ABC | docs/examples/human-atrial/experiments/ical_sun.py | 1 | 9835 | from ionchannelABC.experiment import Experiment
import data.ical.Sun1997.data_Sun1997 as data
from ionchannelABC.protocol import availability_linear, recovery
import numpy as np
import myokit
import warnings
from scipy.optimize import OptimizeWarning
import scipy.optimize as so
Q10_cond = 1.6 # [Li1997]
Q10_tau_... | gpl-3.0 | 1,906,253,293,606,763,300 | 32.797251 | 94 | 0.564108 | false | 3.203583 | false | false | false |
geodynamics/snac | Snac/snac2dx/snac_combine.py | 5 | 12995 | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
'''
Combine the converted Snac Data
usage: snac_combine.py modelname timestep nodex nodey nodez nprocx nprocy ... | gpl-2.0 | -100,081,764,741,577,950 | 34.89779 | 166 | 0.602001 | false | 2.746777 | false | false | false |
t-cas/JumpSSH | jumpssh/exception.py | 2 | 1793 |
class SSHException(Exception):
"""Generic exception for jumpssh
Allow to chain exceptions keeping track of origin exception
"""
def __init__(self, msg, original_exception=None):
message = msg
if original_exception:
message += ": %s" % original_exception
super(SSHExc... | mit | 5,257,936,135,727,758,000 | 32.203704 | 82 | 0.643614 | false | 4.383863 | false | false | false |
ilastikdev/ilastik | ilastik/applets/splitBodyCarving/splitBodyCarvingSerializer.py | 4 | 3655 | ###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | gpl-3.0 | 486,842,752,296,672,640 | 44.123457 | 123 | 0.641587 | false | 4.330569 | false | false | false |
hyphenliu/cnminlangwebcollect | src/crawler/siteInfoMain.py | 1 | 3436 | # -*- coding:utf-8 -*-
'''
Created on 2014年2月2日
@author: Hyphen.Liu
'''
import Queue
import os
import globalvar.guiGlobalVar as ggv
import globalvar.crawlerGlobalVar as cgv
from crawler.siteInfoThread import SiteInfoThread
class SiteInfoMain():
'''
:对所有的网页连接识别该网页的语言
:对已经识别为相应语言的网站获取该网站建站详细信息
'''
... | gpl-3.0 | 3,439,359,229,629,306,400 | 35.173333 | 102 | 0.534661 | false | 2.304163 | false | false | false |
patwat/python-unitex | unitex/utils/fsa.py | 1 | 15087 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from io import open
from unitex import *
_LOGGER = logging.getLogger(__name__)
class FSAConstants:
EPSILON = "<E>"
DEPTH_FIRST_SEARCH = "dfs"
BREADTH_FIRST_SEARCH = "bfs"
class Edge(object):
def __init__(s... | gpl-3.0 | -4,207,266,120,021,869,000 | 24.527919 | 96 | 0.485782 | false | 3.964004 | false | false | false |
trilkk/dnload | dnload/assembler.py | 2 | 3594 | import os
from dnload.common import is_listing
from dnload.common import listify
from dnload.common import run_command
########################################
# Assembler ############################
########################################
class Assembler:
"""Class used to generate assembler output."""
de... | bsd-3-clause | 4,423,154,596,944,982,000 | 31.378378 | 83 | 0.470506 | false | 3.975664 | false | false | false |
mineo/dnf-plugins-core | plugins/copr.py | 1 | 14955 | # supplies the 'copr' command.
#
# Copyright (C) 2014-2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is dis... | gpl-2.0 | -8,652,930,053,118,489,000 | 37.053435 | 94 | 0.570043 | false | 4.092775 | false | false | false |
rtavenar/tslearn | tslearn/hdftools.py | 1 | 4495 | import h5py
import os
import numpy as np
import traceback
from warnings import warn
def save_dict(d, filename, group, raise_type_fail=True):
"""
Recursively save a dict to an hdf5 group in a new file.
Parameters
----------
d: dict
dict to save as an hdf5 file
filename : str
F... | bsd-2-clause | -8,905,089,988,840,970,000 | 28.768212 | 78 | 0.511012 | false | 4.082652 | false | false | false |
marauder37/PokemonGo-Map | pogom/pgoapi/pgoapi.py | 28 | 6203 | """
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | agpl-3.0 | -3,666,100,056,309,610,000 | 33.653631 | 122 | 0.612929 | false | 4.219728 | false | false | false |
vtexier/duniter-python-api | duniterpy/documents/document.py | 1 | 2367 | import base64
import re
import logging
import hashlib
from .constants import signature_regex
class MalformedDocumentError(Exception):
"""
Malformed document exception
"""
def __init__(self, field_name):
super().__init__("Could not parse field {0}".format(field_name))
class Document:
re_v... | gpl-3.0 | -2,618,608,365,082,055,700 | 28.5875 | 96 | 0.588931 | false | 4.264865 | false | false | false |
AHAAAAAAA/HackCU2016 | param_util.py | 5 | 1642 | """
Utility for model parameter
"""
import os
try:
from cPickle import load
except ImportError:
from pickle import load
class Params(object):
pass
def load_dcnn_model_params(path, param_str = None):
"""
>>> p = load_dcnn_model_params("models/filter_widths=8,6,,batch_size=10,,ks=20,8,,fold=1,1,,co... | mit | 684,665,900,532,379,400 | 26.366667 | 186 | 0.523752 | false | 2.921708 | false | false | false |
alexign/botty_clicker | botty_clicker.py | 1 | 121096 | # MIT License
#
# Copyright (c) 2017 Alex Ignatov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | mit | -3,060,479,858,056,614,000 | 37.725935 | 129 | 0.55233 | false | 3.495238 | false | false | false |
robwilkerson/BitBucket-api | bitbucket/repository.py | 1 | 6817 | # -*- coding: utf-8 -*-
import json
from tempfile import NamedTemporaryFile
from zipfile import ZipFile
from pprint import pprint
URLS = {
'CREATE_REPO': 'repositories/',
'CREATE_REPO_V2': 'repositories/%(username)s/%(repo_slug)s/',
'GET_REPO': 'repositories/%(username)s/%(repo_slug)s/',
'UPDATE_REPO... | isc | 1,174,813,250,221,191,000 | 42.698718 | 132 | 0.598944 | false | 4.177083 | false | false | false |
ping/youtube-dl | youtube_dl/extractor/unity.py | 30 | 1228 | from __future__ import unicode_literals
from .common import InfoExtractor
from .youtube import YoutubeIE
class UnityIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?unity3d\.com/learn/tutorials/(?:[^/]+/)*(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://unity3d.com/learn/tutorials/topics/animation/a... | unlicense | -41,882,844,988,352,350 | 37.375 | 117 | 0.576547 | false | 3.257294 | false | false | false |
sparkslabs/kamaelia_ | Sketches/DK/Kamaelia-Paint/App/ToolBox.py | 3 | 5397 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | apache-2.0 | 1,796,602,243,262,130,200 | 48.972222 | 117 | 0.602001 | false | 3.868817 | false | false | false |
Ohmnivore/HeadRush | modexample/hasher.py | 1 | 1213 | #!/usr/bin/python
import sys
import os
import hashlib
import json
path = ""
towrite = {}
hash = hashlib.md5()
def PrintHelp():
print """\nHasher v0.1 is an utility that produces a .txt of MD5 checksums in a folder.
Simply run in a terminal and specify the folder's path as an argument. The .txt will be created
or... | gpl-3.0 | -8,781,004,111,173,241,000 | 24.829787 | 95 | 0.591921 | false | 3.350829 | false | false | false |
Ezeer/VegaStrike_win32FR | vegastrike/boost/1_28/src/gen_function.py | 2 | 8743 | r"""
>>> template = ''' template <class T%(, class A%+%)>
... static PyObject* call( %1(T::*pmf)(%(A%+%:, %))%2, PyObject* args, PyObject* ) {
... PyObject* self;
... %( PyObject* a%+;
... %) if (!PyArg_ParseTuple(args, const_cast<char*>("O%(O%)"), &self%(, &a%+%)))
... return 0... | mit | 355,258,400,327,322,940 | 34.979424 | 121 | 0.510008 | false | 3.707803 | false | false | false |
40huo/cobra | cobra/cli.py | 2 | 4483 | # -*- coding: utf-8 -*-
"""
cli
~~~
Implements CLI mode
:author: Feei <feei@feei.cn>
:homepage: https://github.com/WhaleShark-Team/cobra
:license: MIT, see LICENSE for more details.
:copyright: Copyright (c) 2018 Feei. All rights reserved
"""
import re
import os
from .detection imp... | mit | 4,558,426,633,579,418,600 | 32.719697 | 113 | 0.590429 | false | 3.5608 | false | false | false |
memsharded/conan | conans/client/recorder/upload_recoder.py | 1 | 1783 | from collections import OrderedDict, namedtuple
from datetime import datetime
from conans.model.ref import ConanFileReference
class _UploadElement(namedtuple("UploadElement", "reference, remote_name, remote_url, time")):
def __new__(cls, reference, remote_name, remote_url):
the_time = datetime.utcnow()
... | mit | -8,984,704,860,235,695,000 | 31.418182 | 100 | 0.618059 | false | 3.901532 | false | false | false |
robert-budde/smarthome | tools/build_requirements.py | 4 | 3021 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2018- Martin Sinn m.sinn@gmx.de
#########################################################################
# ... | gpl-3.0 | -4,602,444,489,486,859,000 | 35.841463 | 95 | 0.652102 | false | 3.853316 | false | false | false |
tengqm/senlin | senlin/profiles/os/heat/resource.py | 1 | 1387 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | apache-2.0 | 4,180,324,875,907,093,500 | 30.522727 | 77 | 0.677722 | false | 3.974212 | false | false | false |
PXL-CF2016/pxl-master-server | pxl_master/settings.py | 1 | 3529 | """
Django settings for pxl_master project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
#... | mit | 8,296,968,059,707,074,000 | 25.533835 | 91 | 0.684046 | false | 3.568251 | false | false | false |
linsalrob/PyFBA | PyFBA/filters/reactions_and_proteins.py | 2 | 1568 | import sys
def reactions_with_no_proteins(reactions, verbose=False):
"""
Figure out which reactions in our set have no proteins associated with them.
:param reactions: The reactions dictionary
:type reactions: dict
:param verbose: prints out how many reactions have no proteins out of the total
... | mit | 1,700,619,016,538,963,500 | 31 | 114 | 0.649872 | false | 3.742243 | false | false | false |
yipenggao/moose | python/TestHarness/testers/ImageDiff.py | 3 | 2914 | from FileTester import FileTester
import os
import sys
from mooseutils.ImageDiffer import ImageDiffer
class ImageDiff(FileTester):
@staticmethod
def validParams():
params = FileTester.validParams()
params.addRequiredParam('imagediff', [], 'A list of files to compare against the gold.')
... | lgpl-2.1 | -514,916,517,787,486,200 | 40.042254 | 136 | 0.595402 | false | 4.317037 | true | false | false |
Kyria/LazyBlacksmith | lazyblacksmith/models/sde/item.py | 1 | 3146 | # -*- encoding: utf-8 -*-
from . import db
from .activity import Activity
from flask import url_for
class Item(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=False)
name = db.Column(db.String(100), nullable=True)
max_production_limit = db.Column(db.Integer, nullable=True)
market... | bsd-3-clause | -4,950,217,859,485,991,000 | 28.12963 | 113 | 0.601081 | false | 3.813333 | false | false | false |
d5c5ceb0/currency.workflow | src/currency.py | 1 | 3812 | #!/usr/bin/python
# encoding: utf-8
import sys
from workflow import Workflow, web
import datetime
ICON_DEFAULT = 'icon.png'
def get_yunbi_tickers(query):
url = 'https://yunbi.com//api/v2/tickers.json'
r = web.get(url)
r.raise_for_status()
tickers = r.json()
for name in tickers:
if name[... | apache-2.0 | -9,168,712,520,551,374,000 | 28.3125 | 82 | 0.466951 | false | 3.131886 | false | false | false |
Peanhua/diamond-girl | blender-py/treasure-models.py | 1 | 1477 | import bpy
import sys
scene = bpy.context.scene
scene.frame_set(1)
output_filename = None
parsing = False
for i in sys.argv:
if parsing == True:
output_filename = i
elif i == '--':
parsing = True
for obj in bpy.data.objects:
obj.select = False
for obj in bpy.data.objects:
if... | gpl-2.0 | 4,880,896,058,564,181,000 | 32.568182 | 87 | 0.450237 | false | 4.630094 | false | false | false |
odicraig/kodi2odi | addons/plugin.video.salts/scrapers/tvshow_scraper.py | 1 | 4494 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 | -5,407,110,154,330,804,000 | 43.94 | 191 | 0.58656 | false | 3.735661 | false | false | false |
VigTech/Vigtech-Services | Logica/ConexionBD/adminBD.py | 1 | 10033 | import psycopg2
from psycopg2 import extras
from principal.parameters import *
# Create your views here.
import sys
reload(sys) # to re-enable sys.setdefaultencoding()
sys.setdefaultencoding('utf-8')
class AdminBD:
#conn_string = ""
def __init__(self):
#host='127.0.0.1' dbname='docker' user='docker' pa... | lgpl-3.0 | -7,890,586,123,452,067,000 | 38.038911 | 304 | 0.570517 | false | 3.486101 | false | false | false |
John-Hart/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyComplex/autorestcomplextestservice/operations/polymorphism.py | 2 | 7536 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -2,923,434,051,144,003,600 | 32.945946 | 84 | 0.589039 | false | 4.438163 | true | false | false |
kinow/rosalind-exercises | src/cons.py | 1 | 10762 | from fasta.Fasta import read_fasta
import sys
if __name__ == '__main__':
data = '''
>Rosalind_4592
>Rosalind_9829
TTAGACCATGCTGTTGTACTCCCCCCGTCATGGCAAAAATGACTCATTCGAGTCTTTCGC
ATGCGTCCACCCGGCTGTGGACTTGTCTGTTCGGCCTAGGCGTGACAAAGGTTAAAGTCA
TGTATACAGGATGCCGACCAAATGTAGAGCTACTCATTCCGTATAGCTTCTAAGCCACTA
ACGAGGATACGAAGTGTA... | unlicense | 3,255,450,500,082,523,600 | 45.593074 | 62 | 0.898253 | false | 2.47573 | false | false | false |
thiswind/nn_practice | tensorflow/knn.py | 1 | 1534 | from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
mnist = read_data_sets('data/', one_hot=True)
train_pixels, train_list_values = mnist.train.next_batch(100)
test_pixels, test_list_values = mnist.train.next_batch... | gpl-3.0 | -165,997,286,173,574,100 | 22.242424 | 79 | 0.67927 | false | 2.878049 | true | false | false |
deepmind/acme | acme/environment_loop_test.py | 1 | 3599 | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | apache-2.0 | 339,868,367,020,457,540 | 34.284314 | 77 | 0.714365 | false | 3.323176 | true | false | false |
alfredodeza/pacha | pacha/database.py | 1 | 3105 | import sqlite3
import os
from pacha.util import get_db_file, get_db_dir
REPOS_TABLE = """CREATE TABLE IF NOT EXISTS repos(
id integer primary key,
path TEXT,
permissions TEXT,
type TEXT,
timestamp TEXT
)"""
METADATA_TABLE = """CREATE TAB... | mit | 1,075,039,406,109,860,200 | 28.018692 | 149 | 0.577778 | false | 4.074803 | false | false | false |
Fale/ansible | test/support/network-integration/collections/ansible_collections/vyos/vyos/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py | 47 | 15951 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos_lldp_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necess... | gpl-3.0 | -6,106,193,386,870,510,000 | 35.417808 | 96 | 0.519967 | false | 4.470572 | true | false | false |
mfherbst/spack | var/spack/repos/builtin/packages/votca-tools/package.py | 2 | 2195 | ##############################################################################
# Copyright (c) 2017-2018, The VOTCA Development Team (http://www.votca.org)
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
#
# For details, see https://github.com/spack/... | lgpl-2.1 | 4,780,819,878,848,649,000 | 38.196429 | 78 | 0.64738 | false | 3.658333 | false | false | false |
HoldYourBreath/Library | tests/books/example_books.py | 1 | 1761 | import copy
book1 = {'isbn': 1234,
'title': 'The book',
'authors': ['Bob Author', 'Helio Author'],
'pages': 500,
'format': 'Slippery back',
'publisher': 'Crazy dude publishing',
'publication_date': '1820 01 02',
'description': 'a book',
'thumbnai... | mit | -1,254,717,766,290,441,200 | 28.847458 | 62 | 0.53833 | false | 3.500994 | false | false | false |
playpauseandstop/rororo | examples/hobotnica/src/hobotnica/views.py | 1 | 2868 | import uuid
from aiohttp import web
from rororo import openapi_context, OperationTableDef
from rororo.openapi.exceptions import ObjectDoesNotExist
from .data import ENVIRONMENT_VARS, GITHUB_REPOSITORIES
from .decorators import login_required
operations = OperationTableDef()
@operations.register
@login_required
a... | bsd-3-clause | 3,272,009,733,374,445,000 | 29.510638 | 78 | 0.670153 | false | 3.896739 | false | false | false |
dscrobonia/sawyer | analyzers/response_size_centroidmedian.py | 1 | 3343 | import json
import logging
import matplotlib.pyplot as plt
import numpy as np
import scipy.cluster.hierarchy as hac
log = logging.getLogger(__name__)
def analyze(data):
# Convert this to python data for us to be able to run ML algorithms
json_to_python = json.loads(data)
per_size = dict() # IP-Respons... | mit | 6,647,522,791,595,655,000 | 27.57265 | 185 | 0.504038 | false | 3.296844 | false | false | false |
JoseSalgado1024/ckanext-needupdate | ckanext/needupdate/plugin.py | 1 | 2104 | # encoding: utf-8
"""
Implementación del Plugin NeedUpdate.
"""
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
import logging
from controller import NeedupdateController
# logs
logger = logging.getLogger(__name__)
def get_plugins_list():
"""
Retorna la lista de plugins que posee la pl... | mit | -2,441,623,942,506,500,000 | 28.208333 | 81 | 0.61436 | false | 4.099415 | true | false | false |
jamesstott/layers_by_field | layersbyfielddialogbase.py | 1 | 3849 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'layersbyfielddialogbase.ui'
#
# Created: Fri Mar 28 11:23:31 2014
# by: PyQt4 UI code generator 4.8.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... | gpl-2.0 | -1,596,834,043,230,696,200 | 57.318182 | 154 | 0.747986 | false | 3.758789 | false | false | false |
regnart-tech-club/programming-concepts | course-2:combining-building-blocks/subject-2:functions/topic-3:Functions calling themselves/lesson-3.1:Fibonacci solution.py | 1 | 1098 | # The Fibonacci sequence starts with 0 and 1. Subsequent terms are then gotten by adding the previous two
# such that the first seven terms are: 0, 1, 1, 2, 3, 5, 8.
# Using recursion, write a function that, given an integer n, returns the nth Fibonacci number.
# For example:
# given n = 0, the function should return ... | apache-2.0 | 2,524,405,582,817,933,000 | 28.675676 | 105 | 0.688525 | false | 2.524138 | true | false | false |
CorrosiveKid/django_project_template | project_template/settings/common.py | 1 | 2909 | """
Django settings for project_template project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impor... | mit | -2,922,128,141,967,905,000 | 25.688073 | 78 | 0.678927 | false | 3.753548 | false | false | false |
openstack/networking-l2gw | networking_l2gw/extensions/l2gatewayconnection.py | 1 | 3854 | # Copyright 2015 OpenStack Foundation
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | apache-2.0 | 4,207,975,088,911,122,000 | 34.036364 | 79 | 0.557602 | false | 4.539458 | false | false | false |
glob3mobile/qgis-g3m | QGIS-Plugin/webappbuilder/ext-libs/geoserver/layergroup.py | 1 | 3499 | from geoserver.support import ResourceInfo, bbox, write_bbox, \
write_string, xml_property, url
def _maybe_text(n):
if n is None:
return None
else:
return n.text
def _layer_list(node, element):
if node is not None:
return [_maybe_text(n.find("name")) for n in node.findall(e... | epl-1.0 | -2,319,838,451,695,568,000 | 30.809091 | 89 | 0.587311 | false | 3.892102 | false | false | false |
maciejkula/glove-python | glove/metrics/accuracy.py | 5 | 3242 | try:
from itertools import izip
except ImportError:
izip = zip
import numpy as np
from .accuracy_cython import compute_rank_violations
def read_analogy_file(filename):
"""
Read the analogy task test set from a file.
"""
section = None
with open(filename, 'r') as questions_file:
... | apache-2.0 | -8,236,008,879,430,348,000 | 29.87619 | 81 | 0.570635 | false | 4.459422 | true | false | false |
sean-tan-columbia/aerospike-async-client | aerospike_client.py | 1 | 9857 |
# Copyright (c) 2015 Jinxiong Tan
# GNU General public licence
import aerospike as aero
import multiprocessing
import time
import datetime
import sys
# Usage example:
# records = [Record('key_1', {'bin': 'value_1'}), Record('key_2', {'bin': 'value_2'}), Record('key_3', {'bin': 'value_3'})]
# aerospike_client = aero... | gpl-2.0 | 2,146,844,727,399,308,500 | 31.639073 | 183 | 0.563153 | false | 4.07651 | false | false | false |
emilio/servo | components/style/properties/build.py | 4 | 4779 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import json
import os.path
import re
import sys
BASE = os.path.dirname(__file__.replace('\\', '/'))
sys.path.insert(0,... | mpl-2.0 | -956,424,572,775,642,800 | 29.43949 | 94 | 0.561833 | false | 3.673328 | false | false | false |
Huyuwei/tvm | nnvm/python/nnvm/compiler/graph_util.py | 2 | 5031 | # 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 | -5,987,048,062,232,325,000 | 29.676829 | 75 | 0.649771 | false | 3.970797 | false | false | false |
thispc/download-manager | module/plugins/container/TXT.py | 7 | 2140 | # -*- coding: utf-8 -*-
import codecs
from ..internal.Container import Container
from ..internal.misc import encode
class TXT(Container):
__name__ = "TXT"
__type__ = "container"
__version__ = "0.21"
__status__ = "testing"
__pattern__ = r'.+\.(txt|text)$'
__config__ = [("activated", "bool", ... | gpl-3.0 | -7,854,115,424,311,552,000 | 28.315068 | 84 | 0.499065 | false | 4.17154 | false | false | false |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Ops/PyScripts/lib/xops/ip.py | 1 | 6377 |
from __future__ import division
from math import floor
def get_cidr_from_subnet(subnet):
if (not validate_ipv4(subnet)):
raise ValueError, 'Subnet must be valid.'
subnetsplit = subnet.split('.')
cidr = 0
for oct in subnetsplit:
cidr = (cidr + list(bin(int(oct))).count('1'))
return ... | unlicense | -89,215,009,421,749,810 | 34.433333 | 135 | 0.545868 | false | 3.419303 | false | false | false |
andrewyoung1991/supriya | supriya/tools/ugentools/Pan4.py | 1 | 5290 | # -*- encoding: utf-8 -*-
from supriya.tools.ugentools.MultiOutUGen import MultiOutUGen
class Pan4(MultiOutUGen):
r'''A four-channel equal-power panner.
::
>>> source = ugentools.In.ar(bus=0)
>>> pan_4 = ugentools.Pan4.ar(
... gain=1,
... source=source,
... ... | mit | -7,805,452,371,901,044,000 | 23.05 | 64 | 0.433837 | false | 3.895434 | false | false | false |
eyqs/req | parsers/ubc/req.py | 1 | 5615 | #!/usr/bin/env python3
"""
req v3.1
Copyright (c) 2016, 2017, 2018 Eugene Y. Q. Shen.
req 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.
r... | gpl-3.0 | 5,820,187,232,646,883,000 | 34.537975 | 77 | 0.50472 | false | 4.045389 | false | false | false |
KivApple/mcu-info-util | mcu_info_util/toolchain.py | 1 | 1404 | import os
class Toolchain:
MCU_TYPES = {
"stm32": "arm",
"atsam": "arm",
"at91sam": "arm",
"atmega": "avr",
"attiny": "avr",
"msp430": "msp430"
}
@classmethod
def mcu_type(cls, mcu):
for prefix in cls.MCU_TYPES:
if mcu.startswith(pre... | mit | 6,474,986,655,971,244,000 | 25.490566 | 70 | 0.556268 | false | 3.685039 | false | false | false |
pwojt/beer_app_414 | beer_glass_api.py | 1 | 2753 | from auth import requires_auth
from db_helper import IdUrlField, update_model
from flask.ext.restful import Resource, fields, reqparse, marshal, abort
__author__ = 'wojtowpj'
from google.appengine.ext import db
class BeerGlass(db.Model):
name = db.StringProperty(required=True)
description = db.St... | apache-2.0 | -7,111,607,220,390,472,000 | 29.284091 | 103 | 0.584453 | false | 3.51148 | false | false | false |
cmorgan/toyplot | toyplot/cairo/png.py | 1 | 3651 | # Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
from __future__ import absolute_import
from __future__ import division
import cairo
import toyplot.cairo
import toyplot.svg
try:
import cS... | bsd-3-clause | -3,456,958,551,830,996,500 | 34.794118 | 89 | 0.675705 | false | 4.012088 | false | false | false |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/ldb.py | 1 | 22146 | # encoding: utf-8
# module ldb
# from /usr/lib/python2.7/dist-packages/ldb.so
# by generator 1.135
""" An interface to LDB, a LDAP-like API that can either to talk an embedded database (TDB-based) or a standards-compliant LDAP server. """
# no imports
# Variables with simple values
CHANGETYPE_ADD = 1
CHANGETYPE_DELET... | gpl-2.0 | -6,579,479,681,932,068,000 | 27.068441 | 139 | 0.579563 | false | 3.874388 | false | false | false |
smcgregor/gravity | domain_bridge.py | 1 | 17651 | from FireGirlOptimizer import *
from FireGirlStats import *
# Keep track of file numbers so they don't repeat
server_file_counter = 0
def file_number_str():
global server_file_counter
server_file_counter += 1
return server_file_counter
def initialize():
"""
Return the initialization object for th... | mpl-2.0 | -2,363,515,958,502,612,000 | 43.349246 | 116 | 0.543935 | false | 4.045611 | false | false | false |
bitcraze/crazyflie-firmware | tools/usdlog/example.py | 1 | 3994 | # -*- coding: utf-8 -*-
"""
example on how to plot decoded sensor data from crazyflie
@author: jsschell
"""
import cfusdlog
import matplotlib.pyplot as plt
import re
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("filename")
args = parser.parse_args()
# decode binary log data
logData = cfusdlo... | gpl-3.0 | -5,275,016,593,829,280,000 | 29.953488 | 85 | 0.623842 | false | 3.09775 | false | false | false |
y-usuzumi/survive-the-course | leetcode/23.Merge_k_Sorted_Lists/main.py | 1 | 1817 | from typing import List
# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def mergeKLists(self, lists: List[ListNode]) -> ListNode:
l = len(lists)
if l == 0:
return None
if l == 1:
... | bsd-3-clause | 3,070,693,238,430,207,000 | 25.333333 | 61 | 0.489818 | false | 3.507722 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.