text stringlengths 0 1.05M | meta dict |
|---|---|
""" All Targets Defined Unit Tests for annotated indicators in Program Page indicator list
Requirements for "True":
- Indicator has target frequency
- if LOP, indicator has lop_target
- if MID_END, indicator has both MID and END periodic_target and also target values for both
- if EVENT, indicator has ... | {
"repo_name": "mercycorps/TolaActivity",
"path": "indicators/tests/program_metric_tests/indicator_unit/all_targets_defined_queries_unit_tests.py",
"copies": "1",
"size": "12923",
"license": "apache-2.0",
"hash": 4851417763569795000,
"line_mean": 43.412371134,
"line_max": 115,
"alpha_frac": 0.69070649... |
"""All Task related methods."""
class Tasks:
"""Tasks for database."""
URL = '/_api/tasks'
def __init__(self, database):
"""Initialise the database."""
self.database = database
def __call__(self):
"""All the active tasks in the db."""
response = self.database.action.... | {
"repo_name": "tariqdaouda/pyArango",
"path": "pyArango/tasks.py",
"copies": "1",
"size": "1754",
"license": "apache-2.0",
"hash": 2775297097048492500,
"line_mean": 29.2413793103,
"line_max": 67,
"alpha_frac": 0.5421892816,
"autogenerated": false,
"ratio": 3.9954441913439633,
"config_test": fal... |
__all__ = ['TasProcessor']
import logging
from indra.statements import Inhibition, Agent, Evidence
from indra.statements.validate import assert_valid_db_refs
from indra.ontology.standardize import standardize_name_db_refs
from indra.databases import hgnc_client, chembl_client, lincs_client
logger = logging.getLogger... | {
"repo_name": "johnbachman/belpy",
"path": "indra/sources/tas/processor.py",
"copies": "1",
"size": "4974",
"license": "mit",
"hash": 6030239107312334000,
"line_mean": 40.1074380165,
"line_max": 79,
"alpha_frac": 0.5526739043,
"autogenerated": false,
"ratio": 3.7230538922155687,
"config_test": ... |
# All-Terrain Pi control code
# By Ian Renton
# http://robots.ianrenton.com/atp
# This is the main control code. It runs a web server to serve the control web
# page, then listens for websocket connections. The data received over the
# websockets is used to drive the motors.
# This script runs the web server on port ... | {
"repo_name": "ianrenton/All-Terrain-Pi",
"path": "home/pi/atp/atp.py",
"copies": "1",
"size": "3800",
"license": "bsd-3-clause",
"hash": 7275963528613456000,
"line_mean": 32.3333333333,
"line_max": 229,
"alpha_frac": 0.7134210526,
"autogenerated": false,
"ratio": 3.47985347985348,
"config_test... |
__all__ = ['TestPost', 'TestDraft', 'TestTag', 'TestPostOperator']
import time
import unittest
from datetime import datetime
from ..helpers import TaoblogTestCase
from taoblog.models.post import Post, PostText, PostOperator, Tag, Draft
from taoblog.models import ModelError
class TestTag(TaoblogTestCase):
def se... | {
"repo_name": "ptpt/taoblog",
"path": "tests/models/post.py",
"copies": "1",
"size": "8547",
"license": "mit",
"hash": -2229711651081767000,
"line_mean": 38.7534883721,
"line_max": 114,
"alpha_frac": 0.5883935884,
"autogenerated": false,
"ratio": 3.6124260355029585,
"config_test": true,
"has_... |
"""All tests for views."""
from django.http import HttpRequest
from django.test import TestCase
from django.template.loader import render_to_string
from django.contrib.messages.storage.fallback import FallbackStorage
from django.contrib.auth.models import AnonymousUser
from django.contrib.sites.shortcuts import get_cu... | {
"repo_name": "ExCiteS/geokey-extension-boilerplate",
"path": "geokey_extension/tests/test_views.py",
"copies": "1",
"size": "1899",
"license": "mit",
"hash": -3011853210522531300,
"line_mean": 29.6290322581,
"line_max": 72,
"alpha_frac": 0.6313849394,
"autogenerated": false,
"ratio": 4.286681715... |
__all__ = ['TestUser', 'TestUserOperator']
import unittest
from ..helpers import TaoblogTestCase
from taoblog.models.user import *
from taoblog.models import ModelError
class TestUser(TaoblogTestCase):
def setUp(self):
self.db_setup()
def tearDown(self):
self.db_teardown()
def test_nam... | {
"repo_name": "ptpt/taoblog",
"path": "tests/models/user.py",
"copies": "1",
"size": "2549",
"license": "mit",
"hash": 5376371276195707000,
"line_mean": 31.2658227848,
"line_max": 68,
"alpha_frac": 0.4464495881,
"autogenerated": false,
"ratio": 4.818525519848771,
"config_test": true,
"has_no_... |
# all the C decls for pyvips
# we keep these together to make switching between ABI and API modes simpler
# we have to pass in the libvips version, since it can come from either
# pkg-config in compile.py (in API mode) or libvips itself in __init__.py
# (in ABI mode)
import sys
def _at_least(features, x, y):
r... | {
"repo_name": "jcupitt/pyvips",
"path": "pyvips/decls.py",
"copies": "1",
"size": "12388",
"license": "mit",
"hash": 2718728523199166000,
"line_mean": 30.7641025641,
"line_max": 78,
"alpha_frac": 0.5754762674,
"autogenerated": false,
"ratio": 3.7178871548619448,
"config_test": false,
"has_no_... |
""" All the class models for the objects we need to represent the games """
from enum import Enum, auto
from logbook import Logger
from . helpers import get_datetime
class State(Enum):
""" Enumerate the state a game can be in """
STARTED = auto()
STOPPED = auto()
CRASHED = auto()
ABORTED = auto()
... | {
"repo_name": "gylle/uhc_parser",
"path": "parser/models.py",
"copies": "1",
"size": "7385",
"license": "mit",
"hash": 7915668903009639000,
"line_mean": 36.1105527638,
"line_max": 90,
"alpha_frac": 0.5577522004,
"autogenerated": false,
"ratio": 4.172316384180791,
"config_test": false,
"has_no... |
# All the code needed to implement pattern masking
# only a subset of the clearest colors are used
from ledlib.helpers import debugprint, verboseprint
from ledlib import colordefs
# A mask is a list of colors and transparencies
# Simple Colors:
# kw = black, white
# roygbiv = basic colors # ... | {
"repo_name": "bbulkow/MagnusFlora",
"path": "led/ledlib/masking.py",
"copies": "1",
"size": "3345",
"license": "mit",
"hash": -3973125859962543600,
"line_mean": 36.1666666667,
"line_max": 131,
"alpha_frac": 0.5491778774,
"autogenerated": false,
"ratio": 3.4237461617195497,
"config_test": false... |
# All the code samples below have one parameter, which is where the protection level name
# for that storage type will be inserted, e.g. NSDataWritingFileProtectionCompleteUnlessOpen
CODE_SAMPLE_CORE_DATA = """
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
if (persistentStoreCoordinator_ != nil) {
... | {
"repo_name": "erikr/howtostoreiosdata",
"path": "howtostoreiosdata/wizard/code_samples.py",
"copies": "1",
"size": "1995",
"license": "mit",
"hash": -554655422729914940,
"line_mean": 31.1774193548,
"line_max": 98,
"alpha_frac": 0.7047619048,
"autogenerated": false,
"ratio": 3.8737864077669903,
... |
# all the constants
import numpy as np
import re
from os import listdir
from collections import defaultdict
RET='-RET-'
TOP='-TOP-' # top relation for the overall bracket
LBR='('
RBR=')'
SURF='-SURF-' # surface form
CONST='-CONST-'
VERB='-VERB-'
END='-END-'
UNK='UNK' # unknown words
date_relations = set(['time', 'yea... | {
"repo_name": "masterkeywikz/seq2graph",
"path": "amr2seq/data_prep/constants.py",
"copies": "1",
"size": "3153",
"license": "mit",
"hash": -4690781043471946000,
"line_mean": 29.9117647059,
"line_max": 128,
"alpha_frac": 0.5214081827,
"autogenerated": false,
"ratio": 3.383047210300429,
"config_... |
# all the constants
import numpy as np
import re
from os import listdir
from collections import defaultdict
RET='-RET-'
TOP='-TOP-' # top relation for the overall bracket
LBR='('
RBR=')'
SURF='-SURF-' # surface form
CONST='-CONST-'
VERB='-VERB-'
END='-END-'
UNK='UNK' # unknown words
WORD2VEC_EMBEDDING_PATH='/home/j/... | {
"repo_name": "masterkeywikz/seq2graph",
"path": "amr2seq/constants.py",
"copies": "1",
"size": "4178",
"license": "mit",
"hash": 8559728821032438000,
"line_mean": 30.4210526316,
"line_max": 95,
"alpha_frac": 0.5306366683,
"autogenerated": false,
"ratio": 3.1366366366366365,
"config_test": fals... |
"""All the database related entities are in this module."""
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import text
import numpy as np
import math
from scipy.stats import lognorm
from sqlalchemy.ext.hybrid import hybrid_property
db = SQLAlchemy()
class Ethnicity(db.Model):
"""Ethnicity Model. We wil... | {
"repo_name": "vishalbedi/CollegeScorecard",
"path": "backend/flask_app/models.py",
"copies": "1",
"size": "7158",
"license": "mit",
"hash": 2137919662898776800,
"line_mean": 29.2025316456,
"line_max": 136,
"alpha_frac": 0.6422184968,
"autogenerated": false,
"ratio": 2.7573189522342063,
"config... |
"""All the database related entities are in this module."""
from flask_security import RoleMixin, SQLAlchemyUserDatastore, UserMixin
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Base(db.Model):
"""Base class for all the tables.
Consists of two default columns `created_at` and `modified_... | {
"repo_name": "stevenaubertin/angular2-flask",
"path": "backend/flask_app/models.py",
"copies": "1",
"size": "2313",
"license": "mit",
"hash": 376823964820684540,
"line_mean": 32.5217391304,
"line_max": 79,
"alpha_frac": 0.598357112,
"autogenerated": false,
"ratio": 3.8358208955223883,
"config_... |
"""All the data-importing functions are listed here for various colleges.
"""
import re
import urllib2
import dateutil.parser
import logging
import logging.handlers
import sys
import datetime
import rpi_calendars
from contextlib import closing
from icalendar import Calendar, Event
import pytz
from django.core.mail im... | {
"repo_name": "JGrippo/YACS",
"path": "courses/bridge/rpi.py",
"copies": "2",
"size": "21713",
"license": "mit",
"hash": 2860979662781118500,
"line_mean": 40.1231060606,
"line_max": 162,
"alpha_frac": 0.5779486943,
"autogenerated": false,
"ratio": 3.8919161139989247,
"config_test": true,
"has... |
"""All the db operations for storing and retrieving boog data"""
from collections import Counter
import itertools
import operator
from copy import copy
import os.path
from lib.sort_data import sorted_series, sorted_titles, sorted_filters
from lib.sort_data import sorted_apg
from lib.variables import VARIABLES
import l... | {
"repo_name": "JB26/Bibthek",
"path": "lib/db_books.py",
"copies": "1",
"size": "21873",
"license": "mit",
"hash": 2673404510419482000,
"line_mean": 36.5824742268,
"line_max": 79,
"alpha_frac": 0.5084350569,
"autogenerated": false,
"ratio": 3.592215470520611,
"config_test": false,
"has_no_key... |
# All the default / common settings to be here
"""
Django settings for linkresting project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside t... | {
"repo_name": "rajeshvaya/linkresting.com",
"path": "src/linkresting/linkresting/settings/defaults.py",
"copies": "1",
"size": "3027",
"license": "mit",
"hash": -4872468172410754000,
"line_mean": 24.225,
"line_max": 92,
"alpha_frac": 0.6987115956,
"autogenerated": false,
"ratio": 3.22021276595744... |
# All the imports necessary to run this game:
import random
import os
#Global variables used in our program
cards = [(1,'2C'),(2,'3C'),(3,'4C'),(4,'5C'),(5,'6C'),(6,'7C'),(7,'8C'),
(8,'9C'),(9,'TC'),(10,'JC'),(11,'QC'),(12,'KC'),(13,'AC'),
(14,'2D'),(15,'3D'),(16,'4D'),(17,'5D'),(18,'6D'),(19,'7D'),(20,'8D'),
... | {
"repo_name": "CraigglesO/Hearts-Trick-Game",
"path": "Hearts_trick_card_game.py",
"copies": "1",
"size": "20904",
"license": "mit",
"hash": 5142168173791110000,
"line_mean": 31.1615384615,
"line_max": 154,
"alpha_frac": 0.4899540758,
"autogenerated": false,
"ratio": 2.6830958798613787,
"config... |
# all the imports
from __future__ import with_statement
from sqlite3 import dbapi2 as sqlite3
from contextlib import closing
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
import string, random, socket, logging, json
from tasks import *
# create our little application :)... | {
"repo_name": "vincentt143/meet-street",
"path": "meet-street.py",
"copies": "1",
"size": "1917",
"license": "apache-2.0",
"hash": 1207380178441324000,
"line_mean": 33.2321428571,
"line_max": 105,
"alpha_frac": 0.676056338,
"autogenerated": false,
"ratio": 3.8035714285714284,
"config_test": fal... |
# all the imports
import json
import sqlite3
from flask import Flask, request, session, g, redirect,url_for, \
abort, render_template, flash, Response
from contextlib import closing
import re
# configuration
# create our little application :)
app = Flask(__name__)
# app.config.from_object(__name__)
app.config['FREE... | {
"repo_name": "okfde/haushalt-kreis-offenbach",
"path": "of_hh.py",
"copies": "1",
"size": "8213",
"license": "mit",
"hash": 3186453904418565600,
"line_mean": 40.6903553299,
"line_max": 444,
"alpha_frac": 0.6560331182,
"autogenerated": false,
"ratio": 2.7312936481543066,
"config_test": true,
... |
# all the imports
import logging
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
from BT4221 import *
app = Flask(__name__) # create the application instance :)
app.config.from_object(__name__) # load config from this file , flaskr.py
# Lo... | {
"repo_name": "chloeyangu/BigDataAnalytics",
"path": "Terrorisks/flaskr/flaskr/flaskr.py",
"copies": "1",
"size": "2304",
"license": "mit",
"hash": -4723873931551625000,
"line_mean": 33.3880597015,
"line_max": 117,
"alpha_frac": 0.6697048611,
"autogenerated": false,
"ratio": 3.496206373292868,
... |
# all the imports
import os,binascii
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash, Blueprint, stream_with_context, Response
from flaskext.mysql import MySQL
from config import config
from werkzeug.utils import secure_filename
from flask import send_from_directory
im... | {
"repo_name": "sudheesh001/Cove-Services",
"path": "server.py",
"copies": "1",
"size": "2533",
"license": "mit",
"hash": 3793120318097310700,
"line_mean": 25.3958333333,
"line_max": 97,
"alpha_frac": 0.7031188314,
"autogenerated": false,
"ratio": 3.0890243902439023,
"config_test": false,
"has... |
# all the imports
import os
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash, jsonify
import base64
import cv2
import numpy as np
import ctypes
import time
import re
import httplib, urllib
import json
from review import wrap_Doreview, wrap_ReadVocabulary, wrap_ReadTf... | {
"repo_name": "yuzhao12/MindCamera",
"path": "flaskr2/flaskr.py",
"copies": "1",
"size": "14702",
"license": "mit",
"hash": 3294035222193640400,
"line_mean": 31.170678337,
"line_max": 143,
"alpha_frac": 0.6755543463,
"autogenerated": false,
"ratio": 2.645672125247436,
"config_test": false,
"h... |
# all the imports
import os
import re
import sys
import glob
import time
import uuid
import atexit
import requests
import subprocess
import pandas as pd
import seaborn as sns
import pybtex.database
from datetime import datetime
from contextlib import closing
from numpy import array, random
from os.path import abspath, ... | {
"repo_name": "bdecost/uhcsdb",
"path": "uhcsdb/uhcsdb.py",
"copies": "1",
"size": "6267",
"license": "mit",
"hash": -786510791594927500,
"line_mean": 31.8115183246,
"line_max": 99,
"alpha_frac": 0.6743258337,
"autogenerated": false,
"ratio": 3.4434065934065936,
"config_test": true,
"has_no_k... |
# all the imports
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
app = Flask(__name__) # create the application instance :)
app.config.from_object(__name__) # load config from this file , flaskr.py
# Load default config and override confi... | {
"repo_name": "sobeckley/Wallpaper_Sorter",
"path": "flaskr/flaskr/flaskr.py",
"copies": "1",
"size": "2765",
"license": "mit",
"hash": 6644359817448868000,
"line_mean": 29.0543478261,
"line_max": 73,
"alpha_frac": 0.6394213382,
"autogenerated": false,
"ratio": 3.638157894736842,
"config_test":... |
# all the imports
import os
import sqlite3
import datetime
from flask import Flask, request, session, g, redirect, url_for, abort, \
render_template, flash
from flask.ext.babel import Babel, lazy_gettext
from passlib.apps import custom_app_context as pwd_context
from config import LANGUAGES
... | {
"repo_name": "Bytespeicher/KANT",
"path": "src/kant.py",
"copies": "1",
"size": "8385",
"license": "mit",
"hash": 9074012061975698000,
"line_mean": 28.628975265,
"line_max": 90,
"alpha_frac": 0.5749552773,
"autogenerated": false,
"ratio": 3.6142241379310347,
"config_test": false,
"has_no_key... |
# all the imports
import os
import sqlite3
import pandas as pd
from flask import Flask, g, render_template
from contextlib import closing
# create our little application :)
app = Flask(__name__)
# configuration
app.config.update(dict(
DATABASE=os.path.join(app.root_path, 'flaskr.db'),
))
def connect_db():
re... | {
"repo_name": "johnsliao/D3.js-flask",
"path": "flaskr/flaskr.py",
"copies": "1",
"size": "1128",
"license": "mit",
"hash": 3398159330241524000,
"line_mean": 24.6590909091,
"line_max": 83,
"alpha_frac": 0.655141844,
"autogenerated": false,
"ratio": 3.40785498489426,
"config_test": false,
"has... |
#all the imports
import sqlite3
#for a heavier-duty app, we could use sqlalchemy
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
import local_settings
import re
from datetime import date, datetime
#Link to config settings
ALVA_SETTINGS... | {
"repo_name": "tommeagher/alva",
"path": "v.5/alva.py",
"copies": "1",
"size": "4375",
"license": "mit",
"hash": 1804331070691387100,
"line_mean": 32.9147286822,
"line_max": 316,
"alpha_frac": 0.648,
"autogenerated": false,
"ratio": 3.5,
"config_test": false,
"has_no_keywords": false,
"few_... |
# all the imports
import sqlite3
from contextlib import closing
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
# configuration
DATABASE = '/tmp/wekndpln.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# create our little ap... | {
"repo_name": "Pinkii-/weekendplan",
"path": "wekndpln.py",
"copies": "1",
"size": "2507",
"license": "mit",
"hash": -7258128797942725000,
"line_mean": 27.5,
"line_max": 79,
"alpha_frac": 0.6039090546,
"autogenerated": false,
"ratio": 3.6228323699421967,
"config_test": false,
"has_no_keywords... |
# all the imports
import sqlite3
from flask import Flask, request, g, redirect, render_template
from contextlib import closing
app = Flask(__name__)
@app.route('/')
@app.route('/index')
def front_page():
return render_template('index.html')
@app.route('/about')
def about_page():
return render_template('abou... | {
"repo_name": "daliu/Tuber",
"path": "flaskr.py",
"copies": "1",
"size": "1935",
"license": "mit",
"hash": -1883523486637747700,
"line_mean": 21,
"line_max": 63,
"alpha_frac": 0.6516795866,
"autogenerated": false,
"ratio": 3.359375,
"config_test": false,
"has_no_keywords": false,
"few_assig... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, jsonify
from contextlib import closing
# configuration
DATABASE = '/tmp/demo.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# creating the app
app ... | {
"repo_name": "Blackmagicbox/Microblog_app_in_flask",
"path": "microblog.py",
"copies": "1",
"size": "2101",
"license": "mit",
"hash": -1801190383246015000,
"line_mean": 24.6219512195,
"line_max": 110,
"alpha_frac": 0.626368396,
"autogenerated": false,
"ratio": 3.5914529914529916,
"config_test"... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
from contextlib import closing
# configuration
DATABASE = '/tmp/flaskr.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# create our little application... | {
"repo_name": "radiumweilei/flaskr",
"path": "flaskr.py",
"copies": "1",
"size": "2200",
"license": "apache-2.0",
"hash": 377923041844347300,
"line_mean": 25.8414634146,
"line_max": 94,
"alpha_frac": 0.6290909091,
"autogenerated": false,
"ratio": 3.648424543946932,
"config_test": false,
"has_... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
from contextlib import closing
#configuration
DATABASE = './flaskr.db'
DEBUG = True
SECRET_KEY = 'dev key'
USERNAME = 'admin'
PASSWORD = 'admin'
# create our little application :)
app = Fla... | {
"repo_name": "vmseba/flaskr",
"path": "flaskr.py",
"copies": "1",
"size": "2130",
"license": "mit",
"hash": 5327306830372261000,
"line_mean": 26.6623376623,
"line_max": 113,
"alpha_frac": 0.6305164319,
"autogenerated": false,
"ratio": 3.5678391959798996,
"config_test": false,
"has_no_keyword... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
#configuration
DATABASE = '/tmp/flasr.db'
DEBUG = True
SECRET_KEY= 'development key'
USERNAME = 'admin'
PASSWORD= 'default'
# create our little applicat... | {
"repo_name": "mhcrnl/PmwTkEx",
"path": "pywebframework/pyflask/flaskr/faskr.py",
"copies": "1",
"size": "2144",
"license": "apache-2.0",
"hash": 9151373654720099000,
"line_mean": 27.5866666667,
"line_max": 74,
"alpha_frac": 0.6263992537,
"autogenerated": false,
"ratio": 3.591289782244556,
"con... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
# configuration
DATABASE = '/tmp/flaskr.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# create our little app... | {
"repo_name": "michaelsnook/flaskr-heroku",
"path": "flaskr.py",
"copies": "1",
"size": "2209",
"license": "cc0-1.0",
"hash": 5348196205348368000,
"line_mean": 26.9620253165,
"line_max": 74,
"alpha_frac": 0.6278859212,
"autogenerated": false,
"ratio": 3.574433656957929,
"config_test": true,
"... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
# configuration
DATABASE = 'app.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# create our little application
app = Flask(__name__)
app.confi... | {
"repo_name": "sergeimoiseev/egrixcalc",
"path": "old/app.py",
"copies": "2",
"size": "2164",
"license": "mit",
"hash": 8504746313751289000,
"line_mean": 27.8666666667,
"line_max": 74,
"alpha_frac": 0.6284658041,
"autogenerated": false,
"ratio": 3.6187290969899664,
"config_test": false,
"has_... |
# all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash, Request, Response
from contextlib import closing
from datetime import datetime
# configuration
DATABASE = '/tmp/flaskr.db'
DEBUG = False
SECRET_KEY = 'development key'
USERNAME = 'adm... | {
"repo_name": "Ruin0x11/elona_server",
"path": "elona.py",
"copies": "1",
"size": "4933",
"license": "bsd-3-clause",
"hash": 7117966210903689000,
"line_mean": 32,
"line_max": 175,
"alpha_frac": 0.5683364255,
"autogenerated": false,
"ratio": 3.152046783625731,
"config_test": false,
"has_no_key... |
# all the imports
import sqlite3
from os.path import dirname, abspath
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
# configuration
DATABASE = abspath(dirname(__file__)) + '/rsvp.db'
DEBUG = True
SECRET_KEY = 'Hmm. Should autogen this, right?'
USERNAME = 'admin'
... | {
"repo_name": "simeonf/meetup-checkin",
"path": "rsvp/rsvp.py",
"copies": "1",
"size": "1962",
"license": "apache-2.0",
"hash": -5175704498818030000,
"line_mean": 29.65625,
"line_max": 101,
"alpha_frac": 0.618756371,
"autogenerated": false,
"ratio": 3.3769363166953528,
"config_test": false,
"... |
# all the imports
import sqlite3
import time
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
# for db initiation
from contextlib import closing
# configuration
DATABASE = '/tmp/portal.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'de... | {
"repo_name": "rakeshsingh/trend-in",
"path": "portal/portal.py",
"copies": "1",
"size": "2718",
"license": "mit",
"hash": 8277177270227273000,
"line_mean": 25.1346153846,
"line_max": 140,
"alpha_frac": 0.6309786608,
"autogenerated": false,
"ratio": 3.672972972972973,
"config_test": false,
"h... |
# all the imports
import sqlite3
from contextlib import closing
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
# configuration
DATABASE = '/tmp/flaskr.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
# create application
a... | {
"repo_name": "drincruz/flask-tutorial-flaskr",
"path": "flaskr.py",
"copies": "1",
"size": "2220",
"license": "mit",
"hash": -6150076342959416000,
"line_mean": 25.1176470588,
"line_max": 74,
"alpha_frac": 0.6189189189,
"autogenerated": false,
"ratio": 3.6097560975609757,
"config_test": false,
... |
# all the imports
import sqlite3,re,json,ast
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from contextlib import closing
# configuration
DATABASE = '/home/flavorshare/mysite/flavorshare.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD =... | {
"repo_name": "anshikam/FlavorShare",
"path": "app.py",
"copies": "1",
"size": "30292",
"license": "mit",
"hash": 2460550007392793000,
"line_mean": 42.1524216524,
"line_max": 457,
"alpha_frac": 0.6284497557,
"autogenerated": false,
"ratio": 3.4442296759522457,
"config_test": false,
"has_no_ke... |
# all the imports
import sys
import json
import socket
import errno
from flask import session, redirect, url_for, render_template, flash, request, jsonify
from flask.ext.login import login_required, login_user, logout_user, current_user
from ops import app, facebook, twitter, mongo
from auth import User
import time
fro... | {
"repo_name": "nickpope/commpute",
"path": "commpute.py",
"copies": "1",
"size": "13917",
"license": "apache-2.0",
"hash": 7902317899134936000,
"line_mean": 29.8580931264,
"line_max": 106,
"alpha_frac": 0.6053747216,
"autogenerated": false,
"ratio": 3.659479358401262,
"config_test": false,
"h... |
#all the imports
from GenSched import Schedule, Theater_Room
from RegularSchedule import RegularSchedule
from DontWantSched import DontWantSchedule
from SpecGenreSched import SpecGenreSchedule
from SpecTimeSched import SpecTimeSchedule
#Make initial database
s = Schedule([("The Little Mermaid", "Family"), ("Saw 3", ... | {
"repo_name": "askii93/Strategy-Movies",
"path": "overall.py",
"copies": "1",
"size": "2826",
"license": "apache-2.0",
"hash": 5339533688148490000,
"line_mean": 41.1940298507,
"line_max": 251,
"alpha_frac": 0.6733899505,
"autogenerated": false,
"ratio": 2.9345794392523366,
"config_test": false,... |
# all the imports
import os
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, request, jsonify
from flask_mail import Message, Mail
app = Flask(__name__) # create the application instance :)
app.config.from_object(__name__) # load config from this file ... | {
"repo_name": "loutwo17/mySite",
"path": "alex/alex/alex.py",
"copies": "1",
"size": "2650",
"license": "mit",
"hash": 1001446993668458500,
"line_mean": 25.0408163265,
"line_max": 135,
"alpha_frac": 0.6758490566,
"autogenerated": false,
"ratio": 3.0355097365406642,
"config_test": true,
"has_n... |
"""All the index classes.
Currentlly:
PKIndex: Primary Key Index
TreeIndex: Tree based index using a AVL tree for high cardinality fields
BitmapIndex: Bitmap index for low cardinality fields
vptreeIndex: for similarity search
"""
# from .persistentdb import FILES_DIR
# from .baseclasses import BaseInd... | {
"repo_name": "cs207-project/TimeSeries",
"path": "tsdb/utils_indices.py",
"copies": "1",
"size": "14583",
"license": "mit",
"hash": -9030452057666894000,
"line_mean": 32.5195402299,
"line_max": 114,
"alpha_frac": 0.5710856594,
"autogenerated": false,
"ratio": 3.9429421308815575,
"config_test":... |
# All the individual config players have their own tests, but this tests the
# generic ConfigPlayer functionality
from collections import namedtuple
from mpf.assets.show import Show
from mpf.config_players.device_config_player import DeviceConfigPlayer
from mpf.tests.MpfTestCase import MpfTestCase
from mpf.core.config... | {
"repo_name": "missionpinball/mpf",
"path": "mpf/tests/test_ConfigPlayers.py",
"copies": "1",
"size": "4919",
"license": "mit",
"hash": 9003929969340159000,
"line_mean": 33.1597222222,
"line_max": 104,
"alpha_frac": 0.632445619,
"autogenerated": false,
"ratio": 3.7068575734740015,
"config_test"... |
"""All the MapReduce magic."""
from collections import defaultdict, deque
import itertools as it
from multiprocessing.dummy import Pool as ThreadPool
from multiprocessing.pool import Pool
import operator as op
from tinymr import _compat
from tinymr.errors import ClosedTaskError, KeyCountError
from tinymr.tools impor... | {
"repo_name": "geowurster/tinymr",
"path": "tinymr/_base.py",
"copies": "2",
"size": "6202",
"license": "bsd-3-clause",
"hash": 8822808646637030000,
"line_mean": 31.3020833333,
"line_max": 78,
"alpha_frac": 0.5744920993,
"autogenerated": false,
"ratio": 4.199052132701421,
"config_test": false,
... |
"""All the models used by DrawWrite."""
from django.db import models
from django.utils import timezone
class Game(models.Model):
"""
Games have a number of players, a unique name, and a
created time.
"""
name = models.CharField('Name', max_length=50)
num_players = models.SmallIntegerField('Num... | {
"repo_name": "RMMoreton/drawwrite",
"path": "drawwritesite/drawwrite/models.py",
"copies": "1",
"size": "2278",
"license": "mit",
"hash": 1853833444171951400,
"line_mean": 33.5151515152,
"line_max": 82,
"alpha_frac": 0.6848112379,
"autogenerated": false,
"ratio": 4.1343012704174225,
"config_te... |
#all the stuff related to Bot₵oin
import requests
import time
import sys
import datetime
import csv
import random
import re
import json
import traceback
import os
import telegram
from pydblite import Base #The PyDbLite stuff
import builtins
from . import atbSendFunctions
from . import atbMiscFunction... | {
"repo_name": "agincel/AdamTestBot",
"path": "src/atbBTC.py",
"copies": "1",
"size": "37331",
"license": "mit",
"hash": -3603995628688494000,
"line_mean": 53.3516320475,
"line_max": 340,
"alpha_frac": 0.5044093602,
"autogenerated": false,
"ratio": 3.936167967925723,
"config_test": true,
"has_... |
"""all the things that we need"""
from functools import partial
import itertools
from random import random
from kivy.clock import Clock
from kivy.properties import (BooleanProperty, ListProperty, NumericProperty,
ReferenceListProperty, StringProperty)
from kivy.vector import Vector
from k... | {
"repo_name": "wilsaj/flingy",
"path": "widgets.py",
"copies": "1",
"size": "8007",
"license": "bsd-3-clause",
"hash": -2543282086618853400,
"line_mean": 34.2731277533,
"line_max": 103,
"alpha_frac": 0.5597602098,
"autogenerated": false,
"ratio": 3.5010931351114998,
"config_test": false,
"has... |
# All the times here are in hours
# These are the times for non-pgo
import requests
import logging
from mozci.mozci import query_repo_url_from_buildername, query_repo_name_from_buildername, \
trigger_all_talos_jobs, trigger_range, set_query_source
from mozci.query_jobs import TreeherderApi
from mozci.platforms ... | {
"repo_name": "jmaher/alert_manager",
"path": "alerts.py",
"copies": "1",
"size": "15324",
"license": "mpl-2.0",
"hash": 3666538438271824400,
"line_mean": 47.4936708861,
"line_max": 134,
"alpha_frac": 0.6030409815,
"autogenerated": false,
"ratio": 3.9761286974571872,
"config_test": true,
"has... |
"""All the views for DrawWrite."""
# Imports {{{
import logging
from base64 import b64decode
from itertools import zip_longest
from django.core.files.base import ContentFile
from django.db import IntegrityError
from django.http import HttpResponseBadRequest, HttpResponseNotAllowed, JsonResponse
from django.shortcut... | {
"repo_name": "RMMoreton/drawwrite",
"path": "drawwritesite/drawwrite/views.py",
"copies": "1",
"size": "27825",
"license": "mit",
"hash": 8370612826824721000,
"line_mean": 36.2489959839,
"line_max": 96,
"alpha_frac": 0.6201617251,
"autogenerated": false,
"ratio": 3.9648047876888004,
"config_te... |
"""All the weapon pickups.
Weapons are unusual, they don't directly specify the models.
Instead it's specified in the weapon script.
"""
from srctools._class_resources import *
res('weapon_357')
# res('weapon_adrenaline_spawn')
# res('weapon_ak47')
res('weapon_alyxgun')
# res('weapon_ammo_spawn')
res('weapon_annabell... | {
"repo_name": "TeamSpen210/srctools",
"path": "srctools/_class_resources/weapons.py",
"copies": "1",
"size": "4838",
"license": "unlicense",
"hash": -6384353297203735000,
"line_mean": 28.5,
"line_max": 60,
"alpha_frac": 0.6903679206,
"autogenerated": false,
"ratio": 2.689271817676487,
"config_t... |
"""all things PeerAssets protocol."""
from enum import Enum
from operator import itemgetter
from typing import List, Optional, Generator, cast, Callable
from pypeerassets.kutil import Kutil
from pypeerassets.paproto_pb2 import DeckSpawn as deckspawnproto
from pypeerassets.paproto_pb2 import CardTransfer as cardtransf... | {
"repo_name": "PeerAssets/pypeerassets",
"path": "pypeerassets/protocol.py",
"copies": "1",
"size": "15807",
"license": "bsd-3-clause",
"hash": -8201133129104425000,
"line_mean": 32.7756410256,
"line_max": 144,
"alpha_frac": 0.5770861011,
"autogenerated": false,
"ratio": 4.152088258471237,
"con... |
"""all things PeerAssets protocol."""
import warnings
from .kutil import Kutil
from . import paproto
from .pautils import amount_to_exponent, issue_mode_to_enum
from operator import itemgetter
class Deck:
def __init__(self, name: str, number_of_decimals: int, issue_mode: str,
network: str, produ... | {
"repo_name": "backpacker69/pypeerassets",
"path": "pypeerassets/protocol.py",
"copies": "1",
"size": "8780",
"license": "bsd-3-clause",
"hash": 4814869228457875000,
"line_mean": 32.6398467433,
"line_max": 102,
"alpha_frac": 0.5908883827,
"autogenerated": false,
"ratio": 4.044219253800092,
"con... |
# All this craziness is so that we can allow the classes in nested_admin.formsets
# to be importable directly from this module, e.g.:
#
# from nested_admin import NestedInlineFormSet
#
# without running afoul of the strict import order required by Django 1.9+.
# This implementation is shamelessly stolen from werkze... | {
"repo_name": "sbussetti/django-nested-admin",
"path": "nested_admin/__init__.py",
"copies": "1",
"size": "4049",
"license": "bsd-2-clause",
"hash": 3653661570130393600,
"line_mean": 35.4774774775,
"line_max": 81,
"alpha_frac": 0.6243516918,
"autogenerated": false,
"ratio": 4.23979057591623,
"c... |
## All this functions were grenerated to dynamically print output.
import sys
import numpy as np
import time
import pylab as plt
class Printer():
"""
Print things to stdout on one line dynamically
"""
def __init__(self):
self.tic=time.clock()
sys.stdout.flush()
self.data=[]
... | {
"repo_name": "Josue-Martinez-Moreno/trackeddy",
"path": "trackeddy/printfunc.py",
"copies": "1",
"size": "2353",
"license": "mit",
"hash": 7913191188884385000,
"line_mean": 37.5901639344,
"line_max": 200,
"alpha_frac": 0.5303867403,
"autogenerated": false,
"ratio": 3.4653902798232696,
"config_... |
# all this shamelessly ripped off from flask-security plugin cause it was well done over there
import base64
import hashlib
import hmac
from passlib.context import CryptContext
class PasswordUtils(object):
def __init__(self, config):
self.salt = config.get('SECURITY_PASSWORD_SALT', None)
self.pw... | {
"repo_name": "LandRegistry/lr-utils",
"path": "lrutils/password/password_utils.py",
"copies": "1",
"size": "1329",
"license": "mit",
"hash": 8065265410896025000,
"line_mean": 29.9069767442,
"line_max": 97,
"alpha_frac": 0.6772009029,
"autogenerated": false,
"ratio": 3.943620178041543,
"config_... |
__all__ = ["ThreadLocal", "Registry", "WeakValuedRegistry", "SyncDict", "encoded_path", "verify_directory"]
try:
import thread as _thread
import threading as _threading
except ImportError:
import dummy_thread as _thread
import dummy_threading as _threading
from datetime import datetime, timedelta
imp... | {
"repo_name": "santisiri/popego",
"path": "envs/ALPHA-POPEGO/lib/python2.5/site-packages/Beaker-0.7.5-py2.5.egg/beaker/util.py",
"copies": "1",
"size": "7582",
"license": "bsd-3-clause",
"hash": -4407470462856582000,
"line_mean": 32.1091703057,
"line_max": 126,
"alpha_frac": 0.5859931417,
"autogene... |
__all__ = ["ThreadWrap", "ExecuteGetResponse"]
import threading
import subprocess
import time
import Queue
import sys
import re
from browser.status import *
from log import VLOG
""" wrapper of basic thread where commands enqueued should run on same thread with
same session id for avoiding race condition.
since it... | {
"repo_name": "PeterWangIntel/crosswalk-webdriver-python",
"path": "base/thread_wrap.py",
"copies": "1",
"size": "3865",
"license": "bsd-3-clause",
"hash": -4655848634263552000,
"line_mean": 34.787037037,
"line_max": 105,
"alpha_frac": 0.6698576973,
"autogenerated": false,
"ratio": 3.896169354838... |
__all__ = ['threshold_adaptive',
'threshold_otsu',
'threshold_yen',
'threshold_isodata']
import numpy as np
import scipy.ndimage
from skimage.exposure import histogram
def threshold_adaptive(image, block_size, method='gaussian', offset=0,
mode='reflect', param=... | {
"repo_name": "SamHames/scikit-image",
"path": "skimage/filter/thresholding.py",
"copies": "1",
"size": "11634",
"license": "bsd-3-clause",
"hash": 1078266607003098500,
"line_mean": 37.78,
"line_max": 126,
"alpha_frac": 0.6320268179,
"autogenerated": false,
"ratio": 3.973360655737705,
"config_t... |
__all__ = ['threshold_adaptive',
'threshold_otsu',
'threshold_yen',
'threshold_isodata',
'threshold_li', ]
import numpy as np
from scipy import ndimage as ndi
from ..exposure import histogram
from .._shared.utils import assert_nD
import warnings
def threshold_adaptive(imag... | {
"repo_name": "ClinicalGraphics/scikit-image",
"path": "skimage/filters/thresholding.py",
"copies": "1",
"size": "14107",
"license": "bsd-3-clause",
"hash": 6337271314505982000,
"line_mean": 36.3201058201,
"line_max": 126,
"alpha_frac": 0.6339405969,
"autogenerated": false,
"ratio": 3.90883901357... |
__all__ = ['threshold_adaptive', 'threshold_otsu', 'threshold_yen']
import numpy as np
import scipy.ndimage
from skimage.exposure import histogram
def threshold_adaptive(image, block_size, method='gaussian', offset=0,
mode='reflect', param=None):
"""Applies an adaptive threshold to an arra... | {
"repo_name": "almarklein/scikit-image",
"path": "skimage/filter/thresholding.py",
"copies": "1",
"size": "7022",
"license": "bsd-3-clause",
"hash": 2678145550383971300,
"line_mean": 36.752688172,
"line_max": 126,
"alpha_frac": 0.6152093421,
"autogenerated": false,
"ratio": 3.9897727272727272,
... |
__all__ = ['ThresholdingFeatClass']
import logging
import numpy as np
from .base import BaseFeatClass
from ..classifiers import ThresholdRescaler, BinaryLabelsClassifier
from ..classifiers import get_thresholds_from_file
logger = logging.getLogger(__name__)
class ThresholdingFeatClass(BaseFeatClass):
def __in... | {
"repo_name": "skylander86/ycml",
"path": "ycml/featclass/thresholds.py",
"copies": "1",
"size": "2642",
"license": "apache-2.0",
"hash": 7652813940318329000,
"line_mean": 36.2112676056,
"line_max": 213,
"alpha_frac": 0.6483724451,
"autogenerated": false,
"ratio": 3.8124098124098125,
"config_te... |
__all__ = ['threshold_otsu', 'threshold_adaptive']
import numpy as np
import scipy.ndimage
from skimage.exposure import histogram
def threshold_adaptive(image, block_size, method='gaussian', offset=0,
mode='reflect', param=None):
"""Applies an adaptive threshold to an array.
Also know... | {
"repo_name": "emmanuelle/scikits.image",
"path": "skimage/filter/thresholding.py",
"copies": "2",
"size": "4881",
"license": "bsd-3-clause",
"hash": 1433080453095765000,
"line_mean": 35.4253731343,
"line_max": 80,
"alpha_frac": 0.6295841016,
"autogenerated": false,
"ratio": 4.143463497453311,
... |
__all__ = ['ThresholdRescaler', 'get_thresholds_from_file']
import numpy as np
from ..utils import load_dictionary_from_file
class ThresholdRescaler(object):
def __init__(self, thresholds, n_classes=None):
if isinstance(thresholds, float): self.thresholds = np.full(n_classes, thresholds)
elif is... | {
"repo_name": "skylander86/ycml",
"path": "ycml/classifiers/thresholds.py",
"copies": "1",
"size": "1965",
"license": "apache-2.0",
"hash": -8733335217416255000,
"line_mean": 32.3050847458,
"line_max": 121,
"alpha_frac": 0.6351145038,
"autogenerated": false,
"ratio": 3.2372322899505765,
"config... |
__all__ = ['Tick']
class Tick(object):
'''Tick Class.
A new Tick object is instantiated every tick by BehaviorTree. It is passed
as parameter to the nodes through the tree during the traversal.
The role of the Tick class is to store the instances of tree, debug, target
and blackboard. So, all nod... | {
"repo_name": "renatopp/behavior3py",
"path": "b3/core/tick.py",
"copies": "2",
"size": "2005",
"license": "mit",
"hash": 3079876645558248000,
"line_mean": 27.6571428571,
"line_max": 79,
"alpha_frac": 0.6034912718,
"autogenerated": false,
"ratio": 4.238900634249472,
"config_test": false,
"has... |
__all__ = ['TiledCompound']
import itertools as it
import numpy as np
from mbuild.compound import Compound
from mbuild.exceptions import MBuildError
from mbuild.port import Port
from mbuild.coordinate_transform import translate
from mbuild.periodic_kdtree import PeriodicCKDTree
from mbuild import clone
class Tiled... | {
"repo_name": "sallai/mbuild",
"path": "mbuild/recipes/tiled_compound.py",
"copies": "1",
"size": "5774",
"license": "mit",
"hash": -6407374002826200000,
"line_mean": 40.5395683453,
"line_max": 92,
"alpha_frac": 0.5888465535,
"autogenerated": false,
"ratio": 4.02649930264993,
"config_test": fal... |
__all__ = ['TiledCompound']
import itertools as it
import numpy as np
from mbuild.compound import Compound
from mbuild.exceptions import MBuildError
from mbuild.port import Port
from mbuild.periodic_kdtree import PeriodicCKDTree
from mbuild import clone
class TiledCompound(Compound):
"""Replicates a Compound i... | {
"repo_name": "tcmoore3/mbuild",
"path": "mbuild/recipes/tiled_compound.py",
"copies": "3",
"size": "5723",
"license": "mit",
"hash": 8688001058264066000,
"line_mean": 40.4710144928,
"line_max": 92,
"alpha_frac": 0.5864057313,
"autogenerated": false,
"ratio": 4.018960674157303,
"config_test": f... |
__all__ = [ 'Tile' ]
from .Coordinate import Coordinate
from .Exceptions import HandsomeException
from .Interval import Interval
from .Pixel import Pixel, array_view, pixel_view
from .capi import generate_numpy_begin, c_void_p
from handsome.capi import Rectangle, downsample_tile, generate_numpy_begin
import math
impo... | {
"repo_name": "bracket/handsome",
"path": "handsome/Tile.py",
"copies": "2",
"size": "6576",
"license": "bsd-2-clause",
"hash": -6082180440706165000,
"line_mean": 25.5161290323,
"line_max": 98,
"alpha_frac": 0.5734489051,
"autogenerated": false,
"ratio": 3.834402332361516,
"config_test": false,... |
__all__ = ['TimestepperBD']
import os
import numpy as np
import miles.default as default
from miles import (BaseTimestepper, ChunksBD, get_random_name)
class TimestepperBD(BaseTimestepper):
"""Runs a trajectory from an initial phase space point until it hits a
milestone.
"""
def __init__(self, tra... | {
"repo_name": "clsb/miles",
"path": "miles/timestepper_bd.py",
"copies": "1",
"size": "1542",
"license": "mit",
"hash": 7410523479204792000,
"line_mean": 31.8085106383,
"line_max": 74,
"alpha_frac": 0.6452658885,
"autogenerated": false,
"ratio": 3.9844961240310077,
"config_test": false,
"has_... |
# __all__ = ['TimestepperMOIL']
#
# from miles import BaseTimestepper
#
#
# class TimestepperMOIL(BaseTimestepper):
# """Runs a trajectory from an initial phase space point until it hits a
# milestone.
#
# """
# def __init__(self, reporter, configuration,
# max_chunks=default.max_chunks... | {
"repo_name": "clsb/miles",
"path": "miles/timestepper_moil.py",
"copies": "1",
"size": "1852",
"license": "mit",
"hash": -2229327631735111200,
"line_mean": 33.9433962264,
"line_max": 80,
"alpha_frac": 0.5572354212,
"autogenerated": false,
"ratio": 3.289520426287744,
"config_test": false,
"ha... |
__all__ = ['TimestepperNAMD']
import logging
import os
import shutil
from typing import List, Optional, Union
import numpy as np
import miles.default as default
from miles import (BaseTimestepper, Chunk, ChunksNAMD, CollectiveVariables, Clock, Configuration, Mapping, PhaseSpacePoint, Transition, TrajectoryParser, ge... | {
"repo_name": "clsb/miles",
"path": "miles/timestepper_namd.py",
"copies": "1",
"size": "5192",
"license": "mit",
"hash": -865141221824599800,
"line_mean": 35.8226950355,
"line_max": 198,
"alpha_frac": 0.5976502311,
"autogenerated": false,
"ratio": 3.7623188405797103,
"config_test": true,
"ha... |
__all__ = ['time_zone_by_country_and_region']
_country = {}
_country["AD"] = "Europe/Andorra"
_country["AE"] = "Asia/Dubai"
_country["AF"] = "Asia/Kabul"
_country["AG"] = "America/Antigua"
_country["AI"] = "America/Anguilla"
_country["AL"] = "Europe/Tirane"
_country["AM"] = "Asia/Yerevan"
_country["AO"] = "Africa/Luan... | {
"repo_name": "mygu/django-googlemap",
"path": "googlemap/ip2geo/timezone.py",
"copies": "2",
"size": "27245",
"license": "mit",
"hash": -7943400278920077000,
"line_mean": 37.1582633053,
"line_max": 68,
"alpha_frac": 0.6175445036,
"autogenerated": false,
"ratio": 2.4112753341003628,
"config_tes... |
__all__ = ['TokensToIndexTransformer']
import logging
from .base import PureTransformer
from .text import ListCountVectorizer
logger = logging.getLogger(__name__)
class TokensToIndexTransformer(PureTransformer):
def __init__(self, skip_unknown=False, pad_sequences=None, count_vectorizer_args={}, pad_sequences_... | {
"repo_name": "skylander86/ycml",
"path": "ycml/transformers/sequences.py",
"copies": "1",
"size": "3076",
"license": "apache-2.0",
"hash": 6265458517541118000,
"line_mean": 41.1369863014,
"line_max": 280,
"alpha_frac": 0.6518205462,
"autogenerated": false,
"ratio": 3.9588159588159586,
"config_... |
__all__ = ["to_nibabel", "from_nibabel", "nifti_to_ants"]
import os
from tempfile import mkstemp
import numpy as np
import nibabel as nib
from ..core import ants_image_io as iio2
def to_nibabel(image):
"""
Convert an ANTsImage to a Nibabel image
"""
import nibabel as nib
fd, tmpfile = mkstemp(su... | {
"repo_name": "ANTsX/ANTsPy",
"path": "ants/utils/convert_nibabel.py",
"copies": "1",
"size": "1572",
"license": "apache-2.0",
"hash": -8781720737191637000,
"line_mean": 21.7826086957,
"line_max": 80,
"alpha_frac": 0.6017811705,
"autogenerated": false,
"ratio": 3.1377245508982035,
"config_test"... |
__all__ = ['Tool']
from typing import Dict, Optional, Any
import yaml
import docker
class Tool(object):
def __init__(self,
name: str,
image: str,
environment: Dict[str, str],
source: Optional[str] = None
) -> None:
"""
... | {
"repo_name": "ChrisTimperley/AutomatedRepairBenchmarks.c",
"path": "bugzoo/core/tool.py",
"copies": "3",
"size": "1906",
"license": "mit",
"hash": -5149253597954320000,
"line_mean": 26.2285714286,
"line_max": 77,
"alpha_frac": 0.5162644281,
"autogenerated": false,
"ratio": 4.717821782178218,
"... |
__all__ = ['ToolTip']
try:
import tkinter as tk
from tkinter import ttk
except:
import Tkinter as tk
import ttk
class ToolTip(object):
def __init__(self, widget):
self.widget = widget
self.tipwindow = None
self.id = None
self.x = self.y = 0
def showtip(self, ... | {
"repo_name": "ArcherSys/ArcherSys",
"path": "Lib/site-packages/pygubu/widgets/simpletooltip.py",
"copies": "2",
"size": "1722",
"license": "mit",
"hash": -7479057489036518000,
"line_mean": 25.90625,
"line_max": 75,
"alpha_frac": 0.5197444832,
"autogenerated": false,
"ratio": 3.5578512396694215,
... |
__all__ = ('TopCachedEncryptedHeapStorage',)
import logging
import tempfile
import mmap
import pyoram
from pyoram.util.virtual_heap import SizedVirtualHeap
from pyoram.encrypted_storage.encrypted_heap_storage import \
(EncryptedHeapStorageInterface,
EncryptedHeapStorage)
import tqdm
import six
from six.move... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/encrypted_storage/top_cached_encrypted_heap_storage.py",
"copies": "1",
"size": "12369",
"license": "mit",
"hash": -430434162053232960,
"line_mean": 40.9288135593,
"line_max": 93,
"alpha_frac": 0.5796749939,
"autogenerated": false,
"ratio": 4... |
__all__ = ["TopologicalSorter", "CycleError"]
_NODE_OUT = -1
_NODE_DONE = -2
class _NodeInfo:
__slots__ = "node", "npredecessors", "successors"
def __init__(self, node):
# The node this class is augmenting.
self.node = node
# Number of predecessors, generally >= 0. When this value f... | {
"repo_name": "djrobstep/schemainspect",
"path": "schemainspect/graphlib/__init__.py",
"copies": "1",
"size": "9896",
"license": "unlicense",
"hash": -6929130829176618000,
"line_mean": 37.3565891473,
"line_max": 101,
"alpha_frac": 0.5851859337,
"autogenerated": false,
"ratio": 4.5415328132170725,... |
__all__ = ['tqdm', 'trange']
import sys
import time
def format_interval(t):
mins, s = divmod(int(t), 60)
h, m = divmod(mins, 60)
if h:
return '%d:%02d:%02d' % (h, m, s)
else:
return '%02d:%02d' % (m, s)
def format_meter(n, total, elapsed):
# n - number of finished iterations
#... | {
"repo_name": "Plasticoo/RandomImgur",
"path": "lib/tqdm.py",
"copies": "1",
"size": "3354",
"license": "mit",
"hash": -2724210150147272000,
"line_mean": 32.2178217822,
"line_max": 82,
"alpha_frac": 0.5700655933,
"autogenerated": false,
"ratio": 3.541710665258712,
"config_test": false,
"has_n... |
__all__ = ['tqdm', 'trange']
import sys
import time
def format_interval(t):
mins, s = divmod(int(t), 60)
h, m = divmod(mins, 60)
if h:
return '%d:%02d:%02d' % (h, m, s)
else:
return '%02d:%02d' % (m, s)
def format_meter(n, total, elapsed):
# n - number of finished iterations
... | {
"repo_name": "Djabbz/tqdm",
"path": "tqdm.py",
"copies": "8",
"size": "3549",
"license": "mit",
"hash": -4310563474555024400,
"line_mean": 30.1315789474,
"line_max": 79,
"alpha_frac": 0.5700197239,
"autogenerated": false,
"ratio": 3.5740181268882174,
"config_test": false,
"has_no_keywords": ... |
__all__ = ['tqdm', 'trange']
import sys
import time
def format_interval(t):
mins, s = divmod(int(t), 60)
h, m = divmod(mins, 60)
if h:
return '%d:%02d:%02d' % (h, m, s)
else:
return '%02d:%02d' % (m, s)
def format_meter(n, total, elapsed):
# n - number of finishe... | {
"repo_name": "fras2560/Baseball-Simulator",
"path": "simulator/tqdm.py",
"copies": "1",
"size": "3661",
"license": "apache-2.0",
"hash": -2656214811171791000,
"line_mean": 30.1315789474,
"line_max": 79,
"alpha_frac": 0.552581262,
"autogenerated": false,
"ratio": 3.686807653575025,
"config_test... |
all_tracking = ('B0020HRVG2', 'B0050DIWHU', 'B00C0ALZ0W', 'B00GL3PZ0K', 'B00H6JBFOS', 'B00ALBR6LO', 'B00BVJG2P6',
'B00G1J1D28', 'B00M60PIXQ', 'B00N6PESWC', '9780385521338','0385521332', '9780307888907','0307888908',
'9780804137508', '0804137501', '0804138079', '9780804141444', '0804141444', '9780385346658', '... | {
"repo_name": "gabelev/MISMI",
"path": "asins.py",
"copies": "1",
"size": "39327",
"license": "mit",
"hash": 2475938425944966700,
"line_mean": 31.0521597392,
"line_max": 126,
"alpha_frac": 0.7616650139,
"autogenerated": false,
"ratio": 2.010171744019628,
"config_test": false,
"has_no_keywords... |
__all__ = ["TrainerConfig", "ModelConfig"]
class TrainerConfig(object):
# Whether to use GPU in training or not.
use_gpu = False
# The number of computing threads.
trainer_count = 1
# The training batch size.
batch_size = 32
# The epoch number.
num_passes = 10
# The global lear... | {
"repo_name": "qingqing01/models",
"path": "nested_sequence/text_classification/config.py",
"copies": "4",
"size": "1206",
"license": "apache-2.0",
"hash": -3848514369348313600,
"line_mean": 25.2173913043,
"line_max": 77,
"alpha_frac": 0.6683250415,
"autogenerated": false,
"ratio": 4.02,
"confi... |
__all__ = ["TrainerConfig", "ModelConfig"]
class TrainerConfig(object):
# Whether to use GPU in training or not.
use_gpu = True
# The number of computing threads.
trainer_count = 1
# The training batch size.
batch_size = 10
# The epoch number.
num_passes = 10
# Parameter updat... | {
"repo_name": "lcy-seso/models",
"path": "scene_text_recognition/config.py",
"copies": "4",
"size": "1817",
"license": "apache-2.0",
"hash": 8108204166392936000,
"line_mean": 23.2266666667,
"line_max": 70,
"alpha_frac": 0.660429279,
"autogenerated": false,
"ratio": 4.011037527593819,
"config_te... |
__all__ = ['Transaction']
import time
import thread
import threading
class Transaction(object):
def __init__(self, store):
self.store = store
self._log = []
def __enter__(self):
self.begin()
return self
def __exit__(self, exc_type, exc_value, traceback):
self.end(... | {
"repo_name": "yadb/yadb",
"path": "backup/store/transaction.py",
"copies": "1",
"size": "1795",
"license": "mit",
"hash": -1324444956722477000,
"line_mean": 25.0144927536,
"line_max": 68,
"alpha_frac": 0.4746518106,
"autogenerated": false,
"ratio": 4.626288659793815,
"config_test": false,
"h... |
# All transforms used to answer the four questions of exercise 1, broken up by question.
# These are repeated for clarity in the question answers.
# Python import to ensure HiveContext is ready
try:
sc.stop()
except NameError:
pass
from pyspark import SparkContext
sc = SparkContext()
from pyspark.sql i... | {
"repo_name": "bruinAlex/indoor-stomach",
"path": "exercise_1/transforming/all_transforms.py",
"copies": "1",
"size": "6048",
"license": "mit",
"hash": -5985247810553818000,
"line_mean": 79.64,
"line_max": 357,
"alpha_frac": 0.7953042328,
"autogenerated": false,
"ratio": 3.595719381688466,
"con... |
__all__ = ['TreekvParser']
class Logger(object):
def __init__(self):
pass
def write(self, message):
print(message)
class KeyValue(object):
def __init__(self, key, value=None, lineinfo=None, logger=Logger()):
self.key = key
self.value = value
self._list = []
... | {
"repo_name": "mizuy/seqtool",
"path": "seqtool/util/parser.py",
"copies": "1",
"size": "6396",
"license": "mit",
"hash": 8440031361017789000,
"line_mean": 24.8947368421,
"line_max": 169,
"alpha_frac": 0.5129768605,
"autogenerated": false,
"ratio": 3.6361569073337123,
"config_test": false,
"h... |
__all__ = ('TreeORAMStorageManagerExplicitAddressing',
'TreeORAMStorageManagerPointerAddressing')
import struct
import copy
from pyoram.util.virtual_heap import \
SizedVirtualHeap
from six.moves import xrange
class TreeORAMStorage(object):
empty_block_id = -1
block_status_storage_string = "... | {
"repo_name": "ghackebeil/PyORAM",
"path": "src/pyoram/oblivious_storage/tree/tree_oram_helper.py",
"copies": "1",
"size": "12252",
"license": "mit",
"hash": -3026134481358254600,
"line_mean": 36.2401215805,
"line_max": 76,
"alpha_frac": 0.5562357166,
"autogenerated": false,
"ratio": 3.8735377805... |
__all__ = ['TrendClassifier',
'TrendNormalizer',
'BaselineNormalizer',
'SpikeNormalizer',
'SmoothingNormalizer',
'LogNormalizer']
from collections import OrderedDict
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.base im... | {
"repo_name": "norbert/hearsay",
"path": "hearsay/models/nikolov.py",
"copies": "1",
"size": "4158",
"license": "mit",
"hash": 7295942375702504000,
"line_mean": 26.72,
"line_max": 74,
"alpha_frac": 0.5738335738,
"autogenerated": false,
"ratio": 3.5937770095073467,
"config_test": false,
"has_n... |
__all__ = ['Tripcode']
class Tripcode (object):
"""
Base class for tripcodes.
"""
def __init__ (self, cipher, key=None):
"""
Initializes a new instance from a ciphertext and an optional key.
"""
self.cipher = cipher
self.key = key
def __cmp__ (self, other... | {
"repo_name": "crypt3lx2k/Imageboard-Image-Scraper",
"path": "iwi/core/Tripcode.py",
"copies": "3",
"size": "1447",
"license": "mit",
"hash": 7247972173553072000,
"line_mean": 23.9482758621,
"line_max": 77,
"alpha_frac": 0.5044920525,
"autogenerated": false,
"ratio": 4.243401759530792,
"config_... |
__all__ = ['Triple', 'Quad', 'q_as_t', 't_as_q', 'Literal', 'NamedNode',
'Prefix', 'BlankNode', 'Graph', 'Dataset', 'PrefixMap', 'TermMap',
'parse_curie', 'is_language', 'lang_match', 'to_curie']
import collections
import datetime
from operator import itemgetter
import urllib
import urlparse
im... | {
"repo_name": "igor-kim/blazegraph-python",
"path": "pymantic/primitives.py",
"copies": "4",
"size": "27194",
"license": "bsd-3-clause",
"hash": 4022649712399411700,
"line_mean": 32.1230207065,
"line_max": 80,
"alpha_frac": 0.6028535706,
"autogenerated": false,
"ratio": 4.074617920287683,
"conf... |
__all__ = ['triplot','lineplot','lineplot2','cube_quivers','simplex_quivers']
try:
import matplotlib.collections, matplotlib.pylab
except ImportError:
import warnings
warnings.warn("matplotlib not installed, some loss of functionality will result")
from scipy import rand,asarray,zeros,empty,average
from ... | {
"repo_name": "DongliangGao/pydec",
"path": "pydec/vis/draw.py",
"copies": "6",
"size": "5172",
"license": "bsd-3-clause",
"hash": 9190885721886063000,
"line_mean": 28.2203389831,
"line_max": 90,
"alpha_frac": 0.5732791957,
"autogenerated": false,
"ratio": 3.4388297872340425,
"config_test": fal... |
__all__ = ['TRMM3B40RTFile', 'TRMM3B41RTFile', 'TRMM3B42RTFile']
import sys
import warnings
from gzip import GzipFile
import numpy as np
from numpy import ma
class TRMM3B4XRTFile(object):
"""Base Class for read operations on TRMM 3B4XRT files.
This class should not be used directly, use one of the derived
... | {
"repo_name": "sahg/pytrmm",
"path": "pytrmm/trmm3b4xrt.py",
"copies": "1",
"size": "10026",
"license": "bsd-3-clause",
"hash": 5509368062701922000,
"line_mean": 29.5670731707,
"line_max": 121,
"alpha_frac": 0.5821863156,
"autogenerated": false,
"ratio": 3.8770301624129933,
"config_test": false... |
__all__ = ['tsort']
from functools import reduce
def tsort(data, smallest_first=False, fewest_edges_first=False, flatten=False):
# FIXME: support fewest_edges_first
# make copy of data
tmp = data.copy()
# remove self-references
for k, v in tmp.items():
v.discard(k)
# initially find v... | {
"repo_name": "mtasic85/pytsort",
"path": "tsort.py",
"copies": "1",
"size": "2082",
"license": "mit",
"hash": 213660974581948830,
"line_mean": 25.7051282051,
"line_max": 79,
"alpha_frac": 0.5667627281,
"autogenerated": false,
"ratio": 4.06640625,
"config_test": false,
"has_no_keywords": fals... |
# __all__ = ['tvwap_trades','online_tvwap_trades']
import numpy as np
import ctypes
def _getpath():
return r"~/dev/signals/build"
def _load_signals_lib():
return np.ctypeslib.load_library("libsignals", _getpath())
def tvwap_trades(window, t, px, sz):
#requires = ["CONTIGUOUS", "ALIGNED"]
lib = _... | {
"repo_name": "tambu-j/signals",
"path": "python/tvwap.py",
"copies": "1",
"size": "2280",
"license": "apache-2.0",
"hash": 2123022970537283000,
"line_mean": 39,
"line_max": 80,
"alpha_frac": 0.4456140351,
"autogenerated": false,
"ratio": 4.427184466019417,
"config_test": false,
"has_no_keywo... |
__all__ = 'tyrving_score'
import typing
from athlib import parse_hms, normalize_gender, normalize_event_code, is_hand_timing
from athlib.codes import PAT_RUN
from typing import Union, Dict, Tuple
class TyrvingCalculator:
def __init__(self, gender, event_code, kind, args):
self.gender = gender
self... | {
"repo_name": "openath/athlib",
"path": "athlib/tyrving_score.py",
"copies": "1",
"size": "15114",
"license": "apache-2.0",
"hash": 5321353391485518000,
"line_mean": 49.5484949833,
"line_max": 115,
"alpha_frac": 0.4559348948,
"autogenerated": false,
"ratio": 2.2057793345008756,
"config_test": f... |
__all__ = ['UniformBlock']
class UniformBlock:
'''
UniformBlock
'''
__slots__ = ['mglo', '_index', '_size', '_name', 'extra']
def __init__(self):
self.mglo = None #: Internal representation for debug purposes only.
self._index = None
self._size = None
self._n... | {
"repo_name": "cprogrammer1994/ModernGL",
"path": "moderngl/program_members/uniform_block.py",
"copies": "1",
"size": "1409",
"license": "mit",
"hash": 7500322488437588000,
"line_mean": 19.7205882353,
"line_max": 78,
"alpha_frac": 0.5117104329,
"autogenerated": false,
"ratio": 4.256797583081571,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.