text
stringlengths
4
1.02M
meta
dict
import factory.fuzzy from rest_framework.reverse import reverse from waldur_core.structure import models as structure_models from waldur_core.structure.tests import factories as structure_factories from waldur_core.users import models class InvitationBaseFactory(factory.DjangoModelFactory): email = factory.Seque...
{ "content_hash": "c5210c407ba6f4c4ed776fca5d7b819c", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 80, "avg_line_length": 34.670103092783506, "alnum_prop": 0.6993755575379126, "repo_name": "opennode/waldur-mastermind", "id": "c53af7af58087fe07586a3a0fe988277d9e4f677", "s...
"""Tests for occupancy_flow_grids.""" import tensorflow as tf from waymo_open_dataset.utils import occupancy_flow_data from waymo_open_dataset.utils import occupancy_flow_grids from waymo_open_dataset.utils import occupancy_flow_renderer from waymo_open_dataset.utils import occupancy_flow_test_util class OccupancyF...
{ "content_hash": "dcbe3ed3ac5227c9681a68aad68ace02", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 80, "avg_line_length": 41.389830508474574, "alnum_prop": 0.6852989352989353, "repo_name": "waymo-research/waymo-open-dataset", "id": "3385e7e4d62abd3ecab31b37398c0293bce5fdb...
import os import mock from oslo.config import cfg from poppy.transport import pecan from tests.unit import base class PecanTransportDriverTest(base.TestCase): def test_listen(self): tests_path = os.path.abspath(os.path.dirname( os.path.dirname( os.path.d...
{ "content_hash": "ea08cbd3acb19ba100b48654ddc5940a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 78, "avg_line_length": 35.5, "alnum_prop": 0.5937161430119177, "repo_name": "amitgandhinz/cdn", "id": "2c1fea62768b62cc76eda5b4138b0bde1ee4b5e3", "size": "1508", "binary"...
import optparse import os import signal import subprocess import sys import utils os_name = utils.GuessOS() POSIX_INFO = 'ps -p %s -o args' EXECUTABLE_NAMES = { 'win32': { 'chrome': 'chrome.exe', 'dart': 'dart.exe', 'dart_precompiled_runtime': 'dart_precompiled_runtime.exe', 'fir...
{ "content_hash": "1e0efdd1cef7ae2b27fb0ddffaa22422", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 85, "avg_line_length": 27.420454545454547, "alnum_prop": 0.5824008841000138, "repo_name": "dartino/dart-sdk", "id": "3c36acc5620ebb82825bc7ef9406066e31c3063a", "size": "75...
"""Contains DiscoElastigroup class that orchestrates AWS Spotinst Elastigroups""" import copy import logging import time import os from base64 import b64encode from itertools import groupby import boto3 from disco_aws_automation.resource_helper import throttled_call, tag2dict from .spotinst_client import SpotinstCli...
{ "content_hash": "84ce73e4b45c8af521ab7d63b9f76922", "timestamp": "", "source": "github", "line_count": 785, "max_line_length": 110, "avg_line_length": 42.21528662420382, "alnum_prop": 0.5738555780198558, "repo_name": "amplifylitco/asiaq", "id": "a861aab686dc1a7e936c8911b2e812e3f415905f", "size": "...
"""Demonstrate that a Model can inherite from more abstract models.""" from django.conf import settings import salesforce from salesforce import models from salesforce.models import SalesforceModel # All demo models simplified for readability, except tested features class User(SalesforceModel): username = models.Ch...
{ "content_hash": "1c8207015e96c045f9199f78b8811b55", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 88, "avg_line_length": 28.2375, "alnum_prop": 0.769809650287738, "repo_name": "philchristensen/django-salesforce", "id": "9f36d9ad0e79727f624bb64fe549fe28a6349822", "size":...
from manilaclient import base from manilaclient import utils class Extension(utils.HookableMixin): """Extension descriptor.""" SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__') def __init__(self, name, module): self.name = name self.module = module self._parse_exten...
{ "content_hash": "26a57d8e87532e8fe680dc27129af36a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 67, "avg_line_length": 31.791666666666668, "alnum_prop": 0.6094364351245085, "repo_name": "bswartz/python-manilaclient", "id": "82fa8f182d841080f58ffc8f0e94611b4005abe9", "...
"""Utilities to handle tensor tracer parameters.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import os.path import re from tensorflow.python.ops import linalg_ops from tensorflow.python.ops import math_ops from tensorflow.python.platform ...
{ "content_hash": "402e9e0ff072010f34c58aa2bddb6f57", "timestamp": "", "source": "github", "line_count": 478, "max_line_length": 103, "avg_line_length": 35.89748953974895, "alnum_prop": 0.6373914563785769, "repo_name": "frreiss/tensorflow-fred", "id": "b45f9fc6409464f41f8092fb1cf7da926f84093f", "siz...
from analyze_sessions.commands import AnalyzeSessionsCommand as Command
{ "content_hash": "5084fba2e6cfc6e90a0807aba8235361", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 71, "avg_line_length": 72, "alnum_prop": 0.8888888888888888, "repo_name": "isnotajoke/django-analyze-sessions", "id": "dadd9fe6b50633efec12fa15016914b8fa600510", "size": "20...
import json import os.path import time import subprocess import sys CONFIG_FILE_NAME = "/opt/pi/CheeseCave/config.json" STATE_FILE_NAME = "/var/lib/CheeseCave/sensor1-state.json" RELAY_EXECUTABLE = "/opt/pi/CheeseCave/relay" LOG_FILE_NAME = "/var/lib/CheeseCave/control-log.json" config_mod_time = 0 config_compres...
{ "content_hash": "a3321d886e66a97cf74ee5bd0fe66e85", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 109, "avg_line_length": 30.72, "alnum_prop": 0.6795014880952381, "repo_name": "cswales/CheeseCave", "id": "35d380fdeeab62e10bca351d2d0a7532c57f2ac9", "size": "5395", "bi...
'''@file dblstm.py contains de LAS class''' import tensorflow as tf from nabu.neuralnetworks.classifiers import classifier from nabu.neuralnetworks.classifiers.asr.encoders import encoder_factory from nabu.neuralnetworks.classifiers.asr.asr_decoders import asr_decoder_factory from nabu.neuralnetworks.classifiers.asr.r...
{ "content_hash": "cc3622529ed195d714a0889f33fe0a21", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 80, "avg_line_length": 42.68468468468468, "alnum_prop": 0.6135500211059519, "repo_name": "JeroenBosmans/nabu", "id": "efe8d686717b319e9c78c9d666e241b4041b05b9", "size": "4...
from time import sleep from UUGear import * import sys import pygame import datetime import os print 'starting init' pygame.init() UUGearDevice.setShowLogs(0) fname = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M') + "-log.txt" f_new = open(fname, 'a') f_new.close() try: device = UUGearDevice('UUGear-Arduino-...
{ "content_hash": "96c09ce5838a7fea30b0b9a535ca0e02", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 85, "avg_line_length": 29.1, "alnum_prop": 0.5572737686139748, "repo_name": "TimSmith714/Pi-Arduino-MusicJokeBox", "id": "c770a949f17f632a3cfde48fe6327fa78a2d02b6", "size":...
''' usage: 4up.py my.pdf firstpage lastpage Creates 4up.my.pdf ''' import sys import os import find_pdfrw from pdfrw import PdfReader, PdfWriter, PdfDict, PdfName, PdfArray from pdfrw.buildxobj import pagexobj def get4(allpages): # Pull a maximum of 4 pages off the list pages = [pagexobj(x) for x in allp...
{ "content_hash": "c050c2b60a61745fec7173848d099dc4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 25.510204081632654, "alnum_prop": 0.5968, "repo_name": "kulbirsaini/pdfrw-fork", "id": "0f1fd3b70c9888d77a8874478df7ecdf447108ae", "size": "1273", ...
""" Reinforcement Learning (DQN) tutorial ===================================== **Author**: `Adam Paszke <https://github.com/apaszke>`_ This tutorial shows how to use PyTorch to train a Deep Q Learning (DQN) agent on the CartPole-v0 task from the `OpenAI Gym <https://gym.openai.com/>`__. **Task** The agent has to d...
{ "content_hash": "0677272319e4cf528b93a55dffecedd6", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 95, "avg_line_length": 34.72629310344828, "alnum_prop": 0.6500961956184448, "repo_name": "jt120/start-ml", "id": "a1301c1becf55a917e07a1870c8e18fde1b10c27", "size": "16137...
""" constants.py: Scientific constants in SI units. Included constants: * **g0** : standard acceleration of gravity * **r_earth** : mean radius of Earth * **Omega** : angular velocity of Earth * **Rd** : specific gas constant for dry air * **Rv** : specific gas constant for water vapor * **Cpd** : specific heat capac...
{ "content_hash": "93dace580f893ea6843e88e98ad16f51", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 39.629629629629626, "alnum_prop": 0.688785046728972, "repo_name": "mcgibbon/atmos", "id": "2efd475a376d7e434484027b0ad324f415cde291", "size": "1094",...
from typing import Any, Dict, List, Optional, Type, Union from flask_appbuilder.models.filters import BaseFilter from flask_appbuilder.models.sqla import Model from flask_appbuilder.models.sqla.interface import SQLAInterface from sqlalchemy.exc import SQLAlchemyError, StatementError from sqlalchemy.orm import Session ...
{ "content_hash": "720de019c122e1dd5a18e3dff6072e03", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 85, "avg_line_length": 34.092485549132945, "alnum_prop": 0.5879959308240081, "repo_name": "zhouyao1994/incubator-superset", "id": "c6890e53a5ce483a9bd1fe5e128fa5e68ccbe775",...
import unittest import re import os.path import codecs from mock import MagicMock, call, patch from uiautomator import AutomatorDevice, Selector class TestDevice(unittest.TestCase): def setUp(self): self.device = AutomatorDevice() self.device.server = MagicMock() self.device.server.jsonrp...
{ "content_hash": "ce89d028c6c0d405b1c962e1f4c5e31c", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 136, "avg_line_length": 49.13986013986014, "alnum_prop": 0.670414116977373, "repo_name": "sumitahuja79/testing2", "id": "43f226bb1ffcb0c532ff1a4a462eb782faba0de6", "size":...
'''Adversarial autoencoder ''' from cortex.plugins import ModelPlugin, register_model from cortex.built_ins.models.gan import (SimpleDiscriminator, GradientPenalty, generator_loss) from cortex.built_ins.models.vae import ImageDecoder, ImageEncoder class AdversarialAutoencode...
{ "content_hash": "5b5201cffdaecb80dfb2acc2a6c66aa7", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 78, "avg_line_length": 31.27027027027027, "alnum_prop": 0.6113511956208585, "repo_name": "rdevon/cortex", "id": "45d9a08d4d8c9c9c4546cd7c53828c12b454867c", "size": "3471",...
from ironic.common import exception as excp from ironic.common import fsm from ironic.tests import base class FSMTest(base.TestCase): def setUp(self): super(FSMTest, self).setUp() m = fsm.FSM() m.add_state('working', stable=True) m.add_state('daydream') m.add_state('wakeup'...
{ "content_hash": "ed586ac51f538e38632301038f51618e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 79, "avg_line_length": 37.28, "alnum_prop": 0.6208869814020028, "repo_name": "hpproliant/ironic", "id": "2d523544a2954d46df68bb651d0035eaddadae0d", "size": "3453", "binar...
from django.db import models from django.db.models import Q from django.core.exceptions import ValidationError class KeyValue(models.Model): """How this KeyValue class works: The KeyValue objects have functions that correspond to different keys. When a key is saved an attempt is made to find a val...
{ "content_hash": "43c592c7bd2cb4debeae3f4754be57f9", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 35.80487804878049, "alnum_prop": 0.6018392370572208, "repo_name": "rtucker-mozilla/mozilla_inventory", "id": "15439fdffb9c94533657fedbbc0cdb1fae2ac1e2"...
import logging import os import time from ray.util.debug import log_once from ray.rllib.utils.framework import try_import_tf tf1, tf, tfv = try_import_tf() logger = logging.getLogger(__name__) class TFRunBuilder: """Used to incrementally build up a TensorFlow run. This is particularly useful for batching o...
{ "content_hash": "98e67e493b4c9df272f45ce111cad22c", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 34.3, "alnum_prop": 0.5866537091026887, "repo_name": "robertnishihara/ray", "id": "82b904bd1316487868f1fa6ad6a936274393afdc", "size": "3087", "bina...
from __future__ import absolute_import from pyface.qt import QtGui from traits.api import Any, Int, Float, Str, Bool, Either, Callable # ============= standard library imports ======================== # ============= local library imports ========================== from traitsui.basic_editor_factory import BasicEdito...
{ "content_hash": "495f0a3fb9962bacc2947c9bef411426", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 72, "avg_line_length": 29.666666666666668, "alnum_prop": 0.5766292134831461, "repo_name": "NMGRL/pychron", "id": "b4b6f02762d71baa702d2a744a3230183424be37", "size": "3027",...
import pyfwk from pyfi.entity.habtm.entityindustry import EntityIndustry from pyfi.entity.habtm.entityindices import EntityIndices from pyfi.entity.industry.object import Industry from pyfi.entity.sector.object import Sector from pyfi.entity.indices.object import Indices from pyfi.entity.indices.membership import Indic...
{ "content_hash": "411f155c0def4674fd4157cacc32e6c7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 34.18604651162791, "alnum_prop": 0.5863945578231292, "repo_name": "rlinguri/pyfi", "id": "3f139e1a74e2b3389a6b14d812dd6c039e6571a3", "size": "1493", ...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.moves.urllib.request import urlopen from future.moves.urllib.parse import urlparse import time import logging from datetime import timedelta, datetime import r...
{ "content_hash": "1be15164aa767c057f40343e5e573d71", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 119, "avg_line_length": 35.92982456140351, "alnum_prop": 0.6552734375, "repo_name": "qk4l/Flexget", "id": "d10b89885e4d495af612e53e6b7162774cdfc8c3", "size": "10240", "b...
from django.utils.functional import cached_property from share import ProviderAppConfig from .harvester import FigshareHarvester class AppConfig(ProviderAppConfig): name = 'providers.com.figshare.v2' version = '0.0.1' title = 'figshare' long_title = 'figshare' harvester = FigshareHarvester h...
{ "content_hash": "12fa450829cb5e86594b92b04b315112", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 68, "avg_line_length": 26.789473684210527, "alnum_prop": 0.7170923379174853, "repo_name": "zamattiac/SHARE", "id": "91605b22d8d44ebcf3fd24f93b94db27d70e02c0", "size": "509"...
"""Contains the definition of the Inception Resnet V2 architecture. As described in http://arxiv.org/abs/1602.07261. Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, Alex Alemi """ from __future__ import absolute_import from ...
{ "content_hash": "d1e14eda38e00f0b60f670d78a614cb5", "timestamp": "", "source": "github", "line_count": 383, "max_line_length": 80, "avg_line_length": 45.49869451697128, "alnum_prop": 0.5836680821760588, "repo_name": "ildoonet/tf-openpose", "id": "0205340e71baf62cad4f2e281a9bfa1b328e3e1c", "size": ...
## # Import Modules # import Common.EdkLogger as EdkLogger ## TableFile # # This class defined a common table # # @param object: Inherited from object class # # @param Cursor: Cursor of the database # @param TableName: Name of the table # class Table(object): def __init__(self, Cursor): ...
{ "content_hash": "b68e96e177d5517293965ae9c6e3d753", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 93, "avg_line_length": 25.01851851851852, "alnum_prop": 0.5455218356772761, "repo_name": "MattDevo/edk2", "id": "e89b99320d1f697ef23d32ce46fb8b7cd5d12fe5", "size": "3282",...
"""Provides utility functions in anyconfig.backend.base.""" import functools import pathlib import typing def not_implemented(*_args, **_kwargs) -> None: """Raise NotImplementedError.""" raise NotImplementedError() def ensure_outdir_exists(filepath: typing.Union[str, pathlib.Path]) -> None: """Make dir ...
{ "content_hash": "36820cf23544f479937f79f36c48ce28", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 26.514285714285716, "alnum_prop": 0.6540948275862069, "repo_name": "ssato/python-anyconfig", "id": "536916d5b92feb9430be92ba8ef5d0d051635935", "size"...
import sys import re # Print the transition from the old x,y to the new x,y # @param oldX {int} original x dimension # @param oldY {int} oritinal y dimension # @param newX {int} scaled x dimension # @param newY {int} scaled y dimension def print_new_size(oldX, oldY, newX, newY): print (" > {}x{} -> {}x{}".format(oldX...
{ "content_hash": "9ef8244a9868f4490b9678ae5476dcd1", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 31.875, "alnum_prop": 0.673202614379085, "repo_name": "ChrisoftheBoyerClan/scale.py", "id": "893edffbbfd32170b8bfe54e01e4605df2e8761f", "size": "2295...
import sys, pprint, os sys.path.insert(1, '..') sys.path.insert(1, '.') sys.path.insert(1, os.path.join("..", "py")) import h2o import h2o_test_utils from h2o_test_utils import ModelSpec import os import argparse import time import json import requests sys.path.insert(1, '../rest_tests') ################# # Config ...
{ "content_hash": "d72f0199c76e93120468498d86a8427a", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 163, "avg_line_length": 26.762376237623762, "alnum_prop": 0.6618571957084721, "repo_name": "jangorecki/h2o-3", "id": "9fb91dbcf7b1e2400eeb56c45bb61c92b405ad89", "size": "2...
# Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foundation, either version 2.0 of the License, o...
{ "content_hash": "5cc8e3d0e1da74f86c0fffa7ab30252d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 32.5, "alnum_prop": 0.6939271255060728, "repo_name": "hivesolutions/netius", "id": "fae40397cbedb280295c2d39ba5668328e1542d9", "size": "1279", "bin...
import requests from requests import HTTPError from project.exception_handling import ApiError def make_mobile_payment(amount, phone, names): try: amnt = int(amount) task = { "names": names, "phone": phone, "amount": amnt } resp = requests.post(...
{ "content_hash": "281b459488366b368ef71dcb6bd73a6f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 114, "avg_line_length": 31.416666666666668, "alnum_prop": 0.5755968169761273, "repo_name": "fiston/abaganga", "id": "27985e29f3a42fffa12923a221f8447242a3838c", "size": "754...
class ModuleDocFragment(object): # HPE 3PAR doc fragment DOCUMENTATION = ''' options: storage_system_ip: description: - The storage system IP address. type: str required: true storage_system_password: description: - The storage system password. type: str ...
{ "content_hash": "6560720bdfc5e6b633086de14c92c4dc", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 65, "avg_line_length": 24.185185185185187, "alnum_prop": 0.6385911179173047, "repo_name": "SergeyCherepanov/ansible", "id": "2f0c69eea24e26eee8c0c0de23082b5593f36ca8", "siz...
import copy from gen.resource_xsd import * from gen.resource_common import * from gen.resource_server import * from pprint import pformat class QuotaHelper(object): default_quota = { 'defaults': -1 } @classmethod def get_project_dict(cls, proj_uuid, db_conn): (ok, proj_dict) = db_...
{ "content_hash": "be54f3456b0cfbc5746da011032f79c9", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 97, "avg_line_length": 36.58620689655172, "alnum_prop": 0.5730442978322338, "repo_name": "srajag/contrail-controller", "id": "884ab420c555e5ac5637a15c5432f1fa626d01fb", "si...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Anscombe'] , ['PolyTrend'] , ['NoCycle'] , ['ARX'] );
{ "content_hash": "8591ddf1ccaafb8c43ce59e621ba7ab6", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 76, "avg_line_length": 37.25, "alnum_prop": 0.697986577181208, "repo_name": "antoinecarme/pyaf", "id": "251071b3f018f45d59bf4d90bee799ad78add3b3", "size": "149", "binary":...
import os import sys import argparse import json import requests def debug(msg): if args.debug: print "DEBUG: %s" % (msg) def process_repo_file(filename, stack={"repos":[]}, depth=0): print "[updateRepos]%s Processing %s" % ((' ' * depth), filename) try: repo_file = open(filename) except IOError as error: ...
{ "content_hash": "5a23c672c3cb6f182f41b97aa6a0b6fa", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 129, "avg_line_length": 29.2, "alnum_prop": 0.6952054794520548, "repo_name": "s-archer/f5-super-netops-openshift", "id": "16f035847bb47d8e0a04411aa70d9f27111e5d46", "size":...
"""Test that pymongo resets its own locks after a fork.""" import os import sys import unittest from multiprocessing import Pipe sys.path[0:0] = [""] from test import IntegrationTest from test.utils import is_greenthread_patched from bson.objectid import ObjectId @unittest.skipIf( not hasattr(os, "register_at...
{ "content_hash": "bade110d9ab230157e9ddd65bff25c3c", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 99, "avg_line_length": 32.01282051282051, "alnum_prop": 0.6059271125350421, "repo_name": "mongodb/mongo-python-driver", "id": "422cd89f28351ce731749dcda24c84aa29188cb6", "s...
import os def load_tests(loader, standard_tests, pattern): this_dir = os.path.dirname(__file__) if pattern is None: pattern = "test*" package_tests = loader.discover(start_dir=this_dir, pattern=pattern) standard_tests.addTests(package_tests) return standard_tests
{ "content_hash": "00844901b24cce3ab1461776bbe20cfe", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 72, "avg_line_length": 32.55555555555556, "alnum_prop": 0.6928327645051194, "repo_name": "bitdancer/pynvm", "id": "976bb18892a8176e12a35f5052cf6f578ad36ecb", "size": "293", ...
import os import sys from distribute_setup import use_setuptools use_setuptools() from setuptools import setup, Extension if not hasattr(sys, "hexversion") or sys.hexversion < 0x02040000: raise Error("Python 2.4 or newer is required") if os.name == "posix": from setup_posix import get_config else: # assume w...
{ "content_hash": "d4f05650ee7490d5f031497b95e63dc7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 30, "alnum_prop": 0.7298245614035088, "repo_name": "1c7/Python-ask-answer-website-practice", "id": "798f96f266bd8eb262ac8966b7b85378e95be240", "size"...
"""Generated message classes for servicemanagement version v1. The service management API for Google Cloud Platform """ # NOTE: This file is autogenerated and should not be edited by hand. from googlecloudsdk.third_party.apitools.base.protorpclite import messages as _messages from googlecloudsdk.third_party.apitools....
{ "content_hash": "6d55c6f593fe5a1db94ac9c533156920", "timestamp": "", "source": "github", "line_count": 3108, "max_line_length": 95, "avg_line_length": 44.21621621621622, "alnum_prop": 0.7231196879729888, "repo_name": "flgiordano/netcash", "id": "733514010ae1ef9e0a56851ece6e4ea7d2656035", "size": "...
import unittest from declarativeunittest import raises from construct.lib.hex import * class TestHex(unittest.TestCase): def test_dump(self): assert hexundump(hexdump(b"",32),32) == b"" assert hexundump(hexdump(b"??????????",32),32) == b"??????????" for i in range(100): asser...
{ "content_hash": "23f66b998bf198ea6944d1f6206b3dcf", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 28.933333333333334, "alnum_prop": 0.5921658986175116, "repo_name": "riggs/construct", "id": "d1180222e7958e2c49f45d1c53c10516fb5956f1", "size": "434"...
"""Policies used by various agents.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf from tf_agents.specs import tensor_spec class DeterministicSoftPolicy(tf.Module): """Returns mode of policy distribution.""" def ...
{ "content_hash": "16df0db2385d2c7effe04e127f5f8692", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 80, "avg_line_length": 33.19318181818182, "alnum_prop": 0.655255049640534, "repo_name": "google-research/google-research", "id": "c6d9cf27238439268c537c6aa8e13c75d0ca9022", ...
import json import numpy import os import pathlib import pickle import tempfile def write_delimited(path, data, delimiter='\t'): """Write a list of lists (or iterable of iterables) to a delimited file.""" path = pathlib.Path(path) try: with path.open('w') as f: f.write('\n'.join(delimit...
{ "content_hash": "e77e59c4aba3ebbf08b6679c16554d15", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 94, "avg_line_length": 36.46192893401015, "alnum_prop": 0.6071279409717388, "repo_name": "zplab/zplib", "id": "1a18dc533773dcb60355b87453878744ebef15ea", "size": "7183", ...
from unittest import mock from neutronclient.osc.v2.dynamic_routing import bgp_dragent from neutronclient.tests.unit.osc.v2.dynamic_routing import fakes class TestAddBgpSpeakerToDRAgent(fakes.TestNeutronDynamicRoutingOSCV2): _bgp_speaker = fakes.FakeBgpSpeaker.create_one_bgp_speaker() _bgp_dragent = fakes.Fa...
{ "content_hash": "d8c0c86acf6dee226e7b95748475e476", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 79, "avg_line_length": 39.153153153153156, "alnum_prop": 0.596870685687989, "repo_name": "openstack/python-neutronclient", "id": "7a94b323af1da40a43fb3a5168953b567d90fc6f", ...
from __future__ import print_function # # Based on: xcsoar from sys import platform from setuptools import setup from setuptools.command.install import install from distutils.command.build import build from subprocess import call from multiprocessing import cpu_count import glob import codecs import os import pycudd ...
{ "content_hash": "3225165aed6aaa84a6ab057f6582163c", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 85, "avg_line_length": 30.366863905325445, "alnum_prop": 0.6110678098207326, "repo_name": "pycudd/pycudd", "id": "361d5ec385acf7c35ed44a5617af7076552fe90a", "size": "5154"...
import sys, os, fileinput, errno, datetime, commands, re, string, envvars, time import shutil from optparse import OptionParser import subprocess from subprocess import Popen, PIPE def arg_handle(): usage = "usage: run_gen.py (options)" parser = OptionParser(usage) parser.add_option("-a", "--app", dest="ap...
{ "content_hash": "c989e7f96e32370dfccb97d706bf9880", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 125, "avg_line_length": 43.793103448275865, "alnum_prop": 0.46194225721784776, "repo_name": "rbheemana/Sqoop-Automated", "id": "a8c3878be8209a851d7528c5ccd392999eeb93f9", ...
from django.conf.urls import include, url from django.contrib import admin from django.views.generic import TemplateView from transtech_directory.views import DirectoryListView # from transtech_directory.views import HomeView urlpatterns = [ # Examples: # url(r'^blog/', include('blog.urls')), url(r'^$...
{ "content_hash": "307e60ef8c1e6eaaf6969499f6f0e202", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 98, "avg_line_length": 29.333333333333332, "alnum_prop": 0.7234848484848485, "repo_name": "Leila20/transtech-directory", "id": "bd52d6db8ac4e5d4a7ac68b8d1ab62a95d646d04", "...
""" Helper script to build libmad Version: libmad-0.15.1b Usage: - Download the libmad sourcecode. - Unzip the sourcecode - Set the environment variable LIBMAD_FOLDER to the unzipped dir - Run this script """ import sys import os import logging import time try: from powertb import print_exc except ImportError...
{ "content_hash": "ce7ea22258e26d9f82ddcbb5ded7d831", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 73, "avg_line_length": 26.663636363636364, "alnum_prop": 0.5622229798840778, "repo_name": "windelbouwman/ppci-mirror", "id": "141c9678ef9c9a12f686b907a81b7eca5e4e53fc", "s...
from django.dispatch import Signal class_prepared = Signal(providing_args=["class"]) pre_init = Signal(providing_args=["instance", "args", "kwargs"], use_caching=True) post_init = Signal(providing_args=["instance"], use_caching=True) pre_save = Signal(providing_args=["instance", "raw", "using", "update_fields"], ...
{ "content_hash": "eea0c1a08e9e3a69b79e84d73d3bdd81", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 116, "avg_line_length": 49.5, "alnum_prop": 0.693939393939394, "repo_name": "ZhaoCJ/django", "id": "6b7605839ccbbde5348a1768ef9772ef6700a669", "size": "990", "binary": fa...
from CommonClasses import * # hxl: comment out this line for submission debug = True debug = False class Solution: # @param head, a ListNode # @param m, an integer # @param n, an integer # @return a ListNode def reverseBetween(self, head, m, n): if hea...
{ "content_hash": "1380f21745ce6281ba3d00052a6ccc92", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 89, "avg_line_length": 25.93877551020408, "alnum_prop": 0.47915027537372146, "repo_name": "54lihaoxin/leetcode_python", "id": "6cdbc0edcff7d38db573943b50172744eff87572", "s...
import sys import cv2 from ikalog.scenes.stateful_scene import StatefulScene from ikalog.utils import * class GameStart(StatefulScene): # 720p サイズでの値 mapname_width = 430 mapname_left = 1280 - mapname_width mapname_top = 580 mapname_height = 640 - mapname_top rulename_left = 640 - 120 r...
{ "content_hash": "03470e72b06e7bdd9ebb3d434fe7a7f0", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 97, "avg_line_length": 33.095, "alnum_prop": 0.535126151986705, "repo_name": "hrhtspr/IkaLog", "id": "b751077804785bea1af7f10aba03e13a90c96570", "size": "7734", "binary"...
from django.template.response import TemplateResponse def home(request): return TemplateResponse(request, 'home.html')
{ "content_hash": "b5065ab0a0f65508fe62369173cf24be", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 53, "avg_line_length": 30.75, "alnum_prop": 0.8048780487804879, "repo_name": "iamsteadman/bambu-ajax", "id": "f113a45a0551a567d6b94d6b38e7723199f441a5", "size": "123", "bi...
from cloudmesh_database.dbconn import get_mongo_db, get_mongo_dbname_from_collection, DBConnFactory from cloudmesh_base.util import HEADING from cloudmesh_management.base_user import User from cloudmesh_management.base_project import Project from cloudmesh_management.project import Projects from cloudmesh_management.m...
{ "content_hash": "3741ec1353c06a1c17a9ee2f03ec97c9", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 99, "avg_line_length": 27.5, "alnum_prop": 0.6355731225296443, "repo_name": "cloudmesh/management", "id": "70e129820e9e7d045b1eb73f7454186f1bdcd64e", "size": "1265", "bin...
from __future__ import unicode_literals import frappe from frappe import _ from six.moves import xrange def get_monthly_results(goal_doctype, goal_field, date_col, filter_str, aggregation = 'sum'): '''Get monthly aggregation values for given field of doctype''' # TODO: move to ORM? if(frappe.conf.db_type == 'postgr...
{ "content_hash": "82a90472dcc52c28433383a9d07d3e76", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 112, "avg_line_length": 30.086666666666666, "alnum_prop": 0.6740527365388876, "repo_name": "RicardoJohann/frappe", "id": "90940ba3047dd1f00067a6704f702b82290a5536", "size"...
from tests.conftest import JiraTestCase class CustomFieldOptionTests(JiraTestCase): def test_custom_field_option(self): option = self.jira.custom_field_option("10000") self.assertEqual(option.value, "To Do")
{ "content_hash": "3eaed6b7b6fe55f503d1e013133e613c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 55, "avg_line_length": 32.857142857142854, "alnum_prop": 0.7304347826086957, "repo_name": "pycontribs/jira", "id": "273da848a6ca68ffde3c79df843fadec8e379bc6", "size": "230",...
from .compat import StringIO from . import core import re from pygments import highlight from pygments.formatters import TerminalFormatter from pygments.lexers import get_lexer_by_name from pygments.token import Comment from pygments.formatters.terminal import TERMINAL_COLORS import sys scheme = TERMINAL_COLORS.cop...
{ "content_hash": "efcbe521b0806258fac5b33a0db5cf28", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 78, "avg_line_length": 28.782608695652176, "alnum_prop": 0.5866062437059416, "repo_name": "archsh/sliderepl", "id": "f8bfed01fae453a9dd4b903c6bbbe9699d5132f3", "size": "198...
from django.db.models.manager import Manager from django_roa.db.query import RemoteQuerySet class ROAManager(Manager): """ Manager which access remote resources. """ use_for_related_fields = True is_roa_manager = True # ugly but useful because isinstance is evil def get_query_set(self): ...
{ "content_hash": "2f827892ae341260cbf2a611c1da9449", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 70, "avg_line_length": 25.88235294117647, "alnum_prop": 0.675, "repo_name": "emidln/django_roa", "id": "c3495daa0bc4d6b1f88a2f4d26c9a75ab2a3fadb", "size": "440", "binary"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/food/foraged/shared_edible_jar_bugs.iff" result.attribute_template_id = 5 result.stfName("food_name","edible_bugs") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "8c3efe02aeceedaddd7f4e8f33fdb93c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 23.615384615384617, "alnum_prop": 0.6970684039087948, "repo_name": "obi-two/Rebelion", "id": "44ae02d3074dc288dd4e7a3475caf49bb21213b0", "size": "452...
"""Restart the DNS server service if it has yielded specific errors to the event log. The script is intended to run as a service shortly after services startup and stops after doing its job. """ errors=404,407,408 service="dns" # set up logging ##################################### import sys,logging,logging.handlers...
{ "content_hash": "682253ecea25e8293893d4175fa95d64", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 139, "avg_line_length": 39.33613445378151, "alnum_prop": 0.6693014313180944, "repo_name": "native-api/windns_fix", "id": "f2568c276fa6ce8f934abed38568631fca5771ca", "size"...
""" Iterator ======== The :mod:`streaming.iterator` module is a private module. Most algorithms for streams are implemented here using basic iterators. """ import cytoolz import itertools import operator import numpy as np import operator import collections from ._cython import _interpolate_linear as interpolate_linea...
{ "content_hash": "3b39d2f53da30a7d5b400677eccc4bf6", "timestamp": "", "source": "github", "line_count": 513, "max_line_length": 171, "avg_line_length": 34.372319688109165, "alnum_prop": 0.6745307094652073, "repo_name": "FRidh/streaming", "id": "bed141559464f98a73563a087fef720703073611", "size": "17...
"""TensorFlow Ops to work with embeddings. Note: categorical variables are handled via embeddings in many cases. For example, in case of words. """ # Copyright 2015-present The Scikit Flow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file e...
{ "content_hash": "7e1ca2cb48dd8d47d6fe4a6fa579cb12", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 80, "avg_line_length": 39.609756097560975, "alnum_prop": 0.7158251231527094, "repo_name": "plowman/python-mcparseface", "id": "4cc709de76c43d665467fa106b86fc1a8feec220", "s...
from peewee import PostgresqlDatabase, Model, TextField, DateTimeField, ForeignKeyField, BooleanField, IntegerField from datetime import datetime from config import Config import os import urllib.parse db_parsed_url = urllib.parse.urlparse(Config.DATABASE_URL) username = db_parsed_url.username password = db_parsed_url...
{ "content_hash": "8045c0713e574925246c169167ef39b5", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 115, "avg_line_length": 25.933333333333334, "alnum_prop": 0.6632390745501285, "repo_name": "adamlamers/dokku-flask-blog", "id": "3ff682e6b62d89d303d944efe11a5b150d60f052", ...
import os import shutil import platform import pytest import wandb from wandb.sdk.data_types import saved_model as SM from wandb.apis.public import Artifact from wandb.apis.public import _DownloadedArtifactEntry from wandb.sdk.wandb_artifacts import ArtifactEntry from . import saved_model_constructors sklearn_model...
{ "content_hash": "bab12d2ef10c355a0b6e5c970317d5ae", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 82, "avg_line_length": 27.234939759036145, "alnum_prop": 0.6270736562707365, "repo_name": "wandb/client", "id": "6289820517a64fc57313f05ca051cef449b19de1", "size": "4521",...
"""Starter script for Nova Compute.""" import shlex import sys import os_vif from oslo_log import log as logging from oslo_privsep import priv_context from oslo_reports import guru_meditation_report as gmr from nova.cmd import common as cmd_common from nova.compute import rpcapi as compute_rpcapi from nova.conductor...
{ "content_hash": "aa6ce205147beaeef448f73f16b98313", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 29.930232558139537, "alnum_prop": 0.7404817404817405, "repo_name": "jianghuaw/nova", "id": "eb48853d45fb79600c315d0bcfb3482bc1d61cae", "size": "2019"...
from testtools import TestCase from kmip.core.errors import ErrorStrings from kmip.core import utils class TestUtils(TestCase): def setUp(self): super(TestUtils, self).setUp() def tearDown(self): super(TestUtils, self).tearDown() def test_count_bytes(self): num = 65535 ...
{ "content_hash": "3ecd73f0a2223dd59569737d4016a28f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 79, "avg_line_length": 33.1764705882353, "alnum_prop": 0.5245694022289767, "repo_name": "dmend/PyKMIP", "id": "324f318e29ad861261792f203f1ee5a2235414bc", "size": "4594", ...
import re, pickle, editdistance from teafacto.util import tokenize, ticktock, isstring, argprun from nltk.corpus import stopwords from nltk.stem import porter from teafacto.procutil import wordids2string from IPython import embed class Processor(object): def __init__(self): self.stemmer = porter.PorterStem...
{ "content_hash": "715de3f53aee8628bb9c42e86064c109", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 131, "avg_line_length": 36.59861591695502, "alnum_prop": 0.512338092086603, "repo_name": "lukovnikov/teafacto", "id": "f00ed29ef360170c3b2d30d247dc35750a616dc8", "size": "...
"""A Collection of useful miscellaneous functions. misc.py: Collection of useful miscellaneous functions. :Author: Hannes Breytenbach (hannes@saao.ac.za) """ import collections.abc import itertools import operator def first_true_index(iterable, pred=None, default=None): """find the first index position for ...
{ "content_hash": "93bab06022ff675db9bbe3a688b85e9f", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 100, "avg_line_length": 32.76984126984127, "alnum_prop": 0.5996609348510535, "repo_name": "bsipocz/astropy", "id": "3730c34be35caf84868125d81fb9c8fe1d3b113f", "size": "412...
from setuptools import setup setup( name='dart', )
{ "content_hash": "b89aff97d03de81462414d5507ae3022", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 28, "avg_line_length": 11.2, "alnum_prop": 0.6785714285714286, "repo_name": "RetailMeNotSandbox/dart", "id": "899d141de41a2673917c56c3a1028155b198fc98", "size": "81", "bin...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "af83d0d4f3b4ec065f8cb003051a17d4", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 161, "avg_line_length": 30.66331658291457, "alnum_prop": 0.6522451655195018, "repo_name": "alexryndin/ambari", "id": "467a5ab941b44ddf4a256e10a5982dd73b1cecf1", "size": "6...
import sys, json, httplib, base64 #/(um.1) Assign arguments if len(sys.argv) < 5: print "USAGE: user_manager.py server_name:port auth_user auth_pass", print "ACTION [PARAMS...]" sys.exit(1) server, port = sys.argv[1].split(":") username = sys.argv[2] password = sys.argv[3] action = sys.argv[4] if len(sys...
{ "content_hash": "ccfb76c1371608c9b2ac483490c58812", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 72, "avg_line_length": 29.22077922077922, "alnum_prop": 0.5924444444444444, "repo_name": "rabbitinaction/sourcecode", "id": "9c5b13b9cd3b0ee05be0305ad0f56b4ec42d2a08", "siz...
import logging from math import sin, cos, atan2, sqrt, radians import re import requests from spacebot.util.utils import field log = logging.getLogger(__name__) # Default Google Maps zoom level; values 1 - 21+ # See: https://developers.google.com/maps/documentation/staticmaps/#Zoomlevels DEFAULT_ZOOM = 1 # Gets the...
{ "content_hash": "0644c1562bab17b7eab877d0889367a7", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 120, "avg_line_length": 40.54054054054054, "alnum_prop": 0.647, "repo_name": "ccampo133/slack-spacebot", "id": "3127aca7c06eb791b4e8b8edf2b957895209e97d", "size": "3000", ...
import atexit import getpass import logging import os import shutil import socket import subprocess import threading import time from nose.tools import assert_equal, assert_true from desktop.lib.paths import get_run_root from hadoop import pseudo_hdfs4 from hadoop.mini_cluster import write_config from liboozie.oozie...
{ "content_hash": "4a4c37c638e7f1df029f6916408358a9", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 159, "avg_line_length": 33.914027149321264, "alnum_prop": 0.6442961974649767, "repo_name": "yongshengwang/builthue", "id": "098ab2666dcb419404cc80c3aa3564f8fae59045", "siz...
import wx from robotide import robotapi, context from robotide.controller.settingcontrollers import ( DocumentationController, VariableController, TagsController) from robotide.usages.UsageRunner import ResourceFileUsages from robotide.publish import ( RideItemSettingsChanged, RideInitFileRemoved, RideFileName...
{ "content_hash": "e618cf21c008f5da4c0812ce2ee50f52", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 78, "avg_line_length": 34.36931818181818, "alnum_prop": 0.6196892048272442, "repo_name": "fingeronthebutton/RIDE", "id": "24cc89030628c97662f48964e5fc17d3b8a948db", "size"...
import os from local_setting_production import * from settings import DEBUG TEMPLATE_DEBUG = True MANAGERS = ADMINS BASE_DIR = os.path.dirname(os.path.abspath(__file__)) import json # print os.environ['VCAP_SERVICES'] vcap_services = json.loads(os.environ['VCAP_SERVICES']) # mysql_srv = vcap_services['mysql-5.1'][0...
{ "content_hash": "0f134399961e527a828a3aefe44cf3f2", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 105, "avg_line_length": 32.76279069767442, "alnum_prop": 0.6719193639977286, "repo_name": "esseti/dododo-dadada", "id": "90980ff805d9362188aa6e0ff22eebc1a30635a5", "size":...
import json import mock from oslo_config import cfg import six import webob.exc import heat.api.middleware.fault as fault import heat.api.openstack.v1.stacks as stacks from heat.common import exception as heat_exc from heat.common import identifier from heat.common import policy from heat.common import template_forma...
{ "content_hash": "5947546885ea5cb3cde8435f25a13c12", "timestamp": "", "source": "github", "line_count": 2393, "max_line_length": 79, "avg_line_length": 42.14751358127873, "alnum_prop": 0.516295025728988, "repo_name": "pratikmallya/heat", "id": "c17eb940400a326b93d803417917ff069361e99b", "size": "10...
""" csv2ofx.mappings.mintapi ~~~~~~~~~~~~~~~~~~~~~~~~ Provides a mapping for transactions obtained via mint.com """ from operator import itemgetter mapping = { "is_split": False, "has_header": True, "split_account": itemgetter("Category"), "account": itemgetter("Account Name"), "date": itemgetter(...
{ "content_hash": "8e7913f85cfe577ba8f610c5e935879b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 57, "avg_line_length": 26.65, "alnum_prop": 0.6322701688555347, "repo_name": "reubano/csv2ofx", "id": "27c465763b0344a7556df83c23b315913a0e84f7", "size": "615", "binary":...
from rq import Worker from rq import Queue from rq import Connection from spitter import logger from spitter.connection import redis_conn with Connection(redis_conn): queue = Queue("spitter_messages") logger.info("starting worker...") Worker(queue).work()
{ "content_hash": "5eae30b6bfd218cf46bd0a289190ae68", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 41, "avg_line_length": 19.5, "alnum_prop": 0.7435897435897436, "repo_name": "tmpapageorgiou/spitter", "id": "32759c04ec946447ce240765cdd9ef4a31c5c095", "size": "273", "bi...
"""Support for RESTful API sensors.""" import logging import json import voluptuous as vol import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth from homeassistant.components.sensor import PLATFORM_SCHEMA, DEVICE_CLASSES_SCHEMA from homeassistant.const import ( CONF_AUTHENTICATION, CONF_FORC...
{ "content_hash": "c63c1d6ddfe8c48b1d67c6905927353b", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 88, "avg_line_length": 32.08712121212121, "alnum_prop": 0.5963876755991028, "repo_name": "joopert/home-assistant", "id": "6fdf5ce7221c648544eba605f9825e9a26ba5abb", "size"...
""" SeeKeR 3B Dialogue Model. """ from parlai.zoo.seeker.seeker_download import download_with_model_type def download(datapath): download_with_model_type(datapath, 'seeker_dialogue_3B', 'v1.0')
{ "content_hash": "0ea27ad34258a04d30ebddf11abff16b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 70, "avg_line_length": 25, "alnum_prop": 0.74, "repo_name": "facebookresearch/ParlAI", "id": "9cd1087dcf11711b1ed35751d8f13e62cc6169bd", "size": "399", "binary": false, ...
"""Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable name...
{ "content_hash": "c937584a8e8a79396d0dff998cadbfd3", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 88, "avg_line_length": 32.96343692870201, "alnum_prop": 0.5695191614441795, "repo_name": "pydata/pydata-google-auth", "id": "493d121122cc89f09483f873afb94ec108ad0974", "si...
"""Helpers that help with state related things.""" import asyncio import json import logging from collections import defaultdict from homeassistant.loader import bind_hass import homeassistant.util.dt as dt_util from homeassistant.components.media_player import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, ATT...
{ "content_hash": "c580fe76e4e1e6ea068bb0a595cacc15", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 37.588235294117645, "alnum_prop": 0.6643794390273263, "repo_name": "ewandor/home-assistant", "id": "254a48c3d0a8e83f18c5fb4b08920c7b8b71d323", "size...
"""Support for Fibaro switches.""" import logging from homeassistant.components.switch import ENTITY_ID_FORMAT, SwitchDevice from homeassistant.util import convert from . import FIBARO_DEVICES, FibaroDevice DEPENDENCIES = ['fibaro'] _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entitie...
{ "content_hash": "ddbb27dd60d5205c36540effc523da8c", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 28.714285714285715, "alnum_prop": 0.6268656716417911, "repo_name": "jamespcole/home-assistant", "id": "024531f62c70e8eb95e8f4472b7b37968ac2e827", "si...
from raysect.core.scenegraph import Primitive, Node, Observer from .world import World
{ "content_hash": "e256c4c1f2711024f74f11196a66b737", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 61, "avg_line_length": 43, "alnum_prop": 0.8372093023255814, "repo_name": "raysect/source", "id": "c5918a6ac85796dcd4d9fdcc4abe80911842785b", "size": "1720", "binary": fal...
import _plotly_utils.basevalidators class YValidator(_plotly_utils.basevalidators.InfoArrayValidator): def __init__(self, plotly_name="y", parent_name="layout.grid.domain", **kwargs): super(YValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ed...
{ "content_hash": "2188e7797fefdbb00047cfbbd11528f5", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 84, "avg_line_length": 37, "alnum_prop": 0.4894894894894895, "repo_name": "plotly/plotly.py", "id": "c03f5a032cb1ab8278db524e9cf2343deb085b09", "size": "666", "binary": f...
import copy import functools import sys # PyPI imports import contracts import pytest # Putil imports import putil.exh import putil.pcontracts from putil.test import AE, AI, GET_EXMSG ### # Helper functions ### def decfunc(func): """" Decorator function to test _create_argument_value_pairs function """ @funct...
{ "content_hash": "1a63f83aa184aef11a3952c3d5b3f6ee", "timestamp": "", "source": "github", "line_count": 669, "max_line_length": 79, "avg_line_length": 32.41554559043348, "alnum_prop": 0.5564419441114082, "repo_name": "pmacosta/putil", "id": "c9b14db15945b4cd0bc4c5c47b4afef130a7bf92", "size": "21875...
import collections import hashlib import signal import sys import time import uuid import functools import netaddr from oslo_config import cfg from oslo_log import log as logging import oslo_messaging from oslo_service import loopingcall import six from six import moves from neutron.agent.common import ovs_lib from n...
{ "content_hash": "711c0026538bbb7d809c1e60bcd65409", "timestamp": "", "source": "github", "line_count": 1906, "max_line_length": 79, "avg_line_length": 46.04616998950682, "alnum_prop": 0.5430472631147167, "repo_name": "jumpojoy/neutron", "id": "230fbb20dfa3543fd11ed275c0684c6c188f3409", "size": "88...
from PIL import Image, ImageTk import math import terralib.pixelgrid as pixelgrid class ColorSet: def __init__(self, maxcolors): self.maxcolors = maxcolors self.colors = [] @property def palette(self): if len(self.colors) == self.maxcolors: return list(self.colors) ...
{ "content_hash": "a3e088570a92fa2c1930fb2e8b05a9f9", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 29.766990291262136, "alnum_prop": 0.5107632093933464, "repo_name": "nicolebranagan/terraformer", "id": "0cd4e62fbc4239f569fcd8de1fc9bb4c31cdd992", "...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from flexget.utils.imdb import ImdbParser @pytest.mark.online class TestImdbParser(object): def test_parsed_data(self): parser = ImdbParser() ...
{ "content_hash": "c546f8fa8a8cf671c3e0bb1f6e2526ab", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 120, "avg_line_length": 53.92307692307692, "alnum_prop": 0.6150737042320494, "repo_name": "LynxyssCZ/Flexget", "id": "e8a1884b0a241e4278a753415eb8a88d86647726", "size": "42...
import os import bdb import types from Tkinter import * from idlelib.WindowList import ListedToplevel from idlelib.ScrolledList import ScrolledList from idlelib import macosxSupport class Idb(bdb.Bdb): def __init__(self, gui): self.gui = gui bdb.Bdb.__init__(self) def user_line(self, frame):...
{ "content_hash": "655c52bdcc97737b2d5aee562b92d783", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 79, "avg_line_length": 32.92723492723493, "alnum_prop": 0.5400303068569264, "repo_name": "MonicaHsu/truvaluation", "id": "94a8cb251405afe4307d766e031b7c71fd8b7fb6", "size"...
''' test for batch changing vm password @author: SyZhao ''' import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.vm_operations as vm_ops import t...
{ "content_hash": "fe07648271d0a0c2cc07bef9fba6dd20", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 112, "avg_line_length": 25.301075268817204, "alnum_prop": 0.5490862728431789, "repo_name": "zstackorg/zstack-woodpecker", "id": "6c6bde4ba52c415d6e25101798cacd2e58086813", ...
from django.db import models from django.db.models import Field, Lookup @Field.register_lookup class SearchLookup(Lookup): lookup_name = 'search' def as_mysql(self, compiler, connection): lhs, lhs_params = self.process_lhs(compiler, connection) rhs, rhs_params = self.process_rhs(compiler, con...
{ "content_hash": "443c40e5d43393332359c5727159a192", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 77, "avg_line_length": 28.339622641509433, "alnum_prop": 0.625832223701731, "repo_name": "unt-libraries/coda", "id": "20ea0ec5f16ea814a738d7f558caa1402ac374b7", "size": "3...
"""Correctness tests for tf.keras CNN models using DistributionStrategy.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python import keras from tensorflow.python.distribute import combinations from tensorflow.python.ea...
{ "content_hash": "fc12cf346480394e1ecc2fbad4d22906", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 79, "avg_line_length": 38.352112676056336, "alnum_prop": 0.6569959603378627, "repo_name": "aldian/tensorflow", "id": "57b9b718491120ae336a6219f08c27cb76a10596", "size": "6...
import os from configurations import values from boto.s3.connection import OrdinaryCallingFormat from .common import Common try: # Python 2.x import urlparse except ImportError: # Python 3.x from urllib import parse as urlparse class Production(Common): # Honor the 'X-Forwarded-Proto' header for...
{ "content_hash": "640260ec36e19ccc1777dcd9b60f5bb7", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 137, "avg_line_length": 39.16, "alnum_prop": 0.6016343207354443, "repo_name": "amorwilliams/gsoops", "id": "b9ac6eef1d8fea293f8d7dce6093b6642899971d", "size": "5035", "b...
import _plotly_utils.basevalidators class AlignValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__(self, plotly_name="align", parent_name="violin.hoverlabel", **kwargs): super(AlignValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "28960918139a06def3af181a5d419d82", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 87, "avg_line_length": 40.642857142857146, "alnum_prop": 0.5922671353251318, "repo_name": "plotly/python-api", "id": "837c21ec4926fd44df60ffdcfd3d5fdea1bb38a1", "size": "56...
from .viterbi_decode import ViterbiDecoder, viterbi_decode from .datasets import Conll05st # noqa: F401 from .datasets import Imdb # noqa: F401 from .datasets import Imikolov # noqa: F401 from .datasets import Movielens # noqa: F401 from .datasets import UCIHousing # noqa: F401 from .datasets import WMT14 # noqa:...
{ "content_hash": "203f4ac544958e6bc5a74192d2e67e11", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 58, "avg_line_length": 27.05, "alnum_prop": 0.6765249537892791, "repo_name": "PaddlePaddle/Paddle", "id": "fbfa0c3fe2e028bb0e6de028bdb4d4c005ca752e", "size": "1154", "bin...
from unittest.mock import patch import moment from .base_tests import BaseTestCase from restriccion.crawlers.uoct import UOCT_Crawler from restriccion.models.restriction import RestrictionReport class TestModelsRestriction(BaseTestCase): @patch('restriccion.models.base_report.moment.utcnow') def test_mode...
{ "content_hash": "d216426e73e58dc2c680873d22b6e0ca", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 118, "avg_line_length": 43.76027397260274, "alnum_prop": 0.6143371419627485, "repo_name": "m4droid/Restriccion-SCL-API", "id": "cfff1906ed6f6d7181233927f2eb4daf371de3ac", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("zerver", "0161_realm_message_content_delete_limit_seconds"), ] operations = [ migrations.AlterField( model_name="realm", name="allow_community_topic_editing", ...
{ "content_hash": "f8ea19d9cb873507680fb3a7ad61be52", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 70, "avg_line_length": 24, "alnum_prop": 0.609375, "repo_name": "kou/zulip", "id": "13e960174ce165439805aa6df514c19d86fdc60d", "size": "435", "binary": false, "copies":...
from oslo_config import cfg from oslo_log import log as logging from networking_cisco.plugins.ml2.drivers.cisco.ucsm import constants as const LOG = logging.getLogger(__name__) """ Cisco UCS Manager ML2 Mechanism driver specific configuration. Following are user configurable options for UCS Manager ML2 Mechanism dr...
{ "content_hash": "d5a078cbc2359bad17b0f60c84a60c02", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 36.128571428571426, "alnum_prop": 0.6156583629893239, "repo_name": "CiscoSystems/networking-cisco", "id": "4a74b4f96124d91a4160e02882e1ea8e1b902de5", ...
import copy from oslo.config import cfg from oslo.serialization import jsonutils from oslo.utils import timeutils from nova.cells import opts as cells_opts from nova.cells import rpcapi as cells_rpcapi from nova.compute import flavors from nova import context from nova import db from nova import exception from nova.i...
{ "content_hash": "5c1e68de6a7369032e3c2f4e6e36be76", "timestamp": "", "source": "github", "line_count": 1196, "max_line_length": 79, "avg_line_length": 43.30769230769231, "alnum_prop": 0.574098385975751, "repo_name": "shakamunyi/nova", "id": "2064b7700018c41cb5dd2fc86f93557e2b9575ba", "size": "5240...
from setuptools import find_packages, setup with open('README.rst', 'rb') as stream: readme = stream.read() if hasattr(readme, 'decode'): readme = readme.decode('utf-8') with open('dotenvfile/version.txt', 'r') as stream: version = stream.read() if hasattr(version, 'decode'): version =...
{ "content_hash": "96928a34d3813e5b94dc8c0260244564", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 57, "avg_line_length": 29.31578947368421, "alnum_prop": 0.6023339317773788, "repo_name": "smartmob-project/dotenvfile", "id": "6c1d3abfdd56ef78fae7d6fd07a8cba5a075b5ab", "s...