text
stringlengths
4
1.02M
meta
dict
""" :mod:`kmmblog` ============== .. module:: kmmblog :synopsis: My personal website .. moduleauthor:: Kyle Martineau-McFarlane <[email protected]> """ __author__ = 'kylemartineaumcfarlane'
{ "content_hash": "36efec11cd81a28ad06092461df553e4", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 78, "avg_line_length": 19.272727272727273, "alnum_prop": 0.6556603773584906, "repo_name": "KyleMarMc/blog", "id": "d9c8480e75082013ada7d592b9e44b651c845409", "size": "236",...
from time import sleep from cproto import CProto class TestEvents: def setup(self): self.cp = CProto() self.Page = self.cp.Page self.Page.enable() def teardown(self): self.cp.close() def test_events(self): def callback(_): self.events_fired += 1 self.ev...
{ "content_hash": "e2b09d7ad5084d75f2a428a15cb811d8", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 66, "avg_line_length": 23.533333333333335, "alnum_prop": 0.6288951841359773, "repo_name": "asyne/cproto", "id": "98701901a23f13194b987e6c902c83dc8149e148", "size": "706", ...
"""Tests for Keras metrics functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops fro...
{ "content_hash": "565cc0ab53b2560cae33f46c7a7a3bd3", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 82, "avg_line_length": 40.06020066889632, "alnum_prop": 0.6349140090165303, "repo_name": "jart/tensorflow", "id": "6d8269f34dff2bf016f99eca62c6f92ec2b3e687", "size": "1266...
from peewee import * import argparse db = SqliteDatabase('randomLunch.db') class BaseModel(Model): class Meta: database = db class Person(BaseModel): name = CharField(unique=True) email = CharField(unique=True) department = CharField() class Lunch(BaseModel): personOne = ForeignKeyField(...
{ "content_hash": "650f2feb5afa4e0515cba30740524f0b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 75, "avg_line_length": 33.9041095890411, "alnum_prop": 0.5329292929292929, "repo_name": "abjordan/RandomLunches", "id": "6e4cf6e819f3292d7049cef5386165f3755c1fe8", "size": ...
import datetime import flask from google.appengine.ext import ndb import config from apps.email import send_email_from_template from util.BaseModel import BaseModel class MemberAlreadyInvited(Exception): def __init__(self, other_user, *args, **kwargs): super(MemberAlreadyInvited, self).__init__(other_us...
{ "content_hash": "d19be779dad8cb6f8e818bea8a53e3f5", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 126, "avg_line_length": 33.909909909909906, "alnum_prop": 0.6246014877789585, "repo_name": "kkinder/GAEStarterKit", "id": "1c806d3796fae6243d184c569ea6a97436c807be", "size...
"""Generated protocol buffer code.""" # third party from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _...
{ "content_hash": "0505f7e659524cc0561bc8fba226743f", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 402, "avg_line_length": 43.04761904761905, "alnum_prop": 0.7671460176991151, "repo_name": "OpenMined/PySyft", "id": "47a697701f1a3c2bae0a04321c5bc16af6569f4a", "size": "196...
"""Metagene class for metagene_counts.py Requires: python 2 (https://www.python.org/downloads/) Joy-El R.B. Talbot Copyright (c) 2014 The MIT License (MIT) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
{ "content_hash": "61b3b2bf033d16045837ea7a356682b8", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 119, "avg_line_length": 41.559701492537314, "alnum_prop": 0.5992099120129287, "repo_name": "Joy-El/metagene_analysis", "id": "f37e3897c3fad98f24642c1ec34d1396a3118272", "s...
import unittest from sqlalchemy import create_engine from marguerite import Marguerite engine = create_engine("mysql+pymysql://root:@localhost/marguerite") app = Marguerite(engine) class TestSQLAlchemy(unittest.TestCase): def setUp(self): self.accessor = app.get_accessor("tests.sql.structure.User") ...
{ "content_hash": "c9e4cf699f116f4f5fcc894089e8cc07", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 68, "avg_line_length": 28.81159420289855, "alnum_prop": 0.5503018108651911, "repo_name": "teitei-tk/Marguerite", "id": "55d27f1602394526333b3dc1d7448cfeb89012c3", "size": "...
class bet_invoice(object): def __init__(self): self.invariant_violations = 0 self.precondition_violations = 0 self.failures = 0 self.successes = 0 self.candidates = 0 self.method_call_candidates = 0 self.running_log = [] def print_invoice(self): pass ...
{ "content_hash": "8abcb89eaf31cee20e4ffd7ed7ecfb8d", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 214, "avg_line_length": 38.84070796460177, "alnum_prop": 0.6992481203007519, "repo_name": "ccoakley/dbcbet", "id": "b63d3ecf57fc7572274ce4cea882475837478bb6", "size": "498...
import Foundation # -*- coding: utf-8 -*- languageCode=Foundation.NSUserDefaults.standardUserDefaults().objectForKey_('AppleLanguages')[0] #languageCode='fr' translations={ 'da': # Danish {'Yes' : u'Ja', 'No' : u'Nej', 'Recordings by Series' : u'Optagelser efter serier', 'Favorite Channels' : ...
{ "content_hash": "4479a7647d2343f364c3bca547177293", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 155, "avg_line_length": 34.2463768115942, "alnum_prop": 0.5454930173508252, "repo_name": "essandess/pyetv", "id": "e7325762aef346c058c0e4c5e12fdbac5f9aa248", "size": "9503...
from __future__ import unicode_literals from subprocess import call import os from django.core.management.base import BaseCommand, CommandError from django.conf import settings class Command(BaseCommand): help = 'Pushes all the local files listed in ./.tx/config to transifex' requires_system_checks = False ...
{ "content_hash": "decd6f9a937fbf39ddb15cddeae139d7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 77, "avg_line_length": 31.375, "alnum_prop": 0.6427622841965471, "repo_name": "shriyanka/daemo-forum", "id": "2b60844f337732b27f742c6f9c9ce9718e63a6c2", "size": "778", "b...
""" This script is responsible for enabling reduced transparency Commands used: - defaults write com.apple.universalaccess reduceTransparency -bool true """ from common import CLITieIn class ReducedTransparencyEnabler(CLITieIn): def enable_reduced_transparency(self): command = '/usr/bin/defaults writ...
{ "content_hash": "1aea3a16760f9d941a65a994c7671526", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 99, "avg_line_length": 24.083333333333332, "alnum_prop": 0.5882352941176471, "repo_name": "initialed85/mac_os_scripts", "id": "514ff585a3d0097901ddb75c3f3465e3950ad310", "s...
from cms.plugin_pool import plugin_pool from django.utils.translation import gettext as _ from ..models.schoolyear import SchoolYearBlockPlugin from .base import LeprikonPluginBase @plugin_pool.register_plugin class LeprikonSchoolYearBlockPlugin(LeprikonPluginBase): name = _("School year block") model = Scho...
{ "content_hash": "f0958818d73cf51d81eab3cb3a2100d4", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 59, "avg_line_length": 33.285714285714285, "alnum_prop": 0.776824034334764, "repo_name": "leprikon-cz/leprikon", "id": "40cbf5383578f789df90ccdab7b472ca9735284f", "size": "...
"""kenWeaver URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
{ "content_hash": "611c9f9eebc592ae8f90c4e37f25bfa6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 33.57692307692308, "alnum_prop": 0.695303550973654, "repo_name": "kenjones21/kenWeaver", "id": "1225c0ade7be02edbd405add89859bcb6c28e1e6", "size": "8...
from flask import Blueprint api=Blueprint('api',__name__) from . import authentication,users,errors
{ "content_hash": "2af33694b09578e9504b3ecf3fc6c837", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 41, "avg_line_length": 21, "alnum_prop": 0.7428571428571429, "repo_name": "pvpnvz/internshipsystem", "id": "83500cbf041cf48540d4d147e52f5da29f34c0f7", "size": "105", "bina...
from django.views.generic import TemplateView, View from osf.management.commands.manage_switch_flags import manage_waffle from django.core.urlresolvers import reverse from django.shortcuts import redirect class ManagementCommands(TemplateView): """ Basic form to trigger various management commands """ temp...
{ "content_hash": "d8d48b266d7d1b2adb06ccd776e0f3fc", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 33.875, "alnum_prop": 0.7490774907749077, "repo_name": "baylee-d/osf.io", "id": "fffd1bbef4f6d4c965efeb4547a937a0869d5e50", "size": "542", "binary"...
import sys import requests from lxml import html def main(argv): # compose url: query = argv[0] prefix = "http://www.bing.com/news/search?q=entertainment+news+" suffix = "&qs=n&form=NWRFSH&pq=entertainment+news+ozz&sc=0-20&sp=-1&sk=" print query uri = prefix + query + suffix print uri ...
{ "content_hash": "e0f95714e7890442e1346a8980c11a02", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 76, "avg_line_length": 28.838709677419356, "alnum_prop": 0.5525727069351231, "repo_name": "0--key/lib", "id": "0fee86a10de53c0df8482c91e3c19367bb76178b", "size": "894", "...
""" Read and write PB's Dataset files. """ import sys import os.path import struct import lmdb # Import comression/decompression functions from zlib import compress as zlib_comp, decompress as zlib_decomp from lz4 import compress as _lz4_comp, decompress as lz4_decomp from backports.lzma import compress as _xz_comp,...
{ "content_hash": "c6d998f2a043e1d5a197c05e49a862a7", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 80, "avg_line_length": 28.42655935613682, "alnum_prop": 0.5507502831257078, "repo_name": "parantapa/pbdset", "id": "28b2aa2cd191d54e5e13c248908422db9eef2c97", "size": "147...
import pytest from py4jdbc.dbapi2 import Connection from py4jdbc.gateway_process import GatewayProcess @pytest.fixture(scope='session') def gateway(request): gateway = GatewayProcess() gateway.__enter__() def finalizer(): gateway.shutdown() request.addfinalizer(finalizer) return gateway ...
{ "content_hash": "1866704b464ee55e4e7d9c95232ba2b2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 50, "avg_line_length": 20.5, "alnum_prop": 0.6707317073170732, "repo_name": "massmutual/py4jdbc", "id": "76f3a427697bad5160ef1e649b5f52ad8b687fd1", "size": "738", "binary...
""" HTCondor utilities. """ __all__ = ["get_htcondor_version"] import re import subprocess import threading from law.util import no_value, interruptable_popen _htcondor_version = no_value _htcondor_version_lock = threading.Lock() def get_htcondor_version(): """ Returns the version of the HTCondor instal...
{ "content_hash": "a202fc234fb50a0d9b868f41664f3f7e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 100, "avg_line_length": 26.641025641025642, "alnum_prop": 0.6005774783445621, "repo_name": "riga/law", "id": "ec56239105ad404f2483fb45b9aa3100d9bd69f7", "size": "1056", "...
from appconf import AppConf from django.conf import settings # NOQA class CmspluginArticlesAppConf(AppConf): MODULE_NAME = 'Ri+' HEAD_CHILD_CLASSES = None MAIN_CHILD_CLASSES = None CLASSNAME = 'ripiu' TEMPLATES = [] class Meta: prefix = 'ripiu_articles'
{ "content_hash": "cb5af624a5aec5fe25ebfe82779abcd3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 40, "avg_line_length": 22.307692307692307, "alnum_prop": 0.6724137931034483, "repo_name": "ripiu/ripiu.cmsplugin_articles", "id": "59d1daf279c8dd0e01865842bb49eb3ed4101f5e", ...
''' Created on 2013-05-21 @author: Scott Sibole ''' from __future__ import print_function from builtins import range from builtins import object class Load(object): ''' self.loads - list of dictionaries with keys holding lists of all load types assigned in a given step 'force' - append to this list wi...
{ "content_hash": "6bf22ea2bc921e231fdf105424a1f998", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 136, "avg_line_length": 45.640625, "alnum_prop": 0.5857583019513866, "repo_name": "siboles/pyFEBio", "id": "51a753d3c6d286f7b5c1408ac99ac20bd5195617", "size": "5842", "b...
from mock import Mock, patch import string import sys import unittest from libcloud.common.nfsn import NFSNConnection from libcloud.test import LibcloudTestCase, MockHttp from libcloud.utils.py3 import httplib mock_time = Mock() mock_time.return_value = 1000000 mock_salt = Mock() mock_salt.return_value = 'yumsalty1...
{ "content_hash": "4e2968b2000a63b2c8e664551658d50e", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 84, "avg_line_length": 30.323076923076922, "alnum_prop": 0.6610857432775241, "repo_name": "curoverse/libcloud", "id": "5e77f32b5ec3a819533091fb5c9f40d3e830d0e9", "size": "1...
"""Package contenant les éditeurs génériques du module objet."""
{ "content_hash": "4c55d21984a4f75af6756d98ec86ffef", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 64, "avg_line_length": 33, "alnum_prop": 0.7575757575757576, "repo_name": "vlegoff/tsunami", "id": "670ff331f4b5255b9a1cbf8be0346157fbe0dafc", "size": "1639", "binary": fa...
import unittest import re from test_runner import g_test_view from tests import select_bof from tests import select_eof from tests import select_line from vex.ex_range import EX_RANGE from vex.ex_range import new_calculate_range from vex.ex_range import calculate_relative_ref from vex.ex_range import calcu...
{ "content_hash": "8a41f9960e9f5e91ae3f19c68544ef90", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 82, "avg_line_length": 35.8021978021978, "alnum_prop": 0.598219766728054, "repo_name": "SublimeText/VintageEx", "id": "1b9c4a4e6edda82f66ef2ae5e7d01a5f831eca0c", "size": "3...
import json import logging import os from collections import OrderedDict from pokemongo_bot.base_dir import _base_dir ''' Helper class for updating/retrieving Inventory data Interesting info and formulas: https://drive.google.com/file/d/0B0TeYGBPiuzaenhUNE5UWnRCVlU/view https://www.reddit.com/r/pokemongodev/comments...
{ "content_hash": "39ea64e500f2f3e7ca210ef448d9e191", "timestamp": "", "source": "github", "line_count": 1321, "max_line_length": 144, "avg_line_length": 32.6782740348221, "alnum_prop": 0.6026918087472202, "repo_name": "bbiiggppiigg/PokemonGo-Bot", "id": "0577b65e207d60c4d5ca2e5e945aad478d83bd0a", "...
from rdflib.namespace import Namespace, RDF, DCTERMS BIBO = Namespace('http://purl.org/ontology/bibo/') EBU = Namespace('http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#') F4 = Namespace('http://fedora.info/definitions/v4/repository#') F4EV = Namespace('http://fedora.info/definitions/v4/event#') LDP = Namespace(...
{ "content_hash": "33eb9d56ceceb7a8c8b1d66e63beca51", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 52.083333333333336, "alnum_prop": 0.7232, "repo_name": "mitlib-tdm/pit", "id": "37ce1c3ff66f097a2e6cb84b2ac4eb338437da6a", "size": "625", "binary":...
import shutil import graph_tool.all as gt import numpy as np import modules.distance_matrix as distance_matrix import modules.graph_io as graph_io import modules.layout_io as layout_io import modules.thesne as thesne import modules.user_input as usr_input import modules.animation as animations from modules.tsn_config...
{ "content_hash": "a006e18d44aed15c04ee491eeeeb3102", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 291, "avg_line_length": 57.24832214765101, "alnum_prop": 0.5863423212192262, "repo_name": "HanKruiger/tsnetwork", "id": "5602e2b018f018a8eb496e98a12409dd6ac3c4b5", "size":...
''' Simple non-secure password locker ''' PASSWORDS = {'email': 'F7minlBDDuvMJuxESSKHFhTxFtjVB6', 'blog': 'VmALvQyKAxiVH5G8v01if1MLZF3sdt', 'luggage': '12345'} import sys, pyperclip if len(sys.argv) < 2: print('Usage: python pw.py [account] - copy account password') sys.exit() account ...
{ "content_hash": "a83024fce0fc69cec492dacbca5292e2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 63, "avg_line_length": 25.714285714285715, "alnum_prop": 0.6851851851851852, "repo_name": "cunctat0r/pystudy", "id": "44df99c27f122e5e69c4756d8df7df90fe06a03e", "size": "55...
import os import sys sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extension...
{ "content_hash": "a4623a2ed3e3262866ce37ec5d49661c", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 78, "avg_line_length": 29.840579710144926, "alnum_prop": 0.6644001942690626, "repo_name": "The-Fonz/adventure-track", "id": "36d6912290364dffad95592577dcc30b92eef3ba", "si...
import numpy as np import cv2 img = cv2.imread('images/bicycle.png') cv2.imshow('Bicycle', img) cv2.waitKey(0) cv2.destroyAllWindows() cropped = img[109:310, 9:160] cv2.imshow('Cropped Image', cropped) cv2.waitKey(0) cv2.destroyAllWindows()
{ "content_hash": "ec4902cad616e021a8e62dc716cb0d03", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 38, "avg_line_length": 17.5, "alnum_prop": 0.7387755102040816, "repo_name": "KECB/learn", "id": "6b065b288b7257f9b5b713db12fc6ddd6274a768", "size": "245", "binary": false...
import sys from rdkit import Chem class FastSDMolSupplier(object): """ A wrapper around an SDMolSupplier that precomputes and stores molecular indices (via text processing) to allow quick length calculations and random access. NOTE that this class needs to have the entire SD data in memory, ...
{ "content_hash": "a6e10dbbdc96a389988deb9504dd908e", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 86, "avg_line_length": 26.34246575342466, "alnum_prop": 0.609984399375975, "repo_name": "rdkit/rdkit-orig", "id": "4a99102897466daef15b44ce56cca37d61c76ebb", "size": "2187"...
""" Django settings for govgroup_scrape project. Generated by 'django-admin startproject' using Django 1.11.6. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ i...
{ "content_hash": "6b23df30db3f2fb4bee49febc6b9b1ac", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 91, "avg_line_length": 25.94214876033058, "alnum_prop": 0.6890729531697993, "repo_name": "anbangisak/thikey_scrape", "id": "bca7750c6b866d67ae08ebba89b99e1143de9dca", "siz...
from solution import Solution from solution import TreeNode def constructOne(s): s = s.strip() if s == '#': return None else: return TreeNode(int(s)) def createTree(tree): q = [] tree = tree.split(",") root = constructOne(tree[0]); q.append(root); idx = 1; while q: ...
{ "content_hash": "9f9ccd3cc0059923c4a689cb21d9c8ad", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 42, "avg_line_length": 21.25925925925926, "alnum_prop": 0.5331010452961672, "repo_name": "zhlinh/leetcode", "id": "47fb5e31a2705ffc301cb4b6f5b498606679b51f", "size": "1195"...
from settings.defaults import * DEBUG = True TEMPLATE_DEBUG = DEBUG # Change this to work with your default development database DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': project_dir("demo....
{ "content_hash": "f6cb72fdc7583a81b594060090a7f26d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 123, "avg_line_length": 38.25925925925926, "alnum_prop": 0.6069699903194579, "repo_name": "armstrong/armstrong.cli", "id": "a25e07b16c708a97a1f11e153a16b9bfbc7254ce", "size...
""" Least Cost is an algorithm for choosing which host machines to provision a set of resources to. The input is a WeightedHost object which is decided upon by a set of objective-functions, called the 'cost-functions'. The WeightedHost contains a combined weight for each cost-function. The cost-function and weights ar...
{ "content_hash": "72eb25acd741681eb844f3a3151c6973", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 79, "avg_line_length": 35.898148148148145, "alnum_prop": 0.6644312612844984, "repo_name": "salv-orlando/MyRepo", "id": "7e12ca390865c1da01a599fa9d2ad7e73ec63f57", "size": ...
from bitpay_exceptions import * import bitpay_key_utils as key_utils import requests import json import re class Client: def __init__(self, api_uri="https://bitpay.com", insecure=False, pem=key_utils.generate_pem(), tokens={}): self.uri = api_uri self.verify = not(insecure) ...
{ "content_hash": "aba947c015cf1346f16c0a3c1dedb620", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 79, "avg_line_length": 38.82835820895522, "alnum_prop": 0.5562175667883913, "repo_name": "bitpay/bitpay-python-py2", "id": "3bc64fe325cbc459a02c349687d56201bc2fcb4a", "siz...
""" Clone client Model Two Author: Min RK <[email protected]> """ import time import zmq from kvsimple import KVMsg def main(): # Prepare our context and subscriber ctx = zmq.Context() snapshot = ctx.socket(zmq.DEALER) snapshot.linger = 0 snapshot.connect("tcp://localhost:5556") subscr...
{ "content_hash": "2b98eff8c37470ec6ba4a4c5899c1860", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 65, "avg_line_length": 22.425925925925927, "alnum_prop": 0.5755573905862923, "repo_name": "soscpd/bee", "id": "b36d9499f58b7d7877b74ac1dc74d1c820068abd", "size": "1211", ...
import logging import random from queue import Queue from typing import List import ray import ray.streaming._streaming as _streaming import ray.streaming.generated.streaming_pb2 as streaming_pb from ray.actor import ActorHandle, ActorID from ray.streaming.config import Config CHANNEL_ID_LEN = 20 class ChannelID: ...
{ "content_hash": "cbd2e90ac4ef5dbaac3aac880c90c9fe", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 79, "avg_line_length": 30.920962199312715, "alnum_prop": 0.5917981773727495, "repo_name": "stephanie-wang/ray", "id": "4bb9b5f1d65fe48413cbc8be8d39d2b540552876", "size": "...
""" remove - remove a trigger """ from trigger import Trigger def main (args, app): for trigger in Trigger.FromConfig(app.config): if args.name == trigger.name: trigger.remove(app.config) app.config.save( ) print 'removed', trigger.format_url( ) break
{ "content_hash": "c31f5feaeaacf4dbd749a1a2f3bfc8a2", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 23.583333333333332, "alnum_prop": 0.6537102473498233, "repo_name": "openaps/oacids", "id": "9014f3fc5b1d6d56d079bda9ecfc41a28b673d0a", "size": "284",...
from __future__ import unicode_literals import os import boto.kms from moto.core import BaseBackend, BaseModel from moto.core.utils import iso_8601_datetime_without_milliseconds from .utils import generate_key_id from collections import defaultdict from datetime import datetime, timedelta class Key(BaseModel): ...
{ "content_hash": "7e8ef26664e1e036d5775515959fbbce", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 112, "avg_line_length": 33.59, "alnum_prop": 0.6065793390890146, "repo_name": "whummer/moto", "id": "577840b06cd80bf6a9d230b4b7d10f5c3bcc09e0", "size": "6718", "binary":...
import datetime import os from google.appengine.ext import db from mcfw.consts import MISSING import oca_unittest from rogerthat.bizz.service import create_service from rogerthat.dal import put_and_invalidate_cache from rogerthat.dal.profile import get_user_profile from rogerthat.models import ServiceProfile from rog...
{ "content_hash": "160d6b0ccf4d3ca2ed711db09408626f", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 390, "avg_line_length": 48.27333333333333, "alnum_prop": 0.6562629471067533, "repo_name": "our-city-app/oca-backend", "id": "b887e10f370a9936032fa67a9f058f5025e838a0", "si...
"""Weak reference support for Python. This module is an implementation of PEP 205: http://www.python.org/dev/peps/pep-0205/ """ # Naming convention: Variables named "wr" are weak reference objects; # they are called this instead of "ref" to avoid name collisions with # the module-global ref() function imported from ...
{ "content_hash": "710c0abcec63452461ebef793eba92f2", "timestamp": "", "source": "github", "line_count": 590, "max_line_length": 80, "avg_line_length": 31.838983050847457, "alnum_prop": 0.54990684056428, "repo_name": "ArcherSys/ArcherSys", "id": "ed4dc584623e8a708e38e014dfb90e4897d1728e", "size": "1...
""" Django settings for sufwebapp1 project. Generated by 'django-admin startproject' using Django 1.9.6. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os...
{ "content_hash": "084898262ca312e82346de339913d63a", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 91, "avg_line_length": 25.642857142857142, "alnum_prop": 0.6905292479108636, "repo_name": "sufhani/suf-webapp", "id": "cbb90e507e7b77e88ac3bce11f8518c244dc0656", "size": "...
from ..engine import Vec2 class Direction: """ Represents a direction an entity can move in """ NO_MOVEMENT = Vec2(0,0) def __init__(self, direction): """ Initialize with the direction vector to use """ self.direction = Vec2(direction).unitVector self.moving = False ...
{ "content_hash": "f88d4fd9d11e50730b6b776e9dd4d79d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 118, "avg_line_length": 33.5, "alnum_prop": 0.5613598673300166, "repo_name": "cloew/NytramBox2D", "id": "68a81836876e173d3fce66ce1f54a2d284a4764d", "size": "1206", "binar...
__author__ = "Andre Merzky, Ole Weidner, Alexander Grill" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ shell based file adaptor implementation """ import saga.utils.pty_shell as sups import saga.utils.misc as sumisc import saga.adaptors.base import saga.adaptors.cpi.file...
{ "content_hash": "a7d209b78de584ee1fffebff22ea72ba", "timestamp": "", "source": "github", "line_count": 1425, "max_line_length": 110, "avg_line_length": 33.07017543859649, "alnum_prop": 0.4666737400530504, "repo_name": "mehdisadeghi/saga-python", "id": "800afed951c121ac507ba6b6265ba26460a54726", "s...
from in_place import InPlace from test_in_place_util import TEXT, pylistdir class PathLike: def __init__(self, path): self.path = path def __fspath__(self): return self.path def test_pathlike(tmpdir): assert pylistdir(tmpdir) == [] p = tmpdir.join("file.txt") p.write(TEXT) w...
{ "content_hash": "2f5924bd45a6f17a6e0f5e22698b9ca7", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 68, "avg_line_length": 28.350649350649352, "alnum_prop": 0.6007787448465415, "repo_name": "jwodder/inplace", "id": "6306feb3fc29d81426b0a9dbf511f27ff92e26e5", "size": "436...
""" Flax OPT model.""" from functools import partial from typing import Optional, Tuple import flax.linen as nn import jax import jax.numpy as jnp from flax.core.frozen_dict import FrozenDict, freeze, unfreeze from flax.linen import combine_masks, make_causal_mask from flax.linen.attention import dot_product_attentio...
{ "content_hash": "c1d2a9dc1f546ce4506ec82326b92214", "timestamp": "", "source": "github", "line_count": 790, "max_line_length": 206, "avg_line_length": 39.08987341772152, "alnum_prop": 0.6249149962760273, "repo_name": "huggingface/transformers", "id": "adb38f4138aa073013c5dec17e3ce92c12873c3b", "si...
import bottle def setup(main_app, sub_apps = [], plugins = [], error_handlers = [], error_handler_generators = []): real_sub_apps = sub_apps[:] real_sub_apps.append(main_app) for app_data in real_sub_apps: if isinstance(app_data, list): app, mountpoint = app_data else: ...
{ "content_hash": "5bb6135557bd0801bf5963dcf8e68a02", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 101, "avg_line_length": 32.64102564102564, "alnum_prop": 0.5255302435192458, "repo_name": "BasementCat/bottle-utils", "id": "9350eb086c49a9f1a14305378afd4e7dd0834ecf", "siz...
""" Script to get information from: http://www.transtats.bts.gov/Data_Elements.aspx?Data=2 about carrier and airports """ from bs4 import BeautifulSoup import requests import urllib2 def extract_data(url, s): # Extract data from a html source from a URL r = s.get(url) soup = BeautifulSoup(r.text) da...
{ "content_hash": "035829df02fbf192f906270d971d8620", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 72, "avg_line_length": 23.3265306122449, "alnum_prop": 0.5962379702537183, "repo_name": "aguijarro/DataSciencePython", "id": "b278850d5834f8e1749673cfa5e57a4f8ea6386f", "si...
def extractSetsunatranslationWordpressCom(item): ''' Parser for 'setsunatranslation.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Harem', 'My Sister is Jealous of Another Wo...
{ "content_hash": "787d0827b9b49f7ea3aec266ca906731", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 117, "avg_line_length": 32.93939393939394, "alnum_prop": 0.6605335786568537, "repo_name": "fake-name/ReadableWebProxy", "id": "eeb0df9fd43900141bd0cb4c6afd16dbd2f4256f", "s...
from django.conf import settings from django.contrib.auth.models import User from django.contrib.flatpages.models import FlatPage from django.contrib.sites.models import Site from django.test import TestCase, modify_settings, override_settings from .settings import FLATPAGES_TEMPLATES class TestDataMixin(ob...
{ "content_hash": "ff6a6eaedcc42bfbc7c041c7b9479650", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 114, "avg_line_length": 45.71264367816092, "alnum_prop": 0.6553935126980136, "repo_name": "yephper/django", "id": "3486d570323e6e13590da0f6c115e368ce0a1be8", "size": "7954...
import logging from abc import ABC, abstractmethod from typing import Dict import tensorflow as tf from ludwig.constants import * from ludwig.features.feature_utils import compute_feature_hash from ludwig.modules.fully_connected_modules import FCStack from ludwig.modules.reduction_modules import SequenceReducer from ...
{ "content_hash": "c039927f0affe96fa94c94d0976b922e", "timestamp": "", "source": "github", "line_count": 466, "max_line_length": 91, "avg_line_length": 33.987124463519315, "alnum_prop": 0.5566990781664352, "repo_name": "uber/ludwig", "id": "5a07c3398c9b04b125856ae7cd7a779f2a381dba", "size": "16525",...
True, False is None and, not, or break continue pass def return class del import from if elif else for in while try except finally raise with as lambda yield global, nonlocal assert
{ "content_hash": "2fb39e39d6965b030aa6f1a554ef2ba8", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 16, "avg_line_length": 4.4772727272727275, "alnum_prop": 0.7360406091370558, "repo_name": "PySchwaben/learn-python", "id": "dc8932111492514254fe6194ad0f1924eddcd0a2", "size...
""" Converts an input file to an output file using the given style. """ from . import inp, outp, text, stylesheet def convert(input_file, output_file, style): assert isinstance(input_file, inp.InputFile) assert isinstance(output_file, outp.OutputFile) assert isinstance(style, stylesheet.StyleSheet) ...
{ "content_hash": "7fceaffe813eb8e20bd938116f4a00cc", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 27.931818181818183, "alnum_prop": 0.6379170056956875, "repo_name": "groboclown/py-book-selfpub", "id": "32d45b08ae755984258f2cebc3289f7722c99a16", "s...
import json import os import time import psutil import pyautogui pubg_url = 'steam://rungameid/578080' PROCNAME = "TslGame.exe" CRASH_PROCNAME = "BroCrashReporter.exe" debug_directory = "debug_screenshots" start_state = "HELLO" play_state = "PLAYING" play_timer_max = 60 * 3 matching_state = "MATCHING" matching_timer...
{ "content_hash": "9e1881b44d81e600d148c803aee24a12", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 142, "avg_line_length": 44.30175438596491, "alnum_prop": 0.6035957547916997, "repo_name": "fuckpubg/AHK", "id": "a89c762bc05a26b656892179338f84a25bc98f02", "size": "12651"...
from flask_sqlalchemy import SQLAlchemy from flask_alembic import Alembic from . import app, log db = SQLAlchemy() alembic = Alembic() def init_db(): # import all modules here that might define models so that # they will be registered properly on the metadata. Otherwise # you will have to import them fir...
{ "content_hash": "e78f67f6da7f393f51fce3bf1128c532", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 126, "avg_line_length": 43.34285714285714, "alnum_prop": 0.6763348714568227, "repo_name": "twschum/mix-mind", "id": "ed1856e6d84a23360c8e6f72b6015a177b2cfb6a", "size": "151...
from __future__ import absolute_import, division, print_function from collections import OrderedDict from pymel.core import aimConstraint, duplicate, hide, orientConstraint, parent import pdil from ..cardRigging import MetaControl, ParamInfo from .._core import config from .._lib2 import controllerShape from .. i...
{ "content_hash": "5ff67974d07f332e5e0afbdbeccc78d0", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 128, "avg_line_length": 35.27272727272727, "alnum_prop": 0.6368322399250235, "repo_name": "patcorwin/fossil", "id": "3428cf4dd03fed89b789530d4159ff8f78e90cf9", "size": "42...
PYTHON_VERSION_COMPATIBILITY = "PY3" DEPS = [ 'build', 'checkout', 'recipe_engine/context', 'recipe_engine/file', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', 'run', 'vars', ] def RunSteps(api):...
{ "content_hash": "f9cd3f7cd406422e53f8a9684230691a", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 73, "avg_line_length": 26.381818181818183, "alnum_prop": 0.6368022053756031, "repo_name": "aosp-mirror/platform_external_skia", "id": "78d594abc80c7ea0f4ae562803b72bdb4afb72...
import logging import threading from collections import defaultdict from celery.task import task as base_task, Task from django.dispatch import receiver from django.db import DEFAULT_DB_ALIAS from functools import partial from django_atomic_signals import signals logger = logging.getLogger(__name__) _thread_data = th...
{ "content_hash": "75a4439cd3d4a7b097b0c6be40cd04dd", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 77, "avg_line_length": 28.71153846153846, "alnum_prop": 0.555481134181737, "repo_name": "graingert/django_atomic_celery", "id": "94aab86e7ef00054020e2006b95e7028030ba583", ...
from .twxproperty import TWX_Property class TWX_Template(): def __init__(self,name, **kwargs): self.name = name self.allProperties = kwargs.get('allProperties',{}) #{name, TWX_Property} self.simulateList = kwargs.get('simulateList',[]) #[name] = simulate but not follow self.follow...
{ "content_hash": "bb0afe6e1393c2e193bfd691863ffb97", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 92, "avg_line_length": 31.194444444444443, "alnum_prop": 0.6331255565449688, "repo_name": "arproio/kpitest", "id": "4a3fcadedba8ec8712216a02375f51a07cc508c6", "size": "1148...
try: from collections import OrderedDict import json except ImportError: from ordereddict import OrderedDict import simplejson as json import six from csvkit import CSVKitWriter def geojson2csv(f, key=None, **kwargs): """ Convert a GeoJSON document into CSV format. """ js = json.load(...
{ "content_hash": "5e2c00b03b6ffd70c50c141eb087df95", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 107, "avg_line_length": 26, "alnum_prop": 0.6424702058504875, "repo_name": "gepuro/csvkit", "id": "b95a14e428e1ae40ba906617936aea35ad9ee0aa", "size": "1892", "binary": fa...
import os import json import logging import subprocess from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files.base import ContentFile from django.template import Context from django.utils.encoding import force_bytes from sass_processor.utils import get_custom_f...
{ "content_hash": "0b9c40ce942256f55c12720b1ccc27cd", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 103, "avg_line_length": 40.577181208053695, "alnum_prop": 0.6334766787958981, "repo_name": "jrief/django-sass-processor", "id": "a8f6b835ae0c9b353de3d23bac9e7a277164ed1e", ...
import json def ParseCommentedJson(filepath): """Parse a JSON file while stripping out # comments.""" contents = '' with open( filepath, 'rt' ) as f: for line in f.readlines(): comment_begin = line.find('#') if comment_begin != -1: contents += line[:comment_begin] + '\n' else: ...
{ "content_hash": "422092bedea3dd1bddea840ec91812b5", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 57, "avg_line_length": 26.5, "alnum_prop": 0.6064690026954178, "repo_name": "DavidYen/YEngine", "id": "58333b2280558bd354a6e9d7add9372b6ffd16c6", "size": "372", "binary":...
from thrift.Thrift import * from ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class Iface: def login(self, keyspace, auth_request): """ Parame...
{ "content_hash": "9aaf44969ec492f2fce40a56943e11a0", "timestamp": "", "source": "github", "line_count": 6053, "max_line_length": 198, "avg_line_length": 33.349248306624816, "alnum_prop": 0.6352625295373595, "repo_name": "simplegeo/metartg", "id": "9034455f1166fed1a642f8d45408a07217af3c4b", "size": ...
def extractBrokenworldwebWordpressCom(item): ''' Parser for 'brokenworldweb.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ...
{ "content_hash": "505c3700728f2f9321fac20868406fcb", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 27, "alnum_prop": 0.6402116402116402, "repo_name": "fake-name/ReadableWebProxy", "id": "2613b00d6f91d714db88ae975ffb9bfe5596ab87", "size": "568", ...
"""Encapsulate configuration properties.""" from ConfigParser import SafeConfigParser as ConfigParser from .errors import BotError CONFIG_FILENAME = "bddbot.cfg" TEST_COMMAND = ["behave", ] class ConfigError(BotError): # pylint: disable=missing-docstring pass class BotConfiguration(object): """Load conf...
{ "content_hash": "e7694eb320d8ba9238161f28a31c5551", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 99, "avg_line_length": 27.816091954022987, "alnum_prop": 0.6223140495867768, "repo_name": "nivbend/bdd_bot", "id": "1f72fff483015bc26ae1bfb296e628add09c8619", "size": "2420...
def extractChaosWords(item): """ Chaos Words """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None return False
{ "content_hash": "4b1073ec74d1cabdd4a16ab61b9f6120", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 74, "avg_line_length": 27.875, "alnum_prop": 0.7040358744394619, "repo_name": "fake-name/ReadableWebProxy", "id": "813b3985d96a47685e1eef69ab7e5aa8185560a0", "size": "223", ...
from .AvGRLostBarnNSum import AvGRLostBarnNSum from .AvGRLostBarnNSum import AvGRLostBarnNSum_f from gwlfe.Memoization import memoize def GRLBN(NYrs, GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN, GRPctManApp, PctGrazing, GRBarnNRate, Prec, DaysMonth, AWMSGrPct, GrAWMSCoeffN, RunContPct, RunConCoef...
{ "content_hash": "8c764120cccc32f205bd5cd1f8e8274c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 119, "avg_line_length": 57.15, "alnum_prop": 0.6885389326334208, "repo_name": "WikiWatershed/gwlf-e", "id": "1fcf4f7b784dacb08585bc214c0f4803ce212907", "size": "1143", "b...
"""Tests for computing the overlap.""" import numpy as np from unittest import TestCase from exatomic.base import resource from exatomic.core.basis import Overlap from exatomic.molcas import Output as MolOutput class TestMolcasOverlap(TestCase): def setUp(self): dz = MolOutput(resource('mol-carbon-dz.out'...
{ "content_hash": "fa41c8aa3a13e1fa8d3411fd8fa27ab3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 61, "avg_line_length": 36.73529411764706, "alnum_prop": 0.6140912730184147, "repo_name": "exa-analytics/exatomic", "id": "8f2259d36e664b7ed888798a55144c42034cc44b", "size":...
import json import threading import time from concurrent.futures import Future from functools import partial from kubernetes import config from kubernetes import watch from traitlets import Any from traitlets import Bool from traitlets import Dict from traitlets import Int from traitlets import Unicode from traitlets....
{ "content_hash": "290c89080a390863ca7b73366f327d05", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 114, "avg_line_length": 35.86240786240786, "alnum_prop": 0.5685804329953412, "repo_name": "yuvipanda/jupyterhub-kubernetes-spawner", "id": "ac0c61d379865696ffc45245c89207b58...
""" Module for testing the sim_options parameter. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os from itertools import combinations import pytest from surprise import KNNBasic from surprise import KNNWithMeans from surprise import KNNBaselin...
{ "content_hash": "016cf9b2f38a9189b5b87537019fa2d4", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 34.51724137931034, "alnum_prop": 0.6363636363636364, "repo_name": "charmoniumQ/Surprise", "id": "3b6862ed2e1a90970130a0c651b4921bd47ec2d4", "size": "...
from ..tables.auctionhouse import AuctionHouse from .worker import Worker class Seller(Worker): """ Auction House seller. :param db: database object :param seller: auction house seller id :param seller_name: auction house seller name """ def __init__(self, db, seller=0, seller_name='Zissou...
{ "content_hash": "04c603941a091b87195b8e1419395344", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 69, "avg_line_length": 32.701149425287355, "alnum_prop": 0.4818980667838313, "repo_name": "LegionXI/pydarkstar", "id": "91c31816e518e3fab07a0ed051cc1674ce1cfd8a", "size": "...
from .handler import run # Use this to set us up if called directly def main(): print("This is the IR module reporting...") run() if __name__ == '__main__': main()
{ "content_hash": "aeed4358a9fbeecdfae4c40ca1cffc15", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 19.77777777777778, "alnum_prop": 0.601123595505618, "repo_name": "Antificial/antificial", "id": "5522c4348999b6e96cb0f9a8cf042388547c8fd0", "size": "2...
from __future__ import print_function from collections import defaultdict import random import copy # Check python version for queue module. import sys if sys.version_info[0] < 3: import Queue as queue else: import queue # Other imports. from simple_rl.planning.PlannerClass import Planner class ValueIteration(Pla...
{ "content_hash": "8878c53b906f540d3c087a1dfa2b3366", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 109, "avg_line_length": 31.35202492211838, "alnum_prop": 0.5233505564387917, "repo_name": "david-abel/simple_rl", "id": "85296fe16d52039ee42ce32b03accfc6c308f6d1", "size":...
import sys from base64 import b64encode from nomcom import _file_exists from os.path import basename from random import shuffle, randint from re import sub from time import strftime, localtime ########################################################################### __version__ = "0.0.501.1" __status__ = "BETA" __a...
{ "content_hash": "e7188084f7f84fa85b5fd02629bdb64d", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 117, "avg_line_length": 36.372093023255815, "alnum_prop": 0.4869281045751634, "repo_name": "nomuus/obfuscare", "id": "b9f2238d6678cd031de3611589b4b26c40508f70", "size": "1...
from __future__ import print_function from builtins import str from builtins import range import os import sys import numpy as np from girs.feat.layers import LayersReader from girs.rast.raster import RasterReader, RasterWriter, get_driver from girs.rast.raster import get_parameters from girs.rastfeat import rasterize ...
{ "content_hash": "3f7bd67f46a448f56da6b86a55d5958a", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 137, "avg_line_length": 36.47639484978541, "alnum_prop": 0.6166607836216026, "repo_name": "JRoehrig/GIRS", "id": "bf76e082a5b1e90e371b16de97fbab07e114b0dd", "size": "8499"...
from model_mommy import mommy import pytest from quiz.models import Unity, Answer, Lesson, Media, Question, Result from unittest import TestCase from django.db import models class UnityModelTest(TestCase): def test_name_field(self): name = Unity._meta.get_field_by_name('name')[0] self.assertEqual...
{ "content_hash": "d03cb90957616a6375ae730e9e11d0a2", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 78, "avg_line_length": 36.25316455696203, "alnum_prop": 0.6602653631284916, "repo_name": "jesuejunior/golingo", "id": "338f921aef102ec2e04948dcfca433c3d7d8de57", "size": "...
"""Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable name...
{ "content_hash": "9f718315d858a9d148821d060596ae76", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 79, "avg_line_length": 35.24901960784314, "alnum_prop": 0.5697836123936141, "repo_name": "soft-matter/slicerator", "id": "398201cf7eddc24e822ee33d30596855c95806cf", "size"...
''' Created on 2014. 3. 21. @author: Su-Jin Lee ''' from LF.process import Processor from LF.dummycomm import DummyComm def main_ver(): processor = Processor() comm = DummyComm(processor) processor.shotFunc = comm.shotMsg processor.comm = comm comm.run() if __name__ == '__main__': mai...
{ "content_hash": "94332b18c2a5e1e613f27e86218c953a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 37, "avg_line_length": 15.619047619047619, "alnum_prop": 0.6310975609756098, "repo_name": "NecromancerLev0001/LightingFury", "id": "d4fd59697278dca9daef5c77c0f5a64118825092",...
""" Created on Thu Jul 09 15:48:14 2015 @author: ABerner """ from __future__ import print_function import numpy as np import scipy as sp import scipy.stats as stats import quantecon as qe import matplotlib.pyplot as plt #Ex 1
{ "content_hash": "4935e162f84776cfabce6b78ef8e2a51", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 37, "avg_line_length": 14.4375, "alnum_prop": 0.7402597402597403, "repo_name": "andybrnr/QuantEcon.py", "id": "30f4fa2c92b21466b5721a562b447b3711624684", "size": "255", "...
from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" auth_token = "your_auth_token" client = Client(account_sid, auth_token) number = client.api.account.incoming_phone_numbers.create(phone_number="33") print(number.sid)
{ "content_hash": "c9c769dcb027436aad4cfab0375d29ab", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 28.727272727272727, "alnum_prop": 0.7848101265822784, "repo_name": "teoreteetik/api-snippets", "id": "9fbfc9ac02194c2075a531e2b796e8c0b8e45801", "siz...
import re from functools import partial from typing import Any, Callable, Dict, Optional from django.http import HttpRequest, HttpResponse from zerver.decorator import log_unsupported_webhook_event, webhook_view from zerver.lib.exceptions import UnsupportedWebhookEventType from zerver.lib.request import REQ, has_requ...
{ "content_hash": "495ac2d36f4e2841e99078286451c407", "timestamp": "", "source": "github", "line_count": 810, "max_line_length": 142, "avg_line_length": 33.20493827160494, "alnum_prop": 0.6205011897679953, "repo_name": "kou/zulip", "id": "458548b2ffdac2d7e36d8857a83d05ce75d4d182", "size": "26896", ...
from __future__ import absolute_import import atexit import logging try: import multiprocessing except ImportError: multiprocessing = None # noqa import os import socket import sys import warnings from celery import __version__ from celery import platforms from celery import signals from celery.app import ap...
{ "content_hash": "381182056a25989df6500c0d6b143202", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 79, "avg_line_length": 38.523676880222844, "alnum_prop": 0.5735357917570499, "repo_name": "WoLpH/celery", "id": "6ccc4ddab3fdc0282d19039cd5141361efb9a4a7", "size": "13830"...
from setuptools import setup setup( name='zurg', version='0.1', scripts=['zurg'], install_requires=['jinja2', 'PyYAML'], )
{ "content_hash": "47182597f342e3f503cef0406a842c68", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 17.5, "alnum_prop": 0.6071428571428571, "repo_name": "jbalogh/zurg", "id": "90fac9ed1da422db9d7ea0da816d7c617935049a", "size": "140", "binary": fals...
from __future__ import absolute_import from django import template from django.utils.datastructures import SortedDict from django.utils.translation import ugettext as _ from horizon.base import Horizon from horizon import conf register = template.Library() @register.filter def has_permissions(user, component): ...
{ "content_hash": "c935b93a53106e9ebc159be93ffeae45", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 31.708661417322833, "alnum_prop": 0.6406754407747703, "repo_name": "m3z/HT", "id": "ad1c317dd4fb32436a3021f804fbf3ee4566ae6f", "size": "4677", "bi...
import functools import itertools import json import math import os import re import sys from functools import partial from importlib import import_module from itertools import * from pprint import pprint from time import time, sleep from timeit import timeit import numpy as np from numpy import array, arange, concate...
{ "content_hash": "831a2011971277c85bc2ea957967b98f", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 86, "avg_line_length": 24.385964912280702, "alnum_prop": 0.6848920863309352, "repo_name": "SicariusNoctis/dotfiles", "id": "55414aac2b148671df418259c0e208a528d7878e", "size...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "home_page.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is r...
{ "content_hash": "2fabbe54426e30286528e910cf967b7e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.38095238095238, "alnum_prop": 0.6203821656050955, "repo_name": "GoreNetwork/Web-Front-End-Windows", "id": "cf17eea05476080f10b4dafcc212b6221ec99156"...
import sys from collections import defaultdict unique_values_by_column = defaultdict(set) csv_files = ['kpis_1998_2003.csv', 'kpis_2004_2008.csv', 'kpis_2009_2011.csv', 'kpis_2012_2013.csv'] d = unique_values_by_column # for csv in csv_files: # print 'Loading file "{}"'.form...
{ "content_hash": "dcf8c673a93376a9d986e7aae1f74d3d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 87, "avg_line_length": 32.48148148148148, "alnum_prop": 0.4606613454960091, "repo_name": "guidoman/swedish-school-fires", "id": "8de4a82fe5b44d634b02cc6ac9e9649bd8972b83", ...
from django.db import models from django.conf import settings from django.db.models.signals import post_save, pre_save from django.dispatch import receiver # Create your models here. class Question(models.Model): text = models.TextField() active = models.BooleanField(default=True) draft = models.BooleanField(defaul...
{ "content_hash": "6fa2353e4926f16800bcbfa174f2d6fd", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 93, "avg_line_length": 33.756410256410255, "alnum_prop": 0.7413596657804785, "repo_name": "Maelstroms38/Matchmaker", "id": "3f7ab6df46fff56006c51fd5bf5469af9696b3b8", "size...
from google.appengine.ext import ndb class Email(ndb.Model): """Sub model for representing an email.""" sender = ndb.StringProperty(indexed=False) subject = ndb.StringProperty(indexed=False) content = ndb.StringProperty(indexed=False) date = ndb.DateTimeProperty(indexed=True) @classmethod ...
{ "content_hash": "b1b19ea5f75bfd3b652f375d4c4526a8", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 33.5, "alnum_prop": 0.7002487562189055, "repo_name": "LaercioAsano/gae-filtered-forwarding", "id": "b5e35e4435227e75427bcd056325163d576505ca", "size"...
from django.test import TestCase from mail.management.commands import init_app_mail class TestCommand(TestCase): def test_init_app(self): """ Test the management command """ command = init_app_mail.Command() command.handle()
{ "content_hash": "bd325e2563724ca37f2159b41e1db397", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 23.363636363636363, "alnum_prop": 0.6809338521400778, "repo_name": "pkimber/mail", "id": "4665d0dfbc05ec376ac4232f5666ba940f8c06c5", "size": "283", ...
import argparse import json import logging from microservice.core.microservice_logging import configure_logging logger = logging.getLogger(__name__) def start_service(): parser = argparse.ArgumentParser() parser.add_argument("--service", help="Name of service.") parser.add_argument("--host", help="IP ad...
{ "content_hash": "79ccb6d4494925299abb32a714875a4e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 92, "avg_line_length": 31.62162162162162, "alnum_prop": 0.6837606837606838, "repo_name": "MartinHowarth/microservice", "id": "61d4b5ffee10b7f4691380dbf3d0b931a3eb5bbd", "si...
""" example.py an example script for testing the success rate of unmollom. go ahead and run the script. it solves a captcha on the authors site. please note that the test captcha runs under molloms free API limit. if example.py has some unusual bad results check manually whether the test captcha is working currently. ...
{ "content_hash": "2ff6ce540456e7cbd0d03495226742a7", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 105, "avg_line_length": 32.06521739130435, "alnum_prop": 0.6488135593220339, "repo_name": "flurischt/unmollom", "id": "a364da416892ae27ad6d1c6ba912e906fff47bc7", "size": "1...
import os, re from django.conf import settings from django.utils.importlib import import_module from django.core.exceptions import ImproperlyConfigured ORIGINAL_BACKEND = getattr(settings, 'ORIGINAL_BACKEND', 'django.db.backends.postgresql_psycopg2') original_backend = import_module('.base', ORIGINAL_BACKEND) # fro...
{ "content_hash": "d3b78be5bf21e0b3004bfa74fbec27a1", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 98, "avg_line_length": 38.40229885057471, "alnum_prop": 0.6093983837174499, "repo_name": "tuttle/django-schemata", "id": "7a08f8f7f8268b36564f4dbedf1109f38f549ef3", "size":...
import unittest from smac.configspace import ConfigurationSpace from smac.runhistory.runhistory import RunHistory from smac.facade.roar_facade import ROAR from smac.scenario.scenario import Scenario from smac.stats.stats import Stats from smac.tae.execute_func import ExecuteTAFuncArray class TestSMACFacade(unittest...
{ "content_hash": "85ab696a01dae5ef3645c15a5bd44607", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 33.708333333333336, "alnum_prop": 0.7354758961681088, "repo_name": "SgnJp/SMAC3", "id": "e8884360660143171bfa1aa13e37bfe002a2a0b3", "size": "809", ...
from functools import reduce import math from operator import add from ._expr import Expr def _eval_poly(x, offset, coeffs, reciprocal=False): _x0 = x - offset _x = _x0 / _x0 res = None for coeff in coeffs: if res is None: res = coeff * _x else: res += coeff * ...
{ "content_hash": "b1cb540dcba4b4c76304c24fb1a14880", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 114, "avg_line_length": 31.746153846153845, "alnum_prop": 0.4928519505694209, "repo_name": "bjodah/aqchem", "id": "14d5a6198c3a5cf086a4389b9de6ee2c6be8a5c7", "size": "4152...
from .permissions import is_location_safe, location_restricted_response class LocationAccessMiddleware(object): """ Many large projects want to restrict data access by location. Views which handle that properly are called "location safe". This middleware blocks access to any non location safe features...
{ "content_hash": "df3ed772b34fbf15675cd0790e6b4fca", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 88, "avg_line_length": 47.3125, "alnum_prop": 0.678996036988111, "repo_name": "qedsoftware/commcare-hq", "id": "060aa67f74e21348dd5cc1eded70c532cba90dd8", "size": "1514", ...
import sys def raw_hex(val): return hex(val)[2:].upper() class IntelHexDecoder(object): def __init__(self): self.records = [ 'Data record', 'End Of File record', 'Extended Segment Address Record', 'Start Segment Address Record', 'Extended Linear Address ...
{ "content_hash": "c26efc4e04934ba0f209461586243b14", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 153, "avg_line_length": 31.341463414634145, "alnum_prop": 0.5610894941634241, "repo_name": "thecoinproject/ccointestbed", "id": "9d7baa9048cf321cecac2b695deb4921aa8b49f4", ...
"""Translation model""" from sqlalchemy import Column, Sequence, ForeignKey from sqlalchemy.types import Integer, Unicode, UnicodeText, DateTime from onlinelinguisticdatabase.model.meta import Base, now class Translation(Base): __tablename__ = 'translation' def __repr__(self): return '<Translation (...
{ "content_hash": "a7f16384884d0b51f023054f2a90b447", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 89, "avg_line_length": 35.111111111111114, "alnum_prop": 0.7215189873417721, "repo_name": "jrwdunham/old", "id": "db38164e72ff6d10d1e69989283765a85959a328", "size": "1216",...