text
stringlengths
4
1.02M
meta
dict
from ColorSpace import * class SCColorScheme: def __init__(self, arrowColor = (0.5, 0.5, 1), rolloverColor = (0.53, 0.9, 0.53), frameColor = None, pressedColor = None, menuHolderActiveColor = None, emoteIconColor = None, textColor = (0, 0, 0), emoteIconDisabledColor = (0.5, 0.5, 0.5), textDisabledColor = (0.4, 0....
{ "content_hash": "fbfd4ba8d3f6c7ed0441efbd22d0b413", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 295, "avg_line_length": 35.53164556962025, "alnum_prop": 0.6031350195938725, "repo_name": "silly-wacky-3-town-toon/SOURCE-COD", "id": "7b2050bdf41846c0c389947dcc89a77d865666d...
def func(): print("Not really here for a reason.")
{ "content_hash": "0b6b05545f5833d9b4be66c4cf9dab59", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 42, "avg_line_length": 27.5, "alnum_prop": 0.6363636363636364, "repo_name": "DonaldWhyte/module-dependency", "id": "b52d2b7c7a2ca509544f3a0e34d4005287ff81f2", "size": "55", ...
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
{ "content_hash": "666546159052e0c013360f49043f3d15", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 151, "avg_line_length": 41.6986301369863, "alnum_prop": 0.6823258869908015, "repo_name": "AnshulYADAV007/Lean", "id": "7bc5b1acdc276123e905405f5b08d33a214bbb88", "size": "3...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", path_list=[ [TestAction.create_mini_vm, 'vm1', 'data_volume=true'], [TestAction.create_volume, 'volume1', 'flag=scsi'], [TestAction.attach_volume, 'vm1', 'volume1'], [T...
{ "content_hash": "76f7a50e116d3820a7d6aeffb0a91df2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 102, "avg_line_length": 39.482142857142854, "alnum_prop": 0.7132519222071461, "repo_name": "zstackio/zstack-woodpecker", "id": "ef836f3a9c0b42dce36a3d9f7de2055b81e694ec", "...
import pytest from dcicutils.deployment_utils import CreateMappingOnDeployManager from dcicutils.qa_utils import notice_pytest_fixtures from snovault import COLLECTIONS, TYPES from snovault.elasticsearch.create_mapping import type_mapping, run as run_create_mapping from snovault.util import add_default_embeds from uni...
{ "content_hash": "980e445164c49b725fb0b35bf4aefc2f", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 119, "avg_line_length": 48.971875, "alnum_prop": 0.6886605832429328, "repo_name": "4dn-dcic/fourfront", "id": "6653c1df0fa1b06601d193c62eac11649e1757aa", "size": "15671", ...
import logging logging.basicConfig(level=logging.DEBUG) import nengo import nengo_spinnaker import numpy as np def test_probe_passnodes(): """Test that pass nodes are left on SpiNNaker and that they may be probed. """ class ValueReceiver(object): def __init__(self): self.ts = list() ...
{ "content_hash": "698ec63949cd4e3361fe5310041f87bf", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 36.12328767123287, "alnum_prop": 0.59613196814562, "repo_name": "project-rig/nengo_spinnaker", "id": "27b96e596156651f3309cc3267eb81220c03094c", "siz...
class Number: def __init__(self, number): """The constructor of a Number """ try: self.number = float(number) except ValueError as e: print(e) print("That's not a number!") raise ValueError # Programatically raising an exception ...
{ "content_hash": "199e08d4e0fbf922a0263ab6e74c8479", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 76, "avg_line_length": 31.693548387096776, "alnum_prop": 0.5022900763358779, "repo_name": "razeone/data-storage", "id": "5493b432595091a44118253f9287e3ebf747203e", "size": ...
import pecan import wsme from wsme import types as wtypes from tuskar.api.controllers.v1.types.base import Base from tuskar.api.controllers.v1.types.link import Link from tuskar.api.controllers.v1.types.relation import Relation from tuskar.api.controllers.v1.types.chassis import Chassis from tuskar.api.controllers.v1.t...
{ "content_hash": "75fad683b5069b7d7fdfc5ad659256f5", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 88, "avg_line_length": 36.57627118644068, "alnum_prop": 0.5532900834105653, "repo_name": "tuskar/tuskar", "id": "afa8090c92d64572cbe038caeb550d870d6e55fa", "size": "2776", ...
"""C Vulkan generator # How it works? C vulkan module is generated following these steps: - Download vk.xml or get it locally - Pass it to xmltodict to get a python dict from it - Generate a custom model for each part of the binding - Pass the model to the jinja2 template engine - Generate the fin...
{ "content_hash": "22226f3b1c598e4ebf68009c5cb63817", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 79, "avg_line_length": 34.90731707317073, "alnum_prop": 0.5906931246506428, "repo_name": "realitix/cvulkan", "id": "e10cbd55be0c68d6d53df6170dafe1339a6272c7", "size": "214...
import codecs import toml class SettingsLoadStrategyToml: """ This is the strategy used to read settings from toml files """ name = 'toml' @staticmethod def is_valid_file(file_name): return file_name.endswith('.toml') @staticmethod def load_settings_file(settings_file): ...
{ "content_hash": "0f6dd85317ec5bb52425fb51844deddd", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 62, "avg_line_length": 21.42105263157895, "alnum_prop": 0.6388206388206388, "repo_name": "drgarcia1986/simple-settings", "id": "c4d1b8dcdaea0ef62aa9ef40f5044d67f9da552e", "...
""" Utility module for retrieving a node's children. """ import inspect # pylint: disable=C0302, W0703, C1801 from .Annotation import Annotation from .Project import Project from .Study import Study from .Subject import Subject from .Visit import Visit from .Sample import Sample from .WgsAssembledSeqSet import WgsAs...
{ "content_hash": "cb4487197e230c8511c2220311844823", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 87, "avg_line_length": 41.836363636363636, "alnum_prop": 0.6784006953498479, "repo_name": "ihmpdcc/cutlass", "id": "1c512ce100edf1a0ad8a474e57f3b88aede40249", "size": "2301...
import copy from .elements import (RightAlignedClauseElement, LeftAlignedClauseElement, NotRightAlignedClauseElement, NotLeftAlignedClauseElement) from .attributes import (HierarchicalAnnotation) from .results import QueryResults from polyglotdb.exceptions import GraphQueryError from ..base ...
{ "content_hash": "74a4fa7fcdac6963f4491b5b3f10e113", "timestamp": "", "source": "github", "line_count": 429, "max_line_length": 111, "avg_line_length": 38.33799533799534, "alnum_prop": 0.560588557183681, "repo_name": "MontrealCorpusTools/PolyglotDB", "id": "4e139f5a0d1b0eff25e3cb475d70e5a3793cf125", ...
<<<<<<< HEAD <<<<<<< HEAD """Mailcap file handling. See RFC 1524.""" import os __all__ = ["getcaps","findmatch"] # Part 1: top-level interface. def getcaps(): """Return a dictionary containing the mailcap database. The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain') to a list of dict...
{ "content_hash": "06ac076f810a113809359b673e775952", "timestamp": "", "source": "github", "line_count": 765, "max_line_length": 74, "avg_line_length": 29.347712418300652, "alnum_prop": 0.5273261770077057, "repo_name": "ArcherSys/ArcherSys", "id": "583a07578c84b273e904b8314302a8105dd3ad0c", "size": ...
"""Saves and restore variables inside traced @tf.functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.core.protobuf import saver_pb2 from tensorflow.python.eager import context from tensorflow.python.eager import def_function from t...
{ "content_hash": "17789f92b290713a38a7ec0cbcc7d459", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 80, "avg_line_length": 39.88095238095238, "alnum_prop": 0.6780597014925374, "repo_name": "freedomtan/tensorflow", "id": "9511fdbaa05bc0b46cb48ad229d332f9baa79a07", "size":...
import pickle from gym import spaces from gym.envs.registration import EnvSpec import gym import unittest import ray from ray.rllib.agents.a3c import A2CTrainer from ray.rllib.agents.pg import PGTrainer from ray.rllib.agents.pg.pg_tf_policy import PGTFPolicy from ray.rllib.env import MultiAgentEnv from ray.rllib.env....
{ "content_hash": "f35e8342dbc3aa00305b2bcfeb290ad7", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 79, "avg_line_length": 34.84905660377358, "alnum_prop": 0.5444639956686519, "repo_name": "stephanie-wang/ray", "id": "24f17d91123311243440071343bf2dcc2fbe2e50", "size": "1...
import android import json import time from urllib import urlencode from urllib2 import urlopen hello_msg = "Welcome to Coach Kelly's Timing App" list_title = 'Here is your list of athletes:' quit_msg = "Quitting Coach Kelly's App." web_server = 'http://192.168.1.33:8080' get_names_cgi = '/cgi-bin/ge...
{ "content_hash": "31051f490ad196a5901ecf3208f27b89", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 79, "avg_line_length": 30.276315789473685, "alnum_prop": 0.6397218600608431, "repo_name": "tdean1995/HFPythonSandbox", "id": "023b5205ed9b90d0d48cc82248f8f53a986b742d", "si...
import pickle import unittest import numpy as np from pathlib import Path from .context import getspectrum import pyimzml.ImzMLParser as imzmlp import pyimzml.ImzMLWriter as imzmlw # Example files from https://ms-imaging.org/wp/imzml/example-files-test/ CONTINUOUS_IMZML_PATH = str(Path(__file__).parent / 'data/Exampl...
{ "content_hash": "4dedf7065a03339963d543c60ce614fe", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 116, "avg_line_length": 49.37714285714286, "alnum_prop": 0.6056012035644023, "repo_name": "alexandrovteam/pyimzML", "id": "afc4816eaf369122c425ead0ca91586de7205915", "size...
""" Class Hierarchy G{classtree: ControllerManager} Package tree G{packagetree: controller_manager} Import Graph G{importgraph: controller_manager} """ from controller import * class ControllerManager: def __init__(self): print "[ControllerManager] init ..." self.apache_controller = ApacheController() ...
{ "content_hash": "7f4796315177affe95d61061254c2f6b", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 50, "avg_line_length": 20.275, "alnum_prop": 0.7348951911220715, "repo_name": "justasabc/kubernetes-ubuntu", "id": "de24097133b0e872eebce2ee9975e126872de690", "size": "811"...
from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, text from sqlalchemy.orm import relationship from Houdini.Data import Base metadata = Base.metadata class Puffle(Base): __tablename__ = 'puffle' ID = Column(Integer, primary_key=True) PenguinID = Column(ForeignKey(u'penguin.ID', ondele...
{ "content_hash": "772ab146ffbbe18a6dc09223571c9c3d", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 119, "avg_line_length": 39.9, "alnum_prop": 0.7280701754385965, "repo_name": "TunnelBlanket/Houdini", "id": "20523eb983171d0651b2e704591ed1699cf92bcc", "size": "814", "bi...
r''' Copyright 2014 Google Inc. All rights reserved. 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 i...
{ "content_hash": "babf676a7bba9f3d9601ed66d8f0538c", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 99, "avg_line_length": 38.67269076305221, "alnum_prop": 0.5908925697076691, "repo_name": "mkenne11/nogotofail-pii", "id": "d85ebdf9b3708cdd4be104398ff288a6dbdd1191", "size...
from OpenGLCffi.EGL import params @params(api='egl', prms=['dpy', 'max_formats', 'formats', 'num_formats']) def eglQueryDmaBufFormatsEXT(dpy, max_formats, formats, num_formats): pass @params(api='egl', prms=['dpy', 'format', 'max_modifiers', 'modifiers', 'external_only', 'num_modifiers']) def eglQueryDmaBufModifiers...
{ "content_hash": "d7826bb481e978af1d0edd437e2db23a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 106, "avg_line_length": 36.54545454545455, "alnum_prop": 0.7288557213930348, "repo_name": "cydenix/OpenGLCffi", "id": "5f6ab038808af19a41f6c5dd875908f306913e5c", "size": "4...
from nltk.tokenize import sent_tokenize, WordPunctTokenizer class Tokenizer: """Split text into sentence/words.""" def __init__(self): self.tokenizer = WordPunctTokenizer() def sentences(self, text): """Split a text into sentences. :param text: string including sentence(s) ...
{ "content_hash": "a059afbd6ae390a92a35ab8a0b311ba3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 59, "avg_line_length": 24.958333333333332, "alnum_prop": 0.6193656093489148, "repo_name": "stephanos/subvoc", "id": "22f214951cafe9c3561c8846660ca8da4cd760a7", "size": "599...
import matplotlib from numpy.random import randn import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter def to_percent(y, position): # Ignore the passed in position. This has the effect of scaling the default # tick locations. s = str(100 * y) # The percent symbol needs escaping ...
{ "content_hash": "bfa97ef772d6862d08f18679e50e1189", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 79, "avg_line_length": 26.766666666666666, "alnum_prop": 0.7173100871731009, "repo_name": "bundgus/python-playground", "id": "9d7b5d34423f669ed13f3181cde2f53fd735e641", "si...
from pox.core import core from pox.lib.util import initHelper from pox.lib.util import hexdump from pox.lib.addresses import parse_cidr, IPAddr, EthAddr, IPAddr6 import pox.lib.packet as pkt import pox.openflow.libopenflow_01 as of from pox.openflow.libopenflow_01 import ofp_header, ofp_vendor_base from pox.openflow.l...
{ "content_hash": "4ea332c9e31f5113a81d5e80aa8fcca1", "timestamp": "", "source": "github", "line_count": 2594, "max_line_length": 79, "avg_line_length": 27.116422513492676, "alnum_prop": 0.5907307364230878, "repo_name": "routeflow/AutomaticConfigurationRouteFlow", "id": "af1f63272e73736892e9f2bf091274...
import os import pickle import random import item, player, monster, cave class Game(object): def __init__(self): self.caves = self.create_caves() cave1 = self.caves[0] sword = item.Item("sword", "A pointy sword.", cave1) coin = item.Item("coin", "A shiny gold coin. " ...
{ "content_hash": "efd263eae0064598f6d4aeb6b2e826bd", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 76, "avg_line_length": 32.57823129251701, "alnum_prop": 0.5318438087283358, "repo_name": "geekbert/HelloPythonSourceCode", "id": "9e7f01da89af70f813a7cbb7a092ede15d58738a", ...
from __future__ import division, print_function, absolute_import import warnings from . import _minpack import numpy as np from numpy import (atleast_1d, dot, take, triu, shape, eye, transpose, zeros, product, greater, array, all, where, isscalar, asarray, inf, abs, ...
{ "content_hash": "5f3da0b6d112bfecfbd92fd899708483", "timestamp": "", "source": "github", "line_count": 887, "max_line_length": 91, "avg_line_length": 37.346110484780155, "alnum_prop": 0.586940771599348, "repo_name": "boomsbloom/dtm-fmri", "id": "411ac2f27a27e7b9370b7c37a08b8b5f87804930", "size": "...
from setuptools import setup, find_packages import os PACKAGE = 'nexus' VERSION = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'oldowan', PACKAGE, 'VERSION')).read().strip() desc_lines = open('README', 'r').readlines() setup(name='oldowan.%s' % PACKAGE, version=VERSION, ...
{ "content_hash": "65926a2cc90734d5f9e601d8635b4ae9", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 35.3235294117647, "alnum_prop": 0.6061615320566195, "repo_name": "ryanraaum/oldowan.nexus", "id": "751107c7f880be54036f2da70699ae7385a40c5d", "size":...
from __future__ import division import unittest import numpy as np from wyrm.processing import lfilter_zi class TestLFilterZi(unittest.TestCase): COEFFS = 10 def setUp(self): self.b, self.a = np.ones(self.COEFFS), np.ones(self.COEFFS) def test_lfilter_1d(self): """Output has the corr...
{ "content_hash": "d8da91b671ffba70946d019f12acfdca", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 67, "avg_line_length": 22.96551724137931, "alnum_prop": 0.6156156156156156, "repo_name": "venthur/wyrm", "id": "a651ff379412090f599a92a6f58e1dc1359f958b", "size": "666", ...
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': 'Le Chef', 'author': 'Okkar Than', 'url': '', 'download_url': '', 'author_email': '', 'version': '0.1', 'install_requires': ['nose'], 'packages': ['lechef'], 'scr...
{ "content_hash": "486e62868c0cd1cfe6c61d5d2de1a34f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 36, "avg_line_length": 19.526315789473685, "alnum_prop": 0.555256064690027, "repo_name": "r2k0/fe4retail", "id": "0183a8c6a8adb44f182c24f081d92db86f03ebf4", "size": "371", ...
from collections import defaultdict import itertools import logging from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon.utils.memoized import memoized # noqa from openstack_dashboard.api import base from openstack_dashboard.api import cinder from openstack_dashboard.a...
{ "content_hash": "4fa1b23025724200b386794c4268ca4d", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 79, "avg_line_length": 36.694117647058825, "alnum_prop": 0.603184781447045, "repo_name": "yanheven/console", "id": "0210ff8d78249c95fc78c42a809dbb2754981cb0", "size": "990...
from django.conf.urls import patterns, url from .views import EmailAlternativeView urlpatterns = patterns( '', url(r'^email_alternative/(?P<pk>\d+)/$', EmailAlternativeView.as_view(), name='email_alternative'), )
{ "content_hash": "a480d57b4d85728283ec101cdb723fed", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 44, "avg_line_length": 23.8, "alnum_prop": 0.6680672268907563, "repo_name": "bigmassa/django_mail_save", "id": "d3032fbe9867aeaeef7f49981b386162299cbed1", "size": "238", ...
""" Custom decorators defined for Open Anharmonic. All of these decorators were built using the class form per the exposition `here <http://www.artima.com/weblogs/viewpost.jsp?thread=240845>`__ |extlink|. Decorators ---------- .. autoclass:: arraysqueeze .. autoclass:: kwargfetch """ # Imports from functools impo...
{ "content_hash": "174c03edded0c5b9ea91065e8df76b61", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 80, "avg_line_length": 37.16459627329193, "alnum_prop": 0.563549761845074, "repo_name": "bskinn/opan", "id": "ba4f93921da3df1c710b458aad493292f4cbc1b0", "size": "12754", ...
from seahub.profile.models import Profile from seahub.test_utils import BaseTestCase class ProfileManagerTest(BaseTestCase): def setUp(self): pass def test_get_contact_email_by_user(self): # no profile for user, contact email should be username username = self.user.username as...
{ "content_hash": "28c65a73d167d74bd35e6776343c64ec", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 87, "avg_line_length": 38.904761904761905, "alnum_prop": 0.6915544675642595, "repo_name": "saukrIppl/seahub", "id": "bac58301f2e7695bf3e54e1c0a51cbd3847f5e87", "size": "817...
from __future__ import absolute_import, division, print_function, unicode_literals import logging import os from PySide import QtGui, QtCore from PySide.QtCore import Qt from mcedit2.rendering.blockmodels import BlockModels from mcedit2 import editortools from mcedit2.command import SimpleRevisionCommand from mcedit...
{ "content_hash": "acc99877da4049c3c0a77b77c7dc48ec", "timestamp": "", "source": "github", "line_count": 1227, "max_line_length": 158, "avg_line_length": 39.727791361043195, "alnum_prop": 0.6560128010503425, "repo_name": "vorburger/mcedit2", "id": "0138825873c137d0f88a785f43132a7e767a7619", "size": ...
""" Copyright 2017 ManerFan 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 in writing, software distr...
{ "content_hash": "725648c2c80668501bdf9915fefb7993", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 72, "avg_line_length": 25.91111111111111, "alnum_prop": 0.5943396226415094, "repo_name": "manerfan/python-game-snake", "id": "9a76f37dbe3594f4eded4758b3729fea7d65ea2c", "si...
""" Upload a multilambda.domain.zip to the S3 bucket. Useful when developing and small changes need to be made to a lambda function, but a full rebuild of the entire zip file isn't required. """ import alter_path from lib import configuration from lib.lambdas import upload_lambda_zip if __name__ == '__main__': ...
{ "content_hash": "b24e23f16f3ecde695e1b7be1e9e2ad2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 87, "avg_line_length": 32.125, "alnum_prop": 0.6848249027237354, "repo_name": "jhuapl-boss/boss-manage", "id": "50d3e330bb8ff996fc876728ad5fb1a70ec5d728", "size": "1414", ...
""" Test main module. Might get removed in future. """
{ "content_hash": "2f6ce87173a0d5737aa4fbd6c1b3c194", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 28, "avg_line_length": 9.5, "alnum_prop": 0.6491228070175439, "repo_name": "LosoiP/pathwalue", "id": "bf3c43009d78efff2e4de880137c0d904c8b4cc2", "size": "153", "binary": f...
import json from awsclpy import AWSCLPy class AmiEc2(object): def __init__(self, **kwrags): self.__quiet = kwrags.get('quiet', False) self.__recipe = kwrags['recipe'] self.__awscli = AWSCLPy(quiet=self.__quiet, **self.__recipe.awscli_args.__dict__) def ...
{ "content_hash": "ccac6e0442fb09fb758f9a28d27c3213", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 75, "avg_line_length": 35.522267206477736, "alnum_prop": 0.5235924321860042, "repo_name": "lyricnz/amibaker", "id": "6c228b3bed1d2ef94b70587961bdd0e16a8998c0", "size": "87...
from __future__ import absolute_import, division, print_function, unicode_literals import logging import click import ctadc logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) @click.group() def cli(): """CTA-DC command line interface script. For further information, see `README.md`. ...
{ "content_hash": "56cf8d691aa4f70112eba13791049e84", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 82, "avg_line_length": 19.12727272727273, "alnum_prop": 0.6511406844106464, "repo_name": "gammasky/cta-dc", "id": "9e79122eb667cdba49f5b8baf8b94d6fc6c3895a", "size": "1074"...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_lost_aqualish_soldier_male_01.iff" result.attribute_template_id = 9 result.stfName("npc_name","aqualish_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "052a90067cc4ea6442a84046e75d09c2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 24.615384615384617, "alnum_prop": 0.703125, "repo_name": "anhstudios/swganh", "id": "395483b35d84009cf44704f870d17104734c20ba", "size": "465", "bin...
"""demo_uicallback.py - An application that executes Python code from a Java UI It would be handy to have a Java class that called Python through the Javabridge, perhaps something like:: public class PythonEnv { public native void exec(String script); public native String eval(String script); ...
{ "content_hash": "2d7a5a92e74ec64ef169bc8114413330", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 81, "avg_line_length": 38.676, "alnum_prop": 0.49870720860481954, "repo_name": "CellProfiler/python-javabridge", "id": "929c88e74bdc298296a83d76ffb0f29241fce4df", "size": ...
""" Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python S...
{ "content_hash": "825a1dbddc2b5d6f42ac2ebf31cb1680", "timestamp": "", "source": "github", "line_count": 3206, "max_line_length": 103, "avg_line_length": 39.71085464753587, "alnum_prop": 0.5820850973584787, "repo_name": "thejeshgn/pyg2fa", "id": "fbc19a22d8ac2edf48eb12bd5812b2a33e89461a", "size": "1...
""" A demo of using lxml's xpath to parse html document """ from lxml import etree import requests grab_pattern_dict = { 'img': {'//*[@id="J-detail-content"]/div//div/img': 'data-lazyload'}, 'price': {'//*[@id="jd-price"]': 'text'}, 'product': {'//*[@id="name"]/h1': 'text'}, # 'parameter': {'//*[@id="p...
{ "content_hash": "9d7a3f1247d81a600acd6ca1f35cf93d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 73, "avg_line_length": 27.13157894736842, "alnum_prop": 0.6071774975751697, "repo_name": "tiny-cell/tinycell", "id": "f76637b603d44246385e94a00f35df439151249f", "size": "11...
"""Deletes uploaded photos (debug tool).""" import argparse from google.cloud import datastore import common.service_account as sa from common.chunks import chunks # This is not a valid project name (for safety) DEFAULT_PROJECT = 'eclipse-2017-test' def get_arguments(): parser = argparse.ArgumentParser(descripti...
{ "content_hash": "b8c217e01a1f6c5fe73c8882c9bd682b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 30.866666666666667, "alnum_prop": 0.6573074154067674, "repo_name": "google/eclipse2017", "id": "68d73bd010fe28927619b06f86ff189b129bf85f", "size": "1...
""" Copyright 2022 Google LLC 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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
{ "content_hash": "af56adb3a91652e972cd244d34fa915a", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 72, "avg_line_length": 28.88679245283019, "alnum_prop": 0.6838667537557153, "repo_name": "GoogleCloudPlatform/document-intake-accelerator", "id": "b0b2cd4e9f82bd11cc210b7fbcd...
"""Classes and functions for configuring iWorkflow""" from f5.iworkflow.cm.cloud.connectors.local import Locals from f5.iworkflow.resource import OrganizingCollection class Connectors(OrganizingCollection): def __init__(self, cloud): super(Connectors, self).__init__(cloud) self._meta_data['allowe...
{ "content_hash": "4347e2d10eafe3eaed1f148a0df4de7c", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 57, "avg_line_length": 31.083333333333332, "alnum_prop": 0.6916890080428955, "repo_name": "F5Networks/f5-common-python", "id": "6c11ff564bf093d5d346a5f1454174fb3d421809", "...
''' Just a stub for locating Maya plugins. Normally this file would be the __init__.py of the plugins package, but Maya would then pick it up as a plugin too. ''' import os def get_envvars(realpath=False): mayatools_plugins = os.path.abspath(os.path.join(__file__, '..', 'plugins')) if realpath: ma...
{ "content_hash": "2c4ab6d9a28d94d712752717fcf4c49e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 22.130434782608695, "alnum_prop": 0.6463654223968566, "repo_name": "westernx/mayatools", "id": "b44b7dfe33d3f63e9557780679ad3ddc8f9cb3b5", "size": "5...
import urllib from tornado import gen, httpclient as hc from graphite_beacon.handlers import AbstractHandler, LOGGER class HttpHandler(AbstractHandler): name = 'http' # Default options defaults = { 'params': {}, 'method': 'GET', } def init_handler(self): self.url = sel...
{ "content_hash": "05c0f203e9bb1fe81fd6d511915a175d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 92, "avg_line_length": 29.30952380952381, "alnum_prop": 0.5987002437043054, "repo_name": "YuriyIlyin/graphite-beacon", "id": "97a857769f93426d125c3b4d241e8166386d7c09", "si...
"""Creates hierarchy related DAG files and tables.""" # TODO: Make file fully lintable, and remove all pylint disabled flags. import yaml import sys import logging import os import datetime from dag_hierarchies_module import generate_hier from generate_query import check_create_hiertable, generate_hier_dag_files fro...
{ "content_hash": "1287ca4a51c8fd06ac2a9face1582fde", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 79, "avg_line_length": 31.879310344827587, "alnum_prop": 0.5903190914007571, "repo_name": "GoogleCloudPlatform/cortex-dag-generator", "id": "6dbdd3cfd263a802d3a8454379bccd5a...
import json import sure # noqa # pylint: disable=unused-import import moto.server as server """ Test the different server responses """ def test_list_virtual_clusters(): backend = server.create_backend_app("emr-containers") test_client = backend.test_client() res = test_client.get("/virtualclusters") ...
{ "content_hash": "49e7f4eb77fe84092f14372a0339b887", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 59, "avg_line_length": 23.75, "alnum_prop": 0.7210526315789474, "repo_name": "spulec/moto", "id": "2e05a2d6cd7474bbde8064a3ebe7d557c58eb355", "size": "380", "binary": fal...
from spatial_model_utilities import find_closest_grid_point, great_circle_distance import pytz from datetime import datetime, timedelta import string def readline_skip_comments(f): """ Read a new line while skipping comments. """ l = f.readline().strip() while len(l) > 0 and l[0] == '#': l...
{ "content_hash": "8464a6ba69bd74373eb9f9acb86e5d23", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 121, "avg_line_length": 26.069767441860463, "alnum_prop": 0.5414808206958073, "repo_name": "vejmelkam/fmda", "id": "3782634a02b60eacf223e6da7d02b7b5c7c9e658", "size": "672...
from django.test import TestCase from django.db import IntegrityError from datetime import datetime from myproject.core.models import Person, Occupation, Address, Phone, Brand, Category, Product class PersonModelTest(TestCase): def setUp(self): self.occupation = Occupation.objects.create( occ...
{ "content_hash": "d6a656131048bf33e1b72360c5af61a3", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 94, "avg_line_length": 26.375494071146246, "alnum_prop": 0.5325940356661172, "repo_name": "rg3915/django-example", "id": "d083d7a5aa08173a0fe48b921172f4884faa21ef", "size"...
from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^$', 'project.core.views.home', name='home'), )
{ "content_hash": "fe0c3fd1a20444baa77a1f3df35cb871", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 21.666666666666668, "alnum_prop": 0.6615384615384615, "repo_name": "CalebMuhia/django-barcode-generator", "id": "50b5eec4c98a97a2399e91a4cc1f4536af5e136...
import numpy as np import os import gym from gym import error, spaces from gym import utils from gym.utils import seeding try: import atari_py except ImportError as e: raise error.DependencyNotInstalled("{}. (HINT: you can install Atari dependencies by running 'pip install gym[atari]'.)".format(e)) import log...
{ "content_hash": "c3972082b876b6e2d093320558fec2e7", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 143, "avg_line_length": 31.42222222222222, "alnum_prop": 0.5754950495049505, "repo_name": "hparik11/Deep-Learning-Nanodegree-Foundation-Repository", "id": "a224dfca8504f16c8...
from __future__ import print_function import os import re import sys import optparse import textwrap import importlib from collections import ( OrderedDict, ) from textwrap import ( dedent, ) import tpn from .config import ( Config, ConfigObjectAlreadyCreated, get_config, _clear_config_if_a...
{ "content_hash": "b97c2ddcd1ec13be2e0b7fa35f4b12ca", "timestamp": "", "source": "github", "line_count": 575, "max_line_length": 80, "avg_line_length": 30.21913043478261, "alnum_prop": 0.5038558931860037, "repo_name": "tpn/tpn", "id": "345ab072341a5df3081caf5881ff94a29a3bb84f", "size": "17548", "b...
import sys from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL) count = 0 currentKey = None #### Complete the rest of the code
{ "content_hash": "00675284dbf0e8216e0e6962ee32cafc", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 43, "avg_line_length": 18, "alnum_prop": 0.7430555555555556, "repo_name": "ece579/ece579_f17", "id": "48150bf3ebdcea3503f37da1444cd8f7d9e2b748", "size": "166", "binary": f...
import numpy as np import pandas as pd from pandas import CategoricalIndex, Index, MultiIndex, Timestamp, date_range import pandas._testing as tm class TestGetLevelValues: def test_get_level_values_box_datetime64(self): dates = date_range("1/1/2000", periods=4) levels = [dates, [0, 1]] c...
{ "content_hash": "39732c11a5d26ef2a064e89d07975d3a", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 78, "avg_line_length": 33.77142857142857, "alnum_prop": 0.6283135927805978, "repo_name": "jreback/pandas", "id": "f976515870259bebbd2431d1e0021ace44ca0302", "size": "3546"...
from __future__ import unicode_literals from django.db import migrations, models def create_initial_choices(apps, schema_editor): ConferenceName = apps.get_model('metadata', 'ConferenceName') ConferenceName.objects.create(name='AASHE') ConferenceName.objects.create(name='Other') PresentationType = ...
{ "content_hash": "9a3755ec7573993544667652a3f99520", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 114, "avg_line_length": 33.755102040816325, "alnum_prop": 0.5792019347037485, "repo_name": "AASHE/hub", "id": "53d08c3ddaba76e3012f486fedc1c71d7eeb02a3", "size": "1678", ...
import os import pickle import tempfile import sys from glob import glob from data_utils import START_SYMBOL, END_SYMBOL, all_features, \ all_metadatas, indexed_chorale_to_score, chorale_to_inputs, BACH_DATASET from deepBach import load_models from flask import Flask, request, make_response, jsonify from music21 ...
{ "content_hash": "de89f4ceb84bd1f6868277356c402fb7", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 119, "avg_line_length": 39.57877813504823, "alnum_prop": 0.5382240636932326, "repo_name": "SonyCSL-Paris/DeepBach", "id": "5a678041c01705604bce8307543c2a13e9684fe8", "size...
from .parser.factory import ParserFactory from .utils import array_wrapper class SuperDict(object): properties = [] def __init__(self, *args, **kwargs): for prop in self.properties: setattr(self, prop, None) for idx, prop in enumerate(args): if idx > len(self.propert...
{ "content_hash": "2e1be6e5592324fc332071d2fc286a9b", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 102, "avg_line_length": 28.227544910179642, "alnum_prop": 0.5795502757742893, "repo_name": "huyphan/pyyawhois", "id": "abde682aadc00381cf0389b37b8998b4b83e7521", "size": "...
from telemetry.core import exceptions from telemetry.core import util from telemetry.unittest import tab_test_case class InspectorRuntimeTest(tab_test_case.TabTestCase): def testRuntimeEvaluateSimple(self): res = self._tab.EvaluateJavaScript('1+1') assert res == 2 def testRuntimeEvaluateThatFails(self): ...
{ "content_hash": "8aebcc428da459df40c486e2295ef172", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 37.784615384615385, "alnum_prop": 0.6758957654723127, "repo_name": "anirudhSK/chromium", "id": "ef45bab0575bebfcca1f8e49aae42c6ea2d99a55", "size": "2...
import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '9()(lzm)jdr$szjfdx8^^#j_6efj@d&$9pb6l2h&=udxom3(bn' DEBUG = True TEMPLATE_DEBUG = True if DEBUG: # XXX Monkey patch is_secure_transport to allow development over insecure HTTP from warnings import warn warn(UserWarning("Monkey...
{ "content_hash": "28d3ce7a46d10656305bb47d54c01a72", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 132, "avg_line_length": 28.507246376811594, "alnum_prop": 0.6329435688866294, "repo_name": "tracon/kompassi-oauth2-example", "id": "ffe63159c91c2282ef02bc65f4afd90fd13794a0"...
from __future__ import unicode_literals from optparse import make_option from django.core.management.base import NoArgsCommand from doc.actions import create_doc_db, create_doc_local from docutil.commands_util import recocommand from docutil.str_util import smart_decode class Command(NoArgsCommand): option_list =...
{ "content_hash": "0572479247a783890a4a19eed1e87eab", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 65, "avg_line_length": 45.1, "alnum_prop": 0.6280487804878049, "repo_name": "bartdag/recodoc2", "id": "9de4c50be772d7b25cacede11289c2285e338cce", "size": "1804", "binary"...
import json from card_lookup.searcher import Searcher f_read = open("cards.json", encoding = "utf8") card_dict = json.loads(str(f_read.read())) f_read.close() card_searcher = Searcher(card_dict) result = card_searcher.find_card("Al'Akir") print(result)
{ "content_hash": "3c45eded68c3fd0661616585a6be88cb", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 46, "avg_line_length": 25.4, "alnum_prop": 0.7322834645669292, "repo_name": "MagiChau/Hearthstone-Card-Lookup", "id": "24cdc93546a68a91b81818f01afb14ebe517e3a6", "size": "2...
from unittest.mock import patch import pytest from dvc.fs import get_cloud_fs from dvc.fs.webdav import WebDAVFileSystem, WebDAVSFileSystem from tests.utils.asserts import issubset url_fmt = "{scheme}://{user}@example.com/public.php/webdav" url = "webdav://example.com/public.php/webdav" user = "username" password = ...
{ "content_hash": "e8d09c1e48f2bf650043b27f5b002999", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 74, "avg_line_length": 27.016260162601625, "alnum_prop": 0.583508877520313, "repo_name": "efiop/dvc", "id": "e207dfe977300802377ec89f009f0575bd0ef32f", "size": "3323", "...
import sqlite3 import time class SQLiteLogger: def __init__(self, filename="g2x.db"): self.filename = filename self.connection = None def __enter__(self): self.open() return self def __exit__(self, type, value, traceback): self.close() def open(self): ...
{ "content_hash": "2485d2c028ace762df99161760a86d50", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 85, "avg_line_length": 29.951219512195124, "alnum_prop": 0.5537459283387622, "repo_name": "thelonious/g2x", "id": "faad7fc06248eea46a600b77efeecaaa5336cac7", "size": "1228"...
import subprocess, os.path import sqlite3 import shutil import tarfile import datetime import csv from time import sleep import datetime from functools import wraps from flask import Flask from flask import request from flask import render_template from flask import Markup from flask import session, redirect, url_for,...
{ "content_hash": "824b33a543154fe498236eb86a4370ec", "timestamp": "", "source": "github", "line_count": 600, "max_line_length": 238, "avg_line_length": 41.035, "alnum_prop": 0.6454652532391049, "repo_name": "alfg/AdminCraft", "id": "a170cf6b7a6b582397fc0a65a62f56ac0e777325", "size": "24644", "bin...
from neo.SmartContract.ContractParameterType import ContractParameterType from neo.VM.InteropService import StackItem, Array, ByteArray, Struct, Boolean, Integer, InteropInterface from neo.Core.UInt160 import UInt160 from neo.Core.UInt256 import UInt256 from neo.Core.BigInteger import BigInteger from neo.Core.Cryptogra...
{ "content_hash": "4f0ae2ee0028244f8859678ec8f8d81b", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 108, "avg_line_length": 36.09189189189189, "alnum_prop": 0.6380110828216264, "repo_name": "hal0x2328/neo-python", "id": "1d9fd9788f21b72c8535201d368566088ee4002d", "size":...
"""Support for ISY994 fans.""" from __future__ import annotations import math from typing import Any from pyisy.constants import ISY_VALUE_UNKNOWN, PROTO_INSTEON from homeassistant.components.fan import DOMAIN as FAN, FanEntity, FanEntityFeature from homeassistant.config_entries import ConfigEntry from homeassistant...
{ "content_hash": "64e35d997438509aaec72a77a46bbaee", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 84, "avg_line_length": 33.61904761904762, "alnum_prop": 0.6520302171860245, "repo_name": "w1ll1am23/home-assistant", "id": "9e264076d885cdf9b1316fa767665c15e8a7831f", "siz...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sites', '0001_initial'), ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='Dashboard', ...
{ "content_hash": "1810ad252935a70e8967e5bcaba2e4bc", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 139, "avg_line_length": 36.525, "alnum_prop": 0.5359342915811088, "repo_name": "whatisjasongoldstein/django-featuring", "id": "0e2d85d7baa4c2928344cdc1f094011eca84eaaa", "s...
from __future__ import annotations from multiprocessing.connection import Connection as MultiprocessingConnection from typing import Callable from airflow.callbacks.base_callback_sink import BaseCallbackSink from airflow.callbacks.callback_requests import CallbackRequest class PipeCallbackSink(BaseCallbackSink): ...
{ "content_hash": "f4e73e3097093e30d50872053cc92e31", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 33.774193548387096, "alnum_prop": 0.6991404011461319, "repo_name": "nathanielvarona/airflow", "id": "d702a781fa57c0bf89f3ef5b667678afa67b6065", "size...
from mock import DEFAULT from mock import MagicMock from mock import patch from testtools.matchers import Is, Equals, Not from trove.common.instance import ServiceStatuses from trove.guestagent import backup from trove.guestagent.common import configuration from trove.guestagent.common.configuration import ImportOverr...
{ "content_hash": "90c26ca3a115a33e4f7d67e814531a96", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 79, "avg_line_length": 46.18359375, "alnum_prop": 0.6545715977332318, "repo_name": "zhangg/trove", "id": "e55c43162141bc7e32c83a3911a65f1762249243", "size": "12393", "bi...
import unittest import json from django.test import Client from rest_framework import status class SampleViewTest(unittest.TestCase): def setUp(self): self.client = Client() def tearDown(self): pass def test_sample(self): response = self.client.get("/openoapi/multivim-vio/v1/swag...
{ "content_hash": "5c2728365021832e62234a14ec7a4b70", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 84, "avg_line_length": 29.166666666666668, "alnum_prop": 0.6876190476190476, "repo_name": "johnsonlau/multivimdriver-vmware-vio", "id": "04b42367c154e27b97c1bb285f98c5d21ed31...
import os import logging from cliff.app import App from cliff.commandmanager import CommandManager from cliff.command import Command from cliff.show import ShowOne from cliff.lister import Lister from db_manage import DbManage class ListItems(Lister): #"Show details about a file" log = logging.getLogger(__na...
{ "content_hash": "15738007513e24620e7d3db627b5cf7c", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 75, "avg_line_length": 32.20634920634921, "alnum_prop": 0.48053228191227204, "repo_name": "Migwi-Ndungu/bc-9-Pomodoro-Timer", "id": "20b247fc237680317ba75998b1a05d25c40cb717"...
from django.db import models """ Representa las opciones del motivo de otorgamiento de una normativa """ class NormativaMotivoOtorgamiento(models.Model): nombre = models.CharField(max_length = 50, unique = True) class Meta: app_label = 'postitulos' ordering = ['nombre'] db_table = 'po...
{ "content_hash": "1c44d51a9811ef460b0b1662f19222bf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 67, "avg_line_length": 25.9375, "alnum_prop": 0.6795180722891566, "repo_name": "MERegistro/meregistro", "id": "f49df340111a5fc74cf3834c9191a7e3664e5144", "size": "439", "...
import random import string import six from heat.common import exception from heat.common.i18n import _ from heat.engine import attributes from heat.engine import constraints from heat.engine import properties from heat.engine import resource from heat.engine import support class RandomString(resource.Resource): ...
{ "content_hash": "12ad45af6a2750ebdff4fd6b4705372d", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 79, "avg_line_length": 38.51677852348993, "alnum_prop": 0.52709531277226, "repo_name": "maestro-hybrid-cloud/heat", "id": "00d111b8425416813f7eba747d52c63c3ba6faf8", "size...
class Pidata(object): def __init__(self, insights): self.insights = insights self.big5 = {} self.processed = False def floored_percentage(self, val, digits=2): """ Number comes in a 0.45678912 and will be converted 1st to 0.4568 then to 45.68 finally to a string """ val = round(v...
{ "content_hash": "9d97e9014767f8be297fbb2aded366fd", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 99, "avg_line_length": 30.810344827586206, "alnum_prop": 0.6491326245103526, "repo_name": "chughts/watson-betaworks-python-sample", "id": "6fd567c2a4ba33b6b2ece2c993edb82e63a...
from .Nodes import h, Leaf, Branch class Tree: def __init__(self, store=None, root_hash=None): """Initialize a Merkle tree from a store and a root hash. Example: >>> from hippiehug import Tree >>> t = Tree() >>> t.add(b"Hello") >>> b"Hello" in t ...
{ "content_hash": "5dd891a007900e9063bdb2bddaad7955", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 103, "avg_line_length": 31.908571428571427, "alnum_prop": 0.5109240687679083, "repo_name": "gdanezis/rousseau-chain", "id": "680dd44a6fac0453dbe45ae429bf9a91067595eb", "si...
"""Keystone External Authentication Plugins.""" import abc import six from keystone.auth.plugins import base from keystone.common import dependency import keystone.conf from keystone import exception from keystone.i18n import _ CONF = keystone.conf.CONF @six.add_metaclass(abc.ABCMeta) class Base(base.AuthMethodH...
{ "content_hash": "e9ff0dc25bc3d7ab0256af0bcfa44615", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 77, "avg_line_length": 31.987951807228917, "alnum_prop": 0.6369114877589453, "repo_name": "cernops/keystone", "id": "ee0e95b979858c6efc3394c6c1895c3909663de9", "size": "324...
class FuliSpidersPipeline(object): def process_item(self, item, spider): return item
{ "content_hash": "16e1ed3e46d4402e87292f13f40ec48b", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 41, "avg_line_length": 32.333333333333336, "alnum_prop": 0.7010309278350515, "repo_name": "moonlet/fuli", "id": "1aeca1c939a1df94ce503176f94f1df310a4ef71", "size": "291", ...
import rospy from specification import Specification from rated_statistics import RatedStatisticsContainer from arni_core.helper import * import arni_msgs from arni_msgs.msg import RatedStatistics, RatedStatisticsEntity #from arni_gui.helper_functions import prepare_number_for_representation class SpecificationHandle...
{ "content_hash": "e48b6a10534f90c0524e2b6c30583d82", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 139, "avg_line_length": 44.485245901639345, "alnum_prop": 0.5440005896226415, "repo_name": "ROS-PSE/arni", "id": "53cac8e657243dc431459779d9342d6ed11a1cc7", "size": "13568...
import unittest from perfect_numbers import is_perfect class PerfectNumbersTest(unittest.TestCase): def test_first_perfect_number(self): self.assertIs(is_perfect(6), True) def test_no_perfect_number(self): self.assertIs(is_perfect(8), False) def test_second_perfect_number(self): ...
{ "content_hash": "bf9171b03dae323fe32435eaec096e02", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 59, "avg_line_length": 26.232558139534884, "alnum_prop": 0.6675531914893617, "repo_name": "mweb/python", "id": "bb6de15d568c1c86a065fc318f95fe96bc54e9a3", "size": "1128", ...
import pytest from numpy import array from statsmodels.regression.linear_model import OLS from statsmodels.tools.web import _generate_url, webdoc class TestWeb: stable = 'https://www.statsmodels.org/stable/' devel = 'https://www.statsmodels.org/devel/' def test_string(self): url = _generate_url(...
{ "content_hash": "36e043470bb1f3db3c8ed3fded22d00c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 74, "avg_line_length": 37.11363636363637, "alnum_prop": 0.5572565829761176, "repo_name": "statsmodels/statsmodels", "id": "7adc4e9487ff4e0b1c56d02fcad3724849939737", "size"...
from __future__ import absolute_import, print_function, unicode_literals from .api import setup_celery_for_management_commands from django.apps import AppConfig class KolibriTasksConfig(AppConfig): name = 'kolibri.tasks' label = 'kolibritasks' verbose_name = 'Kolibri Tasks' def ready(self): ...
{ "content_hash": "fc6aa1211cea63e8572e20a080415283", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 72, "avg_line_length": 25.714285714285715, "alnum_prop": 0.7333333333333333, "repo_name": "whitzhu/kolibri", "id": "f14a899d3e27985c91e0e790c699dba2e584bde3", "size": "360"...
def solve(): ''' In England the currency is made up of pound, P, and pence, p, and there are eight coins in general circulation: 1p, 2p, 5p, 10p, 20p, 50p, P1 (100p) and P2 (200p). It is possible to make P2 in the following way: 1 P1 + 1 50p + 2 20p + 1 5p + 1 2p + 3 1p How many different ways...
{ "content_hash": "207e3717df1e074a1a920a1987af0b91", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 115, "avg_line_length": 32.58620689655172, "alnum_prop": 0.5576719576719577, "repo_name": "serge-sans-paille/pythran", "id": "7714a2ae489c76de9b3f9679d12842970f439da2", "si...
import os settings_path, settings_module = os.path.split(__file__) import sys sys.path.append('../../') DEBUG = True #TEMPLATE_DEBUG = DEBUG USE_TZ=True #TIME_ZONE = 'America/Chicago' LANGUAGE_CODE = 'en-us' SECRET_KEY = '8(o*lht586wqr9hp5env&n!h!gu@t5g4*$$uupbyd*f+61!xjh' TEMPLATE_LOADERS = ( 'django.templa...
{ "content_hash": "ee8c28338362e374a9a51ecb6ac69cb6", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 69, "avg_line_length": 21.6, "alnum_prop": 0.6743827160493827, "repo_name": "themartorana/python-postmark", "id": "885319bdba4f3aa1618ce9832c1a8bbdddb8c11a", "size": "1333"...
import os,sys try: argument = sys.argv[1] except: argument = 0 def elinsGetDate(): return os.popen("date +'%Y%m%d'").read()[:-1] #-- set path to program folder, or just hardcode where it is if main.py is in separated place Path = str(__file__).replace("main.py","").replace("\\","/") print Path namafile = "time"+e...
{ "content_hash": "4ec12dbc57065129e4a913b2fcf0327c", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 134, "avg_line_length": 29.12621359223301, "alnum_prop": 0.6666666666666666, "repo_name": "imakin/PersonalAssistant", "id": "924a0ff98b80bd3d67396f75ac399c853219ae69", "si...
from __future__ import unicode_literals, print_function import os import sys import shutil import zipfile import time def recursive_zip(zipf, directory, folder=""): for item in os.listdir(directory): if os.path.isfile(os.path.join(directory, item)): src = os.path.join(directory, item) ...
{ "content_hash": "d29a0d33812c230dab7dcc6be3f222a4", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 121, "avg_line_length": 29.356643356643357, "alnum_prop": 0.5883754168651739, "repo_name": "daltomi/oxygine-framework", "id": "ee16efdcea74dbec36050e876239c73236100fa0", "...
import os, sys base_dir = os.path.dirname(os.path.abspath(__file__)) activate_this = os.path.join(base_dir, "/home/pi/.virtualenvs/piwars/bin/activate_this.py") with open(activate_this) as f: exec(f.read(), dict(__file__=activate_this)) import runpy modulename = sys.argv[1] sys.argv = sys.argv[0:1] + sys.arg...
{ "content_hash": "4a0378d85faf5da0c063279889f0ca75", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 91, "avg_line_length": 35.7, "alnum_prop": 0.6890756302521008, "repo_name": "westpark/robotics", "id": "174d2fb12d78b6832c73f93fe5693d0b623a4ca6", "size": "439", "binary"...
"""Utilities for forward-mode automatic differentiation.""" import functools import threading from tensorflow.python import pywrap_tfe from tensorflow.python.eager import backprop from tensorflow.python.eager import backprop_util from tensorflow.python.eager import execute from tensorflow.python.eager import forwardp...
{ "content_hash": "dfc3de155817030b2c76d35b7bd07734", "timestamp": "", "source": "github", "line_count": 461, "max_line_length": 80, "avg_line_length": 42.41431670281996, "alnum_prop": 0.6966194445865085, "repo_name": "Intel-Corporation/tensorflow", "id": "4bc53ee4dfefce60ac40d60d0c44d62f9b8a49cc", ...
import os from Widget import Widget from util import props_to_str HEADERS = [ '<link type="text/css" href="/CTK/css/CTK.css" rel="stylesheet" />', '<script type="text/javascript" src="/CTK/js/jquery-ui-1.7.2.custom.min.js"></script>' ] HTML = """ <div id="%(id)s" %(props)s></div> """ PERCENT_INIT_JS = """ $(...
{ "content_hash": "a7f59924574238e01e345388e6086c65", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 90, "avg_line_length": 27.09090909090909, "alnum_prop": 0.5335570469798657, "repo_name": "cherokee/pyscgi", "id": "9c6effe94bdc7bf9d64acf42c3f015c7dadb0196", "size": "1975"...
from airflow.models import DAG # noqa # pylint: disable=unused-import raise Exception("This dag file should have been ignored!")
{ "content_hash": "980789568e92349b06fd0c8f020466bc", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 70, "avg_line_length": 43.666666666666664, "alnum_prop": 0.7709923664122137, "repo_name": "mtagle/airflow", "id": "1e5b97165422c73f0cf02cb67644a01ea6e9f25d", "size": "973", ...
from sqlalchemy.testing import eq_ from sqlalchemy import * from sqlalchemy import testing from sqlalchemy.testing.schema import Table, Column from sqlalchemy.types import TypeDecorator from sqlalchemy.testing import fixtures, AssertsExecutionResults, engines, \ assert_raises_message from sqlalchemy import exc ...
{ "content_hash": "5ed630efdc04cdf8a9fa6c0bfd3a9f95", "timestamp": "", "source": "github", "line_count": 340, "max_line_length": 106, "avg_line_length": 36.01764705882353, "alnum_prop": 0.5451576024824433, "repo_name": "Cito/sqlalchemy", "id": "e7245aa3c61e0be856f6ce8a31ea9a7135156f1c", "size": "122...
from oslotest import base import stevedore from testtools import matchers class TestPasteDeploymentEntryPoints(base.BaseTestCase): def test_entry_points(self): factory_classes = { 'catch_errors': 'CatchErrors', 'correlation_id': 'CorrelationId', 'cors': 'CORS', ...
{ "content_hash": "abd7add1a40954178da4a1daa0d06a7b", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 63, "avg_line_length": 33.26923076923077, "alnum_prop": 0.6034682080924856, "repo_name": "openstack/oslo.middleware", "id": "d7368ac40895633a6217412b60040c33ab7c08fe", "siz...
import sys, 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('.')) # -- General configurat...
{ "content_hash": "cdf8fd3a01be67f5db0cd88b8c1006b9", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 88, "avg_line_length": 32.7292576419214, "alnum_prop": 0.7059372915276851, "repo_name": "kaleidos/django-sampledatahelper", "id": "6bc03a0fc2f87bbc277a2ccd33b3fde6de7013cc",...
import argparse import os import sys script_dir = os.path.normpath(sys.path[0]) sys.path.append(os.path.abspath(os.path.join(script_dir, "../../utils/"))) import dirutils from ruleutils import create_layer_rules, create_color_rules from basechart import generate_basechart_config from geotif import generate_tif_config ...
{ "content_hash": "0b46c343a45ce87b4317f2b1425202b2", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 423, "avg_line_length": 51.34177215189873, "alnum_prop": 0.6433678500986193, "repo_name": "LarsSchy/SMAC-M", "id": "fc5438cd8d013b79a768f331a5c5fc24b5b3b96c", "size": "813...
"""Perl support for CodeIntel""" import os from os.path import (normpath, join, exists, splitext, basename, isdir, normcase, dirname, islink, isabs) import sys import logging import time from glob import glob import re from pprint import pprint, pformat import weakref import process from ciElemen...
{ "content_hash": "b332a40c2705031c8cb87c828f3a80e7", "timestamp": "", "source": "github", "line_count": 1415, "max_line_length": 119, "avg_line_length": 38.298233215547704, "alnum_prop": 0.4814179214644228, "repo_name": "prisis/sublime-text-packages", "id": "e69a2b20e5a4779364dc4ee68161e7b05b21c4e3",...
import unittest from test import test_support from itertools import * import weakref from decimal import Decimal from fractions import Fraction import sys import operator import random import copy import pickle from functools import reduce maxsize = test_support.MAX_Py_ssize_t minsize = -maxsize-1 def onearg(x): '...
{ "content_hash": "d474f08a3315e440ddccd5702e5cd494", "timestamp": "", "source": "github", "line_count": 1717, "max_line_length": 119, "avg_line_length": 40.429819452533486, "alnum_prop": 0.5404073871330203, "repo_name": "wang1352083/pythontool", "id": "8b5f051f18ee099a2e6e4187973913bb02783a8a", "si...
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('.')) # Get the proje...
{ "content_hash": "2cce308ac4e931f3f8772dd9a62136f2", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 76, "avg_line_length": 30.588461538461537, "alnum_prop": 0.7022507229976109, "repo_name": "giupo/prodomo", "id": "9fa12a949f40e2f0a5101f8acc226ea2ff47cff6", "size": "8398"...
""" The VMware API VM utility module to build SOAP object specs. """ import copy import functools from oslo.config import cfg from oslo.vmware import exceptions as vexc from nova import exception from nova.i18n import _ from nova.network import model as network_model from nova.openstack.common import log as logging ...
{ "content_hash": "e07e9a1b07287ae0729bede97a1565bc", "timestamp": "", "source": "github", "line_count": 1510, "max_line_length": 79, "avg_line_length": 38.94304635761589, "alnum_prop": 0.6101625739745595, "repo_name": "berrange/nova", "id": "1f44e170984701e31f71b84e404d464633e76605", "size": "59555...