text
stringlengths
4
1.02M
meta
dict
import random from go_board import GoBoard class GoGame: def __init__( self, size = 0 ): self.size = size self.history = [ GoBoard( size ) ] self.whose_turn = GoBoard.WHITE self.consecutive_pass_count = 0 self.captures = { GoBoard.WHITE : 0, GoBoard.BLACK : 0 } def...
{ "content_hash": "fb81235d07b5a3e7a11bf4fe8ea7d19c", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 148, "avg_line_length": 46.10377358490566, "alnum_prop": 0.5373439738080622, "repo_name": "spencerparkin/Go", "id": "3b8eb3f804ac11f8f9a438d3c30a3daef477cae5", "size": "97...
import os import program_rust import task_primes class Program(program_rust.ProgramRust): def __init__(self, scale): current_dir = os.path.dirname(os.path.realpath(__file__)) source = os.path.join(current_dir, 'primes.rs') task = task_primes.TaskPrimes(scale=scale) super(Program, self).__init__(sour...
{ "content_hash": "d41e5a3a4a139b92a6adde670a7602b6", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 31.09090909090909, "alnum_prop": 0.7017543859649122, "repo_name": "eterevsky/benchmarks", "id": "b3c1a90688a3e800ae5cd3b855159de58403bf1c", "size": "...
from django.contrib import admin from web import models admin.site.register(models.SocialLink) admin.site.register(models.Stat) admin.site.register(models.Project) admin.site.register(models.Tag) admin.site.register(models.SocialTag) admin.site.register(models.FAQ) admin.site.register(models.PublicTag) admin.site.regi...
{ "content_hash": "8cba2f0cf5cd378458e5401634e2a9a8", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 38, "avg_line_length": 30.90909090909091, "alnum_prop": 0.8294117647058824, "repo_name": "db0company/db0.company", "id": "9c610a0d52fb5a3d08c52457024e76e276447fef", "size":...
""" Script to update Route53 with AWS hostnames found in nventory. Initially works only on AWS hostnames (CNAMEs). """ import argparse from zambi import ZambiConn from nvlib import Nventory from c3.utils.graphite import Graphite from c3.aws.route53.hostedzone import HostedZone class Nv2Route53(object): ''' Updat...
{ "content_hash": "4214eefc7fd95aad2d16e1bcddb42deb", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 72, "avg_line_length": 36.63865546218487, "alnum_prop": 0.5128440366972477, "repo_name": "CityGrid/c3", "id": "a7b0756c7a4ffd6bac9b5b64b8942c0cf767c0ae", "size": "4975", ...
from setuptools import setup, find_packages setup( name='aggregator', author='Alvin Wan', version='0.0.1', description='aggregates BIDS analysis results into Graph database', packages=find_packages() )
{ "content_hash": "b94a935488b8331944326ad606c7a2ea", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 22.4, "alnum_prop": 0.7008928571428571, "repo_name": "BIDS-projects/aggregator", "id": "92f5a4804bb588aa236715fbc05c3933bdf23663", "size": "224", "...
from effectThread import * from ledFunctions import * class effect_cop(StoppableThread): import time iInterval = 1 BUFFER_EFFECT_COPS = 1 def effect_cops(self): if self.BUFFER_EFFECT_COPS == 1: setRGB(255,0,0) self.BUFFER_EFFECT_COPS = 0 else: ...
{ "content_hash": "a7521bad4f490ea036240cf4b402e06e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 43, "avg_line_length": 24.076923076923077, "alnum_prop": 0.5559105431309904, "repo_name": "simondankelmann/LED-Server", "id": "dbd33db0b095637efcaf5c71b688591bebbd2549", "s...
from pact_test import given from pact_test import with_request from pact_test import has_pact_with from pact_test import upon_receiving from pact_test import service_consumer from pact_test import will_respond_with from pact_test import ServiceProviderTest from pact_test.either import * def test_default_service_consu...
{ "content_hash": "0a64064b70b008b97b507939c7d4c499", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 73, "avg_line_length": 26.916666666666668, "alnum_prop": 0.6749226006191951, "repo_name": "Kalimaha/pact-test", "id": "67b10ce1b82bb1b0e5fe793d03d27be99b37a903", "size": "...
from synergine_xyz.Context import Context as XyzContext from intelligine.cst import IMPENETRABLE from synergine_xyz.cst import POSITIONS from intelligine.synergy.stigmergy.MoleculesManager import MoleculesManager class Context(XyzContext): def __init__(self): super().__init__() self._molecules = ...
{ "content_hash": "ae492af0c5c3131ab5bd9d19b7b13a8f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 94, "avg_line_length": 28.94736842105263, "alnum_prop": 0.6572727272727272, "repo_name": "buxx/intelligine", "id": "0addf13172c87d1504e53ef73287a187b65e3e16", "size": "1100...
""" test_naming.py Created by Niall Richard Murphy on 2011-05-30. """ import config_parse import constants import os import sys import test_infrastructure as ti # Perhaps unittest2 is available. Try to import it, for # those cases where we are running python 2.7. try: import unittest2 as unittest except ImportErr...
{ "content_hash": "2c3e6a9279e37d5de0a608160854b8bf", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 76, "avg_line_length": 29.217391304347824, "alnum_prop": 0.7254464285714286, "repo_name": "niallrmurphy/pyvern", "id": "4e4381ac3cb2153ec042d7f03aba7d14566e3f38", "size": "...
import os main_dir = os.path.dirname(os.path.dirname(__file__))
{ "content_hash": "93ca58297f186901cb4c747526e4defa", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 53, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6923076923076923, "repo_name": "mcyprian/pyp2rpm", "id": "958c468c52b57ac35cc2f32c7839d6252f8fb4b7", "size": "65",...
import typing class BaseLockException(Exception): # Error codes: LOCK_FAILED = 1 def __init__( self, *args: typing.Any, fh: typing.Optional[typing.IO] = None, **kwargs: typing.Any, ) -> None: self.fh = fh Exception.__init__(self, *args) class LockExce...
{ "content_hash": "c7b0f52a56e7710f36fc769366ef6104", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 46, "avg_line_length": 16.555555555555557, "alnum_prop": 0.6062639821029083, "repo_name": "WoLpH/portalocker", "id": "b360c77e84d99d14b03042a90042d261a97267e3", "size": "44...
from .plugin import SimStatePlugin from ..s_action_object import ast_stripping_decorator, SimActionObject import sys import functools import logging l = logging.getLogger('simuvex.plugins.solver') #pylint:disable=unidiomatic-typecheck # # Timing stuff # _timing_enabled = False import time lt = logging.getLogger('s...
{ "content_hash": "73e7e70018701a0073db53a4daea8db2", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 148, "avg_line_length": 36.17223198594024, "alnum_prop": 0.6092702361286562, "repo_name": "chubbymaggie/simuvex", "id": "6a6f508c1aafb14e84dbe9e5547d4e1cec44e7ec", "size":...
""" WSGI config for ProgrammerCompetencyMatrix project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ProgrammerCompetenc...
{ "content_hash": "8b24f1cdfa44d7fd5c2e2ef3872caff1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 86, "avg_line_length": 30.5, "alnum_prop": 0.7939110070257611, "repo_name": "FiaDot/programmer-competency-matrix", "id": "2f3710fb5869226da7d0f4e542ea602c4af1554c", "size":...
import logging from flask import Flask from flask import request app = Flask(__name__) app.config['DEBUG'] = True import sys reload(sys) sys.setdefaultencoding('utf8') from google.appengine.api import taskqueue from google.appengine.ext import db import json from news import News from news import NewsModel import ...
{ "content_hash": "dea531c011f3a5f1987970a830615b94", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 107, "avg_line_length": 30.38607594936709, "alnum_prop": 0.6192459904186628, "repo_name": "chatea/NewsMap", "id": "de322351e0b312e5f4723db78e107af4022446f7", "size": "4815...
""" Implements instance extraction and decoding for mention-ranking models. This module implements two variants of the mention ranking model within a framework that expresses coreference resolution as predicting latent structures, while performing learning using a latent structured perceptron with cost-augmented infer...
{ "content_hash": "a42ae5273a9c46ab73b9c0b50c083219", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 80, "avg_line_length": 45.646288209606986, "alnum_prop": 0.6277623648713289, "repo_name": "smartschat/cort", "id": "3a7ff9231708a9f65f805f4466903a1b5a3dca5f", "size": "104...
from .resource import Resource class StorageAccountUpdateParameters(Resource): """ The parameters to update on the account. :param id: Resource Id :type id: str :param name: Resource name :type name: str :param type: Resource type :type type: str :param location: Resource location...
{ "content_hash": "a0922abe13a5d54159269292215ac9a2", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 129, "avg_line_length": 41.285714285714285, "alnum_prop": 0.6495304003954523, "repo_name": "jkonecki/autorest", "id": "1a4b6346505615b67842c8937ca65c592bf3943a", "size": "2...
import Cookie import logging import os def get_cookie_value(key): cookies = None try: cookies = Cookie.BaseCookie(os.environ.get('HTTP_COOKIE','')) except Cookie.CookieError, error: logging.debug("Ignoring Cookie Error, skipping get cookie: '%s'" % error) if not cookies: return...
{ "content_hash": "8fcaf7c9cc2f26fbd2d6192f62b4a50d", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 90, "avg_line_length": 29.551020408163264, "alnum_prop": 0.6070441988950276, "repo_name": "Khan/gae_bingo", "id": "b78e7f20530a6c0e7ce1fbe40d184410e0eef810", "size": "1448"...
from msrest.serialization import Model class DeploymentTrafficManagerProfile(Model): """ Deployment operation parameters. Variables are only populated by the server, and will be ignored when sending a request. :ivar uri: URI referencing the template. Default value: "https://azuresdkci.blob....
{ "content_hash": "1d823598b28f6970ad7504cd46033bbd", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 213, "avg_line_length": 49.13793103448276, "alnum_prop": 0.6748538011695906, "repo_name": "BurtBiel/azure-cli", "id": "780bf78046cf8afdd3e05097ce0c62bd273571eb", "size": "4...
def setup(context, scenario): """ set up scenario scaffolding for local samples :type context: behave.runner.Context :type scenario: behave.model.Scenario """ pass
{ "content_hash": "5b59b1fbeebee9e603b03a50ba428cab", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 49, "avg_line_length": 26.857142857142858, "alnum_prop": 0.675531914893617, "repo_name": "SteelToeOSS/Samples", "id": "79602bfd6d7ac44e3b8fd8c1cb2c83fe817d789f", "size": "19...
import argparse import cPickle as pickle import gzip import sys import cv2 from imagesift import get_sift_keypoints import numpy as np from sklearn.datasets import load_files from sklearn.metrics import accuracy_score, classification_report from sklearn.preprocessing import normalize parser = argparse.ArgumentParser...
{ "content_hash": "700af61ebec64eac77a7fa32866a77f9", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 70, "avg_line_length": 26, "alnum_prop": 0.7023411371237458, "repo_name": "pazeshun/jsk_apc", "id": "5b7aaa4840b4c09751e0216e5000634898208ee9", "size": "1243", "binary": ...
''' Low level Skype for Linux interface implemented using XWindows messaging. Uses direct Xlib calls through ctypes module. This module handles the options that you can pass to L{ISkype.__init__<skype.ISkype.__init__>} for Linux machines when the transport is set to X11. No further options are currently supported. ''...
{ "content_hash": "bd63ab4a525e60397bd4d3be52dbef14", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 116, "avg_line_length": 39.35280373831776, "alnum_prop": 0.5360090245205723, "repo_name": "neurodebian/htcondor", "id": "da6416caddad3c38de848381bb86c3aedef2515b", "size":...
"""Introspection of Moya elements""" from __future__ import unicode_literals from ..elements import Attribute from ..elements.elementproxy import ElementProxy from ..tags.context import DataSetter from .. import errors from ..logic import DeferNodeContents class GetParentElement(DataSetter): class Help: ...
{ "content_hash": "074a652049d9cc19a935ba74fa723584", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 91, "avg_line_length": 35.474926253687315, "alnum_prop": 0.5824879427906203, "repo_name": "moyaproject/moya", "id": "301a77386e0ea145e27a03771f73299c1b11b02e", "size": "12...
"""@package skdaccess The scikit-dataaccess package (import as skdaccess) provides a common api framework for importing and handling scientific data sets. This also supports standardized metadata tags, annotations, and queries. The package contains a base DataClass that provides a top level DataGenerator and DataWrapp...
{ "content_hash": "cbcf26868a1817744b5fe6242e4623d2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 31.666666666666668, "alnum_prop": 0.7954887218045112, "repo_name": "skdaccess/skdaccess", "id": "ee338dc81f4eb12587e2cbbdab8851a3a0e24845", "size": "...
import sendgrid import json import os sg = sendgrid.SendGridAPIClient(apikey=os.environ.get('SENDGRID_API_KEY')) ################################################## # Create a domain whitelabel. # # POST /whitelabel/domains # data = { "automatic_security": False, "custom_spf": True, "default": True, "doma...
{ "content_hash": "9e35b5f95830b48d238f8d94e165e894", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 114, "avg_line_length": 27.308681672025724, "alnum_prop": 0.6154480160131873, "repo_name": "gabrielkrell/sendgrid-python", "id": "f529d3ed2149e54678d20c3d2defcc7e0520a5cc", ...
try: from urllib.parse import quote_plus except ImportError: from urllib import quote_plus from html5lib.tokenizer import HTMLTokenizer from nose.tools import eq_ from bleach import linkify, url_re, DEFAULT_CALLBACKS as DC def test_url_re(): def no_match(s): match = url_re.search(s) if m...
{ "content_hash": "4d3c4725c221763df16c6a3facb3e5f5", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 78, "avg_line_length": 33.3448275862069, "alnum_prop": 0.5539038262668046, "repo_name": "sylarcp/anita", "id": "62da8d19f323bd5b2965867811a378d12c40a77b", "size": "15472",...
from decimal import * import getpass import math import os import os.path import platform import sys import time from jsonrpc import ServiceProxy, json BASE_FEE=Decimal("0.001") def check_json_precision(): """Make sure json library being used does not lose precision converting BST values""" n = Decimal("20000...
{ "content_hash": "3c3b1e0086b2b8885ff868a132d516b7", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 111, "avg_line_length": 38.83730158730159, "alnum_prop": 0.6199039542249923, "repo_name": "getcoin/globalboosty", "id": "fa36462ad9e5db32390a3be0afc8c8178b605109", "size":...
"""Certificate chain where the target certificate sets the extended key usage to clientAuth. Neither the root nor the intermediate have an EKU.""" import sys sys.path += ['../..'] import gencerts # Self-signed root certificate. root = gencerts.create_self_signed_root_certificate('Root') # Intermediate certificate. ...
{ "content_hash": "34538c3701b2c99c55f72538e4a8347e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 77, "avg_line_length": 32.6, "alnum_prop": 0.7653374233128835, "repo_name": "youtube/cobalt_sandbox", "id": "f9cc43ee146f404058f6051dcb68b046ce7e87b7", "size": "837", "bi...
from distutils.core import setup setup( name='RSAExploits', version='0.1.0', author='Kumar Vikramjeet, Eric Azebu', author_email='', packages=['RSAExploits', 'RSAExploits.exploits'], license='LICENSE.txt', description='Collection of RSA exploits', long_description=open('README.md').read...
{ "content_hash": "62fd248b83b97ddd0468e90302cd6a62", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 28.352941176470587, "alnum_prop": 0.5975103734439834, "repo_name": "vik001ind/RSAExploits", "id": "aadd41986750985798cf3b4e847b232a54854253", "size":...
from django.test import TestCase from django.urls import reverse class CsrfFailureTestCase(TestCase): def test_access_csrf_failure_view(self): """Verify that custom CSRF failure view loads properly.""" response = self.client.get(reverse("403-csrf")) self.assertEqual(response.status_code, 4...
{ "content_hash": "93ab4bab2c8f5531e7ebe307bc2256a6", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 66, "avg_line_length": 38.3, "alnum_prop": 0.7180156657963447, "repo_name": "pydata/conf_site", "id": "186672dc7f65eb1d23c8a6410d4fef76c1861329", "size": "383", "binary":...
""" :mod:`nova` -- Cloud IaaS Platform =================================== .. automodule:: nova :platform: Unix :synopsis: Infrastructure-as-a-Service Cloud platform. .. moduleauthor:: Jesse Andrews <jesse@ansolabs.com> .. moduleauthor:: Devin Carlen <devin.carlen@gmail.com> .. moduleauthor:: Vishvananda Ishaya ...
{ "content_hash": "e7aaee2806fb78bcabe7f8e31e3d0f16", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 60, "avg_line_length": 32.8125, "alnum_prop": 0.6819047619047619, "repo_name": "jxta/cc", "id": "2b25d1628d464cbbdf201dd40dedcabd50bd94bd", "size": "1138", "binary": fals...
from ..utils.display import Displayable, default_renderer_base, json_renderer_base from ..utils.display import MimeBundleType, RendererType __all__ = ( "Displayable", "default_renderer_base", "json_renderer_base", "MimeBundleType", "RendererType" )
{ "content_hash": "f2e09136c034898facc799f12307bd2f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 82, "avg_line_length": 24.636363636363637, "alnum_prop": 0.7047970479704797, "repo_name": "ellisonbg/altair", "id": "2be6e0c4c30b333813f3fa7dc022a18e22e297f4", "size": "271...
"""Setup script for Bokeh.""" #----------------------------------------------------------------------------- # Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENCE.txt, distributed with this software. #---------...
{ "content_hash": "7f72d610b372edb70bbbd6e5a3607373", "timestamp": "", "source": "github", "line_count": 596, "max_line_length": 137, "avg_line_length": 35.25167785234899, "alnum_prop": 0.560542598762494, "repo_name": "quasiben/bokeh", "id": "0fe857dcc3941414e19ffdb36f98a902c96e922b", "size": "21010...
"""This module contains the GCI WorkSubmission Model. """ __authors__ = [ '"Madhusudan.C.S" <madhusudancs@gmail.com>', '"Lennard de Rijk" <ljvderijk@gmail.com>', ] from google.appengine.ext import blobstore from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.base...
{ "content_hash": "86aea0aa2ed40e17d08b2149d236d083", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 36.66153846153846, "alnum_prop": 0.7167436005035669, "repo_name": "SRabbelier/Melange", "id": "d6d97ddf4247d424f8eae4bfb7aedb421a788fdc", "size": "29...
import os import pytest import tensorflow as tf from absl.testing import parameterized from tensorflow import keras from keras_nlp.tokenizers.byte_pair_tokenizer import BytePairTokenizer VOCAB_PATH = keras.utils.get_file( None, "https://storage.googleapis.com/keras-nlp/models/roberta_base/vocab.json", ) MERG...
{ "content_hash": "d29738434dc19dcddde8d40be3ebece2", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 80, "avg_line_length": 36.18248175182482, "alnum_prop": 0.6104498688723018, "repo_name": "keras-team/keras-nlp", "id": "f6652c7530db143ef43f187bc63da01275df48b4", "size": ...
from msrest.serialization import Model class RegenerateKeyParameters(Model): """Regenerate key parameters. :param key_name: key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' :type key_name: str or :class:`KeyName <azure.mgmt.cognitiveservices.models.KeyName>` """ ...
{ "content_hash": "41eb1761fe4186ac3ac0521cf34846c3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 70, "avg_line_length": 26.61111111111111, "alnum_prop": 0.6325678496868476, "repo_name": "rjschwei/azure-sdk-for-python", "id": "0d0487503e0f488373d070f14d2138c171e44d1d", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('zerver', '0075_attachment_path_id_unique'), ] operations = [ migrations.AddField( model_name='userprofile', name='emojiset', field=models.CharField(choic...
{ "content_hash": "a873660673e7f43f8ab39146b97d3b8a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 195, "avg_line_length": 30.8125, "alnum_prop": 0.5963488843813387, "repo_name": "Galexrt/zulip", "id": "280dae5c3899c8f27c072ce44f64707e4124568b", "size": "567", "binary"...
import os, sys if __name__ == "__main__": os.environ.setdefault("PYTHONPATH", '/home/docker/hydroshare') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hydroshare.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "643c67dd48923197663eea50a9fe0d8e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 74, "avg_line_length": 41.42857142857143, "alnum_prop": 0.7172413793103448, "repo_name": "hydroshare/hydroshare_temp", "id": "663b77bd88656f61e2c57c646572298d1bb2bff3", "siz...
from common import Config def lambda_handler(event, context=None): failures = get_failures(event) if failures: raise Exception('The following steps have failed:\n' + '\n'.join(failures)) return event def get_failures(results, context=[]): failures = [] for state_name, result in results.items(): i...
{ "content_hash": "12447393fdb51bb1a971452a3e9bf691", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 28.59090909090909, "alnum_prop": 0.6581875993640699, "repo_name": "hhvm/packaging", "id": "8318953a8564389d32764d2986092d2e1d1bab47", "size": "824", ...
"""Store UDHR data into database using ACBX and LOB Adjust settings: FNR DBID ZF $Date: 2008-08-29 16:46:45 +0200 (Fri, 29 Aug 2008) $ $Rev: 67 $ """ # Copyright 2004-2008 Software AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance w...
{ "content_hash": "dc1923b3a3a1488f34457ad780f23d37", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 82, "avg_line_length": 28.971014492753625, "alnum_prop": 0.592296148074037, "repo_name": "flavio-casacurta/Nat2Py", "id": "2a25ce4ca8667931e4334c8498a186e2244f65f7", "size...
import logging import time from typing import Union, Optional import ray from ray.experimental.workflow import workflow_context from ray.experimental.workflow.common import Workflow from ray.experimental.workflow.step_executor import commit_step from ray.experimental.workflow.storage import ( Storage, create_stor...
{ "content_hash": "405bee2415987a7a80d0d9e6d41c1237", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 78, "avg_line_length": 42.4, "alnum_prop": 0.6728773584905661, "repo_name": "pcmoritz/ray-1", "id": "80c68eb6c5a05ad5d452a75e6ac33c192e5ed570", "size": "4240", "binary":...
import math from typing import List from .constants import Constants DIRECTIONS = Constants.DIRECTIONS RESOURCE_TYPES = Constants.RESOURCE_TYPES class Resource: def __init__(self, r_type: str, amount: int): self.type = r_type self.amount = amount class Cell: def __init__(self, x, y): ...
{ "content_hash": "0a7f89cd353afaeeca4e0b5cf5ee1b7a", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 72, "avg_line_length": 28.754716981132077, "alnum_prop": 0.5574146981627297, "repo_name": "Kaggle/kaggle-environments", "id": "3b11ec4b47093dc014baa55d6eba146d1bab90c1", "...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) cwd = os.getcwd()...
{ "content_hash": "44685713db444fa889afd75e7b9540df", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 83, "avg_line_length": 32.36776859504132, "alnum_prop": 0.7058598238222903, "repo_name": "thesgc/cbh_datastore_model", "id": "8ab5df797a92a35e49252e0e162226f23fd6cdbd", "s...
import asyncio import logging import multiprocessing as mp import os import threading from typing import Any from typing import Callable from typing import Dict from typing import Tuple from typing import Optional import kopf import yaml import ray.autoscaler._private.monitor as monitor from ray._private import servi...
{ "content_hash": "68f5f26b489fa5706107559057461711", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 79, "avg_line_length": 36.610271903323266, "alnum_prop": 0.6371513451064532, "repo_name": "pcmoritz/ray-1", "id": "91a5df1fd6fbea186c0381ae9be61c19011c466f", "size": "1211...
from abc import ABCMeta, abstractmethod class Shape(object): __metaclass__ = ABCMeta @abstractmethod def draw(self): raise NotImplementedError() class Rectangle(Shape): def __init__(self): super(Rectangle, self).__init__() def draw(self): print 'Drawing Rectangle...' c...
{ "content_hash": "cbfd24a87073794464acc6a6e4d8dd07", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 41, "avg_line_length": 18.818181818181817, "alnum_prop": 0.5929951690821256, "repo_name": "rolandovillca/python_basic_introduction", "id": "422cbeb9adddf2fd605ba6d68693bc16c4...
def clamp(value, minValue, maxValue): return min(max(minValue, value), maxValue) def clampX(target, minX, maxX): target.setX(clamp(target.getX(), minX, maxX)) def clampY(target, minY, maxY): target.setY(clamp(target.getY(), minY, maxY)) def clampZ(target, minZ, maxZ): target.setZ(clamp(target.getZ(), minZ, maxZ)...
{ "content_hash": "ecbbb470d869ee821505262812845ea9", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 46, "avg_line_length": 29.272727272727273, "alnum_prop": 0.7142857142857143, "repo_name": "codistmonk/burdenofproof", "id": "bad4228a22ca2b8ac282a9c33dc202029a8cac95", "siz...
from __future__ import unicode_literals import datetime from django.core import signing from django.db import models from django.db import transaction from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.uti...
{ "content_hash": "c207e4d3784f2dcfedd5fe7b3e7d5ee8", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 77, "avg_line_length": 36.23295454545455, "alnum_prop": 0.5817782656421515, "repo_name": "nimbis/django-allauth", "id": "293e5f331861dc2e643ef445ca1298f80c38cf78", "size":...
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
{ "content_hash": "f98478c64a68c1dbe43e0aa43acddde8", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 134, "avg_line_length": 40.75806451612903, "alnum_prop": 0.6705579738820736, "repo_name": "rvs/gpdb", "id": "22b4a57f1cb40a3376a191b137958c439996e195", "size": "5054", "...
import sys, os.path from optparse import OptionParser def main(): # Parse the command-line options. parser = OptionParser() parser.add_option("-v", "--verbosity", action = "store", dest = "verbosity", default = "1", type = "choice", choices = ["0", "1", "2", "3"], ...
{ "content_hash": "d1070e102786ceb6c680b928bb7e0bab", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 86, "avg_line_length": 32.1, "alnum_prop": 0.5794392523364486, "repo_name": "etianen/django-optimizations", "id": "f65aaa739f3050c5d0cb8dcc15e715254140ed2e", "size": "2590"...
import os import git import logging import yaml from pecan import conf # noqa logger = logging.getLogger(__name__) RESOURCES_STRUCT = {'resources': {'rtype': {'key': {}}}} class YAMLDBException(Exception): pass class YAMLBackend(object): def __init__(self, git_repo_url, git_ref, sub_dir, ...
{ "content_hash": "d846eca592576ae297ca0ea87aa0ec81", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 79, "avg_line_length": 40.01990049751244, "alnum_prop": 0.5435106911984088, "repo_name": "enovance/managesf", "id": "0f1835a5f927cb49e5e28d108a8a262cf5d89520", "size": "86...
import abc import six from st2common.runners.utils import get_logger_for_python_runner_action @six.add_metaclass(abc.ABCMeta) class Action(object): """ Base action class other Python actions should inherit from. """ description = None def __init__(self, config=None, action_service=None): ...
{ "content_hash": "0bb1a522e05b7b625260a43ff1f09c1a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 94, "avg_line_length": 25.233333333333334, "alnum_prop": 0.6354029062087186, "repo_name": "tonybaloney/st2", "id": "d58cca7ae64c347d34f2a194a8abdb09bab6bcca", "size": "1537...
import pyfuzzy_toolbox.features.selection as selection import os path_name = os.path.dirname(os.path.realpath(__file__)) arff_file_test = path_name + '/cornell_movies_test.arff' def test_features_selection_10_fold_crossvalidation_seed_1_min_folds_10_CfsSubsetEval(): selected_attributes = selection.select_attributes...
{ "content_hash": "b9723de4b5b88b206b1db918708da965", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 131, "avg_line_length": 72.71428571428571, "alnum_prop": 0.7696463654223968, "repo_name": "matheuscas/pyfuzzy_toolbox", "id": "2719eb250b5aa510fa3dbdec3f4fb0d6b6f2fe1e", "s...
from __future__ import print_function from collections import OrderedDict import pygion from pygion import task, Fspace, R, Region, RW # FIXME: Need a better way to determine task IDs. hello = pygion.extern_task( task_id=10000, argument_types=[pygion.int64, pygion.float64], return_type=pygion.int64, c...
{ "content_hash": "0e42b1a4e7b0ef8bab66630bce7fda89", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 78, "avg_line_length": 26.53191489361702, "alnum_prop": 0.6639935846030474, "repo_name": "StanfordLegion/legion", "id": "2e978e27c4fd54819c7e43d46c16e97bbc34d383", "size": ...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Logit'] , ['MovingAverage'] , ['NoCycle'] , ['AR'] );
{ "content_hash": "ae7e330c42538633402895fef41fb5f6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 76, "avg_line_length": 37.25, "alnum_prop": 0.697986577181208, "repo_name": "antoinecarme/pyaf", "id": "f7e5bcfa3a2e15ea6b2e59c52778032929d9a115", "size": "149", "binary":...
field = ['ehfpiAcc', 'geneSymbol', 'geneDescription', 'previousName', 'synonyms', 'entrezId', 'uniprotId', 'proteinName', 'ensemblGeneId', 'targetOrganism', 'drosophilaGene','humanHomolog', 'go', 'pathway', 'isVTP', 'resources', 'geneNote', 'fullName', 'abbreviation', 'aliases'...
{ "content_hash": "9b020ce63fc85a8a8c4d7f7cf270d32a", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 129, "avg_line_length": 64.44444444444444, "alnum_prop": 0.4682266009852217, "repo_name": "polojacky/ehfpi", "id": "c379d4b9076f9e8abe99c065c2a5a6d53d35b231", "size": "4092...
""" Django settings for CloudConfigWebserver project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ #...
{ "content_hash": "7534a29f4dde4ccc0fd649b872e986f3", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 71, "avg_line_length": 24.924050632911392, "alnum_prop": 0.6835957338750634, "repo_name": "remohammadi/coreos-cloud-bootstrapper", "id": "95e7dc39f06f8b0a18fb8aebdbf6da136035...
import sys import serial # import struct import time import math import colorsys import Queue import threading ser = open("/dev/dmx0",'w') nullstr = u'00 ' * 513 # must start with null byte Ustr = u'00 ' * 513 # must start with null byte buf = bytearray.fromhex(Ustr) while(True): for i in range(255): ...
{ "content_hash": "d0bed4309d75cd8f51651d2ebbd51307", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 51, "avg_line_length": 17.10810810810811, "alnum_prop": 0.5671406003159558, "repo_name": "headrotor/aurora-server", "id": "997eaddc0922dc88e9e33053ced67e54418bbafc", "size"...
import sys, os sys.path.append(os.pardir) # 親ディレクトリのファイルをインポートするための設定 import numpy as np import matplotlib.pyplot as plt from dataset.mnist import load_mnist from simple_convnet import SimpleConvNet from common.trainer import Trainer # データの読み込み (x_train, t_train), (x_test, t_test) = load_mnist(flatten=False) # 処理に時間...
{ "content_hash": "bc522fe86aa47f47290331332f7e8b46", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 95, "avg_line_length": 33.75609756097561, "alnum_prop": 0.6575144508670521, "repo_name": "kgsn1763/deep-learning-from-scratch", "id": "a0afa1e38ac36ff2e72448bbdad8f47d1f0312a...
class Private: def __init__(self, names): self.__names = names self.__data = {} def __getattr__(self, name): if name in self.__names: return self.__data[name] raise AttributeError(name) def __setattr__(self, name, value): if name.startswith("_Private"): ...
{ "content_hash": "63b178bd2b9953eb6db698295179a29e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 98, "avg_line_length": 30.032258064516128, "alnum_prop": 0.5241675617615468, "repo_name": "janusnic/21v-python", "id": "5649417874881e8c754b86312f30d69804b0ccb7", "size": "...
import os import platform import subprocess from os.path import join import six # 3rd party libs from nose.plugins.skip import SkipTest from git import * # PyGitup imports from tests import basepath, write_file, init_master test_name = 'bundler' repo_path = join(basepath, test_name + os.sep) def setup(): mast...
{ "content_hash": "d6f04ab431e2bf0952a7b80886321f92", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 26.23611111111111, "alnum_prop": 0.6363155108523028, "repo_name": "christer155/PyGitUp", "id": "72abdcf5a95086db110a06b79aacd01e864cdf7c", "size": "1...
import mongoengine as me from st2common import log as logging from st2common.models.db import MongoDBAccess from st2common.models.db import stormbase from st2common.constants.types import ResourceType __all__ = [ 'ActionAliasDB' ] LOG = logging.getLogger(__name__) PACK_SEPARATOR = '.' class ActionAliasDB(sto...
{ "content_hash": "5f94034c1c2c33b6dbb05e71b2040289", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 79, "avg_line_length": 28.403225806451612, "alnum_prop": 0.6604202157864849, "repo_name": "alfasin/st2", "id": "1757cc408a95caa3cccee1318a446bdc773bf571", "size": "2541", ...
import psychic_disco.util as util class FakeLambdaConsole(object): """ Fake Driver for AWS Lambda """ def _open_relative_json(self, json_path): path = util.relative_path(__file__, json_path) return util.open_json_file_as_dict(path) def list_functions(self): return self._open_relat...
{ "content_hash": "aeaf3b1fdc0f365be04ed50827e4b46c", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 62, "avg_line_length": 34.48275862068966, "alnum_prop": 0.589, "repo_name": "robertdfrench/psychic-disco", "id": "54127a7e038fe5d7a359081077d5ef3e7eddfb28", "size": "1000",...
from unittest import mock import graphene from .....checkout import base_calculations from .....checkout.fetch import fetch_checkout_info, fetch_checkout_lines from .....checkout.utils import ( add_variant_to_checkout, add_voucher_to_checkout, calculate_checkout_quantity, invalidate_checkout_prices, )...
{ "content_hash": "80155315df82c14342369a7d42f7565a", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 85, "avg_line_length": 36.48571428571429, "alnum_prop": 0.6836335160532498, "repo_name": "mociepka/saleor", "id": "b1320c07067c1a179d19466fb75f1ecf388bce72", "size": "5108...
""" Logplex instrumentation. Usage: lplex <message>... [--proc=<proc>] [--token=<token>] lplex -h | --help Options: -h --help Show this screen. --version Show version. """ import os import json from datetime import datetime, timedelta from logplex import Logplex from docopt import docopt LOG_TOKEN...
{ "content_hash": "55bd031ac76aa776424f2a57003c15b9", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 54, "avg_line_length": 18.41304347826087, "alnum_prop": 0.615112160566706, "repo_name": "kennethreitz/lplex", "id": "eb6f2f95e9b47065167daf768924d305de468c39", "size": "870...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/loot/tool/shared_taloscope_broken.iff" result.attribute_template_id = -1 result.stfName("item_n","taloscope_broken") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "63f1a6d15b42acfaf902dabb500642a0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 23.692307692307693, "alnum_prop": 0.698051948051948, "repo_name": "anhstudios/swganh", "id": "b08932cc59563ae76705bab96685c895da8906d5", "size": "453...
from __future__ import absolute_import, unicode_literals, print_function BOARD_DIMENSION = 19 MIN_BOARD_DIMENSION = 5 MAX_BOARD_DIMENSION = 19
{ "content_hash": "b6be2e7cdfe6f38c1b48d73e324c5646", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 72, "avg_line_length": 28.8, "alnum_prop": 0.7708333333333334, "repo_name": "vail130/tenzen", "id": "3bc489840e72909bb7ea061137c4b58c8bd23704", "size": "144", "binary": fa...
'''module for connectors''' __import__('pkg_resources').declare_namespace(__name__)
{ "content_hash": "6ba7a59731a28dbe9884e70b67913ac1", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 55, "avg_line_length": 42, "alnum_prop": 0.6785714285714286, "repo_name": "tomncooper/heron", "id": "6cba8a20d5a6d05a556419017c5d8087c0c1da9a", "size": "869", "binary": fa...
from subprocess import call BUILD_DIR='build' FONTa='Fake Receipt' LANG='hb' OUTPUTBASE = LANG + '.' + FONTa def call_shell(command): splitted = command.split() call(splitted) print(command) def text2image(text_file): splitted = str('text2image --text=' + text_file + ' --fonts_dir ..').split() ...
{ "content_hash": "e10f978b62dc6ff0c0d2f8246d8bff0b", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 80, "avg_line_length": 21.013333333333332, "alnum_prop": 0.6135786802030457, "repo_name": "stryku/hb", "id": "337ff8134f46bd676c7f196d684a6f64af602b98", "size": "1576", "...
import proto # type: ignore from google.ads.googleads.v10.enums.types import ( response_content_type as gage_response_content_type, ) from google.ads.googleads.v10.resources.types import ( shared_set as gagr_shared_set, ) from google.protobuf import field_mask_pb2 # type: ignore from google.rpc import status...
{ "content_hash": "b1a7d3c582d88a26711e052048d7a956", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 113, "avg_line_length": 32.270718232044196, "alnum_prop": 0.6397877075843178, "repo_name": "googleads/google-ads-python", "id": "8680ba4773a5655cd10f92efa62637669ef5cea2", ...
__version__ = 1.0 import random import sys import os import io import unittest import logging import logging.config import yaml import scipy as sp import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from ctypes import * ##############self defined functions##################################### d...
{ "content_hash": "c203f473a1a9c0c252ad98f3731501b1", "timestamp": "", "source": "github", "line_count": 1754, "max_line_length": 199, "avg_line_length": 30.14994298745724, "alnum_prop": 0.5302460147873608, "repo_name": "shennjia/weblte", "id": "c6dbcdb0efcd0b11b15f845229f09ab2ae2ba73a", "size": "52...
from io import BytesIO import PIL.Image from django.core.files.images import ImageFile from wagtail.images import get_image_model Image = get_image_model() def get_test_image_file(filename='test.png', colour='white', size=(640, 480)): f = BytesIO() image = PIL.Image.new('RGBA', size, colour) image.save...
{ "content_hash": "7c1d6499a60f679350d7633c7defeddb", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 84, "avg_line_length": 27.689655172413794, "alnum_prop": 0.6699875466998755, "repo_name": "timorieber/wagtail", "id": "2c48b1266d117e06d1113f3bce30c6c91760be04", "size": "8...
""" This module started out as largely a copy paste from the stdlib's optparse module with the features removed that we do not need from optparse because we implement them in Click on a higher level (for instance type handling, help formatting and a lot more). The plan is to remove more and more from here over time. ...
{ "content_hash": "8ad68f17882eff5fd54041b7c3b84ee8", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 85, "avg_line_length": 36.05769230769231, "alnum_prop": 0.5839407407407408, "repo_name": "mitsuhiko/click", "id": "d730e010669445e9a5c0a58a2e13116391d32787", "size": "1687...
import os import sys sys.path.insert(0, os.path.abspath('../')) # -- Project information ----------------------------------------------------- project = 'libcloudforensics' copyright = '2020, Google' author = 'Google' # -- General configuration --------------------------------------------------- # Add any Sphinx ...
{ "content_hash": "2f6f9439595380923781d95700af69ac", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 80, "avg_line_length": 28.78125, "alnum_prop": 0.6536373507057546, "repo_name": "google/cloud-forensics-utils", "id": "66c99eaaa208ba5b2535baf97f47a2a62c7e5df2", "size": "2...
from nhl_schedule_translate import app if __name__ == '__main__': app.debug = True app.run()
{ "content_hash": "3dec71ba10e883a1bc653a61ba452db1", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 38, "avg_line_length": 20.2, "alnum_prop": 0.6039603960396039, "repo_name": "glebb/Nhl-Schedule-translate-2013-2014", "id": "733b2004afdbb97537ee723c3f86255777b98adc", "size...
from telemetry.page import page as page_module from telemetry import story class ToughCanvasCasesPage(page_module.Page): def __init__(self, url, page_set): super(ToughCanvasCasesPage, self).__init__(url=url, page_set=page_set) self.archive_data_file = 'data/tough_canvas_cases.json' def RunNavigateSteps(...
{ "content_hash": "104f88999fd2004ead334e25e1243326", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 111, "avg_line_length": 46.68181818181818, "alnum_prop": 0.7156767283349562, "repo_name": "Samsung/ChromiumGStreamerBackend", "id": "28ce0bb8158ccb82cf0d4b72cd7513612d09b51a"...
from core.himesis import Himesis import uuid class HState2CProcDef(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule State2CProcDef. """ # Flag this instance as compiled now self.is_compiled = True super(HS...
{ "content_hash": "d19e653706a8a2579f8e7433d21cf74d", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 577, "avg_line_length": 42.29752066115702, "alnum_prop": 0.49833919499804613, "repo_name": "levilucio/SyVOLT", "id": "fccdfb4fa0326a82f5ea1acc3231277299600edc", "size": "1...
from django.apps import AppConfig class ComposeConfig(AppConfig): name = 'pdc.apps.compose' def ready(self): from pdc.apps.utils.utils import connect_app_models_pre_save_signal connect_app_models_pre_save_signal(self)
{ "content_hash": "c250abbf18490dbedd75a42173faf2c0", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 75, "avg_line_length": 27.22222222222222, "alnum_prop": 0.7142857142857143, "repo_name": "release-engineering/product-definition-center", "id": "3b983bcb4b1b11fac1bf4ca8d106ab...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lotes', '0038_leadcolecao_lm_cor'), ] operations = [ migrations.CreateModel( name='RegraLeadTamanho', fields=[ ...
{ "content_hash": "f9405b0a7905ee42e8c940a26844393a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 154, "avg_line_length": 36.6, "alnum_prop": 0.5879781420765028, "repo_name": "anselmobd/fo2", "id": "9f01a3a1f0f4e6960988fd156d3eacffd0e648b8", "size": "995", "binary": f...
import json from telegram import ParseMode class TestParseMode: markdown_text = "*bold* _italic_ [link](http://google.com)." html_text = '<b>bold</b> <i>italic</i> <a href="http://google.com">link</a>.' formatted_text_formatted = u'bold italic link.' def test_send_message_with_parse_mode_m...
{ "content_hash": "93571c578e3dbf5596b1efefd77e20da", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 39.34782608695652, "alnum_prop": 0.6143646408839779, "repo_name": "rogerscristo/BotFWD", "id": "d64b66433887f5dc61038c718b8b0c3acc73dc67", "size": "1...
"""Base class for optimizers.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc from tensorflow.python.eager import backprop from tensorflow.python.eager import context from tensorflow.python.framework import dtypes...
{ "content_hash": "c96ee0a0383ce8e6b0013ed04f67f61a", "timestamp": "", "source": "github", "line_count": 896, "max_line_length": 98, "avg_line_length": 37.4453125, "alnum_prop": 0.6720813090518911, "repo_name": "nolanliou/tensorflow", "id": "9ec588bac96d8c8404dee994bc5991f897abbf77", "size": "34241"...
from lettuce import world, after, before from tools import terrain_steps from tools import environment_request from tools.environment_request import EnvironmentRequest from tools.constants import PAAS, KEYSTONE_URL, PAASMANAGER_URL, TENANT, USER,\ PASSWORD, VDC, SDC_URL @before.each_feature def before_each_scenar...
{ "content_hash": "48a35ee8bac456b859af10478c122d86", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 79, "avg_line_length": 33, "alnum_prop": 0.7301136363636364, "repo_name": "telefonicaid/fiware-paas", "id": "453105e25915ab4ffd1c1af8472ec78d83dffdb3", "size": "1847", "b...
"""AsyncIO TCP Server for Kytos.""" import asyncio import logging from kytos.core.connection import Connection from kytos.core.events import KytosEvent LOG = logging.getLogger("atcp_server") def exception_handler(loop, context): """Exception handler to avoid tracebacks because of network timeouts.""" if is...
{ "content_hash": "9e90f03f1241b28970a148f1a29cb5b8", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 79, "avg_line_length": 36.43783783783784, "alnum_prop": 0.6280967215546654, "repo_name": "macartur/kytos", "id": "58f6c544652ab00711f171150121a5ff5f945764", "size": "6741"...
import sys; import os sys.path.insert(0, os.path.abspath('..')) from testing import detector_lof2d_testing, netjinn_ip_testing, netjinn_tcp_testing, tshark_testing from unittest import TestLoader, TextTestRunner, TestSuite if __name__ == "__main__": # TODO: WHY THIS DOES NOT WORK? loader = TestLoader() suite = T...
{ "content_hash": "2e4e1ecc84c6e1f37f6997932bb7b849", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 99, "avg_line_length": 36.94736842105263, "alnum_prop": 0.7606837606837606, "repo_name": "mnmnc/campephilus", "id": "8e3a044522674decec18f2c95c4e1465a326ae69", "size": "702...
import unittest from wethepeople import Url class url_test(unittest.TestCase): def test_url_is_string(self): test_url = Url("http://myurl.com") self.assertIsInstance(str(test_url), str)
{ "content_hash": "c3dc137c2d781b55e91d238441e731ec", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 49, "avg_line_length": 15.285714285714286, "alnum_prop": 0.6682242990654206, "repo_name": "Dolphman/WeThePeople", "id": "dc156e076ba2882d63e54098503204841b6ecc88", "size": ...
"""Google Cloud Game Servers sample for getting a game server cluster. Example usage: python get_cluster.py --project-id <project-id> --location <location> --realm-id <realm-id> --cluster-id <cluster-id> """ import argparse from google.cloud import gaming from google.cloud.gaming_v1.types import game_server_clus...
{ "content_hash": "3c5e91f8758705f4b07b3bde564e0fa5", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 121, "avg_line_length": 33.97674418604651, "alnum_prop": 0.7063655030800822, "repo_name": "googleapis/python-game-servers", "id": "6a3cbba46f60e46213911e38e1c9d6beeafa3bec", ...
from django.shortcuts import render from django.contrib.auth.models import User from django.contrib.auth import logout from django.http import HttpResponse, HttpResponseRedirect, \ HttpResponseNotFound from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.s...
{ "content_hash": "4bafd24ba49225870dbea397510e2635", "timestamp": "", "source": "github", "line_count": 727, "max_line_length": 205, "avg_line_length": 38.18707015130674, "alnum_prop": 0.5913478855990203, "repo_name": "karlfloersch/friends-r-us", "id": "cc3253fc3b2aa5aa098efe765eab601612ef36d0", "s...
"""Use Bayesian Inference to trigger a binary sensor.""" from collections import OrderedDict import logging import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity from homeassistant.const import ( CONF_ABOVE, CONF_BELOW, CONF_DEVICE_CLASS, CONF_...
{ "content_hash": "ecf2437410f923c2c98493de45691979", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 100, "avg_line_length": 32.45454545454545, "alnum_prop": 0.5989237800383311, "repo_name": "adrienbrault/home-assistant", "id": "6879e278bab03f536ab1e1ddd93223d2c746c967", ...
import os import subprocess import sys import phoenix_utils import atexit import urlparse global childProc childProc = None def kill_child(): if childProc is not None: childProc.terminate() childProc.kill() if os.name != 'nt': os.system("reset") atexit.register(kill_child) phoe...
{ "content_hash": "b47c66a3508e6c5fd17923404a1c0130", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 126, "avg_line_length": 32.1796875, "alnum_prop": 0.6550133527555232, "repo_name": "djh4230/Apache-Phoenix", "id": "2e237ed044f895a89076a3b314c5b2dcb76a14fd", "size": "508...
"""Generate MRMS MESH Contours.""" import argparse import datetime import json import os import subprocess import sys import pathlib import tempfile import pygrib import numpy as np from pyiem.util import logger from pyiem.mrms import NORTH, WEST import rasterio from rasterio.transform import from_origin LOG = logger...
{ "content_hash": "c7e46893e76e0366b7d69bb4abc51a8a", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 76, "avg_line_length": 28.571428571428573, "alnum_prop": 0.570952380952381, "repo_name": "akrherz/iem", "id": "18b1f65c581b3f4601f1a3e350bc0e76bc1b0bc9", "size": "4200", ...
from __future__ import absolute_import from django.views.decorators.csrf import csrf_exempt from sentry.api.base import Endpoint from sentry.integrations.pipeline import ensure_integration from .integration import BitbucketIntegrationProvider class BitbucketInstalledEndpoint(Endpoint): authentication_classes ...
{ "content_hash": "4380007c30c6b2010ca5af30f0335ed9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 89, "avg_line_length": 29.4, "alnum_prop": 0.7306122448979592, "repo_name": "beeftornado/sentry", "id": "85f0b41e29fb234d9bf05836ca0ef609f79f96de", "size": "735", "binary...
import math import zope.event from bika.lims.utils import formatDecimalMark from Products.Archetypes.event import ObjectInitializedEvent from Products.CMFCore.WorkflowCore import WorkflowException from Products.CMFPlone.utils import _createObjectByType def create_analysis(context, service, keyword, interim_fields): ...
{ "content_hash": "c2ece734944f20a12124e9814706d71a", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 85, "avg_line_length": 40.32119205298013, "alnum_prop": 0.6325039007965837, "repo_name": "hocinebendou/bika.gsoc", "id": "b4a4f069ee7bd40a991f90456193f5d897b056da", "size"...
"""circuits Lightweight Event driven Framework :copyright: CopyRight (C) 2004-2010 by James Mills :license: MIT (See: LICENSE) """ try: from __version__ import version as __version__ except ImportError: __version__ = "unknown" from core import *
{ "content_hash": "7cb939963820397ed8d1e8b8f49c19e8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 18.428571428571427, "alnum_prop": 0.6937984496124031, "repo_name": "antont/tundra", "id": "31c03e69643f6de93c255c4c0fd3dc1eb32468d1", "size": "374", ...
import logging import os.path import shutil import time import subprocess from shell.cmd import exec_cmd, exec_cmd_out from vcs import OK, NOT_OK # try to locate the git command line tool, or raise ImportError GIT = exec_cmd_out("which git").strip() if GIT == '': raise ImportError() class VCSImpl(object): de...
{ "content_hash": "2ea41f4f86293416fd0d6f36ee3e6ab4", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 98, "avg_line_length": 31.976047904191617, "alnum_prop": 0.5383895131086143, "repo_name": "konker/syncilainen", "id": "cd33542d89bc12216e06d68c3265c746ed494371", "size": "...
"""Nova base exception handling. Includes decorator for re-raising Nova-type exceptions. SHOULD include dedicated exception logging. """ import functools import itertools import webob.exc from nova import log as logging from nova.openstack.common import excutils LOG = logging.getLogger(__name__) class Converte...
{ "content_hash": "dad5d26716fb16a4bf43dbfffb0a06e9", "timestamp": "", "source": "github", "line_count": 1092, "max_line_length": 79, "avg_line_length": 27.686813186813186, "alnum_prop": 0.668981940861282, "repo_name": "josephsuh/extra-specs", "id": "1e1818e7d044537cc25f3f51befbca938a97ac0b", "size"...
"""subcmd_plot.py Provides the plot subcommand for pdp (c) The James Hutton Institute 2017-19 Author: Leighton Pritchard Contact: leighton.pritchard@hutton.ac.uk Leighton Pritchard, Information and Computing Sciences, James Hutton Institute, Errol Road, Invergowrie, Dundee, DD2 5DA, Scotland, UK The MIT License C...
{ "content_hash": "e7fb91c3bcb791872f56c95db9fe9a8d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 35.24074074074074, "alnum_prop": 0.7877036258539148, "repo_name": "widdowquinn/find_differential_primers", "id": "5caa479758737ee814d85dba26a8906467261...
""" Test cases for Usage Test Path """ from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase from marvin.lib.utils import (cleanup_resources, validateList, verifyRouterState, get_process_sta...
{ "content_hash": "93dc6262c19d1e257ac7afc40fe2ad7e", "timestamp": "", "source": "github", "line_count": 3397, "max_line_length": 147, "avg_line_length": 37.2346187812776, "alnum_prop": 0.5799456066284016, "repo_name": "jcshen007/cloudstack", "id": "5f36c694d7c7ebbe487f67bd44ba2092d9c32781", "size":...
"""Ops to use variables as resources.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib from tensorflow.core.framework import attr_value_pb2 from tensorflow.core.framework import variable_pb2 from tensorflow....
{ "content_hash": "84c4cc27550f5e65fa2f584dd4448e02", "timestamp": "", "source": "github", "line_count": 1526, "max_line_length": 108, "avg_line_length": 40.07273918741809, "alnum_prop": 0.6543147291131789, "repo_name": "AnishShah/tensorflow", "id": "55c2eb5fa487e96b62201511fdd7e82162c2bee5", "size"...
""" Functions for de-spiking LA-ICPMS data (outlier removal). (c) Oscar Branson : https://github.com/oscarbranson """ import numpy as np # Despiking functions def noise_despike(sig, win=3, nlim=24., maxiter=4): """ Apply standard deviation filter to remove anomalous values. Parameters ---------- ...
{ "content_hash": "b96a460e37bcef7917096aec57452e35", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 102, "avg_line_length": 33.398058252427184, "alnum_prop": 0.5976744186046512, "repo_name": "oscarbranson/latools", "id": "bc1e21c17cb93636a7f03cac340a712519263042", "size"...
import os from setuptools import setup def readreq(filename): result = [] with open(filename) as f: for req in f: req = req.lstrip() if req.startswith('-e ') or req.startswith('http:'): idx = req.find('#egg=') if idx >= 0: re...
{ "content_hash": "fbd7d03010b96dbc30cee0646e7dfc09", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 65, "avg_line_length": 27.436363636363637, "alnum_prop": 0.5400927766732936, "repo_name": "klmitch/nutjob", "id": "8b205fbcf29eafccd748180ca807ea3d3ec907cc", "size": "1532"...
import gevent.monkey ; gevent.monkey.patch_all() import os, sys, traceback as tb, bottle, json from bottle import route, run, template from uuid import uuid4 from cors import add_headers from auth import * @route('/') def index(): return 'xxx' @route('/hello/<name>') def index(name): return template('<b>Hell...
{ "content_hash": "5a1fb06b588ae986bc64a8bc1694948a", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 24.695652173913043, "alnum_prop": 0.6452464788732394, "repo_name": "val314159/old.authsvr", "id": "a869f75219dd932e5214616590615620f74b9aca", "size":...
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:10011") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
{ "content_hash": "44d42b2986a167155d063364640a80c7", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 47, "avg_line_length": 39.75, "alnum_prop": 0.7610062893081762, "repo_name": "HundredCoinProject/HundredCoin", "id": "7f8fca6675422156b0eec20a12b9a09abb6bd3ea", "size": "159...