text
stringlengths
4
1.02M
meta
dict
import keras from keras.datasets import mnist from keras.layers import Dense from keras.layers import Bidirectional, LSTM from keras.models import Sequential from keras.optimizers import SGD batch_size = 128 decay = 1e-6 epochs = 30 learning_rate = 0.1 momentum = 0.9 num_classes = 10 time_step = 28 ...
{ "content_hash": "a5922cef9168913b858e034a35aed63d", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 93, "avg_line_length": 33.3125, "alnum_prop": 0.5959974984365228, "repo_name": "paperrune/Neural-Networks", "id": "09a24712de1d9416ab48bb1c62eaeb4f840aa13b", "size": "1599"...
from IPython.utils.shimmodule import ShimModule import IPython def test_shimmodule_repr_does_not_fail_on_import_error(): shim_module = ShimModule("shim_module", mirror="mirrored_module_does_not_exist") repr(shim_module) def test_shimmodule_repr_forwards_to_module(): shim_module = ShimModule("shim_module...
{ "content_hash": "c8e0256c3a8a41fda9a37e636f1c94d1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 84, "avg_line_length": 32.25, "alnum_prop": 0.7416020671834626, "repo_name": "ipython/ipython", "id": "6ea2629b42d9bcdc26bc0d0cb04624e2a60c0822", "size": "387", "binary":...
import datetime import os import subprocess import sys def regenerate_projects(): should_regenerate_projects = False current_working_directory = os.getcwd() projects_timestamp_file = os.path.join(current_working_directory, "projects/.projects_timestamp") if not os.path.exists(projects_timestamp_file): open(proj...
{ "content_hash": "74be0955a30ceb85818952dd1dbb41de", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 189, "avg_line_length": 41.90384615384615, "alnum_prop": 0.7342817806333181, "repo_name": "chrisculy/Divida", "id": "462023235f47792a2f5ac5c78a5ab15cad01fd20", "size": "217...
import traceback class GetParameterException(Exception): pass class get_parameter(object): def __init__(self, name, access_stack=[], callstack=None): self.name = name if not isinstance(name, str): raise TypeError("bee.get_parameter must be called with a string argument") self...
{ "content_hash": "d97d0425a587ef3b9a37f3f2ac9c2675", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 108, "avg_line_length": 37.03896103896104, "alnum_prop": 0.5631136044880786, "repo_name": "agoose77/hivesystem", "id": "70cf9f2af1581493cc328756f90259b9ca1319ec", "size": "...
"""DigiByte P2P network half-a-node. This python code was modified from ArtForz' public domain half-a-node, as found in the mini-node branch of http://github.com/jgarzik/pynode. P2PConnection: A low-level connection object to a node's P2P interface P2PInterface: A high-level interface object for communicating to a no...
{ "content_hash": "a304b60bddd160a6e20a433938beb753", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 413, "avg_line_length": 41.14954954954955, "alnum_prop": 0.6310535073123741, "repo_name": "digibyte/digibyte", "id": "3ab23112c0c568fe3c33690f95672f67120af66a", "size": "2...
from . import doc def main(argv): d = doc.Doc(argv[1]) for a in argv[2:]: print(make_line(d, a)) def make_enviroment_name(name): return name.upper().replace(".","_") def make_line(doc, name): temp = doc for attr in name.split("."): temp = getattr(temp, attr) if type(temp) != ...
{ "content_hash": "f2a6de69357003f85389102f9107cd6c", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 85, "avg_line_length": 24.24, "alnum_prop": 0.5742574257425742, "repo_name": "thedavecollins/ExEmGel", "id": "c0856a08d99afe272991f46a20f32351d52f9689", "size": "628", "b...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['None'] , ['LinearTrend'] , ['Seasonal_Second'] , ['SVR'] );
{ "content_hash": "e856c27530f780204e3d9d26ce707863", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 82, "avg_line_length": 38.75, "alnum_prop": 0.7032258064516129, "repo_name": "antoinecarme/pyaf", "id": "795ce4f48c23dd9e0cf3a0ba5e6c2f0b2a0e6255", "size": "155", "binary"...
import re from decorator import decorator class ValidationException(Exception): pass @decorator def reply(f, *args, **kwargs): """ if a command needs to show the message as a reply """ r = f(*args, **kwargs) if r: if isinstance(r, dict): r['needs_reply'] = True elif isinst...
{ "content_hash": "73a974998bab07b7dba74739a9431749", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 119, "avg_line_length": 29.371069182389938, "alnum_prop": 0.574304068522484, "repo_name": "fernandotakai/telegram_bot", "id": "747e7dada034f44d7ddd3a8df17bdb1d6305f883", "...
from UTIL.SYS import Error, LOG, LOG_INFO, LOG_WARNING, LOG_ERROR import CCSDS.PACKET import EGSE.CNC, EGSE.IF import MC.IF import PUS.PACKET import UTIL.TASK ########### # classes # ########### # ============================================================================= class TCclient(EGSE.CNC.TCclient): """Subc...
{ "content_hash": "a578685d478fa765acc02049b7a75f1e", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 82, "avg_line_length": 41.74825174825175, "alnum_prop": 0.5331658291457286, "repo_name": "Stefan-Korner/SpacePyLibrary", "id": "40fc4cc4f0c897c876d4c92da68a461e7549a4f8", ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: ovirt_cluster_facts short_description: Retrieve facts about one or more oVirt/RHV clusters author: "Ondra Machacek (@machacekondra)" version_added:...
{ "content_hash": "e34e766e369f5a6d9bc2e72e5c606634", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 142, "avg_line_length": 30.68888888888889, "alnum_prop": 0.6299782766111514, "repo_name": "SergeyCherepanov/ansible", "id": "c7f5d8cdbaba4777940346303a9cb56f323926a7", "siz...
import json import logging import re from api.api_samples.python_client.api_client import CloudBoltAPIClient from api.api_samples.python_client.samples.api_helpers import wait_for_order_completion from common.methods import set_progress from servicecatalog.models import ServiceBlueprint from utilities.exceptions impor...
{ "content_hash": "a1e3fbf1d5b298cafa85280b0e63d21d", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 106, "avg_line_length": 32.56310679611651, "alnum_prop": 0.6368515205724508, "repo_name": "CloudBoltSoftware/cloudbolt-forge", "id": "dcbada1e03f348a3c9a101e3db554ab5b22def4...
""" :Authors: - Wilker Aziz """ #from .kbest import KBest #from .ancestral import AncestralSampler #from .viterbi import viterbi_derivation #from .value import robust_value_recursion, derivation_value #from .sample import sample_one, sample_k
{ "content_hash": "1e100b2e011fe267d369548abbd023c3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 60, "avg_line_length": 27.11111111111111, "alnum_prop": 0.7704918032786885, "repo_name": "wilkeraziz/grasp", "id": "ef7ea5af541384bba46e0d42c8479027dd286253", "size": "244",...
""" Configuration options registration and useful routines. """ import os from oslo_config import cfg import st2common.config as common_config from st2common.constants.system import VERSION_STRING CONF = cfg.CONF BASE_DIR = os.path.dirname(os.path.abspath(__file__)) def parse_args(args=None): CONF(args=args, ...
{ "content_hash": "2054d93e02bbf397648e9746bf99699c", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 97, "avg_line_length": 31.35593220338983, "alnum_prop": 0.6416216216216216, "repo_name": "tonybaloney/st2", "id": "91e0c3c67342c2f27de0c53750661ffcff8b141d", "size": "2630"...
import json from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User as DjangoUser from anaf.core.models import Group, Perspective, ModuleSetting from anaf.messaging.models import Message, MessageStream, MailingList from anaf.identities.models import Cont...
{ "content_hash": "2cab7ea77745119eb08f573fe228ed26", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 120, "avg_line_length": 46.723404255319146, "alnum_prop": 0.6355494839101397, "repo_name": "tovmeod/anaf", "id": "0f574acd25d276ebbf6d066eb12c1e25357b6b49", "size": "6588"...
from sys import argv # read the WYSS section for how to run this script, first, second, third = argv print("The script is called:", script) print("Your first variable is:", first) print("Your second variable is:", second) print("Your third variable is:", third)
{ "content_hash": "dc9729f34640fe198478ff38bae64ce0", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 43, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7310606060606061, "repo_name": "zedshaw/learn-python3-thw-code", "id": "7d141c1fd99bacc6cbb1b8962e77bed62a6c39c9", ...
import argparse import bisect import functools import os import socket import struct import sys import time import traceback from pyasn1 import debug as pyasn1_debug from pyasn1.codec.ber import decoder from pyasn1.error import PyAsn1Error from pyasn1.type import univ from pysnmp import debug as pysnmp_debug from pysn...
{ "content_hash": "14bf4a72e6517e1ae01544cdf3298be4", "timestamp": "", "source": "github", "line_count": 690, "max_line_length": 84, "avg_line_length": 32.37246376811594, "alnum_prop": 0.5357030935219591, "repo_name": "etingof/snmpsim", "id": "c5c435d0a94a061c80c46a11675244f5c2c971c7", "size": "2254...
import unittest, sys, os, optparse, re import astropy, astropy.io.fits as pyfits, numpy as np import photometry_db, ldac, utilities ########################## __cvs_id__ = "$Id: save_slr.py,v 1.2 2010-09-01 01:38:56 dapple Exp $" ########################## ################################################## ### Phot...
{ "content_hash": "b9995c4da1c043dc3499b9d2321834c4", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 135, "avg_line_length": 31.415343915343914, "alnum_prop": 0.5014736842105263, "repo_name": "deapplegate/wtgpipeline", "id": "f979a3455356ac53bc969443954dfe1a4c9c1361", "si...
try: from setuptools import setup except ImportError: from distutils.core import setup setup( name="trulia", version="0.0.3", author="Matt Koskela", author_email="[email protected]", packages=["trulia"], url="https://github.com/mattkoskela/trulia", license="LICENSE", descrip...
{ "content_hash": "b3545af83de8e0b7d65514fcc06c5e4e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 25.6, "alnum_prop": 0.64453125, "repo_name": "mattkoskela/trulia", "id": "b44f51a8ba8b00c58bfcd898013613712c4956ba", "size": "512", "binary": false...
import unittest from hecuba import config, StorageDict from hecuba.IStorage import IStorage class PersistentDict(StorageDict): ''' @TypeSpec dict<<key:int>, value:double> ''' class IStorageTests(unittest.TestCase): @classmethod def setUpClass(cls): cls.old = config.execution_name ...
{ "content_hash": "4da83afc73d6304e13b392a9335e1672", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 86, "avg_line_length": 26.016666666666666, "alnum_prop": 0.6274823830877643, "repo_name": "bsc-dd/hecuba", "id": "737940714da24502026a0b6dae4926d9ceff1c40", "size": "3122"...
import _plotly_utils.basevalidators class CategoryorderValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="categoryorder", parent_name="layout.polar.radialaxis", **kwargs, ): super(CategoryorderValidator, self).__init__( ...
{ "content_hash": "4cc2bc34a12d92ebea91b77fd1a15c54", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 79, "avg_line_length": 32.108108108108105, "alnum_prop": 0.43013468013468015, "repo_name": "plotly/plotly.py", "id": "4776cdb882cf510367bafb27ad45b60ca943b79c", "size": "11...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0010_auto_20160916_1053'), ] operations = [ migrations.AlterField( model_name='post', name='image', fiel...
{ "content_hash": "7196bdd9c2a0fee5e9484c3819edf502", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 102, "avg_line_length": 23.555555555555557, "alnum_prop": 0.6061320754716981, "repo_name": "CaptainMich/IMS", "id": "b85b0387893958d27a2bf069186569f0f4dabb10", "size": "494...
"""pkgs module tests.""" import mox import stubout from google.apputils import app from google.apputils import basetest from simian.mac.munki import pkgs class MunkiPackageInfoTest(mox.MoxTestBase): def setUp(self): mox.MoxTestBase.setUp(self) self.stubs = stubout.StubOutForTesting() self.mpi = pkgs....
{ "content_hash": "257d5de13777086211f9842abe8b014a", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 33.064935064935064, "alnum_prop": 0.6734092694422624, "repo_name": "sillywilly42/simian", "id": "aa081bceac3bc79a700be4e09c045f42ae5d01ec", "size": ...
""" ================================LICENSE====================================== Copyright (c) 2015 Chirag Mello & Mario Tambos Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction...
{ "content_hash": "f07de11eca93fce6b0d4e03724161dcf", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 41.96, "alnum_prop": 0.6003813155386082, "repo_name": "g402chi/SpatialPooler", "id": "415625d8bb69ae204ca369e0018ca7c3c96196e6", "size": "5245", "...
import datetime import threading import subprocess import pymorse import tempfile import numpy as np import rospy from std_msgs.msg import Header from geometry_msgs.msg import Point from fire_rs.simulation.morse import MorseWildfire import serialization from supersaop.msg import Timed2DPointStamped, WildfireMap ...
{ "content_hash": "798cdb2a98916e965e65bace5a21fee4", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 91, "avg_line_length": 27.220338983050848, "alnum_prop": 0.5712951432129514, "repo_name": "fire-rs-laas/fire-rs-saop", "id": "f122f6235fdb8d5fa6415aad88fbedb021c7e497", "s...
from six.moves.urllib import parse from conveyor.conveyorheat.engine import constraints from conveyor.conveyorheat.engine import properties from conveyor.conveyorheat.engine import resource from conveyor.conveyorheat.engine import support from conveyor.i18n import _ class KeystoneRegion(resource.Resource): """He...
{ "content_hash": "d353f107562a1377d9dbcd94e41f24d7", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 78, "avg_line_length": 32.5, "alnum_prop": 0.6180602006688963, "repo_name": "Hybrid-Cloud/conveyor", "id": "ed98a1ccbb1d7ac4e2383e31af94ccaceb0606a4", "size": "3565", "bi...
import logging import logging.config import yaml import options def configure(): with open("%s/config.yml" % options.PACKAGE_PATH, 'r') as ymlfile: logging.config.dictConfig(yaml.load(ymlfile)['logging'])
{ "content_hash": "be52d6a4cf70f344cdc7706d72bec99e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 20.09090909090909, "alnum_prop": 0.7149321266968326, "repo_name": "mickael-grima/optimizedGPS", "id": "5d358655b13f649a9bce8271cbfc00f690805246", "si...
from merc import feature from merc import message class QuitFeature(feature.Feature): NAME = __name__ install = QuitFeature.install @QuitFeature.register_server_command class Quit(message.Command): NAME = "QUIT" MIN_ARITY = 0 FORCE_TRAILING = True def __init__(self, reason=None, *args): self.reason...
{ "content_hash": "97152d912936da46cae91d6e24886ff2", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 24.705882352941178, "alnum_prop": 0.6555555555555556, "repo_name": "merc-devel/merc", "id": "2b26da02023fbfe3ad792026b030dab6243a19ca", "size": "1260...
from mastermind_import import * from settings import * import math import random import threading from time import gmtime, strftime from time import sleep ip = "localhost" port = 6317 def PlayerColour(playerID, col): bckgd = [0,0,0] fgd = [255,127,39] neutral = [127,127,127] try: if len(c...
{ "content_hash": "cea9db0067126807bdf4700aa69601b3", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 478, "avg_line_length": 61.69191919191919, "alnum_prop": 0.6019647973802702, "repo_name": "ant1b/Planets4X", "id": "00653a255ec4e08cfeaf601527aab612d1f644af", "size": "244...
import __builtin__ import locale import os import re import sys import textwrap from urllib import quote, quote_plus, unquote from unicodedata import east_asian_width from trac.util.translation import _ CRLF = '\r\n' class Empty(unicode): """A special tag object evaluating to the empty string""" __slots__ =...
{ "content_hash": "e794c138faf5ae72232e40afe3565de0", "timestamp": "", "source": "github", "line_count": 659, "max_line_length": 79, "avg_line_length": 33.371775417298934, "alnum_prop": 0.5653419425245544, "repo_name": "trac-ja/trac-ja", "id": "f188da2df6fe92e08810e9aa01afe915a48cfdb2", "size": "228...
from __future__ import print_function import httplib import optparse import os import sys import six.moves.urllib.parse as urlparse from glance.common import utils from glance.openstack.common import gettextutils from glance.openstack.common import jsonutils from glance.openstack.common import log LOG = log.getLogg...
{ "content_hash": "e193d189613f97b1a6d4be07161024ff", "timestamp": "", "source": "github", "line_count": 729, "max_line_length": 79, "avg_line_length": 35.4636488340192, "alnum_prop": 0.5560669941592852, "repo_name": "redhat-openstack/glance", "id": "0d60440b6fd90286c859a63e1e8214732f30a29e", "size"...
import sys import os import os.path import hashlib import datetime import uuid import random import string import time import threading import logging from future.utils import iteritems from pandaharvester.harvesterconfig import harvester_config from pandaharvester.harvestercore.job_spec import JobSpec from pandaharves...
{ "content_hash": "8e0b073b3380888ec68b0a17e5e7571b", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 119, "avg_line_length": 36.274924471299094, "alnum_prop": 0.6817689681019405, "repo_name": "PanDAWMS/panda-harvester", "id": "168ee496d77e9ba760f47c281d530180dff9e3c2", "s...
from django.db import models class Category(models.Model): title = models.CharField(max_length=100) slug = models.SlugField(max_length=100, unique=True) description = models.TextField() created = models.DateTimeField(auto_now_add=True) class Meta: ordering = ( '-created' ...
{ "content_hash": "bccc7dd9a57d3e08f37dcfc3319e7a48", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 95, "avg_line_length": 31.644444444444446, "alnum_prop": 0.6327247191011236, "repo_name": "ByteRockCode/django-sitelight", "id": "2019a0cc0755b8e66f5fd5d80b647d78b810814b", ...
from jira.client import JIRA # By default, the client will connect to a JIRA instance started from the Atlassian Plugin SDK # (see https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK for details). # Override this with the options parameter. options = { 'server': 'https://jira.atlassian...
{ "content_hash": "2cf6b3d7ae5fb54b02b7b33779b1d6d4", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 101, "avg_line_length": 34.46153846153846, "alnum_prop": 0.7433035714285714, "repo_name": "jameskeane/jira-python", "id": "89a2133e329f0aff78e965a00f127cd10c0e2228", "size"...
""" This module defines the events signaled by abinit during the execution. It also provides a parser to extract these events form the main output file and the log file. """ import sys import os.path import datetime import collections import ruamel.yaml as yaml import abc import logging import numpy as np from monty....
{ "content_hash": "7f9ba2e7c2d5ea9b0195f4ee0db0b457", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 124, "avg_line_length": 32.82151029748284, "alnum_prop": 0.6198145436798438, "repo_name": "montoyjh/pymatgen", "id": "85cb71421ee3691ec1b8677b444ba8e94924099e", "size": "2...
""" Copyright 2010-2018 University Of Southern California Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to...
{ "content_hash": "c9e6232fe777827cc88ab7f30a6a57cb", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 80, "avg_line_length": 46.23247232472325, "alnum_prop": 0.4875887939979248, "repo_name": "SCECcode/BBP", "id": "239364d80b1b388786f927f324ac24b74e0823ef", "size": "12551",...
""" Django settings for InertiaApi project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import...
{ "content_hash": "761fb7fa9921c1d927545eb58082ef4a", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 91, "avg_line_length": 26.036496350364963, "alnum_prop": 0.6834875245304177, "repo_name": "Wilimitis9/Inertia", "id": "e764def7985acbb970da74fd0fdbff27ad2b49b1", "size": "...
from numpy import average, std def standardize_matrix(m): """ Standardize each colum of the matrix 'm' """ averages = list(map(average, m)) stds = list(map(std, m)) return [list(map(lambda x: x if stds[i] == 0.0 else (x - averages[i]) / stds[i], m[i])) for i in range(len(m))]
{ "content_hash": "bbba1279e698b76806f707de3357ecd1", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 28.636363636363637, "alnum_prop": 0.5777777777777777, "repo_name": "moritz-wundke/pyMining", "id": "577373d8158dc9513ea126806e946ba4cbae3627", "size"...
from setuptools import setup setup(name='topojson', version='0.2.0', description='An extension to GeoJSON that encodes topology.', url='https://github.com/osgn/python-topojson', download_url='https://github.com/osgn/python-topojson/archive/0.2.0.tar.gz', packages=['topojson', 'geojson'], p...
{ "content_hash": "28c56b532c96e11be204234a91a12573", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 80, "avg_line_length": 26.9375, "alnum_prop": 0.6357308584686775, "repo_name": "osgn/python-topojson", "id": "1fd7af982487a275e1a7b1bdc408b38c3276e496", "size": "431", "b...
import http.server import socketserver PORT_NUMBER = 8080 #This class will handles any incoming request from #the browser class myHandler(request, client_address, server): #Handler for the GET requests def do_GET(self): self.send_response(200) self.send_header('Content-type','text/html')...
{ "content_hash": "2fa61d5192b6ff4e96f649fa7731425a", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 65, "avg_line_length": 28.70967741935484, "alnum_prop": 0.6775280898876405, "repo_name": "vivekzhere/scrachpad", "id": "3a00945bf78d87fa8b8715e964a68411f21df3bf", "size": "...
""" Author: OMKAR PATHAK Created On: 1st August 2017 """ import inspect def search(graph, start_vertex): """ Breadth first search algorithm :param graph: :param start_vertex: :return: """ # Take a list for storing already visited vertexes if start_vertex not in graph or graph[...
{ "content_hash": "63f4a84c74cdb1b25ab000f9d58cc655", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 93, "avg_line_length": 22.224489795918366, "alnum_prop": 0.6308539944903582, "repo_name": "OmkarPathak/pygorithm", "id": "1541577a624771b4eb900c1f7de250a260a8bb0d", "size":...
import json class ChivesMemory(): def __init__(self): self.userGender = "" self.userName = "" class ChivesMemoryEncoderDecoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, ChivesMemory): return [obj.userGender, obj.userName] return json.JSONEncoder....
{ "content_hash": "bb4bbbb85a23c927911fb1d5d3a12335", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 51, "avg_line_length": 29.105263157894736, "alnum_prop": 0.5949367088607594, "repo_name": "edbrown23/Chives", "id": "abeaceb87531c93220a2071cde397e1d80fa3f38", "size": "553...
from __future__ import unicode_literals from django.db import models class RecoDocError(Exception): """Exception thrown when a problem occurs with Py4J.""" pass class Project(models.Model): '''A project.''' name = models.CharField(max_length=255, unique=True) '''att.''' url = models.URLFie...
{ "content_hash": "616cf0019893fc7966f3372fc8304307", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 78, "avg_line_length": 25.610526315789475, "alnum_prop": 0.6165228113440198, "repo_name": "bartdag/recodoc2", "id": "30a5ecc466b9513363a96f27f17b0c5caa1e4146", "size": "243...
import unittest import os import sys sys.path.append(os.path.join('../lib')) from myStatistics import MyStatistics class outputTest(unittest.TestCase): def test_getFieldStdev(self): ms = MyStatistics() self.assertEqual(ms.getFieldStdev([1,1,1], None), 0, "getFieldStdev error") def test_getFie...
{ "content_hash": "39ced5e5990053a7ab84f0c4dbff8804", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 83, "avg_line_length": 26.05263157894737, "alnum_prop": 0.6646464646464646, "repo_name": "WemyJu/TOC_proj", "id": "1e39d62194383a68469ad8de8c6fc44c3d2d5e36", "size": "495",...
"""Views of the ``django-metrics-dashboard`` app.""" from django.conf import settings from django.views.generic import TemplateView from django.utils.decorators import method_decorator from metrics_dashboard.decorators import permission_required from metrics_dashboard.widget_pool import dashboard_widget_pool class P...
{ "content_hash": "3f02dcdd1e418f4abcb4ac1aba8aef69", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 34.614285714285714, "alnum_prop": 0.6929426330994635, "repo_name": "bitmazk/django-metrics-dashboard", "id": "b030bb78a50268d8dde55ecee5324ef972325314"...
import ckeditor_uploader.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventory', '0006_auto_20201021_0135'), ] operations = [ migrations.RenameField( model_name='item', old_name='image', new...
{ "content_hash": "05481e70739746c918de77488965e53d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 106, "avg_line_length": 27.333333333333332, "alnum_prop": 0.573170731707317, "repo_name": "hackerspace-ntnu/website", "id": "57c4f756cadf12b54c0c8e7eb754e8657654c1a3", "siz...
import os # Use the VERSION file to get version version_file = os.path.join(os.path.dirname(__file__), 'src', 'graf', 'VERSION') with open(version_file) as fh: grafpython_version = fh.read().strip() from setuptools import setup, find_packages setup( name = "graf-python", description = "Pytho...
{ "content_hash": "9840c586f732cfa8d73f86e6347ff113", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 126, "avg_line_length": 42.19230769230769, "alnum_prop": 0.6280765724703737, "repo_name": "cidles/graf-python", "id": "6be6437fa67fc30e10001c018d80a7d73250ace0", "size": "2...
"""Model directory methods.""" import os import tensorflow as tf def incrementing_model_dir(dirname: str, start: int = 0) -> str: """Create, given some `dirname`, an incrementing model directory. Args: dirname: The base directory name. start: The starting integer. Returns: A model directory `dirn...
{ "content_hash": "66920292efc360e665dbd4194dad15db", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 80, "avg_line_length": 30.047619047619047, "alnum_prop": 0.6925515055467512, "repo_name": "tensorflow/gnn", "id": "f75be2253f29f2fc871ed065c999b53603431afb", "size": "1324"...
"""Define version.""" import pathlib import subprocess here = pathlib.Path(__file__).resolve().parent __all__ = ["__version__", "__branch__"] # read from VERSION file with open(str(here / "VERSION")) as f: __version__ = f.read().strip() try: __branch__ = ( subprocess.run( ["git", "bra...
{ "content_hash": "706480deab3ba28f5c3d2c7fd774b841", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 18.321428571428573, "alnum_prop": 0.52046783625731, "repo_name": "wright-group/PyCMDS", "id": "1327365f96ebd1d56c23ab2732ef350bedf80b5c", "size": "51...
import nltk, os, pickle, time, sys, glob from collections import defaultdict from nltk.stem.snowball import EnglishStemmer from invidx import Index def read_as_string(filename): with open(filename, 'r') as content_file: content = content_file.read() content = "".join(i for i in content if ord(i)<...
{ "content_hash": "344590262f95a5b16665b7b7f620b32f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 127, "avg_line_length": 34.28813559322034, "alnum_prop": 0.5477014335145823, "repo_name": "JeffBezanson/julia_examples", "id": "b60c526926b131797ce9ace696118ab1f0226421", "...
from __future__ import absolute_import from traits.api import Instance, Button, Bool, Str, List, provides, Property # ============= standard library imports ======================== # ============= local library imports ========================== from pychron.external_pipette.protocol import IPipetteManager #from pyc...
{ "content_hash": "f11eb6eb8f396a66f8b53e06b0b6e4ff", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 121, "avg_line_length": 35.99669966996699, "alnum_prop": 0.5468048042541487, "repo_name": "UManPychron/pychron", "id": "c15ccc0d04ff34352ce2f33b2d1a7ce62e3a1334", "size": ...
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False Copy = False CleanAl...
{ "content_hash": "bdded7c847c1076116694b916985087d", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 195, "avg_line_length": 38.23098591549296, "alnum_prop": 0.5922487474211612, "repo_name": "xylsxyls/xueyelingshuang", "id": "b9831392ee971e222a5a5279af1c90546d0c4ac4", "si...
"""The default Windows Registry plugin.""" from plaso.events import windows_events from plaso.lib import utils from plaso.parsers import winreg from plaso.parsers.winreg_plugins import interface class DefaultPlugin(interface.KeyPlugin): """Default plugin that extracts minimum information from every registry key. ...
{ "content_hash": "be713647ceaa580feb27a3776aa62bf4", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 78, "avg_line_length": 37.11340206185567, "alnum_prop": 0.6647222222222222, "repo_name": "cvandeplas/plaso", "id": "6914f4b9c99b7eec4d3417a5f62aa2ca4cb450fc", "size": "4298...
from __future__ import unicode_literals import logging import re import six from storops.lib.common import cache from storops.lib.parser import ParserConfigFactory, OutputParser __author__ = 'Cedric Zhuang' log = logging.getLogger(__name__) class UnityParserConfigFactory(ParserConfigFactory): @classmethod ...
{ "content_hash": "960c28e69a7a33a7513b613d6c8ad977", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 76, "avg_line_length": 29.05263157894737, "alnum_prop": 0.5618206521739131, "repo_name": "emc-openstack/storops", "id": "27273ec5fdf8c23ec90e83a5838f4f37ce1d91a5", "size":...
__author__ = 'jcorbett' from mongoengine import * class ProjectReference(EmbeddedDocument): id = ObjectIdField() name = StringField()
{ "content_hash": "909a40aef576b38aa2b769b4eaeeae39", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 41, "avg_line_length": 16.22222222222222, "alnum_prop": 0.6986301369863014, "repo_name": "slickqa/slickqaweb", "id": "49084d5e5fe2de7b6702bf5f665660822150e44b", "size": "146...
from django import template register = template.Library() @register.inclusion_tag('moon_tracker/scan_result.html') def display_scan(scan, classes=""): return { 'scan': scan, 'classes': classes }
{ "content_hash": "8d77d6a5d863aeefd6932bc9c4e81c81", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 56, "avg_line_length": 18.583333333333332, "alnum_prop": 0.6502242152466368, "repo_name": "StephenSwat/eve_lunar_mining_organiser", "id": "ae47d660404a3c78fa0837500d55da4ceb7...
""" jabber """ import sys import sleekxmpp import zmq from core.config import settings from core.config.settings import logger from core.people import person from core.config.settings import REDIS import redis import atexit """ SleekXMPP: The Sleek XMPP Library Copyright (C) 2010 Nathanael C. Fritz Thi...
{ "content_hash": "34076700d9db194075327648d70cfaac", "timestamp": "", "source": "github", "line_count": 384, "max_line_length": 101, "avg_line_length": 33.96875, "alnum_prop": 0.5582643360932229, "repo_name": "vsilent/smarty-bot", "id": "c01de17e3a270a466395e20a158124b7c920c791", "size": "13090", ...
""" Copyright (c) 2013-2014 Heiko Strathmann All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and th...
{ "content_hash": "75cfbdc7e75bb2f18dc10abb4822ea38", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 93, "avg_line_length": 39.280575539568346, "alnum_prop": 0.6276556776556776, "repo_name": "karlnapf/kameleon-mcmc", "id": "a03de4e7b5185abd7cd4125b2c2d6be9cbf9eea3", "size...
''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use sendgrid to send emails - Use MEMCACHIER on Heroku ''' from configurations import values # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings try: from S3 import...
{ "content_hash": "cbb6cc62c05dd42a85ade18346aca348", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 97, "avg_line_length": 35.94656488549618, "alnum_prop": 0.6973879804629433, "repo_name": "hanleybrand/mdid3-core-a-goof-around", "id": "1fde89385f421d710cccbcb69801a5731793e...
import arrow from flask import ( render_template, current_app, url_for ) from feedback.database import ( Column, db, Model ) from feedback.utils import send_email class Monthly(Model): ''' The monthly report model - this only contains one field: a string of e-mails separated by commas if nec...
{ "content_hash": "d0c32c60f3fd187db2e6dde17145e4e0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 76, "avg_line_length": 34.377049180327866, "alnum_prop": 0.5560324272770625, "repo_name": "codeforamerica/mdc-feedback", "id": "3867a37715c800813fbd7e99faea3a24d0a953a7", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('mig_main', '0002_initial_split'), ('electees', '0003_electeeinterviewsurvey_instructions'), ] operations = [ migrations.CreateModel( ...
{ "content_hash": "c9fd7126ccad779c6de59480a754f232", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 114, "avg_line_length": 30.36, "alnum_prop": 0.5757575757575758, "repo_name": "tbpmig/mig-website", "id": "e3e22dde9299c29b8a8381fd7baba933fdc4ce1d", "size": "783", "bina...
from util.tipo import tipo class S_SKILL_CATEGORY(object): def __init__(self, tracker, time, direction, opcode, data): print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
{ "content_hash": "4dcfe3c0cdbba579e5d99b7d02af351c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 103, "avg_line_length": 45.6, "alnum_prop": 0.618421052631579, "repo_name": "jeff-alves/Tera", "id": "078f0edfc572f2d9471fbd0112bdfa5c1a483dae", "size": "228", "binary": f...
from __future__ import with_statement from contextlib import contextmanager import os import sys import datetime import imp import copy import fnmatch protocol = imp.load_source('protocol', '../protocol.py') nxDSCLog = imp.load_source('nxDSCLog', '../nxDSCLog.py') helperlib = imp.load_source('helperlib', '../helperlib...
{ "content_hash": "cee745ba2010291bfcb29f8825d32fd5", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 143, "avg_line_length": 40.46958174904943, "alnum_prop": 0.598205477521492, "repo_name": "MSFTOSSMgmt/WPSDSCLinux", "id": "accc0687dabd258abf142edaaea9f0c768a7c1d2", "size...
from __future__ import unicode_literals import contextlib import functools import json import logging import traceback from django.conf import settings from django.conf.urls import url from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.http import HttpResponse, Http404 from django.view...
{ "content_hash": "cc4f7175d66916d21425bc3821563a9b", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 116, "avg_line_length": 35.8280701754386, "alnum_prop": 0.5756537067867985, "repo_name": "pinax/pinax-api", "id": "5bb51aede4e86749912aa2a32dc885efaef40bd4", "size": "1021...
from django.utils import translation from parler.models import TranslationDoesNotExist from .testapp.models import AnyLanguageModel, EmptyModel, NotRequiredModel, SimpleModel from .utils import AppTestCase class ModelAttributeTests(AppTestCase): """ Test model construction """ def test_untranslated...
{ "content_hash": "b59cbcdeb11d9f40ab6c79f94082ec14", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 111, "avg_line_length": 36.69590643274854, "alnum_prop": 0.6030278884462151, "repo_name": "edoburu/django-parler", "id": "8a42a7251ec4c1bad6174f4145689dbb4537a794", "size"...
from .futures import FutureBase from . import async_task from . import _debug _debug_options = _debug.options def result(value): """An async equivalent for return for async methods: result(x); return.""" assert not isinstance( value, FutureBase ), "You probably forgot to yield this value before ...
{ "content_hash": "7a168451aa699acd9a7194dbdb68039a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 26.785714285714285, "alnum_prop": 0.7173333333333334, "repo_name": "quora/asynq", "id": "8ec36fa70e5b0d21204e1e6321c76625e8447aef", "size": "949", ...
""" Django settings for cacaomovilcom project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import envi...
{ "content_hash": "79c56eac6fd0b3dbaa8daab1792ac275", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 102, "avg_line_length": 35.99267399267399, "alnum_prop": 0.60451862405862, "repo_name": "javierwilson/cacaomovilcom", "id": "16324f2e693e9c53e84d811ec30a6e82c682f16b", "si...
''' follow.py Takes a list of input ingredient names. If there is more than one, arranges each item in the list in a row, importing as necessary. If there is only one, arrange next to another object in the scene. If the scene is empty and there's only one argument, just set it at the origin. Thomas Storey 2016 ''' ...
{ "content_hash": "8d52842d18f667c0fc6a7885b15193be", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 83, "avg_line_length": 35.466257668711656, "alnum_prop": 0.5877875800034597, "repo_name": "thomasrstorey/recipesfordisaster", "id": "df182e50537010580629a4ea07812c829a2c4dee...
from StringIO import StringIO from PIL import Image import iso_media params_num = { "LBAS": 0, "LAEN": 3 } def wrapLayers(layers, quality = 95, diffquality = 90): def wrapLayer(layer, boxtype, quality, parameters): def writeImageBuffer(): buf = "" for param in param...
{ "content_hash": "c2c5192986f569e6a11546b44ca43aed", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 72, "avg_line_length": 29.933333333333334, "alnum_prop": 0.5395322939866369, "repo_name": "yoavweiss/Responsive-Image-Container", "id": "a5d089c7dd0800f041cd2b09329dc984e385c...
import time import json import os from datetime import datetime, timedelta from world import world from bigml.api import HTTP_CREATED from bigml.api import HTTP_ACCEPTED from bigml.api import FINISHED from bigml.api import FAULTY from bigml.api import get_status from read_library_steps import i_get_the_library #@st...
{ "content_hash": "eff5ed9d60130ab01d8620bbe1627d6d", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 36, "alnum_prop": 0.6497395833333334, "repo_name": "xaowoodenfish/python-1", "id": "9fa8f0808a9ca75f4af2e7f5077cefcf5bd83d36", "size": "2922", "bin...
""" Provide exception classes for :mod:`migrate.versioning` """ class Error(Exception): """Error base class.""" class ApiError(Error): """Base class for API errors.""" class KnownError(ApiError): """A known error condition.""" class UsageError(ApiError): """A known error condition where help ...
{ "content_hash": "51f43a610795a7751dc9f6278cf3d2cc", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 71, "avg_line_length": 21.413333333333334, "alnum_prop": 0.7160647571606475, "repo_name": "denny820909/builder", "id": "00b5dd6894bf485726e15533f859f1866789ac10", "size": "...
class ConfigurationItem(object): def __init__(self,uuid,ip_mgmt,login,password): self.uuid = uuid self.ip_mgmt = ip_mgmt self.login = login self.password = password self.ci_parents = [] # List to store parents ci self.ci_children = [] # L...
{ "content_hash": "d05ec467f817443cfa2a3cc69838b1a4", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 73, "avg_line_length": 24.242424242424242, "alnum_prop": 0.51125, "repo_name": "uggla/alexandria", "id": "7647653b0fa2f45dbe4adfcb443dfc10daa15f3c", "size": "818", "binar...
from __future__ import unicode_literals """ This module provides classes to define everything related to band structures. """ __author__ = "Geoffroy Hautier, Shyue Ping Ong, Michael Kocher" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "1.0" __maintainer__ = "Geoffroy Hautier" __email__ = "geo...
{ "content_hash": "7ce869cc0665bd6bc4dc79a1c956800c", "timestamp": "", "source": "github", "line_count": 979, "max_line_length": 97, "avg_line_length": 41.83248212461696, "alnum_prop": 0.5188748351809347, "repo_name": "yanikou19/pymatgen", "id": "5105c74ec86f0808a1bdb5d5f2c04f75ceaec857", "size": "4...
''' Created on 4 Feb 2016 @author: fressi ''' from __future__ import absolute_import import sys import profiterole _COMMANDS = {} def main(argv=None): 'Profit main entry point.' if argv is None: argv = sys.argv if '--version' in argv[1:]: print_message(profiterole.__version__) ...
{ "content_hash": "b37ac7a6cb4223873983ba7e36eb595b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 17.854545454545455, "alnum_prop": 0.6018329938900203, "repo_name": "FedericoRessi/profiterole", "id": "e33ece5d60c7aa8dc3a27a4b1e642a950ce253dd", "si...
import hurl urlpatterns = hurl.patterns('pipeye.accounts.views', { 'preferences': 'preferences', })
{ "content_hash": "4d88369dea2568eea86ef8de6f8e8145", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 54, "avg_line_length": 21, "alnum_prop": 0.7047619047619048, "repo_name": "oinopion/pipeye", "id": "70152a27be6d24b0d0a045f14c54f788e547a94b", "size": "105", "binary": fal...
import numpy as np from keras.callbacks import TensorBoard, LambdaCallback from keras.layers import Dense, Activation, Convolution1D, MaxPooling1D, Concatenate, Flatten, Dropout from keras.models import Sequential, model_from_yaml from keras.optimizers import Adam class CNNModel: def __init__(self, model): ...
{ "content_hash": "31b5b35e7f89ea1fa39ae84f1447615d", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 120, "avg_line_length": 38.142857142857146, "alnum_prop": 0.6166399143927234, "repo_name": "aesuli/text-model", "id": "b5876f4d1973445aabd56f84546611a540f075b0", "size": "3...
import sys # sums all columns in biom table into one column def collapse_biom(biom,out): with open(biom) as b: temp = b.readline() temp = temp.split(']}}],"columns":')[0] temp = temp.split(']],"rows": [{"id": "') rows = temp[1] data = temp[0].split(',"data": [[')[1] # Da...
{ "content_hash": "05866921e4843954fc9437c518137e87", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 94, "avg_line_length": 37.588235294117645, "alnum_prop": 0.5101721439749609, "repo_name": "lotrus28/TaboCom", "id": "7ea64bfa784352db3f475d07e09e602c6e3c6d19", "size": "191...
""" Django settings for executive project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
{ "content_hash": "2bf2ae5cca4acda480c096a40e6cf020", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 88, "avg_line_length": 26.895238095238096, "alnum_prop": 0.7234419263456091, "repo_name": "bmcollier/vcloudexecutive", "id": "e3f5ae3ea16fe4a9a4c2e7c34359e87aed3a56c8", "s...
from requests import request import rclpy from rclpy.node import Node from std_srvs.srv import Empty from bitbots_msgs.msg import Buttons from rclpy.node import Node from rclpy.duration import Duration rclpy.init(args=None) node = Node('zero_on_button') zero_l = node.create_client(Empty, "/foot_pressure_left/set_foot...
{ "content_hash": "a22539bc3dcdefc1b0dc878b19376276", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 109, "avg_line_length": 33, "alnum_prop": 0.7064393939393939, "repo_name": "bit-bots/bitbots_lowlevel", "id": "7f874c7560a53af24917e89ed3c96e54bb991692", "size": "1079", ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_chocolatey version_added: '1.9' short_description: Manage packages using chocolatey description: - Manage packages using Chocolatey. - If Choco...
{ "content_hash": "10bbd055e48682f0e09c57d26661d405", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 140, "avg_line_length": 33.58423913043478, "alnum_prop": 0.7021603689618902, "repo_name": "thaim/ansible", "id": "70876edb36f17b8e3ba65b22d99659575817eb9c", "size": "12690...
import json import os import random import re import subprocess from ccmlib import common from dtest import Tester, debug from tools import known_failure, since class TestOfflineTools(Tester): # In 2.0, we will get this error log message due to jamm not being # in the classpath ignore_log_patterns = ["...
{ "content_hash": "255d767bf6cea8dae8366381fc5d81d6", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 146, "avg_line_length": 46.314087759815244, "alnum_prop": 0.6206243143512516, "repo_name": "mambocab/cassandra-dtest", "id": "43e0c8c051e9550a4454fd914b547117a4ea7980", "s...
def create(replies): """Used for faking out scripts so they can run like the book needs but be sectioned to appear to be normal. """ def input(prompt=None): reply = replies.pop(0) if prompt: print(prompt, end=' ') print(reply) return reply return input, input
{ "content_hash": "3bf698c4aab0777dfa756d3663b941a5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 59, "avg_line_length": 24.23076923076923, "alnum_prop": 0.6095238095238096, "repo_name": "zedshaw/learn-python3-thw-code", "id": "dbd4ace318135454f2ca37055ebbadfd316a83e4", ...
import xmlrpclib, socket, ConfigParser, os, os.path, time import siuxmethodlib class TimeoutTransport (xmlrpclib.Transport): """ Custom XML-RPC transport class for HTTP connections, allowing a timeout in the base connection. """ def __init__(self, timeout=socket._GLOBAL_DEFAULT_TIMEOUT, use_dat...
{ "content_hash": "77de83cc7ad321e676e39022b6bbdf07", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 163, "avg_line_length": 31.137404580152673, "alnum_prop": 0.5670507477322874, "repo_name": "eSiUX/siux-python", "id": "69bcb3862f86af1e541b84fcd463ac6ab38438b3", "size": "...
from django.conf.urls import patterns, url from core.views import report, user, scheduler, examinations, api, user_examinations, department, examination, doc from core.views.management import department urlpatterns = [ url(r'^$', examination.user_examination_list_view, name='user_examination_list_view'), url(...
{ "content_hash": "6366f975d6327703b2ca3f4771edf29d", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 200, "avg_line_length": 98.63157894736842, "alnum_prop": 0.7223408039843472, "repo_name": "telminov/personnel-testing", "id": "b1f2bac4229fb8e16aeaecd0b4158c330820ffc6", "s...
import unittest import _mysql import MySQLdb from MySQLdb.constants import FIELD_TYPE from configdb import connection_factory import warnings warnings.simplefilter("ignore") class TestDBAPISet(unittest.TestCase): def test_set_equality(self): self.assertTrue(MySQLdb.STRING == MySQLdb.STRING) ...
{ "content_hash": "edd80864538ae790550989d25930e2c1", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 72, "avg_line_length": 32.45977011494253, "alnum_prop": 0.6094192634560907, "repo_name": "hipnusleo/laserjet", "id": "9dcedfc1e184cd1666a7ea235488a6a357b6425b", "size": "28...
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="scattergl.marker", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name=plotly_name, parent_name=...
{ "content_hash": "61eda68206ad7bcaf9aaf5d607a1c1d2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 32.30769230769231, "alnum_prop": 0.6071428571428571, "repo_name": "plotly/plotly.py", "id": "207f192dea157339a3bf4538beb9cda9a1946a0d", "size": "420"...
"""Kd-tree for nearest neighbours queries. This implementation currently runs faster than SciPy's KDTree but is often slower than a brute-force approach in Hienoi's use cases, killing the primary purpose for such a data structure. Still, it is left here as an educational resource. """ import collections import heapq ...
{ "content_hash": "205caa7cf849ca7baf385a60dd1ded93", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 79, "avg_line_length": 38.79225352112676, "alnum_prop": 0.5365344467640919, "repo_name": "christophercrouzet/hienoi", "id": "c20bfa0e08d2cf576c5eef48a476e3f71876b85e", "si...
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os...
{ "content_hash": "863aeaa7f78add648087894c4b698a66", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 31.85185185185185, "alnum_prop": 0.6127906976744186, "repo_name": "Basask/xls-tmpl", "id": "19991291590866cccc6dca55b614b514b6f3a0b2", "size": "860",...
import httplib, urllib, base64, twitter, os from pprint import pprint import json def sentiment(scoreArray): headers = { # Request headers 'Content-Type': 'application/json', 'Ocp-Apim-Subscription-Key': '<your key>', } params = urllib.urlencode({ }) with open('tweetOutput.json', 'r') a...
{ "content_hash": "a1ee18078925f525d66ad5ba66accd89", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 104, "avg_line_length": 31.221052631578946, "alnum_prop": 0.5863115306810519, "repo_name": "rbitia/aci-demos", "id": "c24c941f49cb811a438113662b0e6fb5fd54574c", "size": "29...
import os from stat import ( S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_ISVTX, S_ISGID ) from nbgrader.apps.baseapp import TransferApp, transfer_aliases, transfer_flags from nbgrader.utils import get_username, check_mode aliases = {} aliases.update(transfer_ali...
{ "content_hash": "8015a21ba8448e1d28664f1eefccfec4", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 110, "avg_line_length": 38.59756097560975, "alnum_prop": 0.6584518167456556, "repo_name": "MatKallada/nbgrader", "id": "d2c3929daaa3c65971502860a47914ed90d30760", "size": "...
from runner.koan import * class Proxy: def __init__(self, target_object): # WRITE CODE HERE self._obj = target_object # WRITE CODE HERE # The proxy object should pass the following Koan: # class AboutProxyObjectProject(Koan): def test_proxy_method_returns_wrapped_object(self): # ...
{ "content_hash": "81863d7781821e65e7f413a4860c652b", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 70, "avg_line_length": 24.386861313868614, "alnum_prop": 0.5779706674648308, "repo_name": "dstanek/python_koans", "id": "ed2afa12e11b6bc51d3ac6d3ded15ce10942ad81", "size":...
import random from django.test import TestCase from django.core.cache import cache as django_cache from django.utils.timezone import now from pretix.base.models import Event, Organizer class CacheTest(TestCase): """ This test case tests the invalidation of the event related cache. """ @classmeth...
{ "content_hash": "ce61f20b09be27d3f4e8994e01b353f7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 68, "avg_line_length": 29.244897959183675, "alnum_prop": 0.6127006280530356, "repo_name": "Unicorn-rzl/pretix", "id": "31f6c645f4d03cb0de4a3d26e66a78e59445958c", "size": "1...
from concurrent.futures import ProcessPoolExecutor def formula(a, n): v = (a-1)**n + (a+1)**n return v % (a*a) def maxR(a, lim=10000): return max(formula(a, i) for i in range(lim + 1)) if __name__ == "__main__": executor = ProcessPoolExecutor(12) results = executor.map(maxR, range(999, 1001)) ...
{ "content_hash": "1f3263f37bc71ed2f01e8705de8e697e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 53, "avg_line_length": 26.153846153846153, "alnum_prop": 0.6205882352941177, "repo_name": "ulikoehler/ProjectEuler", "id": "5a08e2023b3ab2506fea5b292ababc67abdf21b5", "size...
'''get repository information for use in a shell prompt Take a string, parse any special variables inside, and output the result. Useful mostly for putting information about the current repository into a shell prompt. ''' from __future__ import with_statement import re import os import subprocess from datetime impo...
{ "content_hash": "cf811957cc6218b45a53f423215187dc", "timestamp": "", "source": "github", "line_count": 637, "max_line_length": 92, "avg_line_length": 30.601255886970172, "alnum_prop": 0.5687682757913097, "repo_name": "rushi/dotfiles", "id": "3851cad6ba3472d1d85c08fd604b777805b94daa", "size": "1951...
from __future__ import absolute_import, division, print_function from .generator import MarkovGenerator __all__ = [ 'MarkovGenerator', ] from ._version import get_versions __version__ = get_versions()['version'] del get_versions
{ "content_hash": "8a8c17184bc702c7fccc17967b2bffc2", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 23.5, "alnum_prop": 0.723404255319149, "repo_name": "kdmurray91/mpg", "id": "4f9ae96d55f80317f9535495d114869663b54df8", "size": "1351", "binary": f...
from . import viewsets from rest_framework import routers api_router = routers.SimpleRouter() api_router.register('category', viewsets.CategoryViewSet) api_router.register('source', viewsets.SourceViewSet) api_router.register('seed', viewsets.SeedViewSet) api_router.register('blacklist', viewsets.BlacklistViewSet)
{ "content_hash": "739deda69e666b8da45bc98843eec1bf", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 59, "avg_line_length": 31.9, "alnum_prop": 0.8087774294670846, "repo_name": "WebArchivCZ/Seeder", "id": "462755d5f69dea1369279bc0f509543326c6b45a", "size": "319", "binary...
import datetime import random from django.conf import settings from django.core.mail import send_mail from django.utils.translation import ugettext_lazy as _ from django.template.loader import render_to_string from django.contrib.auth.models import User from django.contrib.sites.models import RequestSite from django.co...
{ "content_hash": "90abb9a17e8aafd29d92cf220ea555ec", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 87, "avg_line_length": 37.543103448275865, "alnum_prop": 0.5818599311136624, "repo_name": "mouradmourafiq/django-invite-registration", "id": "5cfa267b4893db5a6ed0022a9cba805...
from django.utils.decorators import method_decorator from django.contrib.admin.views.decorators import staff_member_required from django.views.generic import TemplateView from django.views.generic.edit import CreateView try: from django.urls import reverse, reverse_lazy except ImportError: from django.core.urlr...
{ "content_hash": "6fb24053658c73478a6cc087d51f3688", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 81, "avg_line_length": 35.14655172413793, "alnum_prop": 0.6595535933284278, "repo_name": "AlexStarov/Shop", "id": "45a9f5103dd850652a389d5fbf49352d92c343e5", "size": "4101...
#------------------------------------------------------------ # Arduino Yun UDP Echo Server #------------------------------------------------------------ # Version 1.6 # April 14, 2018 # MIT License (in root of git repo) # by Tim Seemann # # # Takes UDP datagram packets at its UDP_PORT as input and # echoes...
{ "content_hash": "4c05afd2b8d6010b60a67b9c00b7b402", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 96, "avg_line_length": 31.629032258064516, "alnum_prop": 0.5915349311575727, "repo_name": "timsee/RGB-LED-Routines", "id": "eac4e9e9483b64252b92e907956b61d23dd5a743", "siz...
""" This is the place that takes the basic configuration of the LaTeX build project. """ LATEX_PROJECT = 'manual' DEFAULT_TARGET = 'pdf' IMAGES_DIRECTORY = 'images' GENERATED_DIRECTORY = 'generated' CHAPTER_DIRECTORY = 'chapters' FILE_EXTENSIONS = {'eps': '.eps', 'pdf': '.pdf', ...
{ "content_hash": "148736e207e7fcce71d267a66e943c12", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 65, "avg_line_length": 24.045454545454547, "alnum_prop": 0.499054820415879, "repo_name": "zer0infinity/CuteTestForCoastTest", "id": "bc575729ede98771f8a46ff2761b4d7410cbaba9"...
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ # Examples: # url(r'^$', 'pganalytics.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), ]
{ "content_hash": "9658383e8fbe26ca676407e3a31cd4fc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 56, "avg_line_length": 25.9, "alnum_prop": 0.637065637065637, "repo_name": "fearofcode/nagini", "id": "1ff5decd61f139495548e2d32675baac0165e75d", "size": "259", "binary":...