text stringlengths 0 1.05M | meta dict |
|---|---|
"""A library that provides a Python interface to the Futbol24 API"""
import json
# static type-checking
from typing import Dict
from urllib.parse import urlparse, urlunparse, urlencode
import requests
import re
from lxml import html
from futbol24.models import Country, Competition, League, Team, Match, Matches
from ... | {
"repo_name": "vladimir-zahradnik/futbol24-python",
"path": "futbol24/api.py",
"copies": "1",
"size": "22892",
"license": "apache-2.0",
"hash": 538868867375233500,
"line_mean": 36.8043117745,
"line_max": 119,
"alpha_frac": 0.5291717845,
"autogenerated": false,
"ratio": 3.673811442385173,
"confi... |
"""A library that provides a Python interface to the GetResponse API"""
import requests
from collections import defaultdict
import json
from json.decoder import JSONDecodeError
class GetresponseClient:
"""
Base class which does requests calls
"""
API_ENDPOINT = 'https://api.getresponse.com/v3'
API... | {
"repo_name": "pavelkalin/getresponse-python",
"path": "getresponse/getresponsev3.py",
"copies": "1",
"size": "53453",
"license": "mit",
"hash": -7133962155115208000,
"line_mean": 46.7258928571,
"line_max": 204,
"alpha_frac": 0.5584158045,
"autogenerated": false,
"ratio": 4.432255389718076,
"co... |
""" A library that provides a Python interface to the ScreenConnect API """
import re
from json import dumps
import requests
from screenconnect.session import Session
from screenconnect.session_group import SessionGroup
from screenconnect.error import ScreenConnectError
class ScreenConnect:
""" A python interf... | {
"repo_name": "jacobeturpin/python-screenconnect",
"path": "screenconnect/api.py",
"copies": "1",
"size": "8800",
"license": "mit",
"hash": 2255075523229696000,
"line_mean": 32.7164750958,
"line_max": 88,
"alpha_frac": 0.5965909091,
"autogenerated": false,
"ratio": 4.4110275689223055,
"config_t... |
'''A library to allow navigating rest apis easy.'''
from __future__ import print_function
from __future__ import unicode_literals
__version__ = '1.0'
from weakref import WeakValueDictionary
try:
from http import client as http_client
except ImportError:
import httplib as http_client
import json
try:
fro... | {
"repo_name": "deontologician/restnavigator",
"path": "restnavigator/halnav.py",
"copies": "1",
"size": "23952",
"license": "mit",
"hash": 3088228122453363700,
"line_mean": 33.4633093525,
"line_max": 91,
"alpha_frac": 0.5708917836,
"autogenerated": false,
"ratio": 4.274089935760172,
"config_tes... |
'''A library to allow navigating rest apis easy.'''
from __future__ import print_function
__version__ = '0.2'
import copy
from weakref import WeakValueDictionary
import functools
import httplib
import re
import json
import urlparse
import webbrowser
import urllib
import requests
import unidecode
import uritemplate
... | {
"repo_name": "EricSchles/rest_navigator",
"path": "restnavigator/halnav.py",
"copies": "1",
"size": "12660",
"license": "mit",
"hash": -1084705765944690700,
"line_mean": 33.9723756906,
"line_max": 79,
"alpha_frac": 0.5488151659,
"autogenerated": false,
"ratio": 4.349020954998283,
"config_test"... |
"""A library to control a RobertSonics WavTrigger through a serial port
"""
from __future__ import absolute_import, division, print_function
from os import errno
import serial
import struct
__version__ = '0.1.2'
__author__ = 'Eberhard Fahle'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 Eberhard Fahle'
#Const... | {
"repo_name": "wayoda/rswt",
"path": "rswt.py",
"copies": "1",
"size": "15701",
"license": "mit",
"hash": -2205861493957191200,
"line_mean": 32.1244725738,
"line_max": 91,
"alpha_frac": 0.5974778677,
"autogenerated": false,
"ratio": 3.5442437923250565,
"config_test": false,
"has_no_keywords":... |
"""A library to evaluate MDM on a single GPU.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
from pathlib import Path
import data_provider
import math
import menpo
import matplotlib
import mdm_model
import mdm_train
import... | {
"repo_name": "trigeorgis/mdm",
"path": "mdm_eval.py",
"copies": "1",
"size": "8331",
"license": "bsd-3-clause",
"hash": 5910222370436099000,
"line_mean": 35.8628318584,
"line_max": 97,
"alpha_frac": 0.6272956428,
"autogenerated": false,
"ratio": 3.5196451204055768,
"config_test": false,
"has... |
""" A library to export some stats that we can use for monitoring.
"""
def export(values):
o = []
for k, v in sorted(values.items()):
o.append('%s %s' % (escape(k), build_value(v)))
return '\n'.join(o)
class ExportedMap(object):
def __init__(self, label, value):
self.label = label
self.value = val... | {
"repo_name": "AloneRoad/Inforlearn",
"path": "common/monitor.py",
"copies": "1",
"size": "1324",
"license": "apache-2.0",
"hash": -8141803161859887000,
"line_mean": 26.5833333333,
"line_max": 79,
"alpha_frac": 0.6178247734,
"autogenerated": false,
"ratio": 3.3266331658291457,
"config_test": fa... |
# A library to handle dealing with ATCA MoniCA points.
from requests import Session
import json
import cabb_scheduler.errors
class monicaPoint:
def __init__(self, info={}):
self.value = None
self.description = None
self.pointName = None
self.updateTime = None
self.errorState... | {
"repo_name": "ste616/cabb-schedule-api",
"path": "python/cabb_scheduler/monica_information.py",
"copies": "1",
"size": "4820",
"license": "mit",
"hash": 4166115675816516000,
"line_mean": 33.4285714286,
"line_max": 142,
"alpha_frac": 0.603526971,
"autogenerated": false,
"ratio": 4.130248500428449... |
# A library to handle dealing with v3 of the ATCA calibrator database.
from requests import Session
from xml.dom import minidom
import json
import numpy as np
import cabb_scheduler.errors
arrayNames = { '6A': "6km", '6B': "6km", '6C': "6km", '6D': "6km",
'1.5A': "1.5km", '1.5B': "1.5km", '1.5C': "1.5km"... | {
"repo_name": "ste616/cabb-schedule-api",
"path": "python/cabb_scheduler/calibrator_database.py",
"copies": "1",
"size": "15941",
"license": "mit",
"hash": -6466371795305313000,
"line_mean": 43.0359116022,
"line_max": 118,
"alpha_frac": 0.5554231228,
"autogenerated": false,
"ratio": 4.18618697478... |
"""'A library to help presenters demonstrate terminal sessions hands-free."""
import locale
import logging
import random
import subprocess
import time
import warnings
from contextlib import contextmanager
from functools import wraps
from . import keys as keyboard
from .version import get_version
__version__ = get_ve... | {
"repo_name": "ddbeck/oraide",
"path": "oraide/__init__.py",
"copies": "1",
"size": "8158",
"license": "bsd-3-clause",
"hash": 8550628255468664000,
"line_mean": 32.9916666667,
"line_max": 79,
"alpha_frac": 0.6144888453,
"autogenerated": false,
"ratio": 4.271204188481676,
"config_test": false,
... |
"""A library to plot zipcodes on a map of America"""
from __future__ import print_function
try:
from ConfigParser import SafeConfigParser
except ImportError:
from configparser import SafeConfigParser
from datetime import datetime
import json
import random
import sys
import time
import paho.mqtt.client as mqt... | {
"repo_name": "Plasmarobo/LevelUpMap",
"path": "mqtt_locator.py",
"copies": "1",
"size": "11028",
"license": "mit",
"hash": -9190755774495834000,
"line_mean": 36.3830508475,
"line_max": 145,
"alpha_frac": 0.5797968807,
"autogenerated": false,
"ratio": 3.445173383317713,
"config_test": true,
"... |
# A library to read Starbound's SBAsset format.
# I know it's terrible
import struct
import logging
# Make sure the file is a valid pak, then get various information from it.
def get_pak_info(pak):
# Check that the pak is valid
header = pak.read(8)
assert header == b'SBAsset6', 'Unrecognized format!'
... | {
"repo_name": "R2pChyou/starcheat",
"path": "starcheat/assets/sb_asset.py",
"copies": "1",
"size": "3535",
"license": "mit",
"hash": 3110389603335012400,
"line_mean": 28.7142857143,
"line_max": 90,
"alpha_frac": 0.6263083451,
"autogenerated": false,
"ratio": 3.3006535947712417,
"config_test": f... |
"""A library to support the mojo command line client"""
import os
import sys
import yaml
from pymojo.mojo import Mojo
def dict_merge(src, dest):
"""Helper function for merging config dictionaries"""
# For each item in the source
for key, value in src.items():
# If the item is a dictionary, merge ... | {
"repo_name": "GradysGhost/pymojo",
"path": "pymojo/cli.py",
"copies": "1",
"size": "8820",
"license": "apache-2.0",
"hash": 968245283014085900,
"line_mean": 33.8616600791,
"line_max": 76,
"alpha_frac": 0.5583900227,
"autogenerated": false,
"ratio": 4.4590495449949445,
"config_test": true,
"h... |
"""A library with a base class that stores the assigned name of an object.
>>> import name
>>> a = name.AutoName()
>>> a.__assigned_name__
'a'
"""
from __future__ import annotations
import inspect
from types import FrameType
from typing import Generator, Iterator, Dict, Any, Optional
__all__ = ["AutoName"]
# Yi... | {
"repo_name": "AlanCristhian/named",
"path": "name.py",
"copies": "2",
"size": "3116",
"license": "mit",
"hash": -2817110240312406000,
"line_mean": 34.0112359551,
"line_max": 78,
"alpha_frac": 0.5847240051,
"autogenerated": false,
"ratio": 4.274348422496571,
"config_test": false,
"has_no_keyw... |
alien_0 = {'color': 'green', 'points': 5}
print(alien_0)
print(alien_0['color'])
print(alien_0['points'])
new_points = alien_0['points']
print("you just earned " + str(new_points) + " points!")
alien_0['x_position'] = 0
alien_0['y_position'] = 25
print(alien_0)
print("The alien is " + alien_0['color'] + ".")
alien... | {
"repo_name": "timtian090/Playground",
"path": "Python/dictionary.py",
"copies": "1",
"size": "2901",
"license": "mit",
"hash": -1065786397649997600,
"line_mean": 22.593495935,
"line_max": 77,
"alpha_frac": 0.5798000689,
"autogenerated": false,
"ratio": 2.858128078817734,
"config_test": false,
... |
alien_0 = {
"cor": "verde",
"pontos": 10
}
# impressao divergente
print(alien_0)
print(alien_0.items())
print("----")
# imprime o valor da chave especifica
print(alien_0["cor"])
print(alien_0["pontos"])
print("----")
linguagem_favorita = {}
linguagem_favorita.__setitem__("paulo", "python")
lin... | {
"repo_name": "romeubertho/USP-IntroPython",
"path": "06-Dicionarios/dicionario.py",
"copies": "1",
"size": "3496",
"license": "mit",
"hash": 6869659061885434000,
"line_mean": 27.3781512605,
"line_max": 66,
"alpha_frac": 0.5875286041,
"autogenerated": false,
"ratio": 2.9133333333333336,
"config... |
# Aliex Cardona and Josep Casanovas
# Realitat aumentada practica 1
import cv2
import numpy as np
from matplotlib import pyplot as plt
from PyFiles.convolutionKernel import getMatchingMap
IMAGES_PATH = "../Images/"
#imageName = IMAGES_PATH + input("Source image: ")
#targetName = IMAGES_PATH + input("Target to search... | {
"repo_name": "UndistinguishedFellows/RealitatAumentadaPractiques",
"path": "Practica_1/MatchingImages.py",
"copies": "1",
"size": "1447",
"license": "mit",
"hash": -6834179536693130000,
"line_mean": 26.8461538462,
"line_max": 95,
"alpha_frac": 0.6862474084,
"autogenerated": false,
"ratio": 2.876... |
"""A light and fast template engine."""
import re
import sys
PY3 = False
if sys.version_info > (3, 0):
PY3 = True
class Template(object):
COMPILED_TEMPLATES = {} # {template string: code object, }
# Regex for stripping all leading, trailing and interleaving whitespace.
RE_STRIP = re.compile("(^[ \... | {
"repo_name": "dotpy/step",
"path": "step/step.py",
"copies": "1",
"size": "5051",
"license": "bsd-3-clause",
"hash": 1515811274266750700,
"line_mean": 36.4148148148,
"line_max": 92,
"alpha_frac": 0.5181152247,
"autogenerated": false,
"ratio": 3.8498475609756095,
"config_test": false,
"has_no... |
"""A light system for platforms which batches all updates."""
import abc
import asyncio
from typing import Tuple, Set, List
from sortedcontainers import SortedSet, SortedList
from mpf.platforms.interfaces.light_platform_interface import LightPlatformInterface
from mpf.core.utility_functions import Util
class Platfor... | {
"repo_name": "missionpinball/mpf",
"path": "mpf/core/platform_batch_light_system.py",
"copies": "1",
"size": "7875",
"license": "mit",
"hash": -6938963416869747000,
"line_mean": 42.0327868852,
"line_max": 117,
"alpha_frac": 0.5912380952,
"autogenerated": false,
"ratio": 4.125196437925616,
"con... |
"""A lightweight library for common vector and matrix operations."""
# ***** BEGIN LICENSE BLOCK *****
#
# Copyright (c) 2007-2012, Python File Format Interface
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following condit... | {
"repo_name": "griest024/PokyrimTools",
"path": "pyffi-develop/pyffi/utils/mathutils.py",
"copies": "1",
"size": "8964",
"license": "mit",
"hash": -117752123602741570,
"line_mean": 31.3610108303,
"line_max": 79,
"alpha_frac": 0.5893574297,
"autogenerated": false,
"ratio": 3.35604642456009,
"con... |
"""A lightweight mutable container factory.
This is a lightweight struct that can be used when working with very
large numbers of objects. thinrecord instances do not carry around a
dict, and cannot define their own attributes. You can, however, add
methods to the class object and, with caveats, subclass the class to
... | {
"repo_name": "isaacl/thinrecord",
"path": "thinrecord.py",
"copies": "1",
"size": "6444",
"license": "mit",
"hash": 5427799041935288000,
"line_mean": 30.900990099,
"line_max": 80,
"alpha_frac": 0.6315952824,
"autogenerated": false,
"ratio": 3.5899721448467967,
"config_test": false,
"has_no_k... |
"""A lightweight Python wrapper of espeak and mbrola"""
import fnmatch
import io
import logging
import os
import re
import wave
from pathlib import Path
from shlex import quote
from shutil import which
from struct import pack
from subprocess import PIPE, run
from sys import platform
from typing import List, Dict
from t... | {
"repo_name": "hadware/voxpopuli",
"path": "voxpopuli/main.py",
"copies": "1",
"size": "10858",
"license": "mit",
"hash": -3271826230098135000,
"line_mean": 36.8327526132,
"line_max": 94,
"alpha_frac": 0.5614293608,
"autogenerated": false,
"ratio": 3.8178621659634318,
"config_test": false,
"h... |
"""A lightweight Python wrapper of SoX's effects."""
import shlex
from io import BufferedReader, BufferedWriter
from subprocess import PIPE, Popen
import numpy as np
from .sndfiles import (
FileBufferInput,
FileBufferOutput,
FilePathInput,
FilePathOutput,
NumpyArrayInput,
NumpyArrayOutput,
... | {
"repo_name": "carlthome/python-audio-effects",
"path": "pysndfx/dsp.py",
"copies": "1",
"size": "19031",
"license": "mit",
"hash": 992653292582544500,
"line_mean": 33.7281021898,
"line_max": 172,
"alpha_frac": 0.5801586885,
"autogenerated": false,
"ratio": 4.076033411865496,
"config_test": fal... |
"""A lightweight test suite for games.py"""
# You can run this test suite by doing: py.test tests/test_games.py
# Of course you need to have py.test installed to do this.
import pytest
from games import * # noqa
# Creating the game instances
f52 = Fig52Game()
ttt = TicTacToe()
def gen_state(to_move='X', x_positi... | {
"repo_name": "sofmonk/aima-python",
"path": "tests/test_games.py",
"copies": "1",
"size": "2510",
"license": "mit",
"hash": -6377196400236806000,
"line_mean": 33.3835616438,
"line_max": 81,
"alpha_frac": 0.6003984064,
"autogenerated": false,
"ratio": 2.9460093896713615,
"config_test": true,
... |
"""A lightweight wrapper around MySQL Connector/Python."""
# -*- coding: utf-8 -*-
import logging
from collections import namedtuple
import time
import mysql.connector
__version__ = '0.0.1'
class JeekdbError(Exception):
"""jeekdb error"""
pass
ExecuteResult = namedtuple('ExecuteResult', ['last_row_id', 'r... | {
"repo_name": "gaopenghigh/jeekdb",
"path": "jeekdb.py",
"copies": "1",
"size": "7547",
"license": "apache-2.0",
"hash": -8487911619596600000,
"line_mean": 34.5990566038,
"line_max": 99,
"alpha_frac": 0.560620114,
"autogenerated": false,
"ratio": 3.9679284963196637,
"config_test": false,
"has... |
"""A lightweight wrapper around _mysql."""
from MySQLdb import _mysql
import time
import operator
try:
from _thread import get_ident as _get_ident
except ImportError:
from thread import get_ident as _get_ident
from memsql.common.conversions import CONVERSIONS
MySQLError = _mysql.MySQLError
OperationalError ... | {
"repo_name": "memsql/memsql-python",
"path": "memsql/common/database.py",
"copies": "1",
"size": "9853",
"license": "mit",
"hash": 219747671753173600,
"line_mean": 30.8867313916,
"line_max": 125,
"alpha_frac": 0.5937277986,
"autogenerated": false,
"ratio": 4.1892006802721085,
"config_test": fa... |
"""A lightweight wrapper around _mysql."""
import _mysql
import itertools
import time
try:
from collections import OrderedDict
except:
from ordereddict import OrderedDict
from MySQLdb.converters import conversions
MySQLError = _mysql.MySQLError
OperationalError = _mysql.OperationalError
def connect(*args, ... | {
"repo_name": "vidyar/memsql-python",
"path": "memsql/common/database.py",
"copies": "1",
"size": "6579",
"license": "mit",
"hash": 3968340851776399400,
"line_mean": 32.0603015075,
"line_max": 127,
"alpha_frac": 0.5950752394,
"autogenerated": false,
"ratio": 4.2335907335907335,
"config_test": f... |
"""Align an evaluation set and render the output as a text grid."""
import sys
import hmm
class Aligned:
"""A hand-aligned parallel sentence pair."""
def __init__(self, zh, en, align):
"""zh and en are lists of words (strings). align is moses-formatted."""
self.zh = zh
self.en = en
... | {
"repo_name": "papajohn/zh_en_word_alignment_data",
"path": "src/align.py",
"copies": "1",
"size": "3268",
"license": "mit",
"hash": 1221358594009319700,
"line_mean": 35.7191011236,
"line_max": 79,
"alpha_frac": 0.535495716,
"autogenerated": false,
"ratio": 3.4112734864300625,
"config_test": fa... |
import sublime
import sublime_plugin
import re
class AlignAssignmentsCommand(sublime_plugin.TextCommand):
def run(self, edit):
relevant_line_pattern = r"^[^=]+[^-+<>=!%\/|&*^]=(?!=|~)"
column_search_pattern = r"[\t ]*="
for region in self.view.sel():
if not region.empty():
... | {
"repo_name": "openfirmware/dotfiles",
"path": "sublime2/User/align_assignments.py",
"copies": "1",
"size": "3209",
"license": "mit",
"hash": 5168565313200912000,
"line_mean": 41.8,
"line_max": 101,
"alpha_frac": 0.557182923,
"autogenerated": false,
"ratio": 4.233509234828496,
"config_test": fa... |
#Align a tomography tilt series using cross correlation
#
#
#developed as part of the tomviz project (www.tomviz.com)
def transform_scalars(dataset):
#----USER SPECIFIED VARIABLES-----#
TILT_AXIS = [] #Specify Tilt Axis Dimensions x=0, y=1, z=2
#---------------------------------#
from tomvi... | {
"repo_name": "Hovden/tomviz",
"path": "tomviz/python/Align_Images.py",
"copies": "2",
"size": "2581",
"license": "bsd-3-clause",
"hash": -3612023094479816700,
"line_mean": 41.3278688525,
"line_max": 77,
"alpha_frac": 0.5311894614,
"autogenerated": false,
"ratio": 3.230287859824781,
"config_tes... |
"""Aligned Packed Encoding Rules (PER) codec.
"""
from operator import attrgetter
from operator import itemgetter
import binascii
import string
import datetime
from ..parser import EXTENSION_MARKER
from . import BaseType
from . import EncodeError
from . import DecodeError
from . import OutOfDataError
from . import c... | {
"repo_name": "eerimoq/asn1tools",
"path": "asn1tools/codecs/per.py",
"copies": "1",
"size": "74856",
"license": "mit",
"hash": 2101994487705196000,
"line_mean": 31.6169934641,
"line_max": 90,
"alpha_frac": 0.5260099391,
"autogenerated": false,
"ratio": 4.345271956811981,
"config_test": false,
... |
"""Align embeddings using Procrustes method
"""
import numpy as np
def match_coords(C1, C2):
idx = []
idxlist = range(C2.shape[0])
for pt1 in C1:
idxremain = np.setdiff1d(idxlist, idx)
idxmatch = np.argsort(np.sum((C2[idxremain, :] - pt1) * (C2[idxremain, :] - pt1), axis=1))[0]
id... | {
"repo_name": "ThomasYeoLab/CBIG",
"path": "external_packages/python/mapalign-master/mapalign/align.py",
"copies": "1",
"size": "4122",
"license": "mit",
"hash": -6516714628070068000,
"line_mean": 35.1578947368,
"line_max": 107,
"alpha_frac": 0.5761766133,
"autogenerated": false,
"ratio": 3.50510... |
"""Aligner for texts and their segmentations.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
__all__ = ['AlignmentFailed', 'Aligner']
class AlignmentFailed(Exception): pass
class Aligner(object):
"""Align a text with its tokenization.
... | {
"repo_name": "nryant/twokenize_py",
"path": "twokenize_py/align.py",
"copies": "1",
"size": "1237",
"license": "apache-2.0",
"hash": -7878816150672177000,
"line_mean": 25.8913043478,
"line_max": 79,
"alpha_frac": 0.5238480194,
"autogenerated": false,
"ratio": 4.310104529616725,
"config_test": ... |
"""Alignment algorithms."""
from warnings import warn
import numpy as np
from scipy.linalg import svd, det
from . import earth
from . import dcm
from . import util
def align_wahba(dt, theta, dv, lat, VE=None, VN=None):
"""Estimate attitude matrix by solving Wahba's problem.
This method is based on solving a ... | {
"repo_name": "nmayorov/pyins",
"path": "pyins/align.py",
"copies": "1",
"size": "6144",
"license": "mit",
"hash": 2215627464297501400,
"line_mean": 35.5476190476,
"line_max": 79,
"alpha_frac": 0.6175895765,
"autogenerated": false,
"ratio": 3.1246819338422394,
"config_test": false,
"has_no_ke... |
##### alignment_base_split
import sys
import os
args = sys.argv
arg_len = len(args)
if arg_len <2:
print("\n**** alignment_base_split.py | Written by DJP, 07/04/16 in Python 3.5 in Edinburgh / SA train ****\n")
print("This program takes a fasta alignments as input, and outputs 3 fasta alignments:\n fir... | {
"repo_name": "DarrenJParker/fasta_tools",
"path": "alignment_base_split.py",
"copies": "1",
"size": "2581",
"license": "mit",
"hash": -275477630111508860,
"line_mean": 27.3295454545,
"line_max": 244,
"alpha_frac": 0.5854320031,
"autogenerated": false,
"ratio": 2.6498973305954827,
"config_test"... |
##### alignment_concat
import sys
import os
import getopt
try:
opts, args = getopt.getopt(sys.argv[1:], 'i:d:D:o:s:n:g:e:f:h')
except getopt.GetoptError:
print('ERROR getting options, please see help by specifing -h')
sys.exit(2) ### close ofter error from try
arg_len = len... | {
"repo_name": "DarrenJParker/fasta_tools",
"path": "alignment_concat.py",
"copies": "1",
"size": "6144",
"license": "mit",
"hash": -4466723590678872600,
"line_mean": 26.1834862385,
"line_max": 109,
"alpha_frac": 0.5838216146,
"autogenerated": false,
"ratio": 2.758868432869331,
"config_test": fa... |
# Alignment examples.
from ocempgui.widgets import Renderer, VFrame, HFrame, Button, Alignment, Label
from ocempgui.widgets.Constants import *
def create_alignment_view ():
# Crate and display the different alignments.
frm_main = VFrame (Label ("Alignment examples"))
frm_main.topleft = 10, 10
# Top al... | {
"repo_name": "prim/ocempgui",
"path": "doc/examples/alignment.py",
"copies": "1",
"size": "2185",
"license": "bsd-2-clause",
"hash": 562793848207529500,
"line_mean": 30.6666666667,
"line_max": 79,
"alpha_frac": 0.6672768879,
"autogenerated": false,
"ratio": 3.300604229607251,
"config_test": fa... |
"""Alignment pipeline integration tests.
"""
import os
import time
from django.conf import settings
from djcelery_testworker.testcase import CeleryWorkerTestCase
from main.models import AlignmentGroup
from main.models import Dataset
from main.models import ExperimentSample
from main.testing_util import create_common... | {
"repo_name": "woodymit/millstone",
"path": "genome_designer/tests/integration/test_pipeline_integration.py",
"copies": "3",
"size": "3962",
"license": "mit",
"hash": 6941483204825603000,
"line_mean": 37.4660194175,
"line_max": 80,
"alpha_frac": 0.6617869763,
"autogenerated": false,
"ratio": 3.73... |
"""Alignment with bbmap: https://sourceforge.net/projects/bbmap/
"""
import os
from bcbio import utils
from bcbio.pipeline import datadict as dd
from bcbio.ngsalign import alignprep, novoalign, postalign
from bcbio.provenance import do
def align(fastq_file, pair_file, index_dir, names, align_dir, data):
"""Perfor... | {
"repo_name": "a113n/bcbio-nextgen",
"path": "bcbio/ngsalign/bbmap.py",
"copies": "4",
"size": "1916",
"license": "mit",
"hash": -6166478218451737000,
"line_mean": 48.1282051282,
"line_max": 103,
"alpha_frac": 0.6450939457,
"autogenerated": false,
"ratio": 3.1256117455138663,
"config_test": fal... |
"""Alignment with minimap2: https://github.com/lh3/minimap2
"""
import os
from bcbio import utils
from bcbio.pipeline import datadict as dd
from bcbio.ngsalign import alignprep, novoalign, postalign
from bcbio.provenance import do
def align(fastq_file, pair_file, index_dir, names, align_dir, data):
"""Perform pip... | {
"repo_name": "vladsaveliev/bcbio-nextgen",
"path": "bcbio/ngsalign/minimap2.py",
"copies": "4",
"size": "2380",
"license": "mit",
"hash": 1056028327380683300,
"line_mean": 45.6666666667,
"line_max": 106,
"alpha_frac": 0.631512605,
"autogenerated": false,
"ratio": 3.1860776439089693,
"config_te... |
"""Alignment with SNAP: http://snap.cs.berkeley.edu/
"""
import os
from bcbio import utils
from bcbio.pipeline import config_utils
from bcbio.pipeline import datadict as dd
from bcbio.ngsalign import alignprep, novoalign, postalign
from bcbio.provenance import do
def align(fastq_file, pair_file, index_dir, names, ali... | {
"repo_name": "Cyberbio-Lab/bcbio-nextgen",
"path": "bcbio/ngsalign/snap.py",
"copies": "1",
"size": "2929",
"license": "mit",
"hash": 3543153154401651700,
"line_mean": 44.0615384615,
"line_max": 112,
"alpha_frac": 0.6036189826,
"autogenerated": false,
"ratio": 3.250832408435072,
"config_test":... |
"""Align multiple structures with TMalign."""
from __future__ import division
import itertools
import logging
import math
import os
import subprocess
import tempfile
from cStringIO import StringIO
import networkx
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from biofrills import... | {
"repo_name": "etal/fammer",
"path": "fammerlib/tmalign.py",
"copies": "2",
"size": "6484",
"license": "bsd-2-clause",
"hash": -5913380124578665000,
"line_mean": 35.0222222222,
"line_max": 84,
"alpha_frac": 0.5851326342,
"autogenerated": false,
"ratio": 3.794031597425395,
"config_test": false,
... |
# align
def align_up(alignment, x):
"""Rounds x up to nearest multiple of the alignment."""
a = alignment
return ((x + a - 1) // a) * a
def align_down(alignment, x):
"""Rounds x down to nearest multiple of the alignment."""
a = alignment
return (x // a) * a
def align(alignment, x):
"""Roun... | {
"repo_name": "Haabb/pwnfork",
"path": "pwn/util.py",
"copies": "1",
"size": "2371",
"license": "mit",
"hash": -329871686992642750,
"line_mean": 29.3974358974,
"line_max": 78,
"alpha_frac": 0.5326866301,
"autogenerated": false,
"ratio": 3.5125925925925925,
"config_test": false,
"has_no_keywor... |
""" align_reports.py
Usage: align_reports.py <report> [--gabor=<REPORT>]
Options:
--gabor=<REPORT> [default: gabor_report.txt]
"""
from collections import OrderedDict
__author__ = 'victor'
from docopt import docopt
from tabulate import tabulate
if __name__ == '__main__':
args = docopt(__doc__)
r... | {
"repo_name": "vzhong/sent2rel",
"path": "align_reports.py",
"copies": "1",
"size": "1716",
"license": "mit",
"hash": -9164656366779958000,
"line_mean": 39.8571428571,
"line_max": 133,
"alpha_frac": 0.5734265734,
"autogenerated": false,
"ratio": 3.30635838150289,
"config_test": false,
"has_no... |
"""Align the raw sentences from Read et al (2012) to the PTB tokenization,
outputting as a .json file. Used in bin/prepare_treebank.py
"""
from __future__ import unicode_literals
import plac
from pathlib import Path
import json
from os import path
import os
from spacy.munge import read_ptb
from spacy.munge.read_onton... | {
"repo_name": "rebeling/spaCy",
"path": "spacy/munge/align_raw.py",
"copies": "9",
"size": "7279",
"license": "mit",
"hash": -1558720285742534700,
"line_mean": 29.0785123967,
"line_max": 83,
"alpha_frac": 0.5329028713,
"autogenerated": false,
"ratio": 3.208021154693698,
"config_test": false,
... |
"""Align the tissue."""
import skimage.morphology
import skimage.measure
from jicbioimage.core.transform import transformation
from jicbioimage.segment import connected_components
from jicbioimage.transform import (
equalize_adaptive_clahe,
threshold_otsu,
remove_small_objects,
)
from util import argpars... | {
"repo_name": "JIC-CSB/wheat-leaf-segmentation",
"path": "scripts/align.py",
"copies": "1",
"size": "1066",
"license": "mit",
"hash": -4952143167816337000,
"line_mean": 23.7906976744,
"line_max": 67,
"alpha_frac": 0.7166979362,
"autogenerated": false,
"ratio": 3.577181208053691,
"config_test": ... |
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copi... | {
"repo_name": "wuxue/altanalyze",
"path": "alignToKnownAlt.py",
"copies": "1",
"size": "16386",
"license": "apache-2.0",
"hash": -9221897234071024000,
"line_mean": 53.0825082508,
"line_max": 187,
"alpha_frac": 0.6408519468,
"autogenerated": false,
"ratio": 3.466469219378041,
"config_test": fals... |
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
... | {
"repo_name": "nsalomonis/AltAnalyze",
"path": "build_scripts/alignToKnownAlt.py",
"copies": "1",
"size": "16855",
"license": "apache-2.0",
"hash": -7294693521039946000,
"line_mean": 53.4506578947,
"line_max": 187,
"alpha_frac": 0.630495402,
"autogenerated": false,
"ratio": 3.521730045967405,
"... |
# align vertices into one line
# Purpose: Align vertices to straight line based on 2 vertices.
# Usage: select "start vtx", then select vertices need to align, last select "end vtx" then run the following cmd in python cmdline.
# command(python): import af_alignVert;af_alignVert.main()
#Limitation: Must under Maya 2012... | {
"repo_name": "aaronfang/personal_scripts",
"path": "scripts/af_alignVert.py",
"copies": "2",
"size": "1316",
"license": "mit",
"hash": 3585425033533229600,
"line_mean": 41.4516129032,
"line_max": 132,
"alpha_frac": 0.5911854103,
"autogenerated": false,
"ratio": 2.3087719298245615,
"config_test... |
"""A limited wrapper for RT4's database structure
This only covers tickets, queues and custom fields of tickets. No users.
A complete list of models are in raw_models.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_u... | {
"repo_name": "UNINETT/django-rtdb",
"path": "src/rtdb/models.py",
"copies": "1",
"size": "6175",
"license": "mit",
"hash": -846170732343019800,
"line_mean": 36.1987951807,
"line_max": 91,
"alpha_frac": 0.712388664,
"autogenerated": false,
"ratio": 3.9156626506024095,
"config_test": false,
"h... |
"A linear mixed effects model"
from itertools import product
import copy
import numpy as np
from numpy.linalg import LinAlgError
from scipy.sparse import csc_matrix, issparse
from scipy.sparse import eye as sparseeye
from scipy.linalg import inv as scipy_inv
from scipy.linalg import pinv
from pydigree.stats.mixedmo... | {
"repo_name": "jameshicks/pydigree",
"path": "pydigree/stats/mixedmodel/mixedmodel.py",
"copies": "1",
"size": "22342",
"license": "apache-2.0",
"hash": 2361852839133171700,
"line_mean": 31.8076358297,
"line_max": 86,
"alpha_frac": 0.5799391281,
"autogenerated": false,
"ratio": 4.189386836677293,... |
""" A line segment component. """
from __future__ import with_statement
from numpy import array, resize
# Enthought library imports.
from kiva.constants import FILL, FILL_STROKE, STROKE
from traits.api import Any, Event, Float, List, Trait, Bool
# Local imports.
from enable.api import border_size_trait, Component
f... | {
"repo_name": "tommy-u/enable",
"path": "enable/primitives/line.py",
"copies": "1",
"size": "3775",
"license": "bsd-3-clause",
"hash": -6054470470936187000,
"line_mean": 32.7053571429,
"line_max": 82,
"alpha_frac": 0.4874172185,
"autogenerated": false,
"ratio": 4.4780545670225385,
"config_test"... |
"""A link checker using urllib2."""
import ssl
import socket
import urllib.request
import urllib.error
import urllib.parse
import http.client
import regex
import logging
LINK_CHECK_TIMEOUT = 5
def check_url(url, method="HEAD"):
"""Check a URL using the specified method (GET, or HEAD).
Return None if the UR... | {
"repo_name": "os2webscanner/os2webscanner",
"path": "scrapy-webscanner/linkchecker.py",
"copies": "1",
"size": "1747",
"license": "mpl-2.0",
"hash": 1332120235112983300,
"line_mean": 29.649122807,
"line_max": 73,
"alpha_frac": 0.5907269605,
"autogenerated": false,
"ratio": 4.15952380952381,
"c... |
# a linked list(here the singly linked list) must have a head reference(pointer), otherwise it would
# be impossible to locate the head or any other node.
from time import time
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def __repr__(self):
return str(self.val)... | {
"repo_name": "spencerpomme/coconuts-on-fire",
"path": "DSA/linked_list_node.py",
"copies": "1",
"size": "2633",
"license": "apache-2.0",
"hash": -1096255098069033000,
"line_mean": 22.5089285714,
"line_max": 100,
"alpha_frac": 0.5685529814,
"autogenerated": false,
"ratio": 3.5485175202156336,
"... |
# A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
# Return a deep copy of the list.
# Definition for singly-linked list with a random pointer.
class RandomListNode(object):
def __init__(self, x):
self.label = x
sel... | {
"repo_name": "seanxwzhang/LeetCode",
"path": "138 Copy List with Random Pointer/solution.py",
"copies": "1",
"size": "1505",
"license": "mit",
"hash": -1187486207535339500,
"line_mean": 29.12,
"line_max": 133,
"alpha_frac": 0.5754152824,
"autogenerated": false,
"ratio": 4.0675675675675675,
"co... |
# A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
# Return a deep copy of the list.
# Definition for singly-linked list with a random pointer.
class RandomListNode:
def __init__(self, x):
self.label = x
self.next ... | {
"repo_name": "abawchen/leetcode",
"path": "solutions/138_copy_list_with_random_pointer.py",
"copies": "1",
"size": "1314",
"license": "mit",
"hash": 7256814660487912000,
"line_mean": 28.2222222222,
"line_max": 133,
"alpha_frac": 0.5814307458,
"autogenerated": false,
"ratio": 4.080745341614906,
... |
# A linked list, relies on a more distributed representation in which a
# lightweight object, known as a node, is allocated for each element. each
# node maintains a reference to its element and one or more references to
# neighboring nodes in order to collectively represent the linear order of the
# sequence.
# Linke... | {
"repo_name": "XYM1988/Algorithm",
"path": "Chp7/7.1-Singly-Listed-List.py",
"copies": "1",
"size": "3119",
"license": "mit",
"hash": 3130156461613973000,
"line_mean": 27.6146788991,
"line_max": 80,
"alpha_frac": 0.5694132735,
"autogenerated": false,
"ratio": 4.374474053295932,
"config_test": f... |
"""A linter for docstrings following the google docstring format."""
import ast
from collections import deque
import sys
from enum import Enum
from typing import (
Callable,
Iterator,
List,
Set,
Tuple,
Optional,
Union,
Type,
Any,
)
from .analysis.analysis_visitor import (
Analys... | {
"repo_name": "terrencepreilly/darglint",
"path": "darglint/function_description.py",
"copies": "1",
"size": "6095",
"license": "mit",
"hash": 7630981752976406000,
"line_mean": 28.7317073171,
"line_max": 120,
"alpha_frac": 0.6364232978,
"autogenerated": false,
"ratio": 3.99672131147541,
"config... |
"""A linting utility for targets.json
This linting utility may be called as follows:
python <path-to>/lint.py targets TARGET [TARGET ...]
all targets will be linted
"""
# mbed SDK
# Copyright (c) 2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except i... | {
"repo_name": "adfernandes/mbed",
"path": "tools/targets/lint.py",
"copies": "14",
"size": "10159",
"license": "apache-2.0",
"hash": 2535787793179750000,
"line_mean": 35.6750902527,
"line_max": 87,
"alpha_frac": 0.5983856679,
"autogenerated": false,
"ratio": 3.5471368715083798,
"config_test": f... |
# A Linux-only demo
#
# For comparison purposes, this is a ctypes version of readdir.py.
import sys
import ctypes
if not sys.platform.startswith('linux'):
raise Exception("Linux-only demo")
DIR_p = ctypes.c_void_p
ino_t = ctypes.c_long
off_t = ctypes.c_long
class DIRENT(ctypes.Structure):
_fields_ = [
... | {
"repo_name": "Peddle/hue",
"path": "desktop/core/ext-py/cffi-1.5.2/demo/readdir_ctypes.py",
"copies": "13",
"size": "1789",
"license": "apache-2.0",
"hash": 8812708136425164000,
"line_mean": 24.9275362319,
"line_max": 71,
"alpha_frac": 0.5818893236,
"autogenerated": false,
"ratio": 3.10051993067... |
# A Linux-only demo
#
# For comparison purposes, this is a ctypes version of readdir.py.
import sys
import ctypes
if not sys.platform.startswith('linux'):
raise Exception("Linux-only demo")
DIR_p = ctypes.c_void_p
ino_t = ctypes.c_long
off_t = ctypes.c_long
class DIRENT(ctypes.Structure):
_fi... | {
"repo_name": "hipnusleo/laserjet",
"path": "resource/pypi/cffi-1.9.1/demo/readdir_ctypes.py",
"copies": "1",
"size": "1858",
"license": "apache-2.0",
"hash": -2683616232218035000,
"line_mean": 24.9275362319,
"line_max": 71,
"alpha_frac": 0.5602798708,
"autogenerated": false,
"ratio": 3.127946127... |
"""aliquot parent ref fix
Revision ID: e8b090aa164e
Revises: b06bb829f85d
Create Date: 2020-05-07 12:36:05.140486
"""
from alembic import op
import sqlalchemy as sa
import model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, Orde... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/e8b090aa164e_aliquot_parent_ref_fix.py",
"copies": "1",
"size": "2173",
"license": "bsd-3-clause",
"hash": 6847696966140727000,
"line_mean": 32.953125,
"line_max": 125,
"alpha_frac": 0.7330878969,
"autogenerated": ... |
"""aliquot_specimen_rlims_fk
Revision ID: 69355dfe4d91
Revises: 9a0873b51fe0
Create Date: 2020-05-06 13:43:38.477762
"""
from alembic import op
import sqlalchemy as sa
import model.utils
from sqlalchemy.dialects import mysql
from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, O... | {
"repo_name": "all-of-us/raw-data-repository",
"path": "rdr_service/alembic/versions/69355dfe4d91_aliquot_specimen_rlims_fk.py",
"copies": "1",
"size": "2186",
"license": "bsd-3-clause",
"hash": 5535463848198537000,
"line_mean": 34.2580645161,
"line_max": 127,
"alpha_frac": 0.7451967063,
"autogener... |
"""ALI-related bricks."""
from theano import tensor
from blocks.bricks.base import Brick, application, lazy
from blocks.bricks.conv import ConvolutionalSequence
from blocks.bricks.interfaces import Initializable, Random
from blocks.select import Selector
class ALI(Initializable, Random):
"""Adversarial learned in... | {
"repo_name": "IshmaelBelghazi/ALI",
"path": "ali/bricks.py",
"copies": "1",
"size": "13838",
"license": "mit",
"hash": -756317318554520300,
"line_mean": 35.4157894737,
"line_max": 79,
"alpha_frac": 0.6105651106,
"autogenerated": false,
"ratio": 3.9616375608359577,
"config_test": false,
"has_... |
""" ALI related graphs """
from functools import partial
import numpy as np
import matplotlib.pyplot as plt
import scipy
from ali.datasets import GaussianMixtureDistribution
from ali.utils import as_array
def make_2D_latent_view(valid_data,
samples_data,
gradients_funs... | {
"repo_name": "IshmaelBelghazi/ALI",
"path": "ali/graphing.py",
"copies": "1",
"size": "5528",
"license": "mit",
"hash": -6615574103447395000,
"line_mean": 36.3513513514,
"line_max": 84,
"alpha_frac": 0.5047033285,
"autogenerated": false,
"ratio": 4.236015325670498,
"config_test": false,
"has... |
"""ALI-related training algorithms."""
from collections import OrderedDict
import theano
from blocks.algorithms import GradientDescent, CompositeRule, Restrict
def ali_algorithm(discriminator_loss, discriminator_parameters,
discriminator_step_rule, generator_loss,
generator_parame... | {
"repo_name": "IshmaelBelghazi/ALI",
"path": "ali/algorithms.py",
"copies": "1",
"size": "1632",
"license": "mit",
"hash": -468573184335289700,
"line_mean": 36.9534883721,
"line_max": 71,
"alpha_frac": 0.6537990196,
"autogenerated": false,
"ratio": 4.945454545454545,
"config_test": false,
"ha... |
#Alireza.karimi.67@gmail.com
import json
import sqlite3
class DatabaseHandler():
need_upgrade = False
conn = None
def __init__(self):
self.conn = sqlite3.connect('DataBase.db')
if self.need_upgrade:
self.upgrade_tables()
else:
self.create_tables()
def ... | {
"repo_name": "alireza-87/RansomeAnalyzLDA",
"path": "DataBaseHandler/Handler.py",
"copies": "1",
"size": "2334",
"license": "mit",
"hash": 4194801864288765400,
"line_mean": 32.8260869565,
"line_max": 121,
"alpha_frac": 0.5676949443,
"autogenerated": false,
"ratio": 4.370786516853933,
"config_t... |
# Alireza.Karimi.67@gmail.com
from __future__ import division
import urllib
import urllib2
from os import walk
import os
import time
from PIL import Image
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from DataBaseHandler import DatabaseHandler
from androdd import dump_all_method
impor... | {
"repo_name": "alireza-87/RansomeAnalyzLDA",
"path": "Main.py",
"copies": "1",
"size": "35006",
"license": "mit",
"hash": -5922272111662597000,
"line_mean": 38.2830840046,
"line_max": 323,
"alpha_frac": 0.479146432,
"autogenerated": false,
"ratio": 3.7165304172417453,
"config_test": true,
"ha... |
#@AlirezaKarimi
#alireza.karimi.67@gmail.com
from kivy.uix.popup import Popup
from kivy.uix.screenmanager import ScreenManager, Screen
from game_engine import Engine
from kivy.app import App
from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty
from kivy.uix.widget import Widget
from kivy.... | {
"repo_name": "alireza-87/KivyPongGame",
"path": "game/main.py",
"copies": "1",
"size": "3936",
"license": "mit",
"hash": -6753706001877033000,
"line_mean": 26.914893617,
"line_max": 119,
"alpha_frac": 0.5945121951,
"autogenerated": false,
"ratio": 3.561990950226244,
"config_test": false,
"ha... |
alist = [54,26,93,17,77,31,44,55,21]
def bubbleSort(blist):
for i in range(len(alist)-1, 0, -1):
for j in range(i):
if alist[j] > alist[j + 1]:
alist[j], alist[j+1] = alist[j+1], alist[j]
bubbleSort(alist)
print alist
def selectionSort(alist):
for i in range(len(alist)-1,0,-1)... | {
"repo_name": "behappycc/USB-Driver",
"path": "test/11/Sort.py",
"copies": "1",
"size": "2189",
"license": "mit",
"hash": -8175243303112940000,
"line_mean": 26.375,
"line_max": 138,
"alpha_frac": 0.5883965281,
"autogenerated": false,
"ratio": 3.20497803806735,
"config_test": false,
"has_no_ke... |
#a list is a container for your infomation
#names of thing, text
#each is a variable
attendees = ['Shannon', 'Jenn', 'Grace']
#empty list
coolpeople = []
print attendees[0] # Shannon
print attendees[1] # Jenn
print attendees[2] # Grace
print attendees[0:2] # Shannon, Jenn
#why does it tells it's a list for [0:2],... | {
"repo_name": "JessicaGarson/Hear-Me-Code-TA-notes",
"path": "TAnoteslesson2.py",
"copies": "1",
"size": "3562",
"license": "unlicense",
"hash": 5161256686306035000,
"line_mean": 21.9677419355,
"line_max": 121,
"alpha_frac": 0.7174157303,
"autogenerated": false,
"ratio": 2.9300411522633745,
"co... |
# A list isn't the most efficient way to store a potentially sparse set of memory segments, but then
# again this isn't exactly designed for huge programs.
from debugwire import DWException
MAX_ADDRESS = 0xffff
class memlist(list):
def write(self, offset, values):
if offset + len(values) > MAX_ADDRESS:
... | {
"repo_name": "mvirkkunen/dwprog",
"path": "binparser.py",
"copies": "1",
"size": "1984",
"license": "mit",
"hash": -4126635697877080000,
"line_mean": 25.4533333333,
"line_max": 100,
"alpha_frac": 0.5564516129,
"autogenerated": false,
"ratio": 3.4444444444444446,
"config_test": false,
"has_no... |
# A list is symmetric if the first row is the same as the first column,
# the second row is the same as the second column and so on. Write a
# procedure, symmetric, which takes a list as input, and returns the
# boolean True if the list is symmetric and False if it is not.
def symmetric(lista):
if lista == []:
... | {
"repo_name": "xala3pa/Computer-Science-cs101",
"path": "Lesson3/symmetric_square.py",
"copies": "1",
"size": "1246",
"license": "mit",
"hash": -4865042815470545000,
"line_mean": 24.4285714286,
"line_max": 71,
"alpha_frac": 0.4414125201,
"autogenerated": false,
"ratio": 3.56,
"config_test": fal... |
# A list is used to manage the list of Particles.
from particle import Particle
from crazy_particle import CrazyParticle
class ParticleSystem(object):
def __init__(self, num, v):
self.particles = [] # Initialize the list.
self.origin = v.get() # Store the origin point.
for i in range(n... | {
"repo_name": "jdf/processing.py",
"path": "mode/examples/Topics/Simulate/MultipleParticleSystems/particle_system.py",
"copies": "6",
"size": "1129",
"license": "apache-2.0",
"hash": -8542031432512239000,
"line_mean": 29.5135135135,
"line_max": 73,
"alpha_frac": 0.5943312666,
"autogenerated": false... |
#A list of all available Tequilas, to show the user when they type "help"
#all lowercase values of these exact phrases are stored in the weights dictionary
#The script should take upper and lower case values of these exact strings
tequila_list = ["Jose Cuervo", "JLP", "Herradura", "El Jimador", "Arette", "Casa Noble... | {
"repo_name": "Evander7/Tequila-stocktake",
"path": "Tequila 3.py",
"copies": "1",
"size": "7091",
"license": "apache-2.0",
"hash": 6466793610920742000,
"line_mean": 38.52,
"line_max": 156,
"alpha_frac": 0.5058524891,
"autogenerated": false,
"ratio": 4.01528878822197,
"config_test": false,
"h... |
# A list of applications to be added to INSTALLED_APPS.
ADD_INSTALLED_APPS = ['nec_portal']
# 'key', 'label', 'path'
AVAILABLE_THEMES = [
('nec_portal', 'NEC_Portal', 'themes/nec_portal'),
]
# The default theme if no cookie is present
DEFAULT_THEME = 'nec_portal'
# Site Branding
SITE_BRANDING = 'NEC Cloud System... | {
"repo_name": "NECCSiPortal/NECCSPortal-dashboard",
"path": "openstack_dashboard/local/local_settings.d/_30_nec_portal.py",
"copies": "1",
"size": "6473",
"license": "apache-2.0",
"hash": -3030332370167824400,
"line_mean": 34.1793478261,
"line_max": 81,
"alpha_frac": 0.7067820176,
"autogenerated": ... |
#A list of common functions used by various parts of the app
from consts import switches
import consts.paths as paths
import datetime
def handle_err_msg(err_msg):
globals = Globals()
globals.handle_err_msg(err_msg)
def add_commas_to_num_str(num_str):
num_str = float(num_str)
num_str = ("{:,.2f}".fo... | {
"repo_name": "pbryzek/Freedom",
"path": "common/globals.py",
"copies": "1",
"size": "1619",
"license": "mit",
"hash": -3305529827679223300,
"line_mean": 30.1346153846,
"line_max": 122,
"alpha_frac": 0.5843113033,
"autogenerated": false,
"ratio": 3.2186878727634194,
"config_test": false,
"has... |
# A list of lists storing the Scrabble
# scores of all of the 26 letters
values = [ ["a", 1], ["b", 3], ["c", 3], ["d", 2], ["e", 1], \
["f", 4], ["g", 2], ["h", 4], ["i", 1], ["j", 8], ["k", 5], \
["l", 1], ["m", 3], ["n", 1], ["o", 1], ["p", 3], ["q", 10], \
["r", 1], ["s", 1], ["t", 1], ["u", 1], ["v", 4], ["w", 4]... | {
"repo_name": "chpoon92/python-bridging-lab-exercise-python",
"path": "exercise_1_scrabble_word/ scrabble.py",
"copies": "1",
"size": "1190",
"license": "mit",
"hash": -4768340863694267000,
"line_mean": 26.6744186047,
"line_max": 62,
"alpha_frac": 0.5268907563,
"autogenerated": false,
"ratio": 3.... |
# A list of our CSS and JS assets for jingo-minify.
CSS = {
'mkt/admin': (
'css/zamboni/zamboni.css',
'css/zamboni/mkt-admin.css',
'css/zamboni/admin-django.css',
),
'mkt/devreg': (
# Contains reset, clearfix, etc.
'css/devreg/base.css',
# Base styles (body,... | {
"repo_name": "ngokevin/zamboni",
"path": "mkt/asset_bundles.py",
"copies": "1",
"size": "9529",
"license": "bsd-3-clause",
"hash": 8707214549230948000,
"line_mean": 30.1405228758,
"line_max": 83,
"alpha_frac": 0.5801238325,
"autogenerated": false,
"ratio": 3.0193282636248417,
"config_test": fa... |
# A list of our CSS and JS assets for jingo-minify.
CSS = {
'mkt/devreg': (
# Contains reset, clearfix, etc.
'css/devreg/base.css',
# Base styles (body, breadcrumbs, islands, columns).
'css/devreg/base.styl',
'css/devreg/breadcrumbs.styl',
# Typographical styles (f... | {
"repo_name": "jinankjain/zamboni",
"path": "mkt/asset_bundles.py",
"copies": "1",
"size": "8046",
"license": "bsd-3-clause",
"hash": -6298928333306292000,
"line_mean": 28.8,
"line_max": 79,
"alpha_frac": 0.5662440964,
"autogenerated": false,
"ratio": 3.0362264150943394,
"config_test": false,
... |
# A list of the 05AB1E encoding page in unicode values (256 in total)
osabie_code_page = "\u01DD\u0292\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7" \
"\u03B8\u000A\u0432\u0438\u043C\u043D\u0442\u0393\u0394" \
"\u0398\u03B9\u03A3\u03A9\u2260\u220A\u220D\u221E\u2081" \
... | {
"repo_name": "Emigna/05AB1E",
"path": "lib/encoding.py",
"copies": "1",
"size": "3350",
"license": "mit",
"hash": -5540987796150666000,
"line_mean": 50.5384615385,
"line_max": 79,
"alpha_frac": 0.6211940299,
"autogenerated": false,
"ratio": 2.3843416370106763,
"config_test": false,
"has_no_k... |
# a list of the numbers that Skulpt has trouble rounding correctly; all others should be true
bugs = [-0.5,-0.025,-0.055,0.045,-0.0025,-0.0035,0.0045,0.0055,-250,-350,-450,-550]
def helper(iterable,expect,n=None):
if n:
for i in iterable:
r = round(i,n)
if abs(r-expect) > (1/10.0**(... | {
"repo_name": "ArcherSys/ArcherSys",
"path": "skulpt/test/run/t422.py",
"copies": "1",
"size": "2281",
"license": "mit",
"hash": 2691433720624841700,
"line_mean": 37.0166666667,
"line_max": 93,
"alpha_frac": 0.6063130206,
"autogenerated": false,
"ratio": 2.3275510204081633,
"config_test": false... |
# A list of utility functions.
# Read a single data path (if app info configures this way).
def read_data_path(app_info_path):
file = open(app_info_path, 'r')
for line in file:
clean_line = line.strip()
if not(clean_line.startswith('#')):
return clean_line
return None
# For a given app_info_path, get out th... | {
"repo_name": "chrisgarcia001/Little-Projects",
"path": "courthouse/lib/util.py",
"copies": "1",
"size": "1296",
"license": "epl-1.0",
"hash": 3879801570372613000,
"line_mean": 32.2564102564,
"line_max": 91,
"alpha_frac": 0.6435185185,
"autogenerated": false,
"ratio": 2.88,
"config_test": false... |
''' a little bit more in the comment...
'''
import dynamics.simulation
from dynamics.frame import Frame
from dynamics.spring import NailSpring
from dynamics.object import Rectangle, Circle, Beam
from dynamics.constraint import Nail, Rod, Pin, Shelf
from dynamics.animation import Animation
from dynamics.constants impo... | {
"repo_name": "treygreer/treb",
"path": "treb_sim/src/first_in_fright_2013.py",
"copies": "1",
"size": "25655",
"license": "mit",
"hash": 7394276054165479000,
"line_mean": 45.4764492754,
"line_max": 120,
"alpha_frac": 0.5277333853,
"autogenerated": false,
"ratio": 3.4436241610738256,
"config_te... |
# A little bit of molecular biology
# Codons are non-overlapping triplets of nucleotides.
# ATG CCC CTG GTA ... - this corresponds to four codons; spaces added for emphasis
# The start codon is 'ATG'
# Stop codons can be 'TGA' , 'TAA', or 'TAG', but they must be 'in frame' with the start codon. The first stop codon ... | {
"repo_name": "WomensCodingCircle/CodingCirclePython",
"path": "Lesson05_Strings/DNAExtravaganzaSOLUTION.py",
"copies": "1",
"size": "3769",
"license": "mit",
"hash": 5725075422715767000,
"line_mean": 39.0957446809,
"line_max": 654,
"alpha_frac": 0.7073494296,
"autogenerated": false,
"ratio": 2.9... |
#A little encapsulated databse for storing elevation profiles of OSM ways
import os
import sqlite3
try:
import json
except ImportError:
import simplejson as json
import binascii
from struct import pack, unpack
def pack_coords(coords):
return binascii.b2a_base64( "".join([pack( "ff", *coord ) for coord... | {
"repo_name": "jeriksson/graphserver",
"path": "pygs/graphserver/ext/osm/profiledb.py",
"copies": "3",
"size": "2230",
"license": "bsd-3-clause",
"hash": -1838021591556148000,
"line_mean": 25.2352941176,
"line_max": 87,
"alpha_frac": 0.5156950673,
"autogenerated": false,
"ratio": 4.03254972875226... |
""" A little example script showing a Capture-Game tournament between
- a random player
- a kill-on-sight player
- a small-network-player with random weights
"""
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.agents.capturegameplayers import ... | {
"repo_name": "daanwierstra/pybrain",
"path": "examples/capturegame/minitournament.py",
"copies": "1",
"size": "1468",
"license": "bsd-3-clause",
"hash": -4417278950011121000,
"line_mean": 29.5833333333,
"line_max": 105,
"alpha_frac": 0.780653951,
"autogenerated": false,
"ratio": 3.47044917257683... |
# A little helper module for plotting of broadbean objects
from typing import Tuple, Union, Dict, List
import numpy as np
import matplotlib.pyplot as plt
from broadbean import Sequence, BluePrint, Element
from broadbean.sequence import SequenceConsistencyError
# The object we can/want to plot
BBObject = Union[Seque... | {
"repo_name": "WilliamHPNielsen/broadbean",
"path": "broadbean/plotting.py",
"copies": "1",
"size": "11374",
"license": "mit",
"hash": 7779729029073954000,
"line_mean": 33.6768292683,
"line_max": 79,
"alpha_frac": 0.5025496747,
"autogenerated": false,
"ratio": 3.665485014502095,
"config_test": ... |
from numpy import *
def symmetricPositiveDefinite(n, maxValue= 1):
''' Generates a n x n random symmetric, positive-definite matrix.
The optionnal maxValue argument can be used to specify a maximum
absolute value for extradiagonal coefficients.
Diagonal coefficient will be inferior to 22 times maxValu... | {
"repo_name": "ethiery/heat-solver",
"path": "trunk/matgen.py",
"copies": "1",
"size": "2672",
"license": "mit",
"hash": -6380085539740939000,
"line_mean": 34.6266666667,
"line_max": 71,
"alpha_frac": 0.6781437126,
"autogenerated": false,
"ratio": 3.866859623733719,
"config_test": false,
"has... |
# A little script that calculates the area of each grid cells
# Area output is in sqkm!!!
# Will only work for WGS84 lat/lon grids!
import arcgisscripting, sys, os, math
# {{{ STARTUP STUFF...
# First we need to check that the arguments are ok...
gp = arcgisscripting.create(9.3)
try:
if len(sys.argv) == 0: raise
in... | {
"repo_name": "fraxen/nordpil_arcpy",
"path": "python/calculategridarea.py",
"copies": "1",
"size": "2949",
"license": "apache-2.0",
"hash": -5420444789425520000,
"line_mean": 36.8076923077,
"line_max": 192,
"alpha_frac": 0.6941336046,
"autogenerated": false,
"ratio": 2.6260017809439002,
"confi... |
# A little script that griddifies a bunch of shape files and then takes the median extent
# for the arctic sea ice
# * rasterize shapefiles
# * get median
# * convert back to polygons
# * reproject
import arcgisscripting
gp = arcgisscripting.create(9.3)
gp.Workspace = "u:/ws/ice"
gp.toolbox = "SA"
gp.CheckOutExtension... | {
"repo_name": "fraxen/nordpil_arcpy",
"path": "python/medianice.py",
"copies": "1",
"size": "1491",
"license": "apache-2.0",
"hash": -7900366698218198000,
"line_mean": 39.2972972973,
"line_max": 135,
"alpha_frac": 0.6753856472,
"autogenerated": false,
"ratio": 2.7713754646840147,
"config_test":... |
# A little script that splits the Arctic into four tiles, and then does some basic raster processing
# * Subsets the arctic in geog projection to four tiles
# * Then reprojects those separately
# * ...and then mosaics them
import arcgisscripting
gp = arcgisscripting.create(9.3)
gp.Workspace = "u:/ws/grump"
gp.toolbox ... | {
"repo_name": "fraxen/nordpil_arcpy",
"path": "python/projectpopden.py",
"copies": "1",
"size": "1286",
"license": "apache-2.0",
"hash": -3588808961283824000,
"line_mean": 37.9696969697,
"line_max": 193,
"alpha_frac": 0.7029548989,
"autogenerated": false,
"ratio": 2.7245762711864407,
"config_te... |
# a little script that takes a TCAT tweet file as input, runs them through NLTK/VADER sentiment analysis
# and writes a new files that adds four columns on the right
# The VADER library is documented here:
# Hutto, C.J. & Gilbert, E.E. (2014). VADER: A Parsimonious Rule-based Model for Sentiment Analysis of Social Med... | {
"repo_name": "bernorieder/textprocessing",
"path": "test_bayes.py",
"copies": "1",
"size": "2094",
"license": "unlicense",
"hash": -5939355017558395000,
"line_mean": 36.4107142857,
"line_max": 121,
"alpha_frac": 0.753104107,
"autogenerated": false,
"ratio": 3.1872146118721463,
"config_test": f... |
# A little solver for band-diagonal matrices. Based on NR Ch 2.4.
from math import *
from Numeric import *
do_pivot = True
def bandec(a, m1, m2):
n, m = a.shape
mm = m1 + m2 + 1
if m != mm:
raise ValueError('Array has width %d expected %d' % (m, mm))
al = zeros((n, m1), Float)
indx = zer... | {
"repo_name": "bowlofstew/roboto",
"path": "third_party/spiro/curves/band.py",
"copies": "15",
"size": "2061",
"license": "apache-2.0",
"hash": -8047997545675352000,
"line_mean": 23.2470588235,
"line_max": 68,
"alpha_frac": 0.378942261,
"autogenerated": false,
"ratio": 2.6491002570694087,
"conf... |
# A little something I wrote to compile a bunch of pages from a book I found online.
import os
import urllib
from clint.textui import colored
from pyquery import PyQuery as pq
base_url = "http://digital.library.pitt.edu"
save_loc = os.path.expanduser("~/Documents/pdf_dump/")
if not os.path.isdir(save_loc):
os.m... | {
"repo_name": "QuantumPhi/school",
"path": "scripts/pdfcompile.py",
"copies": "1",
"size": "2270",
"license": "mit",
"hash": 7904725609160001000,
"line_mean": 46.2916666667,
"line_max": 248,
"alpha_frac": 0.6524229075,
"autogenerated": false,
"ratio": 2.547699214365881,
"config_test": false,
... |
# A little test of how many bytes/sec python can push
import sys
# Testing on polypore.
# ~50-60 MiB/s:
# for line in sys.stdin:
# print line
# ~ 100 MiB/s on polypore,
# ~ 120 MiB/s on ged
# BUFSIZE = 2 ** 20
# leftover = ""
# while True:
# buf = sys.stdin.read(BUFSIZE)
# if not buf:
# break
# ... | {
"repo_name": "njsmith/zs",
"path": "microbenchmarks/split-lines.py",
"copies": "1",
"size": "2678",
"license": "bsd-2-clause",
"hash": -6238224613998915000,
"line_mean": 23.1261261261,
"line_max": 53,
"alpha_frac": 0.5257654966,
"autogenerated": false,
"ratio": 2.7665289256198347,
"config_test... |
# A little test server, complete with typelib, we can use for testing.
# Originally submitted with bug:
# [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute
# but modified by mhammond for use as part of the test suite.
import sys, os
import pythoncom
import win32com
import winerror
from win32com.ser... | {
"repo_name": "Microsoft/PTVS",
"path": "Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32com/test/pippo_server.py",
"copies": "5",
"size": "2530",
"license": "apache-2.0",
"hash": -5536596123723634000,
"line_mean": 30.625,
"line_max": 72,
"alpha_frac": 0.5928853755,
"autogenerated": ... |
# A little test server, complete with typelib, we can use for testing.
# Originally submitted with bug:
# [ 753154 ] memory leak wrapping object having _typelib_guid_ attribute
# but modified by mhammond for use as part of the test suite.
import sys, os
import pythoncom
import win32com
import winerror
from win3... | {
"repo_name": "zhanqxun/cv_fish",
"path": "win32com/test/pippo_server.py",
"copies": "2",
"size": "2605",
"license": "apache-2.0",
"hash": -5916710852646424000,
"line_mean": 30.5625,
"line_max": 72,
"alpha_frac": 0.5750479846,
"autogenerated": false,
"ratio": 3.3919270833333335,
"config_test": ... |
"""A little Transport layer to maintain the JSESSIONID cookie that
Javaserver pages use to maintain a session. I'd like to use this
to make xmlrpclib session aware.
Sample usage:
server = Server("http://foobar.com/baz/servlet/xmlrpc.class")
print server.get_jsession_id();
print server.test.sayHello()
... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/161816_Enable_xmlrpclib_maintaJSP/recipe-161816.py",
"copies": "1",
"size": "2691",
"license": "mit",
"hash": -6565418088224652000,
"line_mean": 27.3263157895,
"line_max": 75,
"alpha_frac": 0.6224451877,
"autogenerated": false,
"ratio": 3.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.