text stringlengths 0 1.05M | meta dict |
|---|---|
# A basic Substitution-Permutation Network cipher, implemented by following
# 'A Tutorial on Linear and Differential Cryptanalysis'
# by Howard M. Heys
#
# 02/12/16 Chris Hicks
#
# Basic SPN cipher which takes as input a 16-bit input block and has 4 rounds.
# Each round consists of (1) substitution (2) transposition ... | {
"repo_name": "hicksc/Basic-SPN-cryptanalysis",
"path": "basic_SPN.py",
"copies": "1",
"size": "5172",
"license": "mit",
"hash": 6868405655758013000,
"line_mean": 35.4225352113,
"line_max": 146,
"alpha_frac": 0.5984145398,
"autogenerated": false,
"ratio": 2.9588100686498855,
"config_test": fals... |
# This code is licensed under the MIT License.
#
# MIT License
#
# Copyright (c) 2016 Luca Vallerini
#
# 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 ... | {
"repo_name": "lucavallerini/miscellanea",
"path": "hangman/hangman.py",
"copies": "1",
"size": "4125",
"license": "mit",
"hash": 4226081170446738400,
"line_mean": 28.6762589928,
"line_max": 100,
"alpha_frac": 0.5844848485,
"autogenerated": false,
"ratio": 3.840782122905028,
"config_test": fals... |
# This code is licensed under the MIT License.
#
# MIT License
#
# Copyright (c) 2016 Luca Vallerini
#
# 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 witho... | {
"repo_name": "lucavallerini/miscellanea",
"path": "tictactoe/tictactoe.py",
"copies": "1",
"size": "5377",
"license": "mit",
"hash": -974962534994894000,
"line_mean": 29.7257142857,
"line_max": 124,
"alpha_frac": 0.5458434071,
"autogenerated": false,
"ratio": 3.765406162464986,
"config_test": ... |
"""A basic trie."""
import argparse
import sys
class Trie(object):
def __init__(self):
self.root = {}
def add(self, seq):
node = self.root
for i, x in enumerate(seq):
if x not in node:
node[x] = (False, {})
if i == len(seq) - 1:
node[x] = (True, node[x][1])
else:
... | {
"repo_name": "robinjia/nectar",
"path": "nectar/base/trie.py",
"copies": "1",
"size": "3087",
"license": "mit",
"hash": 6380779751943238000,
"line_mean": 25.3846153846,
"line_max": 66,
"alpha_frac": 0.5558794947,
"autogenerated": false,
"ratio": 3.121334681496461,
"config_test": false,
"has_... |
"""A basic vocabulary class."""
import collections
UNK_TOKEN = '<UNK>'
UNK_INDEX = 0
class Vocabulary(object):
def __init__(self, unk_threshold=0):
"""Initialize the vocabulary.
Args:
unk_threshold: words with <= this many counts will be considered <UNK>.
"""
self.unk_threshold = unk_threshol... | {
"repo_name": "robinjia/nectar",
"path": "nectar/base/vocabulary.py",
"copies": "1",
"size": "1946",
"license": "mit",
"hash": -3435220087128174000,
"line_mean": 25.6575342466,
"line_max": 78,
"alpha_frac": 0.6536485098,
"autogenerated": false,
"ratio": 3.3379073756432245,
"config_test": false,... |
#A basic way of caching files associated with URLs
from datetime import datetime
import os
import urllib2
import tempfile
import json
import socket
import utilities
import shutil
class URLCache(object):
TIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
def __init__(self, folder):
self._folder = os.path.join(folder... | {
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"path": ".kodi/addons/weather.metoffice/src/metoffice/urlcache.py",
"copies": "1",
"size": "2858",
"license": "apache-2.0",
"hash": -1258609642816426000,
"line_mean": 31.1235955056,
"line_max": 130,
"alpha_frac": 0.5542337299,
"autogenerated... |
# A basic web server using sockets
import socket
PORT = 8090
MAX_OPEN_REQUESTS = 5
def process_client(clientsocket):
print(clientsocket)
data = clientsocket.recv(1024)
print(data)
web_contents = "<h1>Received</h1>"
f = open("myhtml.html", "r")
web_contents = f.read()
f.close()
web_headers = "HTT... | {
"repo_name": "acs-test/openfda",
"path": "PER_2017-18/clientServer/P1/server_web.py",
"copies": "1",
"size": "1505",
"license": "apache-2.0",
"hash": 2865624443639080400,
"line_mean": 30.3541666667,
"line_max": 78,
"alpha_frac": 0.673089701,
"autogenerated": false,
"ratio": 3.5245901639344264,
... |
# A basic web server using sockets
import socket
PORT = 8092
MAX_OPEN_REQUESTS = 5
def process_client(clientsocket):
print(clientsocket)
print(clientsocket.recv(1024))
web_contents = "<h1>Received</h1>"
web_headers = "HTTP/1.1 200"
web_headers += "\n" + "Content-Type: text/html"
web_headers ... | {
"repo_name": "acs-test/openfda",
"path": "practice-basic-web-server/server_web.py",
"copies": "3",
"size": "1362",
"license": "apache-2.0",
"hash": 1799987958938211300,
"line_mean": 32.2195121951,
"line_max": 78,
"alpha_frac": 0.6930983847,
"autogenerated": false,
"ratio": 3.661290322580645,
"... |
""" Abaxis Vet Scan - VS2
"""
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from . import AbaxisVetScanCSVParser, AbaxisVetScanImporter
import json
import traceback
title = "Abaxis VetScan - VS2"
def Import(context, request):
""" Abaxix VetScan VS2 analysis results
"""
infil... | {
"repo_name": "hocinebendou/bika.gsoc",
"path": "bika/lims/exportimport/instruments/abaxis/vetscan/vs2.py",
"copies": "3",
"size": "3067",
"license": "mit",
"hash": 3257210682654853600,
"line_mean": 33.0777777778,
"line_max": 78,
"alpha_frac": 0.5572220411,
"autogenerated": false,
"ratio": 4.3015... |
# [['a', '+', ['b', '/', 'c', '*', 2], '-', <__main__.mathop object at 0x03694870>]]
import operator
from .lexer import mathop
op_map = {
"+": operator.add,
"-": operator.sub,
"*": operator.mul,
"/": operator.truediv
}
asm_map = {
"+": "ADD",
"-": "SUB",
"*": "MUL",
"/": "DIV"
}
cla... | {
"repo_name": "nitros12/Cpu_emulator",
"path": "wew compiler/disused/math_op.py",
"copies": "1",
"size": "1799",
"license": "mit",
"hash": -6337805026242189000,
"line_mean": 23.9861111111,
"line_max": 115,
"alpha_frac": 0.4674819344,
"autogenerated": false,
"ratio": 3.5343811394891946,
"config_... |
#< ab || cd > = [[ a,b ] , [ c,d ]]
#A script to find the optimal alignment of diagrams used in the CCDT t3 amplitude equation
def perm(a, i,e):
ai= a[1][e]
ae = a[1][i]
api = a[3][e]
ape = a[3][i]
a[1][i] = ai
a[1][e] = ae
a[3][i] = api
a[3][e] = ape
def perm2(a, ... | {
"repo_name": "CompPhysics/ThesisProjects",
"path": "doc/MSc/msc_students/former/AudunHansen/Audun/Pythonscripts/t3_align.py",
"copies": "1",
"size": "11625",
"license": "cc0-1.0",
"hash": -7462734437164940000,
"line_mean": 23.1623376623,
"line_max": 99,
"alpha_frac": 0.3591397849,
"autogenerated":... |
# a-b-c-d-e-f-g
# i have gummy bears chasing me
# one is red, one is blue
# one is chewing on my shoe
# now i am running for my life
# because the red one has a knife
import codecs
from Crypto.Cipher import AES
class Secrets(object):
"""Collection of functions that are utilities for encryption and Azure Key Vault... | {
"repo_name": "andlin666/DataCachePhase1",
"path": "DataCachePhase1/Secrets.py",
"copies": "1",
"size": "1572",
"license": "apache-2.0",
"hash": 8449405470460501000,
"line_mean": 37.3414634146,
"line_max": 129,
"alpha_frac": 0.6634860051,
"autogenerated": false,
"ratio": 3.432314410480349,
"con... |
# a-b-c-d-e-f-g
# i have gummy bears chasing me
# one is red, one is blue
# one is chewing on my shoe
# now i am running for my life
# because the red one has a knife
import sys
import json
import Secrets
class DataConnection(object):
"""Class that encapsulates account information and credentials for Azure Stora... | {
"repo_name": "andlin666/DataCachePhase1",
"path": "DataCachePhase1/DataConnection.py",
"copies": "1",
"size": "2451",
"license": "apache-2.0",
"hash": 1307915772245715500,
"line_mean": 35.5820895522,
"line_max": 88,
"alpha_frac": 0.6532027744,
"autogenerated": false,
"ratio": 4.424187725631769,
... |
# a-b-c-d-e-f-g
# i have gummy bears chasing me
# one is red, one is blue
# one is chewing on my shoe
# now i am running for my life
# because the red one has a knife
import sys
import os
import traceback
from numpy.random import randint
from azure.storage.blob import BlockBlobService
from DataConnection import Data... | {
"repo_name": "andlin666/DataCachePhase1",
"path": "DataCachePhase1/DataCache.py",
"copies": "1",
"size": "11552",
"license": "apache-2.0",
"hash": 8570662567537444000,
"line_mean": 38.4266211604,
"line_max": 136,
"alpha_frac": 0.6270775623,
"autogenerated": false,
"ratio": 4.487956487956488,
"... |
# a + b * c
# ATerm Graph
# ===========
#
# Arithmetic(
# Add
# , Array(){dshape("3, int64"), 45340864}
# , Arithmetic(
# Mul
# , Array(){dshape("3, int64"), 45340792}
# , Array(){dshape("3, int64"), 45341584}
# ){dshape("3, int64"), 45264528}
# ){dshape("3, int64"), 45264432}
# Ex... | {
"repo_name": "davidcoallier/blaze",
"path": "blaze/rts/execution.py",
"copies": "2",
"size": "1625",
"license": "bsd-2-clause",
"hash": -1840576519012141300,
"line_mean": 25.2096774194,
"line_max": 72,
"alpha_frac": 0.5907692308,
"autogenerated": false,
"ratio": 3.276209677419355,
"config_test... |
# ABC Parser for ABC Music Notation Files
from __future__ import division
import re
import string
import math
from Preprocess import globalConstant
class TuneBook(object):
"""
Represents a tunebook with tunes and free text.
Properties
----------
text
An array of free text blocks, as strings.
tune
An arra... | {
"repo_name": "ChyauAng/DNN-Composer",
"path": "src/Preprocess/abcParser.py",
"copies": "1",
"size": "14802",
"license": "mit",
"hash": 4620247068490036000,
"line_mean": 26.8757062147,
"line_max": 111,
"alpha_frac": 0.618294825,
"autogenerated": false,
"ratio": 3.2332896461336826,
"config_test"... |
# A, B, C
import pylab
import networkx as nx
import numpy as np
import random as rd
from pprint import pprint
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams['text.usetex'] = True
#create the graph
#ex 0->1->2->0 1->3
T1 = nx.DiGraph()
T1.add_edge(0,1)
T1.add_edge(1... | {
"repo_name": "mac389/petulant-network",
"path": "src/randomWalk.py",
"copies": "1",
"size": "1290",
"license": "apache-2.0",
"hash": 7607643401010109000,
"line_mean": 22.8076923077,
"line_max": 79,
"alpha_frac": 0.6240310078,
"autogenerated": false,
"ratio": 2.9119638826185104,
"config_test": ... |
"""ABCs."""
# Authors: Guillaume Favelier <guillaume.favelier@gmail.com
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
from abc import ABC, abstractmethod, abstractclassmethod
from contextlib import nullcontext
import warnings
from ..utils import tight_layout
class _AbstractRenderer(A... | {
"repo_name": "rkmaddox/mne-python",
"path": "mne/viz/backends/_abstract.py",
"copies": "4",
"size": "24939",
"license": "bsd-3-clause",
"hash": -4474690987213582000,
"line_mean": 29.826946848,
"line_max": 79,
"alpha_frac": 0.5697902883,
"autogenerated": false,
"ratio": 4.304280289955126,
"conf... |
"""ABCs."""
# Authors: Guillaume Favelier <guillaume.favelier@gmail.com
# Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import warnings
from abc import ABC, abstractmethod, abstractclassmethod
from ..utils import tight_layout
from ...fixes import nullcontext
class _AbstractRenderer(ABC)... | {
"repo_name": "kambysese/mne-python",
"path": "mne/viz/backends/_abstract.py",
"copies": "3",
"size": "24285",
"license": "bsd-3-clause",
"hash": -4780147132705384000,
"line_mean": 30.2548262548,
"line_max": 79,
"alpha_frac": 0.5698167593,
"autogenerated": false,
"ratio": 4.305851063829787,
"co... |
"""abd automates the creation and landing of reviews from branches."""
# =============================================================================
# CONTENTS
# -----------------------------------------------------------------------------
# abdi_processrepo
#
# Public Functions:
# create_review
# create_differen... | {
"repo_name": "kjedruczyk/phabricator-tools",
"path": "py/abd/abdi_processrepo.py",
"copies": "4",
"size": "12398",
"license": "apache-2.0",
"hash": -1841986050498883600,
"line_mean": 34.7291066282,
"line_max": 79,
"alpha_frac": 0.6216325214,
"autogenerated": false,
"ratio": 3.853901150139882,
... |
# abduction.py
# Logical abduction for kb of definite clauses
# Andrew S. Gordon
import parse
import unify
import itertools
def abduction(obs, kb, maxdepth, skolemize = True):
'''Logical abduction: returns a list of all sets of assumptions that entail the observations given the kb'''
indexed_kb = index_by_co... | {
"repo_name": "asgordon/EtcAbductionPy",
"path": "etcabductionpy/abduction.py",
"copies": "1",
"size": "3622",
"license": "bsd-2-clause",
"hash": 3914288927135969000,
"line_mean": 44.275,
"line_max": 138,
"alpha_frac": 0.5877967973,
"autogenerated": false,
"ratio": 4.051454138702461,
"config_te... |
#a beautiful grid pattern on the screen
import pygame
import time
class Player:
def __init__(self, player_id, name, score, position = (-1,11), roll = 0):
self.id = player_id
self.name = name
self.score = score
self.position = position
self.roll = roll
self.category ... | {
"repo_name": "daniellinye/HRINFG3",
"path": "Test_Files/location test.py",
"copies": "1",
"size": "6941",
"license": "mit",
"hash": 5548306871896422000,
"line_mean": 28.1680672269,
"line_max": 185,
"alpha_frac": 0.516784325,
"autogenerated": false,
"ratio": 3.7458175930922826,
"config_test": f... |
"""A benchmark for diesel's internal timers.
Try something like:
$ python examples/timer_bench.py 10
$ python examples/timer_bench.py 100
$ python examples/timer_bench.py 1000
The script will output the total time to run with the given number of
producer/consumer pairs and a sample of CPU time while the ... | {
"repo_name": "dieseldev/diesel",
"path": "examples/timer_bench.py",
"copies": "1",
"size": "1760",
"license": "bsd-3-clause",
"hash": 4817101190680312000,
"line_mean": 23.7887323944,
"line_max": 111,
"alpha_frac": 0.6397727273,
"autogenerated": false,
"ratio": 3.3396584440227706,
"config_test"... |
""" A benchmark utility used in speed/performance tests. """
from os import getpid
from test import pystone # native python-core "PYSTONE" Benchmark Program
from timeit import default_timer as timer
from psutil import Process
# The result is a number of pystones per second the computer is able to perform,... | {
"repo_name": "duboviy/pybenchmark",
"path": "pybenchmark/profile.py",
"copies": "1",
"size": "1526",
"license": "mit",
"hash": -3399335632202586600,
"line_mean": 33.6818181818,
"line_max": 86,
"alpha_frac": 0.6107470511,
"autogenerated": false,
"ratio": 4.1808219178082195,
"config_test": false... |
ABERRANT_PLURAL_MAP = {
'appendix': 'appendices',
'barracks': 'barracks',
'cactus': 'cacti',
'child': 'children',
'criterion': 'criteria',
'deer': 'deer',
'echo': 'echoes',
'elf': 'elves',
'embargo': 'embargoes',
'focus': 'foci',
'fungus': 'fungi',
'goose': 'geese',
'... | {
"repo_name": "Govexec/django-odd-utilities",
"path": "odd_utilities/text_utilities.py",
"copies": "1",
"size": "2465",
"license": "mit",
"hash": 6774506253501130000,
"line_mean": 22.932038835,
"line_max": 98,
"alpha_frac": 0.5030425963,
"autogenerated": false,
"ratio": 3.344640434192673,
"conf... |
"""A big ball of mud to hold common functionality pending a re-org."""
import os
import cv2
import numpy
import mel.lib.datetime
import mel.lib.image
def determine_filename_for_ident(*source_filenames):
if not source_filenames:
raise ValueError(
"{} is not a valid list of filenames".format(... | {
"repo_name": "aevri/mel",
"path": "mel/lib/common.py",
"copies": "1",
"size": "9500",
"license": "apache-2.0",
"hash": -4382820604492715500,
"line_mean": 27.4431137725,
"line_max": 79,
"alpha_frac": 0.5969473684,
"autogenerated": false,
"ratio": 3.572771718691237,
"config_test": false,
"has_... |
""" Abilities, including both positive and negative.
"""
import numbers
class Base:
""" Base.
"""
name = "base"
""" The name of that card.
"""
optional = True
""" Indicates that if the card effect is optional.
"""
stop_draw = False
""" Indicates that if agent must stop draw f... | {
"repo_name": "cwahbong/tgif-py",
"path": "tgif/ability.py",
"copies": "1",
"size": "4254",
"license": "mit",
"hash": 6088259394291484000,
"line_mean": 21.9945945946,
"line_max": 78,
"alpha_frac": 0.5895627645,
"autogenerated": false,
"ratio": 3.77797513321492,
"config_test": false,
"has_no_k... |
# Ability definitions
class Ability(object):
"""A class to outline abilities"""
def __init__(self, name, cooldown):
"""
:type name: string
:param name: Name of the ability
:type cooldown: integer
:param cooldown: How many turns ability is on cooldown
"""
... | {
"repo_name": "JakeCowton/Pok-e-Lol",
"path": "champion/ability.py",
"copies": "1",
"size": "1765",
"license": "mit",
"hash": -4780608585899015000,
"line_mean": 21.6282051282,
"line_max": 65,
"alpha_frac": 0.5694050992,
"autogenerated": false,
"ratio": 3.8038793103448274,
"config_test": false,
... |
# ability_manager.py
class AbilityManager(object):
"""
Manages ability cooldowns and damage over time
"""
def __init__(self, interface):
"""
:type interface: Interface object
:param interface: The interface used for outputing data
"""
self.interface = interface
# [[ability, receiver, turns_remaining].... | {
"repo_name": "JakeCowton/Pok-e-Lol",
"path": "gameplay/ability_manager.py",
"copies": "1",
"size": "3278",
"license": "mit",
"hash": -8299035789375688000,
"line_mean": 28.0088495575,
"line_max": 82,
"alpha_frac": 0.6949359365,
"autogenerated": false,
"ratio": 3.188715953307393,
"config_test": ... |
from __future__ import print_function
from . import Image, _imagingmorph
import re
LUT_SIZE = 1 << 9
class LutBuilder(object):
"""A class for building a MorphLut from a descriptive language
The input patterns is a list of a strings sequences like these::
4:(...
.1.
1... | {
"repo_name": "ossdemura/django-miniblog",
"path": "Lib/site-packages/PIL/ImageMorph.py",
"copies": "8",
"size": "8313",
"license": "mit",
"hash": -4762195770560904000,
"line_mean": 32.252,
"line_max": 79,
"alpha_frac": 0.5066762901,
"autogenerated": false,
"ratio": 4.076998528690535,
"config_t... |
from __future__ import print_function
from PIL import Image
from PIL import _imagingmorph
import re
LUT_SIZE = 1 << 9
class LutBuilder(object):
"""A class for building a MorphLut from a descriptive language
The input patterns is a list of a strings sequences like these::
4:(...
.... | {
"repo_name": "ryfeus/lambda-packs",
"path": "Pdf_docx_pptx_xlsx_epub_png/source/PIL/ImageMorph.py",
"copies": "14",
"size": "8330",
"license": "mit",
"hash": 7620133925840861000,
"line_mean": 32.187250996,
"line_max": 79,
"alpha_frac": 0.5075630252,
"autogenerated": false,
"ratio": 4.07933398628... |
from PIL import Image
from PIL import _imagingmorph
import re
LUT_SIZE = 1 << 9
class LutBuilder:
"""A class for building a MorphLut from a descriptive language
The input patterns is a list of a strings sequences like these:
4:(...
.1.
111)->1
(whitespaces including linebr... | {
"repo_name": "rec/echomesh",
"path": "lib/darwin/PIL/ImageMorph.py",
"copies": "4",
"size": "7946",
"license": "mit",
"hash": 3513508162133477000,
"line_mean": 31.5655737705,
"line_max": 77,
"alpha_frac": 0.5033979361,
"autogenerated": false,
"ratio": 4.066530194472876,
"config_test": false,
... |
from PIL import Image
from PIL import _imagingmorph
import re
LUT_SIZE = 1 << 9
class LutBuilder(object):
"""A class for building a MorphLut from a descriptive language
The input patterns is a list of a strings sequences like these::
4:(...
.1.
111)->1
(whitesp... | {
"repo_name": "BaichuanWu/Blog_on_django",
"path": "site-packages/PIL/ImageMorph.py",
"copies": "19",
"size": "8308",
"license": "mit",
"hash": 3173045108083631600,
"line_mean": 32.0996015936,
"line_max": 79,
"alpha_frac": 0.5060182956,
"autogenerated": false,
"ratio": 4.072549019607843,
"confi... |
import re
from . import Image, _imagingmorph
LUT_SIZE = 1 << 9
# fmt: off
ROTATION_MATRIX = [
6, 3, 0,
7, 4, 1,
8, 5, 2,
]
MIRROR_MATRIX = [
2, 1, 0,
5, 4, 3,
8, 7, 6,
]
# fmt: on
class LutBuilder:
"""A class for building a MorphLut from a descriptive language
The input patterns... | {
"repo_name": "sserrot/champion_relationships",
"path": "venv/Lib/site-packages/PIL/ImageMorph.py",
"copies": "1",
"size": "7896",
"license": "mit",
"hash": -5161624055058367000,
"line_mean": 31.2285714286,
"line_max": 87,
"alpha_frac": 0.5374873354,
"autogenerated": false,
"ratio": 3.86301369863... |
# A binary ordered tree example
class CNode:
left , right, data = None, None, 0
def __init__(self, data):
# initializes the data members
self.left = None
self.right = None
self.data = data
class CBOrdTree:
def __init__(self):
# initializes the root member
... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/286239_Binary_ordered_tree/recipe-286239.py",
"copies": "1",
"size": "3357",
"license": "mit",
"hash": -1125595048848715900,
"line_mean": 26.975,
"line_max": 67,
"alpha_frac": 0.5111706881,
"autogenerated": false,
"ratio": 4.20676691729323... |
# A binary search number guesser
# Uses Python3
from math import ceil, log
lowNum = 0 # The lowest number we guessed
highNum = 1000 # The highest number we guessed
guessCounter = 0 # For each guess, this will increase by one
depth = ceil(log(highNum - lowNum, 2)) # Maximum number of guesses prediction
answ... | {
"repo_name": "ericpoe/pyNumGuesser",
"path": "numGuesser.py",
"copies": "1",
"size": "1236",
"license": "mit",
"hash": -6089007737824386000,
"line_mean": 40.2,
"line_max": 78,
"alpha_frac": 0.6593851133,
"autogenerated": false,
"ratio": 3.501416430594901,
"config_test": false,
"has_no_keywor... |
"""A binary to train Adience using a single GPU.
Accuracy:
Speed: With batch_size 128.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import os.path
import time
import tensorflow.python.platform
from tensorflow.python.... | {
"repo_name": "NumesSanguis/MLTensor",
"path": "adience/adience_train.py",
"copies": "1",
"size": "6324",
"license": "apache-2.0",
"hash": -9160484344937814000,
"line_mean": 33.7472527473,
"line_max": 93,
"alpha_frac": 0.5725806452,
"autogenerated": false,
"ratio": 4.1936339522546415,
"config_t... |
"""A binary to train BiLSTM on the KTH data set.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import video_train
import tensorflow as tf
from data.kth_data import KTHData
from data.lca_data import LCAData
tf.app.flags.DEFINE_string("data_path", None... | {
"repo_name": "frankgu/tensorflow_video_rnn",
"path": "main.py",
"copies": "1",
"size": "1977",
"license": "mit",
"hash": -3745662834997159400,
"line_mean": 28.9545454545,
"line_max": 93,
"alpha_frac": 0.6130500759,
"autogenerated": false,
"ratio": 3.300500834724541,
"config_test": false,
"ha... |
"""A binary to train CIFAR-10 using a single GPU.
Accuracy:
cifar10_train.py achieves ~86% accuracy after 100K steps (256 epochs of
data) as judged by cifar10_eval.py.
Speed: With batch_size 128.
System | Step Time (sec/batch) | Accuracy
------------------------------------------------------------------
... | {
"repo_name": "dnlcrl/TensorFlow-Playground",
"path": "1.tutorials/4.Convolutional Neural Networks/cifar10_train.py",
"copies": "1",
"size": "4763",
"license": "mit",
"hash": 7451763699984025000,
"line_mean": 34.5447761194,
"line_max": 83,
"alpha_frac": 0.5918538736,
"autogenerated": false,
"rati... |
"""A binary to train CIFAR-10 using multiple GPU's with synchronous updates.
Accuracy:
cifar10_multi_gpu_train.py achieves ~86% accuracy after 100K steps (256
epochs of data) as judged by cifar10_eval.py.
Speed: With batch_size 128.
System | Step Time (sec/batch) | Accuracy
------------------------------... | {
"repo_name": "tobiajo/hops-tensorflow",
"path": "yarntf/examples/cifar10/cifar10_multi_gpu_train.py",
"copies": "2",
"size": "9627",
"license": "apache-2.0",
"hash": 2211993407219763500,
"line_mean": 36.3139534884,
"line_max": 83,
"alpha_frac": 0.6462033863,
"autogenerated": false,
"ratio": 3.68... |
"""A binary to train eye using CPU or a single GPU.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
from datetime import datetime
import numpy as np
import tensorflow as tf
import eye_model
FLAGS = tf.app.flags.FLAGS
tf.app.... | {
"repo_name": "callofdutyops/YXH2016724098982",
"path": "eye_train.py",
"copies": "1",
"size": "3366",
"license": "mit",
"hash": -5805734470023242000,
"line_mean": 33.3469387755,
"line_max": 82,
"alpha_frac": 0.5855614973,
"autogenerated": false,
"ratio": 4.0359712230215825,
"config_test": fals... |
"""A binary to train ocr using a single GPU."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
import time
import tensorflow as tf
import ocr
import ocr_input
import os
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('t... | {
"repo_name": "Luonic/tf-cnn-lstm-ocr-captcha",
"path": "ocr_train.py",
"copies": "1",
"size": "6646",
"license": "mit",
"hash": -7630216789593668000,
"line_mean": 40.5375,
"line_max": 168,
"alpha_frac": 0.551609991,
"autogenerated": false,
"ratio": 3.8195402298850576,
"config_test": false,
"... |
""" A binary tree implementation.
"""
class Node(object):
""" A binary tree node.
"""
def __init__(self, data, left=None, right=None):
self.data = data
self.left = left
self.right = right
def __str__(self):
return str(self.data)
class BinaryTree(objec... | {
"repo_name": "thisismyrobot/dsa",
"path": "src/binary_tree.py",
"copies": "1",
"size": "1762",
"license": "unlicense",
"hash": 7445221678168279000,
"line_mean": 23.1714285714,
"line_max": 57,
"alpha_frac": 0.4750283768,
"autogenerated": false,
"ratio": 4.588541666666667,
"config_test": false,
... |
#A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).
#
#Each LED represents a zero or one, with the least significant bit on the right.
#
#
#For example, the above binary watch reads "3:25".
#
#Given a non-negative integer n which represents ... | {
"repo_name": "95subodh/Leetcode",
"path": "401. Binary Watch.py",
"copies": "1",
"size": "1129",
"license": "mit",
"hash": -1925867035701905000,
"line_mean": 30.3888888889,
"line_max": 143,
"alpha_frac": 0.6536758193,
"autogenerated": false,
"ratio": 2.872773536895674,
"config_test": false,
... |
#A 'Binney' quasi-isothermal DF
import math
import warnings
import numpy
from scipy import optimize, interpolate, integrate
from galpy import potential
from galpy import actionAngle
from galpy.actionAngle import actionAngleIsochrone
from galpy.potential import IsochronePotential
from galpy.orbit import Orbit
from galpy... | {
"repo_name": "followthesheep/galpy",
"path": "galpy/df_src/quasiisothermaldf.py",
"copies": "1",
"size": "76948",
"license": "bsd-3-clause",
"hash": -3468241802468573000,
"line_mean": 39.0770833333,
"line_max": 180,
"alpha_frac": 0.4611425898,
"autogenerated": false,
"ratio": 3.8427886536156612,... |
#A 'Binney' quasi-isothermal DF
import warnings
import hashlib
import numpy
from scipy import optimize, interpolate, integrate
from .. import potential
from .. import actionAngle
from ..actionAngle import actionAngleIsochrone
from ..potential import IsochronePotential
from ..potential import flatten as flatten_potentia... | {
"repo_name": "jobovy/galpy",
"path": "galpy/df/quasiisothermaldf.py",
"copies": "1",
"size": "96610",
"license": "bsd-3-clause",
"hash": 2030695931108671200,
"line_mean": 37.2008699091,
"line_max": 180,
"alpha_frac": 0.4852085705,
"autogenerated": false,
"ratio": 3.8296269869584174,
"config_te... |
"""A biologically-inspired model of visual perception."""
from math import exp, hypot
import logging
import numpy as np
import cv2
import cv2.cv as cv
from collections import OrderedDict, deque
from itertools import izip
#import pyNN.neuron as sim
from lumos.context import Context
from lumos.util import Enum, getNorm... | {
"repo_name": "napratin/nap",
"path": "nap/vision/visual_system.py",
"copies": "1",
"size": "62141",
"license": "mit",
"hash": 4449551680707219000,
"line_mean": 61.5790533736,
"line_max": 310,
"alpha_frac": 0.7012439452,
"autogenerated": false,
"ratio": 3.4746700961753523,
"config_test": true,
... |
""" a bit faster math operations when knowing what you're doing"""
import numpy as np
from scipy import linalg
def dot(A,B):
"""
Dot product of two arrays that directly calls blas libraries
For 2-D arrays it is equivalent to matrix multiplication, and for 1-D
arrays to inner product of vectors (witho... | {
"repo_name": "mfouesneau/faststats",
"path": "faststats/math.py",
"copies": "1",
"size": "5806",
"license": "mit",
"hash": 6556954633881829000,
"line_mean": 30.5543478261,
"line_max": 79,
"alpha_frac": 0.599724423,
"autogenerated": false,
"ratio": 3.4416123295791348,
"config_test": false,
"h... |
''' a 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 import foot... | {
"repo_name": "treygreer/treb",
"path": "treb_sim/src/first_in_fright_2012.py",
"copies": "1",
"size": "25532",
"license": "mit",
"hash": -4166431940091779000,
"line_mean": 45.6782449726,
"line_max": 120,
"alpha_frac": 0.5268290772,
"autogenerated": false,
"ratio": 3.4331047465375826,
"config_t... |
# a bit of tweaking on search path in order to easily import source files.
import sys
import os
sources = os.path.abspath(os.path.join(os.path.dirname(__file__),'../src'))
sys.path.insert(0,sources)
from file_stub import *
from kicad_pcb import *
import unittest
class KicadPcb_TestCase(unittest.TestCase):
'Tests ... | {
"repo_name": "achary/kicad-3d",
"path": "tests/kicad_pcb_test.py",
"copies": "1",
"size": "3730",
"license": "mit",
"hash": -7803804734575118000,
"line_mean": 46.8205128205,
"line_max": 123,
"alpha_frac": 0.5436997319,
"autogenerated": false,
"ratio": 3.4157509157509156,
"config_test": true,
... |
""" Abiword plugin for PubTal
Copyright (c) 2003 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above c... | {
"repo_name": "owlfish/pubtal",
"path": "optional-plugins/abiwordContent/__init__.py",
"copies": "2",
"size": "3234",
"license": "bsd-3-clause",
"hash": 8953143160448503000,
"line_mean": 38.4512195122,
"line_max": 125,
"alpha_frac": 0.7665429808,
"autogenerated": false,
"ratio": 3.968098159509202... |
""" Abiword to HTML Converter for PubTal
Copyright (c) 2003 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain ... | {
"repo_name": "owlfish/pubtal",
"path": "mytesting/abiwordContent/AbiwordToHTMLConverter.py",
"copies": "1",
"size": "15706",
"license": "bsd-3-clause",
"hash": -6807853865313151000,
"line_mean": 39.3753213368,
"line_max": 103,
"alpha_frac": 0.6711447854,
"autogenerated": false,
"ratio": 3.317001... |
a = 'blah {foo-bar %d'
a = 'blah {foo-bar %d}'
a = 'blah {foo-bar %d //insane {}}'
a = '{}blah {foo-bar %d //insane {}}'
a : source.python
: source.python
= : keyword.operator.assignment.python, source.python
: source.python
' : punctuation.definition.s... | {
"repo_name": "MagicStack/MagicPython",
"path": "test/strings/format9.py",
"copies": "1",
"size": "2848",
"license": "mit",
"hash": -7936939987525237000,
"line_mean": 60.9130434783,
"line_max": 138,
"alpha_frac": 0.6664325843,
"autogenerated": false,
"ratio": 3.896032831737346,
"config_test": f... |
#ablerCFLregionTest2.py
import time, os
from armor import pattern
dbz = pattern.DBZ
np = pattern.np
dp = pattern.dp
plt = pattern.plt
ma = pattern.plt
from armor.geometry import transforms
from armor.geometry import transformedCorrelations as trc
outputFolder = '/media/TOSHIBA EXT/ARMOR/labLogs2/ABLERCFLregion/'
... | {
"repo_name": "yaukwankiu/armor",
"path": "tests/ablerCFLregionTest2.py",
"copies": "1",
"size": "10168",
"license": "cc0-1.0",
"hash": 3286458954127436000,
"line_mean": 31.3821656051,
"line_max": 140,
"alpha_frac": 0.6075924469,
"autogenerated": false,
"ratio": 2.915137614678899,
"config_test"... |
#ablerCFLregionTest.py
import time, os
from armor import pattern
dbz = pattern.DBZ
np = pattern.np
dp = pattern.dp
from armor.geometry import transforms as tr
outputFolder = '/media/TOSHIBA EXT/ARMOR/labLogs2/'
a = pattern.a.load()
a = a.getWindow(400,400,200,200)
X, Y = np.meshgrid(range(200), range(200))
I... | {
"repo_name": "yaukwankiu/armor",
"path": "tests/ablerCFLregionTest.py",
"copies": "1",
"size": "2564",
"license": "cc0-1.0",
"hash": 8411181453925741000,
"line_mean": 23.8932038835,
"line_max": 93,
"alpha_frac": 0.5819032761,
"autogenerated": false,
"ratio": 2.564,
"config_test": false,
"has... |
"""A block Davidson solver for finding a fixed number of eigenvalues.
Adapted from https://joshuagoings.com/2013/08/23/davidsons-method/
"""
import time
from typing import Tuple
import numpy as np
from tqdm import tqdm
def davidson(A: np.ndarray, k: int, eig: int) -> Tuple[np.ndarray, np.ndarray]:
assert len(A.... | {
"repo_name": "berquist/programming_party",
"path": "eric/project12/davidson.py",
"copies": "1",
"size": "2084",
"license": "mpl-2.0",
"hash": -368262847949303940,
"line_mean": 24.4146341463,
"line_max": 79,
"alpha_frac": 0.5143953935,
"autogenerated": false,
"ratio": 2.943502824858757,
"config... |
# a block device defines a set of blocks used by a file system
from DiskGeometry import DiskGeometry
class BlockDevice:
def _set_geometry(self, cyls=80, heads=2, sectors=11, block_bytes=512, reserved=2, bootblocks=2):
self.cyls = cyls
self.heads = heads
self.sectors = sectors
self.block_bytes = block... | {
"repo_name": "alpine9000/amiga_examples",
"path": "tools/external/amitools/amitools/fs/blkdev/BlockDevice.py",
"copies": "1",
"size": "1508",
"license": "bsd-2-clause",
"hash": 3982880807004444000,
"line_mean": 29.16,
"line_max": 99,
"alpha_frac": 0.651193634,
"autogenerated": false,
"ratio": 3.... |
"""A Bluetooth data source."""
import logging
from openxc.controllers.base import Controller
from .socket import SocketDataSource
from .base import DataSourceError
LOG = logging.getLogger(__name__)
try:
import bluetooth
except ImportError:
LOG.debug("pybluez library not installed, can't use bluetooth inter... | {
"repo_name": "openxc/openxc-python",
"path": "openxc/sources/bluetooth.py",
"copies": "1",
"size": "2211",
"license": "bsd-3-clause",
"hash": -5424071361890744000,
"line_mean": 30.1408450704,
"line_max": 82,
"alpha_frac": 0.6155585708,
"autogenerated": false,
"ratio": 4.4397590361445785,
"conf... |
"""A board is a list of list of str. For example, the board
ANTT
XSOB
is represented as the list
[['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']]
A word list is a list of str. For example, the list of words
ANT
BOX
SOB
TO
is represented as the list
['ANT', 'BOX', 'SOB', 'TO']
"""
def is_v... | {
"repo_name": "shilpavijay/Word-Search-Board-Game",
"path": "a3.py",
"copies": "1",
"size": "5844",
"license": "unlicense",
"hash": 6597106586216022000,
"line_mean": 26.1813953488,
"line_max": 101,
"alpha_frac": 0.5550992471,
"autogenerated": false,
"ratio": 3.3897911832946637,
"config_test": f... |
'''A board is a list of list of str. For example, the board
ANTT
XSOB
is represented as the list
[['A', 'N', 'T', 'T'], ['X', 'S', 'O', 'B']]
A word list is a list of str. For example, the list of words
ANT
BOX
SOB
TO
is represented as the list
['ANT', 'BOX', 'SOB', 'TO']
'''
def is_v... | {
"repo_name": "penkz/python-fundamentals",
"path": "Assignment3/a3.py",
"copies": "1",
"size": "5044",
"license": "mit",
"hash": 8680311544882167000,
"line_mean": 25.2708333333,
"line_max": 101,
"alpha_frac": 0.5773195876,
"autogenerated": false,
"ratio": 3.438309475119291,
"config_test": false... |
"""A board is the main area of play for different players in the game. This is
were all game pieces are played and is used to determine most of the players'
final scores.
A board inclues multiple elements: buildings (contigious blocks of building
pieces and stables), a market street (or streets), towers with wall... | {
"repo_name": "nicholas-maltbie/Medina",
"path": "Board.py",
"copies": "1",
"size": "12912",
"license": "mit",
"hash": -5858099316050800000,
"line_mean": 40.0586319218,
"line_max": 99,
"alpha_frac": 0.6648079306,
"autogenerated": false,
"ratio": 4.045112781954887,
"config_test": false,
"has_n... |
"""abode output utilities
.. codeauthor:: Joe DeCapo <joe@polka.cat>
"""
import clowder.util.formatting as fmt
from clowder.util.console import CONSOLE
def separator(message: str, character: str) -> None:
sep = character * len(message)
CONSOLE.stdout(fmt.bold(sep))
def h1(message: str, newline: bool = Tr... | {
"repo_name": "JrGoodle/clowder",
"path": "clowder/util/output.py",
"copies": "1",
"size": "1069",
"license": "mit",
"hash": 4454790670431915000,
"line_mean": 22.7555555556,
"line_max": 61,
"alpha_frac": 0.6417212348,
"autogenerated": false,
"ratio": 3.21021021021021,
"config_test": false,
"h... |
# A bot that blindly plays 2048
# Henry Barrow 2015
from selenium import webdriver # Need to 'pip install selenium' first
from selenium.webdriver.common.keys import Keys
# Launch Firefox and 2048
browser = webdriver.Firefox()
browser.get('http://doge2048.com/')
def play2048():
# locate grid, game-over, and score by... | {
"repo_name": "hgbarrow/PythonSnippets",
"path": "doge2048bot.py",
"copies": "1",
"size": "1218",
"license": "mit",
"hash": -2141779333012321500,
"line_mean": 27.3255813953,
"line_max": 82,
"alpha_frac": 0.7085385878,
"autogenerated": false,
"ratio": 3.0680100755667508,
"config_test": false,
... |
"""A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | {
"repo_name": "zooba/PTVS",
"path": "Python/Product/Miniconda/Miniconda3-x64/Lib/lib2to3/btm_matcher.py",
"copies": "33",
"size": "6623",
"license": "apache-2.0",
"hash": 7580694535180002000,
"line_mean": 39.6319018405,
"line_max": 89,
"alpha_frac": 0.5751170165,
"autogenerated": false,
"ratio": ... |
from tkinter import *
import time
import random
SLEEP_TIME = 0.01
PADDLE_SPEED = [20, 10]
BALL_SPEED = [1, 3]
# Model for the Ball class
# canvas is the tkinter current canvas
# color is the color of the ball
# paddle_pos is the current position of the paddle
# speed [x, y] is the absolute speed of the ball
class Bal... | {
"repo_name": "VictaLab/victalab_cpsc",
"path": "games/bouncing-ball-game/bounce-ball-game.py",
"copies": "1",
"size": "5793",
"license": "apache-2.0",
"hash": -5270199365514646000,
"line_mean": 33.8975903614,
"line_max": 157,
"alpha_frac": 0.5779388918,
"autogenerated": false,
"ratio": 3.1011777... |
# about a dataset using pandas and numpy
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
df= pd.read_csv ('school_immunizations.csv')
df= df.dropna()
#print df.head(100)
#had to change PERCENT from object to numeric with this code
df['PERCENT']= pd.to_numeric (df['PERCENT'])
print df.info()
... | {
"repo_name": "artopping/nyu-python",
"path": "course3/assignments/about_a_dataset/about_a_dataset.py",
"copies": "1",
"size": "2563",
"license": "mit",
"hash": 6575254428271700000,
"line_mean": 29.5119047619,
"line_max": 80,
"alpha_frac": 0.7186890363,
"autogenerated": false,
"ratio": 2.97677119... |
about = "cfvg-bot is a discord bot made by LittleFighterFox with a set of commands that is useful for discussing cardfight vanguard. Currently supporting mathematical probability calcuations, it should soon be extended to have automatic searching of cards. Project can found at https://github.com/NanoSmasher/cfvg-discor... | {
"repo_name": "TiniKhang/cfvg-discordbot",
"path": "text.py",
"copies": "2",
"size": "1416",
"license": "mit",
"hash": -6821362145188298000,
"line_mean": 36.2894736842,
"line_max": 325,
"alpha_frac": 0.6843220339,
"autogenerated": false,
"ratio": 3.091703056768559,
"config_test": false,
"has_... |
# about database connect and some actions interface.
# writed by sunhuachuang #
import main.automatic, main.action, main.custom
def connect_check(sql, params):
if sql == 'mysql':
try:
import main.sql.mysql
return main.sql.mysql.connect_check(params)
except ImportError:
... | {
"repo_name": "sunhuachuang/pytestdata",
"path": "main/db.py",
"copies": "1",
"size": "2062",
"license": "mit",
"hash": -5310976924303422000,
"line_mean": 30.7230769231,
"line_max": 72,
"alpha_frac": 0.6823472357,
"autogenerated": false,
"ratio": 3.465546218487395,
"config_test": false,
"has_... |
"""About Dialog for IDLE
"""
from Tkinter import *
import os
import os.path
import textView
import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
self.geometry(... | {
"repo_name": "mujiansu/arangodb",
"path": "3rdParty/V8-4.3.61/third_party/python_26/Lib/idlelib/aboutDialog.py",
"copies": "52",
"size": "6800",
"license": "apache-2.0",
"hash": -2094931173835926800,
"line_mean": 44.3333333333,
"line_max": 80,
"alpha_frac": 0.5666176471,
"autogenerated": false,
... |
"""About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
se... | {
"repo_name": "DecipherOne/Troglodyte",
"path": "Trog Build Dependencies/Python26/Lib/idlelib/aboutDialog.py",
"copies": "46",
"size": "6825",
"license": "mit",
"hash": -5418792131761544000,
"line_mean": 44.5,
"line_max": 80,
"alpha_frac": 0.5676190476,
"autogenerated": false,
"ratio": 3.49462365... |
"""About Dialog for IDLE
"""
from tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
se... | {
"repo_name": "jcoady9/python-for-android",
"path": "python3-alpha/python3-src/Lib/idlelib/aboutDialog.py",
"copies": "55",
"size": "6825",
"license": "apache-2.0",
"hash": 506833609482704900,
"line_mean": 44.5,
"line_max": 80,
"alpha_frac": 0.5676190476,
"autogenerated": false,
"ratio": 3.494623... |
"""About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self, parent, title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
... | {
"repo_name": "MonicaHsu/truvaluation",
"path": "venv/lib/python2.7/idlelib/aboutDialog.py",
"copies": "2",
"size": "6430",
"license": "mit",
"hash": -6486523243233650000,
"line_mean": 44.9285714286,
"line_max": 80,
"alpha_frac": 0.5712286159,
"autogenerated": false,
"ratio": 3.515582285401859,
... |
"""About Dialog for IDLE
"""
from Tkinter import *
import string, os
import textView
import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
self.geometry("+%d+%d... | {
"repo_name": "MalloyPower/parsing-python",
"path": "front-end/testsuite-python-lib/Python-2.3/Lib/idlelib/aboutDialog.py",
"copies": "1",
"size": "7225",
"license": "mit",
"hash": -8906380582848233000,
"line_mean": 43.5987654321,
"line_max": 80,
"alpha_frac": 0.5541868512,
"autogenerated": false,
... |
"""About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwid... | {
"repo_name": "babyliynfg/cross",
"path": "tools/project-creator/Python2.6.6/Lib/idlelib/aboutDialog.py",
"copies": "5",
"size": "6975",
"license": "mit",
"hash": -3643744699556664300,
"line_mean": 44.5,
"line_max": 80,
"alpha_frac": 0.5554121864,
"autogenerated": false,
"ratio": 3.53701825557809... |
"""About Dialog for IDLE
"""
from Tkinter import *
import string, os
import textView
import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self,parent,title):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
self.... | {
"repo_name": "ericlink/adms-server",
"path": "playframework-dist/play-1.1/python/Lib/idlelib/aboutDialog.py",
"copies": "2",
"size": "7436",
"license": "mit",
"hash": -329993661620001900,
"line_mean": 43.6196319018,
"line_max": 82,
"alpha_frac": 0.5420925229,
"autogenerated": false,
"ratio": 3.6... |
"""About models."""
from slugify import slugify
from sqlalchemy.dialects import postgresql
from sqlalchemy_utils import observes
from pygotham.core import db
from pygotham.events.query import EventQuery
__all__ = ('AboutPage',)
class AboutPage(db.Model):
"""About page."""
__tablename__ = 'about_pages'
... | {
"repo_name": "PyGotham/pygotham",
"path": "pygotham/about/models.py",
"copies": "2",
"size": "2231",
"license": "bsd-3-clause",
"hash": 6041012963044899000,
"line_mean": 31.8088235294,
"line_max": 79,
"alpha_frac": 0.6355894218,
"autogenerated": false,
"ratio": 3.859861591695502,
"config_test"... |
"""About models."""
from slugify import slugify
from sqlalchemy_utils import observes
from pygotham.core import db
from pygotham.events.query import EventQuery
__all__ = ('AboutPage',)
class AboutPage(db.Model):
"""About page."""
__tablename__ = 'about_pages'
query_class = EventQuery
id = db.Colu... | {
"repo_name": "djds23/pygotham-1",
"path": "pygotham/about/models.py",
"copies": "1",
"size": "1974",
"license": "bsd-3-clause",
"hash": 2502011231694718000,
"line_mean": 30.8387096774,
"line_max": 79,
"alpha_frac": 0.625633232,
"autogenerated": false,
"ratio": 3.833009708737864,
"config_test":... |
"""AboutModules handlers for the application.
"""
# stdlib imports
import json
# local imports
from app.forms.about_modules import AboutModuleForm
from app.handlers.templates.admin.base import AdminTemplateHandler
from app.models.about_modules import AboutModule
class AboutModuleHandler(AdminTemplateHandler):
f... | {
"repo_name": "mjmcconnell/sra",
"path": "src-server/app/handlers/templates/admin/about_modules.py",
"copies": "1",
"size": "1340",
"license": "apache-2.0",
"hash": -6078901102298042000,
"line_mean": 24.7692307692,
"line_max": 78,
"alpha_frac": 0.623880597,
"autogenerated": false,
"ratio": 4.1358... |
#About
#'Bit:watch' is a Binary Watch programme written in MicroPython for the BBC Micro:bit by @petejbell and distributed under a MIT licence
#Please share with me what you do with it, I'd love to see what you do!
#You can find a tutorial showing you how to build a strap for your watch here: https://t.co/li9CktVJhg
#... | {
"repo_name": "petejbell/BitWatch",
"path": "BitWatch.py",
"copies": "1",
"size": "5679",
"license": "mit",
"hash": -8434066833711867000,
"line_mean": 32.8035714286,
"line_max": 159,
"alpha_frac": 0.6145448142,
"autogenerated": false,
"ratio": 3.334703464474457,
"config_test": false,
"has_no_... |
about = """
^
/ \\
/ \\
/ \\
/ \\
/ \\
/ \\
| IRC Hack |
| |
| |
| |
| A game by |
| Gustavo |
| Ramos |
| Rehermann |
-~=<=============>=~-
\\6046|/
|6046
... | {
"repo_name": "Gustavo6046/GusBot-2",
"path": "plugins/irchack.py",
"copies": "1",
"size": "11268",
"license": "mit",
"hash": -6980256668046021000,
"line_mean": 26.6855036855,
"line_max": 156,
"alpha_frac": 0.5549343273,
"autogenerated": false,
"ratio": 3.712685337726524,
"config_test": false,
... |
# About
# this module contains different metrics of uniformity
# and the metrics of quality as well (which support weights, actually)
from __future__ import division, print_function
import numpy
import pandas
from sklearn.base import BaseEstimator
from sklearn.neighbors.unsupervised import NearestNeighbors
from skle... | {
"repo_name": "anaderi/lhcb_trigger_ml",
"path": "hep_ml/metrics.py",
"copies": "1",
"size": "18871",
"license": "mit",
"hash": 3714703360272555000,
"line_mean": 42.4815668203,
"line_max": 119,
"alpha_frac": 0.6467065868,
"autogenerated": false,
"ratio": 3.565274891365955,
"config_test": true,
... |
# About
# This module contains functions to build reports:
# training, getting predictions,
# building various plots, calculating metrics
from __future__ import print_function, division, absolute_import
from itertools import islice
from collections import OrderedDict
import time
import warnings
import numpy
import p... | {
"repo_name": "anaderi/lhcb_trigger_ml",
"path": "hep_ml/reports.py",
"copies": "1",
"size": "31998",
"license": "mit",
"hash": 571549035349695600,
"line_mean": 47.4818181818,
"line_max": 119,
"alpha_frac": 0.6043502719,
"autogenerated": false,
"ratio": 3.726764500349406,
"config_test": false,
... |
# about:python, originally by Alex Badea
from xpcom import components, verbose
import sys, os
import platform
def getAbout():
# Generate it each time so its always up-to-date.
# Sort to keep things purdy
mod_names = sys.modules.keys()
mod_names.sort()
env = os.environ.items()
env.sort()
ret... | {
"repo_name": "tmhorne/celtx",
"path": "extensions/python/xpcom/components/pyabout.py",
"copies": "1",
"size": "1960",
"license": "mpl-2.0",
"hash": 2417362241978859000,
"line_mean": 27.8235294118,
"line_max": 89,
"alpha_frac": 0.6270408163,
"autogenerated": false,
"ratio": 3.0340557275541795,
... |
import pypuppetdb
import collectd
from pypuppetdb import connect
# Host to connect to. Override in config by specifying 'Host'.
PUPPETDB_HOST = 'localhost'
# Port to connect to. Override in config by specifying 'Port'.
PUPPETDB_PORT = '8080'
# Use ssl. Override in config by specifying 'SSL_VERIFY'.
PUPPETDB_S... | {
"repo_name": "vincentbernat/collectd-puppetdb",
"path": "puppetdb.py",
"copies": "1",
"size": "5145",
"license": "mit",
"hash": 2074521579100940800,
"line_mean": 31.3647798742,
"line_max": 182,
"alpha_frac": 0.6211856171,
"autogenerated": false,
"ratio": 3.3172147001934236,
"config_test": true... |
import sys
import numpy as np
from sklearn import tree, linear_model
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--traning_data', help = 'Training data', required = True)
parser.add_argument('-v', '--testing_data', help = 'Testing data', required = True)
... | {
"repo_name": "slrbl/Intrusion-and-anomaly-detection-with-machine-learning",
"path": "utilities.py",
"copies": "1",
"size": "1253",
"license": "mit",
"hash": -251943514073552100,
"line_mean": 30.325,
"line_max": 88,
"alpha_frac": 0.6105347167,
"autogenerated": false,
"ratio": 3.8085106382978724,
... |
'''A box model is used to decribe the growth of mussels, mainly Mytilus edulis, in a small aquaculture site at Upper South Cove
near Lunenburg Nova Scotia. The ecological interactions in the model include 2 competing herbivores, mussels and zooplankton,
and 2 food sources, phytoplankton and non-plankton seston.
Dowd ... | {
"repo_name": "Diego-Ibarra/aquamod",
"path": "aquamod/bivalves/mussel_Dowd1997.py",
"copies": "1",
"size": "5402",
"license": "mit",
"hash": -4360261048328527000,
"line_mean": 35.5067567568,
"line_max": 133,
"alpha_frac": 0.5429470566,
"autogenerated": false,
"ratio": 3.395348837209302,
"confi... |
""" A box of elements for getting input from a microphone.
"""
from .box import Box
class Mic(Box):
SRC_TEMPLATE = None
def __init__(self, pipeline, name, device):
super(Mic, self).__init__(name, pipeline)
self.add_sequence([
self.SRC_TEMPLATE % {
"name": "src",
... | {
"repo_name": "hodgestar/laghuis",
"path": "laghuis/mic.py",
"copies": "1",
"size": "1174",
"license": "mit",
"hash": 8387268822328807000,
"line_mean": 22.9591836735,
"line_max": 61,
"alpha_frac": 0.5672913118,
"autogenerated": false,
"ratio": 3.6802507836990594,
"config_test": false,
"has_no... |
"""A Broadstreet Ads API wrapper.
This is a thin layer over the python requests library to simplify
access to the Broadstreet Ads API. It provides the functionality:
* Serialization and deserialization of data
* Convert API errors into python exceptions
* Re-trying requests if possible on various errors (... | {
"repo_name": "mpub/broadstreetads",
"path": "broadstreetads.py",
"copies": "1",
"size": "6960",
"license": "mit",
"hash": -3515607055192901000,
"line_mean": 29.9333333333,
"line_max": 87,
"alpha_frac": 0.555316092,
"autogenerated": false,
"ratio": 4.160191273161985,
"config_test": false,
"ha... |
'''a broken pythonic Graph
Nodes and edges, not pretty colors and pitchers.
'''
from . import Point
from .line import Segment
from .exceptions import *
class Node(Point):
'''
XXX missing doc string
'''
pass
class Edge(Segment):
'''
XXX missing doc string
'''
@Segment.A.getter
... | {
"repo_name": "JnyJny/Geometry",
"path": "Geometry/graph.py",
"copies": "1",
"size": "4658",
"license": "mit",
"hash": -7679467674613167000,
"line_mean": 21.180952381,
"line_max": 66,
"alpha_frac": 0.4854014599,
"autogenerated": false,
"ratio": 4.242258652094717,
"config_test": false,
"has_no... |
""" AbsKinGui for setting lines for Kinematic analysis
"""
from __future__ import print_function, absolute_import, division, unicode_literals
# Import libraries
import numpy as np
import warnings
import io
import json
from PyQt4 import QtGui
from PyQt4 import QtCore
# Matplotlib Figure object
from astropy import un... | {
"repo_name": "profxj/xastropy",
"path": "xastropy/xguis/abskingui.py",
"copies": "2",
"size": "8788",
"license": "bsd-3-clause",
"hash": -7628741023865456000,
"line_mean": 31.1904761905,
"line_max": 162,
"alpha_frac": 0.5975193446,
"autogenerated": false,
"ratio": 3.3878180416345414,
"config_t... |
""" Absolute Duality Gap Inverse Optimization
The absolute duality gap method for inverse optimization minimizes the aggregate
duality gap between the primal and dual objective values for each observed
decision. The problem is formulated as follows
.. math::
\min_{\mathbf{c, y},\epsilon_1, \dots, \epsilon_Q} \qu... | {
"repo_name": "rafidrm/invo",
"path": "invo/LinearModels/AbsoluteDualityGap.py",
"copies": "1",
"size": "11291",
"license": "mit",
"hash": 7772254577655969000,
"line_mean": 34.61829653,
"line_max": 153,
"alpha_frac": 0.53635639,
"autogenerated": false,
"ratio": 3.5562204724409447,
"config_test"... |
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = ''
# Absol... | {
"repo_name": "Charnelx/django-split-settings",
"path": "tests/settings/components/static.py",
"copies": "1",
"size": "1251",
"license": "bsd-3-clause",
"hash": 8489234388108962000,
"line_mean": 36.9090909091,
"line_max": 79,
"alpha_frac": 0.7330135891,
"autogenerated": false,
"ratio": 3.74550898... |
# Absolute import needed to import ~/.config/spotipy/settings.py and not ourselves
from __future__ import absolute_import
from copy import copy
import getpass
import glib
import os
import sys
import json
from spotipy import SETTINGS_PATH, SETTINGS_FILE, SETTINGS_JSON_FILE
class SettingsProxy(object):
def __init__(... | {
"repo_name": "ZenHarbinger/spotipy",
"path": "spotipy/utils/settings.py",
"copies": "1",
"size": "2822",
"license": "apache-2.0",
"hash": 8366272326068057000,
"line_mean": 29.3440860215,
"line_max": 82,
"alpha_frac": 0.5737065911,
"autogenerated": false,
"ratio": 3.839455782312925,
"config_tes... |
# absolute_import prevents conflicts between project celery.py file
# and the celery package.
from __future__ import absolute_import
from datetime import datetime
import gzip
import os
from random import randint
from celery import shared_task
from django.conf import settings
from django.core.files import File
@share... | {
"repo_name": "madprime/django_celery_fileprocess_example",
"path": "file_process/tasks.py",
"copies": "1",
"size": "1592",
"license": "apache-2.0",
"hash": -1603496881789344000,
"line_mean": 31.4897959184,
"line_max": 75,
"alpha_frac": 0.6639447236,
"autogenerated": false,
"ratio": 3.83614457831... |
# Absolute import (the default in a future Python release) resolves
# the collections import as the Python standard collections module
# rather than this module of the same name.
from __future__ import absolute_import
from copy import copy
from collections import (Iterable, Mapping, defaultdict)
import functools
import... | {
"repo_name": "ohsu-qin/qiutil",
"path": "qiutil/collections.py",
"copies": "1",
"size": "8275",
"license": "bsd-2-clause",
"hash": -8779240159552352000,
"line_mean": 32.1,
"line_max": 122,
"alpha_frac": 0.64,
"autogenerated": false,
"ratio": 4.375991538868323,
"config_test": false,
"has_no_k... |
# Absolute import (the default in a future Python release) resolves
# the collections import as the standard Python collections module
# rather than the staging collections module.
from __future__ import absolute_import
import os
import re
import glob
from bunch import Bunch
from collections import defaultdict
from ..h... | {
"repo_name": "ohsu-qin/qipipe",
"path": "qipipe/staging/iterator.py",
"copies": "1",
"size": "11711",
"license": "bsd-2-clause",
"hash": -1979158368410731000,
"line_mean": 38.6983050847,
"line_max": 82,
"alpha_frac": 0.5798821621,
"autogenerated": false,
"ratio": 4.15136476426799,
"config_test... |
# Absolute import (the default in a future Python release) resolves
# the logging import as the Python standard logging module rather
# than this module of the same name.
from __future__ import absolute_import
import os
import logging
import logging.config
import yaml
from . import collections as qicollections
LOG_CFG... | {
"repo_name": "ohsu-qin/qiutil",
"path": "qiutil/logging.py",
"copies": "1",
"size": "9672",
"license": "bsd-2-clause",
"hash": 8595559075622866000,
"line_mean": 33.0563380282,
"line_max": 78,
"alpha_frac": 0.6420595533,
"autogenerated": false,
"ratio": 4.364620938628159,
"config_test": true,
... |
## Absolute location where all raw files are
RAWDATA_DIR = '/home/cmb-06/as/skchoudh/dna/Dec_12_2016_Penalva_Musashi1_U251/RNA-Seq'
## Output directory
OUT_DIR = '/home/cmb-06/as/skchoudh/rna/Dec_12_2016_Penalva_Musashi1_U251'
## Absolute location to 're-ribo/scripts' directory
SRC_DIR = '/home/cmb-panasas2/skchoud... | {
"repo_name": "saketkc/ribo-seq-snakemake",
"path": "configs/Dec_12_2016_Penalva_Musashi1_U251.py",
"copies": "1",
"size": "2378",
"license": "bsd-3-clause",
"hash": -6263189815986704000,
"line_mean": 36.746031746,
"line_max": 145,
"alpha_frac": 0.7405382675,
"autogenerated": false,
"ratio": 2.68... |
## Absolute location where all raw files are
RAWDATA_DIR = '/home/cmb-06/as/skchoudh/dna/Dec_12_2017_Penalva_RPS5_RNAseq_and_Riboseq'
## Output directory
OUT_DIR = '/home/cmb-panasas2/skchoudh/rna/Dec_12_2017_Penalva_RPS5_RNAseq_and_Riboseq'
## Absolute location to 're-ribo/scripts' directory
SRC_DIR = '/home/cmb-p... | {
"repo_name": "saketkc/ribo-seq-snakemake",
"path": "configs/Dec_12_2017_Penalva_RPS5.py",
"copies": "1",
"size": "2393",
"license": "bsd-3-clause",
"hash": -9127198814888901000,
"line_mean": 36.9841269841,
"line_max": 145,
"alpha_frac": 0.7417467614,
"autogenerated": false,
"ratio": 2.6857463524... |
"""absolute_massgov_eopss_url
Revision ID: a1b42c9006a7
Revises: 9b30b0fe231a
Create Date: 2017-06-26 00:02:45.998655
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm.session import Session
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from document import Doc... | {
"repo_name": "RagtagOpen/bidwire",
"path": "bidwire/alembic/versions/a1b42c9006a7_absolute_massgov_eopss_url.py",
"copies": "1",
"size": "1311",
"license": "mit",
"hash": -270874387347668770,
"line_mean": 26.3125,
"line_max": 80,
"alpha_frac": 0.6910755149,
"autogenerated": false,
"ratio": 3.197... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.