text
stringlengths
4
1.02M
meta
dict
from bulletphysics import * broadphase = DbvtBroadphase() collisionConfiguration = DefaultCollisionConfiguration() dispatcher = CollisionDispatcher(collisionConfiguration) solver = SequentialImpulseConstraintSolver() world = DiscreteDynamicsWorld(dispatcher, broadphase, solver,collisionConfiguration) world.setGravi...
{ "content_hash": "008382e03fcf374b9d0cb159640c13fa", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 96, "avg_line_length": 34.59701492537314, "alnum_prop": 0.7661777394305436, "repo_name": "20tab/pybulletphysics", "id": "46fe3b098574588649b77ffd0258e00c7f5316a5", "size": ...
from .. import Provider as BankProvider class Provider(BankProvider): """Implement bank provider for ``es_ES`` locale.""" bban_format = "####################" country_code = "ES"
{ "content_hash": "13e4ecf3671c7ed9827a6bd5e991fc43", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 24.25, "alnum_prop": 0.5876288659793815, "repo_name": "joke2k/faker", "id": "16622baf35fbd9f247fee1c7209380c36a1889b4", "size": "194", "binary": fal...
"""Abstract classes for simulations which keep track of state vector.""" import abc from typing import Any, Dict, Sequence, TYPE_CHECKING, Tuple, Generic, TypeVar import numpy as np from cirq import ops, study, value from cirq.sim import simulator, state_vector if TYPE_CHECKING: import cirq TStateVectorStepR...
{ "content_hash": "7184a3467286c59d66656d59a5ab5328", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 97, "avg_line_length": 36.24175824175824, "alnum_prop": 0.6035476046088538, "repo_name": "balopat/Cirq", "id": "4e6e013833ea279547a1b9e9aa9b015eb0e67f4b", "size": "7180", ...
"""Multitask models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from REDACTED.tensorflow_models.mlperf.models.rough.transformer_lingvo.lingvo.core import base_layer from REDACTED.tensorflow_models.mlperf.models.rough.transformer_lingvo.lingvo.core i...
{ "content_hash": "f179de19945d09676a84e360a79131b2", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 100, "avg_line_length": 38.72477064220183, "alnum_prop": 0.7093105899076049, "repo_name": "mlperf/training_results_v0.7", "id": "58f425fb9dcbaf95c9602686f2722ee5dd8011f8", ...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from indra.databases import uniprot_client from indra.util import unicode_strs from nose.plugins.attrib import attr @attr('webservice') def test_query_protein_exists(): g = uniprot_client.query_protein('P00533'...
{ "content_hash": "10b331b8db871963a3f1af6965ef10af", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 74, "avg_line_length": 28.015706806282722, "alnum_prop": 0.6991216595028966, "repo_name": "pvtodorov/indra", "id": "ab96a5e15b80fdc6e27b4da13c21fdfc3b90ebe0", "size": "535...
from __future__ import print_function import os import argparse import sys import subprocess import shutil import threading # from collections import defaultdict # from subprocess import CalledProcessError # make sure scripts/internal is on the pythonpath. sys.path = [os.path.abspath(os.path.dirname(sys.argv[0])) + "/...
{ "content_hash": "7f6889f3dcba1418a318e6abb6890d56", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 108, "avg_line_length": 43.01633986928105, "alnum_prop": 0.5998632530578135, "repo_name": "wantee/pocolm", "id": "0898772930ac234670b89d2a820bbc924c3fa536", "size": "26421...
from lophi.sensors.network import NetworkSensor class NetworkSensorVirtual(NetworkSensor): """ Virtual network sensor for SUTs """
{ "content_hash": "83d7093e28f06bd15490f88decc4f81c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 47, "avg_line_length": 24.5, "alnum_prop": 0.7278911564625851, "repo_name": "mit-ll/LO-PHI", "id": "104f2ff6ebac5dc7604d3676950b411a14eb1e9c", "size": "147", "binary": fal...
''' This script will look through a WireShark csv file and see if it can find unaligned reads. "Unaligned" is any read operation that doesn't begin and end on a 16-byte boundary. You might want to change that value for your tests. Here are some hints and details: * You can create a .csv file with WireShark. With W...
{ "content_hash": "7472b64512ba9cab6452e540a73adf52", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 80, "avg_line_length": 34.4320987654321, "alnum_prop": 0.6618859806382216, "repo_name": "joeriggs/experiments", "id": "87f0ce22878aafae3e00d83408599f02b8089794", "size": "2...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bulletin', '0002_auto_20151216_2200'), ] operations = [ migrations.CreateModel( name='PostCategory', fields=[ ...
{ "content_hash": "c5e9bb1ed02d814cb79785906cdde5ae", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 73, "avg_line_length": 33.46875, "alnum_prop": 0.46872082166199813, "repo_name": "AASHE/django-bulletin", "id": "47052c999266c37707728bc126befe05dbadce44", "size": "1095", ...
from collections import deque from itertools import count filename = 'corporate_gifting.txt' def Node(object): def __init__(self, parent=None): self.parent = parent self.children = [] def solve(tree): """ Cases: - CEO alone - max flat hierarchy - max vertical hierarchy "...
{ "content_hash": "fbaa9d46c411ed151706174ecf15362e", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 82, "avg_line_length": 26.471698113207548, "alnum_prop": 0.5021382751247327, "repo_name": "fcaneto/py_programming_exercises", "id": "2eebdb1b7ab93332e93b6367a9415ae677d9fa72...
import os, sys sys.path.append(os.path.abspath(os.path.join(os.curdir,".."))) import run4v
{ "content_hash": "5aca8f6cce32fe89f46bc3ea0167e170", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 62, "avg_line_length": 18.8, "alnum_prop": 0.7021276595744681, "repo_name": "alejandrogallo/run4v", "id": "8d1d1fbcfe685971117f770c549b97870f29b56d", "size": "94", "binary...
from neutron.tests import base class TestDragonflowL3Agent(base.BaseTestCase): def setUp(self): super(TestDragonflowL3Agent, self).setUp()
{ "content_hash": "bbf9f584fb397e0ede14f1877c0903e3", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 50, "avg_line_length": 22, "alnum_prop": 0.7467532467532467, "repo_name": "no2key/dragonflow", "id": "085897ff7d60e607e534c3173a93e1297aef5dce", "size": "797", "binary": f...
""" Configuration items for the shop. Also contains shopping cart and related classes. """ import datetime import logging import operator import notification import signals try: from decimal import Decimal except: from django.utils._decimal import Decimal from django.conf import settings from django.contrib.s...
{ "content_hash": "810a7787f35531947a4382fe6c82ae4a", "timestamp": "", "source": "github", "line_count": 1187, "max_line_length": 152, "avg_line_length": 37.61246840775063, "alnum_prop": 0.6192940017022801, "repo_name": "sankroh/satchmo", "id": "409a1d1dbaf177e6e0b73d5f5648c5745f7524a1", "size": "44...
import contextlib import copy import datetime import errno import glob import os import random import re import shutil import signal import threading import time import uuid import eventlet from eventlet import greenthread import fixtures from lxml import etree import mock from mox3 import mox from os_brick.initiator ...
{ "content_hash": "7da56c7685bcc6e09c78573ee26bf3b4", "timestamp": "", "source": "github", "line_count": 15131, "max_line_length": 97, "avg_line_length": 44.57471416297667, "alnum_prop": 0.5434495744743943, "repo_name": "raildo/nova", "id": "8c922b4a5b70878a70411ac11b5e20e06d50fd9a", "size": "675116...
from __future__ import unicode_literals """ record of files naming for same name files: file.gif, file-1.gif, file-2.gif etc """ import frappe, frappe.utils from frappe.utils.file_manager import delete_file_data_content, get_content_hash, get_random_filename from frappe import _ from frappe.utils.nestedset import Ne...
{ "content_hash": "77c237a72f474069f7c1f1444e1488e5", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 145, "avg_line_length": 29.626436781609197, "alnum_prop": 0.6919495635305528, "repo_name": "mbauskar/helpdesk-frappe", "id": "72bea79686f22e605903898cf59ac8c64a2672aa", "s...
""" sphinx.builders.linkcheck ~~~~~~~~~~~~~~~~~~~~~~~~~ The CheckExternalLinksBuilder class. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import socket import codecs import threading from os import path from six.moves impo...
{ "content_hash": "4488346f30d6a3b8272e93dcd3a0a46e", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 87, "avg_line_length": 37.12237762237762, "alnum_prop": 0.5157765847226147, "repo_name": "ArcherSys/ArcherSys", "id": "9f5c2131c23091092ec226a5e9fa8e5142eb6aed", "size": "...
''' Custom filters for use in openshift-ansible ''' from ansible import errors from operator import itemgetter import pdb import re import json class FilterModule(object): ''' Custom ansible filters ''' @staticmethod def oo_pdb(arg): ''' This pops you into a pdb instance where arg is the data pa...
{ "content_hash": "75b266530951b0e349f5e5d962763400", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 84, "avg_line_length": 40.65064102564103, "alnum_prop": 0.4499724040053615, "repo_name": "jdamick/openshift-ansible", "id": "47033a88e1ce21613ecec1e5bf96c5791726bcf9", "si...
import pytest import requests from pyffdl.sites.story import * @pytest.mark.parametrize( "exception,url", [ (requests.exceptions.MissingSchema, None), (requests.exceptions.MissingSchema, "net"), (requests.exceptions.InvalidURL, "https://"), (requests.exceptions.InvalidSchema, ...
{ "content_hash": "c426a9e6a358d657920fe539f8de7847", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 66, "avg_line_length": 24.137931034482758, "alnum_prop": 0.6542857142857142, "repo_name": "Birion/python-ffdl", "id": "40d12634f4e5eb53821a657084ef5b6e7c571e26", "size": "7...
from __future__ import unicode_literals import frappe import requests import socket from frappe.model.document import Document from frappe import _ from six.moves.urllib.parse import urlparse class SocialLoginKeys(Document): def validate(self): self.validate_frappe_server_url() def validate_frappe_server_url(sel...
{ "content_hash": "30ca2bb377fb0d57833da09ae2ff1893", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 91, "avg_line_length": 31.566666666666666, "alnum_prop": 0.7275607180570222, "repo_name": "paurosello/frappe", "id": "33c8ab256000733bd6a5b8e495f1873704e8bd2e", "size": "10...
""" Utility to manage multiple :program:`celeryd` instances. """ from __future__ import absolute_import from celery.bin import celeryd_multi from djcelery.management.base import CeleryCommand class Command(CeleryCommand): """Run the celery daemon.""" args = "[name1, [name2, [...]> [worker options]" he...
{ "content_hash": "9b996ba16bc5c509f398a1acd731a09f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 60, "avg_line_length": 28.458333333333332, "alnum_prop": 0.6398243045387995, "repo_name": "softak/webfaction_demo", "id": "01ea4fbdb8e467b4e67ace6f4f0ca7e086221ae2", "size"...
"""UnitDbl module.""" #=========================================================================== # Place all imports after here. # from __future__ import print_function # # Place all imports before here. #=========================================================================== #=================================...
{ "content_hash": "b5101c6355dd82f189d9858036904ee1", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 77, "avg_line_length": 32.56583629893238, "alnum_prop": 0.44344880340946347, "repo_name": "RobertABT/heightmap", "id": "d9451294666534b4c3784f8653f8239187eb4bd1", "size": ...
import os import unittest import six import struct import random import bmemcached import uuid from bmemcached.compat import long, unicode if six.PY3: from unittest import mock else: import mock class MemcachedTests(unittest.TestCase): def setUp(self): self.server = '/tmp/memcached.sock' ...
{ "content_hash": "3a8296e4df589289637646becdfe69a3", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 109, "avg_line_length": 36.972727272727276, "alnum_prop": 0.5990656503565281, "repo_name": "jaysonsantos/python-binary-memcached", "id": "f69ce26179320367cb8bbd781f983dcab37...
from datetime import datetime import pytz from unittest.mock import patch from django.test import SimpleTestCase import testil from corehq.apps.users.models import WebUser, DomainMembership from corehq.util.timezones.utils import get_timezone_for_user, parse_date DOMAIN_TIMEZONE = pytz.timezone('Asia/Kolkata') @p...
{ "content_hash": "e1d48cf489b0bffdf751572db1d0659b", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 95, "avg_line_length": 32.44444444444444, "alnum_prop": 0.6990582191780822, "repo_name": "dimagi/commcare-hq", "id": "a0dfc518fea8c567e944ad2f359f57fc280863cd", "size": "23...
import unittest from pymap.mime import MessageContent from pymap.mime.cte import MessageDecoder _7bit_body = b"""Testing 7bit\n""" _8bit_body = b"""Testing\x008bit\x00\n""" _qp_body = b"""Testing=01Quoted=3DPrintable\n""" _b64_body = b"""VGVzdGluZwEACkJhc2UgNjQgCg==\n""" class TestMessageDecoder(unittest.TestCase):...
{ "content_hash": "ee0009b0ebac0ea282edde0383b9968c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 76, "avg_line_length": 39.5, "alnum_prop": 0.6708860759493671, "repo_name": "icgood/pymap", "id": "e1a0066eab91c7b9f077f5a7735cbf728d1176c5", "size": "1423", "binary": fa...
from six import iteritems class ResourceBase(dict): def __init__(self, parent, name=None): self.__parent__ = parent self.__name__ = name self.__root = None @property def parent(self): return self.__parent__ @property def name(self): return self.__name__ ...
{ "content_hash": "26b44ff467a725950421ff5474531a3c", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 59, "avg_line_length": 24.15625, "alnum_prop": 0.5763260025873221, "repo_name": "xica/hieratic", "id": "109dada13730c5b323c117fb355ee1b12f6dc290", "size": "1546", "binary...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("SVC_sigmoid" , "BinaryClass_10" , "duckdb")
{ "content_hash": "3843a004152637d52bafc76de4f738fb", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 35.25, "alnum_prop": 0.7730496453900709, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "5f0aadb4ef760886cbf58d903f457f1b50be558b", "size": "14...
"""Field handler classes. The field handlers are meant to parse information from or do some other generic action for a specific field type for the build_api script. """ from __future__ import print_function import contextlib import functools import os import shutil import sys from google.protobuf import message as ...
{ "content_hash": "a75018dabf2af47316fd70e9342d7d94", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 80, "avg_line_length": 32.10354223433242, "alnum_prop": 0.6857918859276863, "repo_name": "endlessm/chromium-browser", "id": "0eff8c832e9a3a0d1425e08d70504dbd16e6195d", "si...
from django.db import models from django.contrib.auth.models import AbstractUser class RadiusUser(AbstractUser): pass RadiusUser._meta.get_field('username').max_length = 255
{ "content_hash": "7770577062cf41b3fa54cff642adc5cd", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 25.285714285714285, "alnum_prop": 0.8022598870056498, "repo_name": "DanielGabris/radius_restserver", "id": "5f21cdeb2159a5be7e29a4a0366a4aad8db86469", ...
"""Libvirt volume driver for iSCSI""" from os_brick import exception as os_brick_exception from os_brick.initiator import connector from oslo_log import log as logging import nova.conf from nova.i18n import _LW from nova import utils from nova.virt.libvirt.volume import volume as libvirt_volume LOG = logging.getLogg...
{ "content_hash": "7c89af30f627cde4c44a484d3b464291", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 76, "avg_line_length": 36.68571428571428, "alnum_prop": 0.6456386292834891, "repo_name": "rajalokan/nova", "id": "dfe72a2c3625363778f381d7bf865fd242b7d87e", "size": "3140",...
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2017 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. -----------------------------------...
{ "content_hash": "a27ec868468686072f8cf793dd7c9a9e", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 177, "avg_line_length": 34.55555555555556, "alnum_prop": 0.5913183279742765, "repo_name": "fsxfreak/esys-pbi", "id": "7dcd3c6d89ea5339e6a2362c6db16002942174a2", "size": "31...
class COMMAND_FLAGS: IGNORED = 1 SILENCED = 2 class Command: def __init__(self): self.command = "true" self.flags = 0 def serialize(self): flagged = "" if self.flags & COMMAND_FLAGS.IGNORED: flagged = "-" if self.flags & COMMAND_FLAGS.SILENCED: ...
{ "content_hash": "a1fb1d3460e624751d5b1b604e854369", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 62, "avg_line_length": 22.03030303030303, "alnum_prop": 0.5254470426409904, "repo_name": "hbirchtree/coffeecutie-imgui", "id": "99e1d04a6c8d6677fc72ca01c11a69d00e2af440", "...
"""Various names for properties, transforms, etc.""" # All constants are for internal use only; no backwards-compatibility # guarantees. from __future__ import absolute_import # TODO (altay): Move shared names to a common location. # Standard file names used for staging files. from builtins import object PICKLED_MA...
{ "content_hash": "edd5cba6ab06464303897e9224c074d5", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 78, "avg_line_length": 35.80392156862745, "alnum_prop": 0.7519167579408543, "repo_name": "rangadi/incubator-beam", "id": "4eabbbe8129a8a6de6a7d63422b23c16e60259d1", "size"...
from __future__ import annotations import os from typing import Iterable, Optional from pants.backend.python.subsystems.debugpy import DebugPy from pants.backend.python.target_types import ( ConsoleScript, PexEntryPointField, ResolvedPexEntryPoint, ResolvePexEntryPointRequest, ) from pants.backend.pyt...
{ "content_hash": "9b69b38823d6fc9c822dece3afde809b", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 102, "avg_line_length": 37.476470588235294, "alnum_prop": 0.6780725160885261, "repo_name": "benjyw/pants", "id": "4336aa1e9a8859bfeaa1f46cfb2f656d931af6fb", "size": "6502"...
"""Tests for the tensorflow_serving_client_workload script.""" import datetime import sys import unittest import mock import six # These imports are mocked so that we don't need to add them to the # test dependencies. The script under test for this test module is # expected to execute only on a client VM which has b...
{ "content_hash": "9a3473de2a4e3d52b0e50b394431b4d2", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 131, "avg_line_length": 30.857142857142858, "alnum_prop": 0.6978114478114478, "repo_name": "GoogleCloudPlatform/PerfKitBenchmarker", "id": "0cea03abd440a3aee1ea79e552534db13f...
"""Generated test for checking pynos based actions """ import xml.etree.ElementTree as ET from st2tests.base import BaseActionTestCase from snmp_add_snmp_host import snmp_add_snmp_host __all__ = [ 'TestSnmpAddSnmpHost' ] class MockCallback(object): # pylint:disable=too-few-public-methods """Class to hold mo...
{ "content_hash": "3d394cbe2b77cecc62b1c43fdffa04d3", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 28.07547169811321, "alnum_prop": 0.5772849462365591, "repo_name": "StackStorm/st2contrib", "id": "ee374c6349e42f5368c3c96fa0b46f14bd119b8d", "size": ...
from __future__ import absolute_import import sys from io import TextIOWrapper, TextIOBase from splunklib.six import ensure_str from .event import ET try: from splunklib.six.moves import cStringIO as StringIO except ImportError: from splunklib.six import StringIO class EventWriter(object): """``EventWrit...
{ "content_hash": "7c6905fd7189b498ad4b01941758574b", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 100, "avg_line_length": 31.54794520547945, "alnum_prop": 0.6235345201910552, "repo_name": "doksu/TA-centralops", "id": "3e4321016ec868493b3cd9bdec1c4780c17cfa69", "size": "...
"""Utilities for configuring platform specific installation.""" import os import re import shutil from googlecloudsdk.core.credentials import gce as c_gce from googlecloudsdk.core.util import console_io from googlecloudsdk.core.util import platforms # pylint:disable=superfluous-parens # pylint:disable=unused-argum...
{ "content_hash": "ae29c1bbac84d178061c32e21c7fa728", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 78, "avg_line_length": 32.46190476190476, "alnum_prop": 0.6590875751796978, "repo_name": "ychen820/microblog", "id": "47d3b58942117e8a5e91b34723583c5e1fc404a5", "size": "6...
""" Copyright (c) 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import os import shutil import subprocess from pathlib import Path from typing import Any, Dict, List, Union from atomic_reactor.constants im...
{ "content_hash": "81c8635cbedce4ec8a9da8799b087ed8", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 99, "avg_line_length": 41.1375, "alnum_prop": 0.6338498936493467, "repo_name": "fr34k8/atomic-reactor", "id": "98ace23968663f8dcdbf3ffef16378ee2c4b7012", "size": "6582", ...
from past.builtins import basestring import unittest import types import os from vulndb import DBVuln from vulndb.db_vuln import Reference class TestLoadAllJSON(unittest.TestCase): maxDiff = None def test_from_file(self): failed_json_files = [] processed_files = [] for language in ...
{ "content_hash": "82c87da824536dc4186ef9a164aca55c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 75, "avg_line_length": 32.75471698113208, "alnum_prop": 0.5720046082949308, "repo_name": "vulndb/python-sdk", "id": "3f57c5ab7f08b4e02e6e08ad800b6ed2ce7019a1", "size": "173...
"""Holds the create_app() Flask application factory. More information in create_app() docstring.""" from importlib import import_module import locale import os from flask import Flask from yaml import safe_load import github_status as app_root from github_status.blueprints import all_blueprints from github_status.ex...
{ "content_hash": "0e324dc710ef38064787c574e125f753", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 103, "avg_line_length": 36.17894736842105, "alnum_prop": 0.687809135874309, "repo_name": "Robpol86/Flask-Large-App-Example-2", "id": "b508b25a1503956418ef7c18bb5e8a3806ed5694...
""" MkdocsServer This tool can be used to serve / preview the mkdocs output locally before publishing """ import os, sys, os.path as path import SCons.Script from SCons.Environment import Environment from SCons.Script import Builder # TODO always rebuild option needed? # TODO fix relative imports when im...
{ "content_hash": "a53c907924236ba9ca515a787d957888", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 84, "avg_line_length": 33.72727272727273, "alnum_prop": 0.6415094339622641, "repo_name": "ASoftTech/Scons-Tools-Grbd", "id": "091377291979389de6e5933bbc236b98cc052116", "si...
"""SQLAlchemy storage backend.""" from __future__ import absolute_import import datetime import os from oslo_config import cfg from oslo_db import exception as dbexc from oslo_db.sqlalchemy import session as db_session from oslo_log import log from oslo_utils import timeutils import sqlalchemy as sa from ceilometer....
{ "content_hash": "fbec1f0172f97dc57d7474d29cde6a21", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 79, "avg_line_length": 42.03864734299517, "alnum_prop": 0.5145368880717076, "repo_name": "mathslinux/ceilometer", "id": "a34831a56a9322a11698e58a743d50da707a694f", "size":...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import multiselectfield.db.fields class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_U...
{ "content_hash": "19be97bfafeacbf1cddfafe4d9c95ed2", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 397, "avg_line_length": 72.81395348837209, "alnum_prop": 0.6065154902587033, "repo_name": "hqpr/findyour3d", "id": "6886c454e6f051ae852c87820391cec3e462c1d1", "size": "3204...
class AbstractProvider: """ Abstract provider defining methods for writing and loading profiles. root level: Defaults for totem for all clusters. cluster level: Defaults for particular cluster. organization level: Defaults for particular organization repository: Defaults for particular reposit...
{ "content_hash": "11f3e4b57f1fbb23f801fc0b18b5ed44", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 79, "avg_line_length": 33.868852459016395, "alnum_prop": 0.6393998063891578, "repo_name": "totem/totem-encrypt", "id": "268a12683f7a546f0a24a9ecb771d1f521f274f9", "size": "...
"""JUNOS link down test Run: python -m unittest tests.test_spotmax """ import unittest from spotmax import SpotMAX, SPOTGroup from collections import defaultdict class MockNetworkDevice(object): def __init__(self, asset, loopback=None, groups='', username=None, password=None, ssh_keyfile=None): if loopback...
{ "content_hash": "ee2deabb1d36ed18a88b064e48fc0479", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 146, "avg_line_length": 29.673239436619717, "alnum_prop": 0.5976836909056389, "repo_name": "MaxIV-KitsControls/netspot", "id": "69c6a1ed61ec79b4a0e871a9dff59573ecdd98f0", ...
import unittest import converter class ConverterTestCase(unittest.TestCase): def test_usd(self): usd = converter.convert('usd', 'USD', 1.00) self.assertEquals(usd, 1.0) def test_jpy(self): jpy = converter.convert('usd', 'jpy', 1.00) self.assertEquals(type(u'1.0'), ...
{ "content_hash": "dc0575b16fbb9ba2dbb87b697f4433c5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 51, "avg_line_length": 27.75, "alnum_prop": 0.5891891891891892, "repo_name": "brianriley/python-currency", "id": "2c2acda10c819d6315975275421515b673b4ad00", "size": "555", ...
"""Exceptions for database connectors.""" class ConnectorError(Exception): """Base connector error""" class DumpError(ConnectorError): """Error on dump""" class RestoreError(ConnectorError): """Error on restore""" class CommandConnectorError(ConnectorError): """Failing command"""
{ "content_hash": "8bd3b2f6aaca6e6744b367ea5ea21364", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 44, "avg_line_length": 20.2, "alnum_prop": 0.7095709570957096, "repo_name": "ZuluPro/django-dbbackup", "id": "f22373060780d5f2bd2851154bc10a575c084246", "size": "303", "b...
from datetime import timedelta import logging import re import xml.sax import json from google.appengine.ext import ndb from google.appengine.api import taskqueue from ffe.gae import increase_counter from ffe.ffe_time import cet_from_string, string_from_cet, utc_from_cet from ffe.markup import XMLImporter from TABasic...
{ "content_hash": "a511f27a8268ae0d149c05324e18e044", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 109, "avg_line_length": 36.77183098591549, "alnum_prop": 0.5363873142331852, "repo_name": "firstflamingo/treinenaapje", "id": "d7034d7387f4e908ff19c93e44d3c9eee32f1994", "...
"""Support to trigger Maker IFTTT recipes.""" import json import logging import pyfttt import requests import voluptuous as vol from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.helpers import config_entry_flow import homeassistant.helpers.config_validation as cv from .const import DOMAIN _LOGGER = ...
{ "content_hash": "2b073ec262bc21ece08335ad6fbff786", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 86, "avg_line_length": 27.801724137931036, "alnum_prop": 0.6446511627906977, "repo_name": "qedi-r/home-assistant", "id": "05d773e9fd687a0c36749a268acfc3fda32a2185", "size"...
from django.utils.encoding import force_unicode from django.conf import settings from django import forms import datetime, time from django.utils.safestring import mark_safe from django.core.validators import EMPTY_VALUES calbtn = u"""<img src="%(media_url)scalendar/cal.gif" alt="kalendarz" id="%(field_id)s_btn" style...
{ "content_hash": "f0d7cfef0999dfaff3cd4b3a135ed706", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 172, "avg_line_length": 33.798507462686565, "alnum_prop": 0.5447118569220578, "repo_name": "adamcupial/django-js-addons", "id": "3329dae02a9d4b54e507ecd946402e5fff6dc6a2", ...
""" A mix-in class implementing flow decomposition """ from collections import OrderedDict from copy import copy, deepcopy from hashlib import md5 import structlog from voltha.protos import third_party from voltha.protos import openflow_13_pb2 as ofp _ = third_party log = structlog.get_logger() # aliases ofb_field...
{ "content_hash": "b3a3924bd0d828bd76e184f518d36367", "timestamp": "", "source": "github", "line_count": 995, "max_line_length": 102, "avg_line_length": 36.64723618090452, "alnum_prop": 0.5369953927161035, "repo_name": "opencord/voltha", "id": "8027beeee765abe71072a6cff648947eb3b0199b", "size": "370...
from collections import OrderedDict from typing import Dict, Type from .base import DashboardsServiceTransport from .grpc import DashboardsServiceGrpcTransport from .grpc_asyncio import DashboardsServiceGrpcAsyncIOTransport # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Ty...
{ "content_hash": "09b500695e102a5a9e23ab1714b0c152", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 88, "avg_line_length": 32.73684210526316, "alnum_prop": 0.815112540192926, "repo_name": "googleapis/python-monitoring-dashboards", "id": "7057d44554888f0dd84a43156ae7bfce4538...
from pyspark import tests from pyspark.sql import SparkSession from examples import depSemisupervisedMnist from pyspark.sql import functions as F import math class Test_Semisupervised_Mnist(tests.ReusedPySparkTestCase): def setUp(self): str_input = '/home/svanhmic/workspace/data/DABAI/mnist/train.csv' ...
{ "content_hash": "ed2d04481deae65f7d5d928e288e7bef", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 125, "avg_line_length": 45.33734939759036, "alnum_prop": 0.6486845601913367, "repo_name": "mssalvador/WorkflowCleaning", "id": "3cb7d7fa5109d283cf34b1d5d7ed78a0fe290c35", "...
from threading import Lock class AutocompleteContext(object): ''' An autocomplete context. Singleton. ''' def __init__(self): self.lock = Lock() self._is_open = False self._id = None self._request_id = None self._results = [] self._formatted_result...
{ "content_hash": "1905a903b7bba9b266d03a9246d0c191", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 83, "avg_line_length": 27.11842105263158, "alnum_prop": 0.5992236778262979, "repo_name": "guillermooo/dart-sublime-bundle-releases", "id": "3c1f80eeb1188fb62ad21be020aa47d0a9...
"""Contrastive loss functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import flags import tensorflow.compat.v1 as tf from tensorflow.compiler.tf2xla.python import xla # pylint: disable=g-direct-tensorflow-import FLAGS = flags.FLAGS ...
{ "content_hash": "2a080740f0cf66c85d64fd78798dbb35", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 95, "avg_line_length": 36.733333333333334, "alnum_prop": 0.652651744303287, "repo_name": "google-research/fnc", "id": "6ae270a1e477d86945d98b0f07479f48b7088a30", "size": "...
""" Component that will help set the FFmpeg component. For more details about this component, please refer to the documentation at https://home-assistant.io/components/ffmpeg/ """ import logging import re import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ( ATTR_ENTI...
{ "content_hash": "0254252d1b26a986b311c82f291ef357", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 75, "avg_line_length": 29.018957345971565, "alnum_prop": 0.6393924546790789, "repo_name": "PetePriority/home-assistant", "id": "3184b5a5d54ab31fc9dc6ca899ffdc992d1b3793", ...
""" Django settings for ecoloscore project. Generated by 'django-admin startproject' using Django 1.8.6. 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/ """ # Build p...
{ "content_hash": "e863b4240f60616fa7405e58b8e4d2f6", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 71, "avg_line_length": 24.74264705882353, "alnum_prop": 0.6692421991084695, "repo_name": "J1bz/ecoloscore", "id": "65452c3ed4b079f05c634b88c9e30d5541148283", "size": "3390...
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from zope.interface import implements class LinksCommand(ModuleData, Command): implements(IPlugin, IModuleData, ICommand) name = "LinksCommand" core = True d...
{ "content_hash": "ba5cceffa7a82c4c61de1d5fbccdcf5d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 120, "avg_line_length": 35.05882352941177, "alnum_prop": 0.7374161073825504, "repo_name": "ElementalAlchemist/txircd", "id": "8410362d9c3c2da4a6d13fe3b8ec787520f30611", "si...
import time import quick2wire.i2c as i2c import re import logging from threading import Lock from RPi import GPIO # Support library for MCP23017 on Raspberry pi log = logging.getLogger("MCP23017") BUS = i2c.I2CMaster() GPIO.setmode(GPIO.BCM) # Register Mapping for Bank SETTING mode REGISTER_MAPPING = { 0 : { ...
{ "content_hash": "aa0a03532dfa0c3143c9ea9124fcad53", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 137, "avg_line_length": 32.9536231884058, "alnum_prop": 0.6527399067640074, "repo_name": "computerlyrik/MCP23017-RPi-python", "id": "6a2ea81c4a5fdc622aece9722244aa878d50a51e...
extensions = ['sphinx.ext.autodoc'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree doc...
{ "content_hash": "17837325c67874eee2617ee28bd19e4a", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 78, "avg_line_length": 30.735537190082646, "alnum_prop": 0.6652325894057542, "repo_name": "bbayles/vod_metadata", "id": "d4f0ff06ba722233176e72cd6160450e0eb83cf9", "size":...
import unittest import os import getpass import pwd from os import path from worker_installer import init_worker_installer from worker_installer import DEFAULT_MIN_WORKERS, DEFAULT_MAX_WORKERS from worker_installer import FabricRunner from worker_installer.tasks import create_celery_configuration from cloudify.mocks im...
{ "content_hash": "658f4a710b1114d1d0b82b395e2c0b18", "timestamp": "", "source": "github", "line_count": 476, "max_line_length": 75, "avg_line_length": 35.04201680672269, "alnum_prop": 0.4505395683453237, "repo_name": "konradxyz/dev_fileserver", "id": "9d083d46ea1336ca4d891c2b1c3dd5be1505d5da", "siz...
import itertools from types import MappingProxyType from ..util import superscript, tuplize, ImmutableBase from .grammar import UnionExp, TypeExp from .collection import Tuple class TypeVarExp(UnionExp): def __init__(self, members, tmap, input=False, output=False, index=None): self.mapping = tmap ...
{ "content_hash": "2b5c075ec3445349963aceaee65100b1", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 79, "avg_line_length": 35.180602006688964, "alnum_prop": 0.5587983648635801, "repo_name": "qiime2/qiime2", "id": "c33385641b6fbe4df1436cbd80347020deb0ce52", "size": "10869...
from __future__ import absolute_import import mock import unittest import pandas import datalab.stackdriver.commands._monitoring as monitoring_commands PROJECT = 'my-project' class TestCases(unittest.TestCase): @mock.patch('datalab.stackdriver.commands._monitoring._render_dataframe') @mock.patch('datalab.stac...
{ "content_hash": "29728696a4ec7a5493562905d6b0fce6", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 93, "avg_line_length": 42.265625, "alnum_prop": 0.744547134935305, "repo_name": "supriyagarg/pydatalab", "id": "1361712f11897a8265f67c7508507e34fba249e0", "size": "3294", ...
import datetime import json from twisted.web import http from twisted.internet import defer from twisted.web import client from zope import interface from piped import util, exceptions, processing, yamlutil from piped.processors import base class HttpRequestProcessor(base.Processor): def __init__(self, request...
{ "content_hash": "0fb4c5609456703925cde7cdb383ae17", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 135, "avg_line_length": 37.28059701492537, "alnum_prop": 0.6303947473776924, "repo_name": "foundit/Piped", "id": "6c637c66f8a8c332ff461aab8f4fde9997d41182", "size": "12588...
from __init__ import read_pos, coordinate_correct from image import Image def matrix(name, x_top_left, y_top_left): """ Build the final perstective transformation matrix in a string. Parameters ============ name : String The name of the iamge, such as '1.23.tif' x_topleft : float Th...
{ "content_hash": "fcdda0a55cc9ce64501c8aa72e272df3", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 81, "avg_line_length": 32.04, "alnum_prop": 0.5736579275905118, "repo_name": "suzhaoen/pkout", "id": "36c5d9f0fd1d613f23f017d5e96d1898fa714129", "size": "1602", "binary":...
try: from ucollections import namedtuple except: from collections import namedtuple # test http request for parameters required by rfc6455 # indicating request is request to create websocket def is_websocket_request(request): opts = request.options if "Sec-WebSocket-Key" in opts \ ...
{ "content_hash": "b181039e6141da2dbc4f95e7b31fff61", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 77, "avg_line_length": 30.896551724137932, "alnum_prop": 0.5368303571428571, "repo_name": "PinkInk/upylib", "id": "e0d35baf73eb6d4be31efedaeb2e91ce90591206", "size": "1792"...
import os def is_os_64bit(): arch1 = (os.environ.get('PROCESSOR_ARCHITECTURE') or "").lower() arch2 = (os.environ.get('PROCESSOR_ARCHITEW6432') or "").lower() return (arch1 == "amd64" or arch2 == "amd64") def set_msvc_environment(installDir, arch): oldPathEnv = os.environ.get('PATH') or "" os.e...
{ "content_hash": "22809413d6b263e18c8dc26b046bc9af", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 116, "avg_line_length": 43.958333333333336, "alnum_prop": 0.5914691943127962, "repo_name": "fifoforlifo/pynja", "id": "6db8790bee9bf31f4138e29ee0a9eedb53b1fa61", "size": "1...
match = {'django_openid': 'django-openid'} urls = { 'django-tagging': 'http://code.google.com/p/django-tagging/', 'django-djpcms': 'http://djpcms.com', 'django-openid': 'http://github.com/simonw/django-openid' }
{ "content_hash": "413b41d5838cff42dc0a3139bd9aa2b7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 69, "avg_line_length": 35, "alnum_prop": 0.5918367346938775, "repo_name": "strogo/djpcms", "id": "d98cb018d862a3002603ed1d0b212f2efc3b040d", "size": "246", "binary": false...
from __future__ import division module_name = "didyoumean" def unique_sorted(s): return ''.join(sorted(set(s))) def did_you_mean(given, cmd_name_list): highest_ranked = ("", 0) given = unique_sorted(given.lower()) for name in cmd_name_list: nameu = unique_sorted(name) score = 0 ...
{ "content_hash": "d9b0e72a3cc9b8ce1ffd6a3ebfc2fcf1", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 116, "avg_line_length": 27.714285714285715, "alnum_prop": 0.5601374570446735, "repo_name": "Mego/DataBot", "id": "0803a15dec0c61794c383714c5f5adc2f04d317e", "size": "1164",...
import sys import paramiko from contextlib import closing from scpclient import * import re import logging class CX: def __init__(self, shell=None): self.shell = shell return def login_connect(self, username, password): """ Connect to the CX1 login node. """ logging.info("Connect...
{ "content_hash": "5d0d217feddf708ff2b8a424c02065d8", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 97, "avg_line_length": 30.54054054054054, "alnum_prop": 0.5752212389380531, "repo_name": "ctjacobs/cxqwatch", "id": "18aa28245c36a17070e4489ad1df5e4c79a18023", "size": "45...
from django.test import TestCase from janyson.options import Options class OptionsTestCase(TestCase): def setUp(self): self.options = Options() def test_default_options(self): for option, value in Options.default_options.items(): self.assertEqual(getattr(self.options, option), v...
{ "content_hash": "4858d6f34b21dc9a21cc77e9e58ab57c", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 30, "alnum_prop": 0.6634408602150538, "repo_name": "un-def/django-janyson", "id": "ab4496833d523710d27e81b64c9994534854ad29", "size": "955", "binar...
from django.conf.urls import patterns # noqa from django.conf.urls import url # noqa from dlux.dashboards.network.neutron_ports import views urlpatterns = patterns( 'dlux.dashboards.network.neutron_ports.views', url(r'^$', views.IndexView.as_view(), name='index'), url(r'(?P<port_id>[^/]+)/detail$', ...
{ "content_hash": "2ea925969146f0e3f3d2a15850706a85", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 56, "avg_line_length": 33.63636363636363, "alnum_prop": 0.6837837837837838, "repo_name": "ekarlso/dlux-horizon", "id": "0ace76c3520be73802cd4ee5dd3ade347f1065b2", "size": "...
import hashlib from charms.reactive import when, when_not from charms.reactive import is_state, set_state, remove_state from charmhelpers.core import hookenv from charms.layer.apache_bigtop_base import get_package_version from charms.layer.bigtop_zeppelin import Zeppelin from charms.reactive.helpers import data_change...
{ "content_hash": "e5dfce132b09670b58f30e187182a109", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 78, "avg_line_length": 33.16107382550336, "alnum_prop": 0.6798218984011334, "repo_name": "evans-ye/bigtop", "id": "6d37fdccc6fb9db5d6df6fdcb5b236876347545b", "size": "5723...
sentences = list() while True: txt = raw_input("Skriv en mening: ") if txt == 'END': break sentences.append(txt) outFile = open('mywords.out', 'w') for sentence in sentences: outFile.write(sentence) outFile.write('\n') outFile.close() # empty line print "" fh = open("mywords.ou...
{ "content_hash": "e25d1835a92d0c7863a284b3acd082f4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 40, "avg_line_length": 17.714285714285715, "alnum_prop": 0.6102150537634409, "repo_name": "CoderDojo-Karlskrona/python-exercises", "id": "68cd414ed68bbb89ac3be4e0defb00d5bf19...
from model.contact import Contact import random def test_edit_contact_by_index(app, db, check_ui): if app.contact.count_contacts() == 0: app.contact.create(Contact(firstname="For modify", birth_date="//div[@id='content']/form/select[1]//option[1]", birth_month="//div[@id='conten...
{ "content_hash": "2b45b287c076934233546ab55776551f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 123, "avg_line_length": 66.27272727272727, "alnum_prop": 0.5518975765889346, "repo_name": "AklerQ/python_training", "id": "f15645e2718a43f06b2355f1fd95c770c6af6473", "size"...
import collections import json from telemetry.core import util from telemetry.page import page_benchmark class SunSpiderBenchark(page_benchmark.PageBenchmark): def MeasurePage(self, _, tab, results): js_is_done = """ window.location.pathname.indexOf('sunspider-results') >= 0""" def _IsDone(): return ...
{ "content_hash": "f9b97b9b92dfb97a99d05ffd6c94d701", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 77, "avg_line_length": 33.29032258064516, "alnum_prop": 0.625968992248062, "repo_name": "zcbenz/cefode-chromium", "id": "f976216de30df28cf93d3990d94691563fbc9796", "size": ...
import json from functools import wraps from flask import Blueprint, current_app, jsonify, request from app.celery.tasks import ( record_daily_sorted_counts, update_letter_notifications_statuses, ) from app.config import QueueNames from app.notifications.utils import autoconfirm_subscription from app.schema_v...
{ "content_hash": "176c4ad6e35c7910eac5fb952d138c0c", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 97, "avg_line_length": 36.81967213114754, "alnum_prop": 0.6821015138023152, "repo_name": "alphagov/notifications-api", "id": "121dcb3e194259bd7abe253e3c3048ebbed38d3f", "si...
from sqlalchemy.test.testing import assert_raises, assert_raises_message import sqlalchemy as sa from sqlalchemy import Integer, PickleType, String import operator from sqlalchemy.test import testing from sqlalchemy.util import OrderedSet from sqlalchemy.orm import mapper, relationship, create_session, PropComparator, ...
{ "content_hash": "0bd5824bc7a8b0818c64ddaca71f11ec", "timestamp": "", "source": "github", "line_count": 1064, "max_line_length": 122, "avg_line_length": 31.771616541353385, "alnum_prop": 0.5507173495045111, "repo_name": "dbbhattacharya/kitsune", "id": "d63d7e086ec0b382cf4f5189944e8d73280f45fb", "si...
""" Records from :ref:`equipment-database`\'s or :ref:`connections-database`\'s. """ from __future__ import unicode_literals import json import datetime from enum import Enum from xml.etree.cElementTree import Element from collections import OrderedDict try: from collections.abc import Mapping except ImportError: ...
{ "content_hash": "2c78c3eb29d86ca17021c4922fd9636d", "timestamp": "", "source": "github", "line_count": 1042, "max_line_length": 118, "avg_line_length": 38.27831094049904, "alnum_prop": 0.560873489444918, "repo_name": "MSLNZ/msl-equipment", "id": "dbfc63b12933a0f9fdb0ddda890e3322aef147b0", "size": ...
from logging import getLogger from dateutil.parser import parse from django.utils.translation import ugettext_noop as _ from django.utils.six import iteritems from api.api_views import APIView from api.views import exception_handler from api.utils.views import call_api_view from api.utils.request import set_request_me...
{ "content_hash": "149abf2834f4957b7fc5ca074e10c1db", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 120, "avg_line_length": 39.130434782608695, "alnum_prop": 0.5737777777777778, "repo_name": "erigones/esdc-ce", "id": "f04a6714ebd9958f46f4d35b3573ae619d22d725", "size": "9...
from __future__ import absolute_import, division, print_function from future.utils import with_metaclass from abc import ABCMeta, abstractproperty import numpy as np from skbio.util._decorator import classproperty, stable from ._iupac_sequence import _motifs as parent_motifs class NucleotideMixin(with_metaclass(AB...
{ "content_hash": "6aab50bb1ef86ff7b92c757045b7fb41", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 79, "avg_line_length": 28.390581717451525, "alnum_prop": 0.5252219728754025, "repo_name": "demis001/scikit-bio", "id": "9b5c75cf12692ef06f0dc9a12454659a572ca1df", "size": ...
import os.path import uuid import mock from solum.tests import base from solum.tests import fakes from solum.tests import utils from solum.worker.handlers import shell_nobuild as shell_handler class HandlerTest(base.BaseTestCase): def setUp(self): super(HandlerTest, self).setUp() self.ctx = util...
{ "content_hash": "b367de403ffbe258dc2761e43ce97e0e", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 77, "avg_line_length": 43.90909090909091, "alnum_prop": 0.5718722271517303, "repo_name": "gilbertpilz/solum", "id": "31c6d515ade443c4be719a9690d593257d9eb56c", "size": "73...
import argparse import logging import sys from . import kazoocli from .version import description def main(args=None): parser = argparse.ArgumentParser(description=description) parser.add_argument('server', nargs='?', help='The ZooKeeper server to connect to', ...
{ "content_hash": "78a91abcfe3ff3a800587eb110de070f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 32.03030303030303, "alnum_prop": 0.5988647114474929, "repo_name": "mpetazzoni/kazoocli", "id": "039be5c5d129ddd0824a94a28d6dd803867ef66b", "size": "1...
import time import sys import heapq from gridmap import GridNode, GridMap from random import random class Algo(): def __init__(self, grid): self.visited = [] self.calctime = -1 self.grid = grid self.result = [] def print_result(self, printmap): print 'Number of visited...
{ "content_hash": "313d8034d58b4e75974a7aabd16cdbb5", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 138, "avg_line_length": 32.21172638436482, "alnum_prop": 0.5022752553342097, "repo_name": "adiectio/astar", "id": "29edd100f1175f297fdb1582c09358da2859351c", "size": "9977...
from __future__ import unicode_literals from django.test import TransactionTestCase from aldryn_newsblog.cms_appconfig import NewsBlogConfig from aldryn_newsblog.models import Article from aldryn_people.models import Person from . import NewsBlogTestsMixin class AdminTest(NewsBlogTestsMixin, TransactionTestCase): ...
{ "content_hash": "27f2ceb91b1488c84195d6e31e82d032", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 77, "avg_line_length": 39.28947368421053, "alnum_prop": 0.6751507032819826, "repo_name": "czpython/aldryn-newsblog", "id": "77ce30cb9846bb907d1268b75013945d7a09afcb", "size...
""" Local support for Insteon. For more details about this component, please refer to the documentation at https://home-assistant.io/components/insteon_local/ """ import logging import requests import voluptuous as vol from homeassistant.const import ( CONF_PASSWORD, CONF_USERNAME, CONF_HOST, CONF_PORT, CONF_TIM...
{ "content_hash": "4172a907f865adbd9f64e5bf539c0d9c", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 76, "avg_line_length": 30.507042253521128, "alnum_prop": 0.669898430286242, "repo_name": "shaftoe/home-assistant", "id": "1f700b5ff3e95c5ffb105c08fd975ca0c9c83bbd", "size":...
major = 0 minor = 4 micro = 9 release_level = 'beta' from __svn_version__ import svn_version special_version = '%(major)d.%(minor)d.%(micro)d_%(svn_version)s'\ % (locals ())
{ "content_hash": "c500b0ba7ff3852daaa8804ffde0d1ae", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 66, "avg_line_length": 21.555555555555557, "alnum_prop": 0.5824742268041238, "repo_name": "scipy/scipy-svn", "id": "f6e06061f4efc1fa507040da3bf358ded971d779", "size": "194",...
from requestbuilder import Arg from requestbuilder.exceptions import ArgumentError from requestbuilder.mixins import TabifyingMixin from euca2ools.commands.ec2 import EC2Request class ModifyInstanceTypeAttribute(EC2Request, TabifyingMixin): DESCRIPTION = '[Eucalyptus cloud admin only] Modify an instance type' ...
{ "content_hash": "87807cacc5b2794abefc7357f8732387", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 49.74285714285714, "alnum_prop": 0.6042504307869041, "repo_name": "nagyistoce/euca2ools", "id": "11434a35ba6bc92565b1a747f84e40c3f7d7ff2d", "size": "...
a = {} print 'Before error handler section' try: print 'one' print a['not_here'] print 'two' except KeyError: print 'There was a key exception' print 'three'
{ "content_hash": "743cff2f8cd6425e2b525d3d7df88fd0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 37, "avg_line_length": 14.75, "alnum_prop": 0.6384180790960452, "repo_name": "cstamm/PythonNetworking", "id": "da2af4459346bf9331b08197c1157f9c73446186", "size": "200", "...
"""This module defines the vtgate client interface. """ from vtdb import vtgate_cursor # mapping from protocol to python class. vtgate_client_conn_classes = dict() def register_conn_class(protocol, c): """Used by implementations to register themselves. Args: protocol: short string to document the protocol....
{ "content_hash": "9cf023ad31d57ee20995f1174f123ca5", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 80, "avg_line_length": 36.933933933933936, "alnum_prop": 0.6868038051874136, "repo_name": "netroby/vitess", "id": "5293ef2bf4f0c131283f1f2254b1d3da5d868fd3", "size": "1245...
"""gRPC TensorFlow operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from seed_rl.grpc.python.ops import *
{ "content_hash": "6e9bccf8a0d88e2cde8dd9f3078ed880", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 26.428571428571427, "alnum_prop": 0.7351351351351352, "repo_name": "google-research/seed_rl", "id": "b10e97362997ae7e1cde136fa3502a87f7db888c", "size"...
import logging from ray.rllib.agents.trainer import with_common_config from ray.rllib.agents.dqn.dqn import GenericOffPolicyTrainer from ray.rllib.agents.ddpg.ddpg_tf_policy import DDPGTFPolicy logger = logging.getLogger(__name__) # yapf: disable # __sphinx_doc_begin__ DEFAULT_CONFIG = with_common_config({ # ===...
{ "content_hash": "001c45417e26b38c0b04e71a1b6e4341", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 79, "avg_line_length": 41.30810810810811, "alnum_prop": 0.6754776236587281, "repo_name": "robertnishihara/ray", "id": "9e580c0f8f868526865646f4c077ac5389e1ac5a", "size": "...
from office365.runtime.client_value import ClientValue class Thumbnail(ClientValue): """ The thumbnail resource type represents a thumbnail for an image, video, document, or any item that has a bitmap representation. """ def __init__(self, content=None, height=None, source_item_id=None, url=N...
{ "content_hash": "70ff71a8bf5c91000098348cc143e0ac", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 110, "avg_line_length": 41.43478260869565, "alnum_prop": 0.6610703043022036, "repo_name": "vgrem/Office365-REST-Python-Client", "id": "f83b5c46b0a3987749d37890dc8eeaeac2d2e74...
"""Platform for beewi_smartclim integration.""" from __future__ import annotations from beewi_smartclim import BeewiSmartClimPoller # pylint: disable=import-error import voluptuous as vol from homeassistant.components.sensor import ( PLATFORM_SCHEMA, SensorDeviceClass, SensorEntity, ) from homeassistant....
{ "content_hash": "487b65123d7cf83c95da658ef5f0ed96", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 85, "avg_line_length": 32.83529411764706, "alnum_prop": 0.6782515227517019, "repo_name": "w1ll1am23/home-assistant", "id": "4d8936859f55577d429c5f9b7c5abb2272dc5ed0", "size...
''' Filter reads from one or more BAMs and output a CSV or a new BAM. Loci and VCF files may be specified, in which case reads are filtered to overlap the specified loci or variants. Examples: Print basic fields for the reads in a BAM: %(prog)s test/data/CELSR1/bams/bam_0.bam Same as above but filter only to r...
{ "content_hash": "260c68b3e210bee69acb810704035285", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 34.45238095238095, "alnum_prop": 0.6138217000691085, "repo_name": "hammerlab/varlens", "id": "45e60fdb67e63d49f6031abcacbbc9e7d5686e5a", "size": "72...
''' this function can handle oracle script with block comment handle change drop table table to begin execute immediate \'drop table UTLMGT_DASHBOARD.temp_gen_dm_auth_2\'; exception when others then null; end ''' def convertToBODSScript ( path): f0 = open(path,'r') f1 = [] for line in f0: ...
{ "content_hash": "92ca98c88aaef0eaad4db79a80052ed7", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 219, "avg_line_length": 43.145161290322584, "alnum_prop": 0.47514018691588783, "repo_name": "wenleicao/wenleicao.github.io", "id": "97167ddd82dc52707cc344add3e0a41f193917f5",...
""" Core components of Home Assistant. Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ from __future__ import annotations import asyncio from collections.abc import Awaitable, Collection, Coroutine, Iterable, Mapping import datetime import enum import functo...
{ "content_hash": "238d7360309d8b71e612b1457d61b73a", "timestamp": "", "source": "github", "line_count": 1790, "max_line_length": 101, "avg_line_length": 33.12122905027933, "alnum_prop": 0.5878523116366151, "repo_name": "kennedyshead/home-assistant", "id": "b9bf97e7e6c8209bc77daf02dc40dd6b3df1a3cd", ...
""" These are the core functions/classes for interacting with NetworkX. """ from itertools import chain import networkx as nx def reset_index(graph): """ This clobbers your nodes, best protect them. :param graph: networx.Graph :returns: networkx.Graph """ mapping = dict(zip(graph.nodes(), ran...
{ "content_hash": "8a5f3dbf4e6ae1764c73dd3ae95518f8", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 78, "avg_line_length": 36.2035175879397, "alnum_prop": 0.5742244430564231, "repo_name": "davebshow/projx", "id": "cf489f598fe8551839d35775b4e0f5184ad69d7c", "size": "14433...
from django.core.management.base import BaseCommand import crits.stats.handlers as stats class Command(BaseCommand): """ Script Class. """ help = "Runs mapreduces for CRITs." def handle(self, *args, **options): """ Script Execution. """ stats.generate_yara_hits() ...
{ "content_hash": "ee489c5dc7013bca6c6bf1ef222b6a60", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 51, "avg_line_length": 24.565217391304348, "alnum_prop": 0.6141592920353982, "repo_name": "DukeOfHazard/crits", "id": "0bc0eaaf09e0f25359280a55f09f3b4f8555de30", "size": "5...
import csv from eva_cttv_pipeline.trait_mapping.trait import Trait def output_trait_mapping(trait: Trait, mapping_writer: csv.writer): """ Write any finished ontology mappings for a trait to a csv file writer. :param trait: A trait with finished ontology mappings in finished_mapping_set :param mappi...
{ "content_hash": "fad11b42d1ee0371c2506cfcae427d39", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 116, "avg_line_length": 44.20289855072464, "alnum_prop": 0.7127868852459016, "repo_name": "EBIvariation/eva-cttv-pipeline", "id": "0c3886058285c198ddd0997db40187b6731e7b79", ...