text
stringlengths
4
1.02M
meta
dict
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """Generic utility functions that are used in the framework.""" import asyncio import functools import glob import logging import os import re import subprocess import threading import typing import time impo...
{ "content_hash": "63fa2b86775f8c4eb860a184e4b97c8f", "timestamp": "", "source": "github", "line_count": 786, "max_line_length": 87, "avg_line_length": 30.709923664122137, "alnum_prop": 0.613679675200928, "repo_name": "firecracker-microvm/firecracker", "id": "12a5ff40e63781d5e084926ec675d845ba12ca6e",...
"""This module contains the general information for OneTimeBootDevice ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class OneTimeBootDeviceConsts: DEVICE_HUU = "huu" DEVICE_HV = "hv" DEVICE_NONE = "none" DEVIC...
{ "content_hash": "649462769333e7ef78189886e68ba457", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 211, "avg_line_length": 47.58227848101266, "alnum_prop": 0.5812716147911678, "repo_name": "ragupta-git/ImcSdk", "id": "a0392f678d4a679b0e9cc813944a7d60163b689f", "size": "3...
import os import string import subprocess import sys BUILD_FILE_TEMPLATE = string.Template( """# DO NOT EDIT. This file is generated by tools/proto_format/active_protos_gen.py. load("@rules_proto//proto:defs.bzl", "proto_library") licenses(["notice"]) # Apache 2 # This tracks active development versions of pro...
{ "content_hash": "9f82fb9fd3daf3480dbcf1e403259030", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 98, "avg_line_length": 28.129032258064516, "alnum_prop": 0.6393348623853211, "repo_name": "envoyproxy/envoy-wasm", "id": "bd29cc197d7d358d26b386b21210db1dc81513ff", "size":...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('clinical_annotations_manager', '0006_auto_20170316_1502'), ] operations = [ migrations.CreateModel( nam...
{ "content_hash": "cf3d42cddffbb4abcbfa5bda7e564e5b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 120, "avg_line_length": 42.214285714285715, "alnum_prop": 0.55668358714044, "repo_name": "lucalianas/ProMort", "id": "c8370006c9f0736f8ed592940edd0084dbe9a7f9", "size": "23...
""" PyCOMPSs Testbench ======================== """ # Imports import unittest from pycompss.api.api import compss_wait_on from pycompss.api.task import task class testMultiReturnIntInstanceMethods(unittest.TestCase): @task(returns=2) def argTask(self, *args): print("ARG: ", args) secondRetu...
{ "content_hash": "0e9901da16b5222cd5977afe479fbcd6", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 102, "avg_line_length": 35.49484536082474, "alnum_prop": 0.5979281634233711, "repo_name": "mF2C/COMPSs", "id": "4efff7d2672c772e99bafd6304f61ca08d4c23c5", "size": "10373",...
from ._operations import Operations from ._managed_clusters_operations import ManagedClustersOperations from ._agent_pools_operations import AgentPoolsOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._patch import __all__ as _patch_all from ._patch import * #...
{ "content_hash": "24cf1dea50ae346860a9bdd331fde30f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 90, "avg_line_length": 37.05882352941177, "alnum_prop": 0.7587301587301587, "repo_name": "Azure/azure-sdk-for-python", "id": "65da25631a4b88e85c080fc5847a5ccbfbfa0c3e", "si...
""" Command-line and common processing for Docutils front-end tools. Exports the following classes: * `OptionParser`: Standard Docutils command-line processing. * `Option`: Customized version of `optparse.Option`; validation support. * `Values`: Runtime settings; objects are simple structs (``object.attribute``). ...
{ "content_hash": "ac40aa13c297fafe65069b075fd80215", "timestamp": "", "source": "github", "line_count": 855, "max_line_length": 80, "avg_line_length": 43.226900584795324, "alnum_prop": 0.5704699802483834, "repo_name": "HesselTjeerdsma/Cyber-Physical-Pacman-Game", "id": "1aeae5c86c5da98cee0c977f249975...
from robotide.lib.robot.utils import XmlWriter, get_timestamp class LibdocXmlWriter(object): def write(self, libdoc, outfile): writer = XmlWriter(outfile) writer.start('keywordspec', {'name': libdoc.name, 'type': libdoc.type, 'format': libdoc.doc_format, ...
{ "content_hash": "3394272666cdc0f99c8156984b3d4d64", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 40.6875, "alnum_prop": 0.5599078341013825, "repo_name": "HelioGuilherme66/RIDE", "id": "08817e0809ee2bcac63711bbdf45706ea5606b97", "size": "1946", ...
#!/usr/bin/env impala-python # encoding=utf-8 # Copyright 2014 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
{ "content_hash": "eb689d11029931f8e01ab0d47304ca5a", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 90, "avg_line_length": 40.96842105263158, "alnum_prop": 0.6919321685508736, "repo_name": "kapilrastogi/Impala", "id": "f43a97eda0e87bfd93495f627410facbea4407b4", "size": "...
"""Small plotting-related utility functions.""" from __future__ import division import colorsys import warnings import numpy as np from scipy import stats import pandas as pd import matplotlib.colors as mplcol import matplotlib.pyplot as plt from distutils.version import LooseVersion pandas_has_categoricals = LooseVe...
{ "content_hash": "5a4a849b3b1d04a607834d629a236529", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 79, "avg_line_length": 28.146634615384617, "alnum_prop": 0.600392860193014, "repo_name": "aashish24/seaborn", "id": "e9593ec983baf09fc3047271b65b0eaaa7e7d0ca", "size": "11...
""" Django settings for localizappion project. Generated by 'django-admin startproject' using Django 2.0.5. For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.0/ref/settings/ """ import...
{ "content_hash": "ae6b81b5ab48a7d84afa3f52fa96cbcd", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 91, "avg_line_length": 25.793388429752067, "alnum_prop": 0.6866388977891701, "repo_name": "tughi/localizappion", "id": "9d0afead7c06e780e8e11a8854f2437ee897109b", "size": ...
from js9 import j def configure(job): """ this method will be called from the node.zero-os install action. """ import netaddr import time from zeroos.orchestrator.configuration import get_configuration, get_jwt_token from zeroos.orchestrator.sal.Node import Node from zeroos.orchestrato...
{ "content_hash": "8a92d03428b81d117c992ba668a06cb5", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 130, "avg_line_length": 47, "alnum_prop": 0.6126634196359908, "repo_name": "zero-os/0-orchestrator", "id": "c94857eaa6357ea68b58d081686c851d24a73ea4", "size": "3901", "bi...
"""A selection of helper functions useful for building workflows.""" from __future__ import print_function, absolute_import import atexit from collections import namedtuple from contextlib import contextmanager import errno import fcntl import functools import os import signal import subprocess import sys from thread...
{ "content_hash": "87994488679d65a18216c8c5a6ecceed", "timestamp": "", "source": "github", "line_count": 522, "max_line_length": 88, "avg_line_length": 27.806513409961685, "alnum_prop": 0.60792283844299, "repo_name": "gennaios/alfred-gnosis", "id": "71efed60919ed82885ff5f4c3b4e2df0aadfa324", "size":...
"""Compare multiple lightcurves by plotting them one below the other. Example use =========== from compare_lightcurves import plot_multiple_lightcurves fig = plot_multiple_lightcurves(time=time, fluxes=(flux1, flux2, flux3), labels=('Smith', 'Jones', 'Wil...
{ "content_hash": "c4f497e320c6a4fc505a0ca42ee44d3d", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 76, "avg_line_length": 34.87826086956522, "alnum_prop": 0.5632011967090501, "repo_name": "barentsen/dave", "id": "6a4faeb6e40a3417dbb6b842e3c2a425e5a5279e", "size": "4011"...
import json import os import unittest import codacy.reporter HERE = os.path.abspath(os.path.dirname(__file__)) def _file_location(*args): return os.path.join(HERE, *args) class ReporterTests(unittest.TestCase): def compare_parse_result(self, generated, expected_filename): def file_get_contents(fil...
{ "content_hash": "2fc1a0d2c33a8c3d52c45ac16855e3c9", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 98, "avg_line_length": 31, "alnum_prop": 0.588906372934697, "repo_name": "codacy/python-codacy-coverage", "id": "ed4bf83e0bf953d7b5f0f2bf8148b2af804987bc", "size": "2542", ...
""" sphinx.cmdline ~~~~~~~~~~~~~~ sphinx-build command-line handling. :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import sys import optparse import traceback from os import path from six import...
{ "content_hash": "1ce4d7216c6d8226b17c35b48cc09a0a", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 82, "avg_line_length": 39.245551601423486, "alnum_prop": 0.5761697497279652, "repo_name": "lucywyman/slides-ii", "id": "e411836c3151a0d7e75fc47d9a3b2f7239a3ef7a", "size": ...
from rest_framework.views import APIView from rest_framework.response import Response from rememerme.games.rest.games.forms import GameRequestsForm, GamesPostForm, GamesListGetForm, GamesSingleGetForm from rememerme.games.rest.exceptions import BadRequestException from rest_framework.permissions import IsAuthenticated ...
{ "content_hash": "7d609efbd8b7cb75557a1d8518a5a2a9", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 114, "avg_line_length": 29.753846153846155, "alnum_prop": 0.610134436401241, "repo_name": "rememerme/games-api", "id": "4cfeb96e2a19f2c7dfc9fa0092f2eccdaf31bea6", "size": "...
import os import subprocess from arguments import isIterable as _isIterable __all__ = ['appendEnv', 'prependEnv', 'getEnv', 'getEnvs', 'putEnv', 'refreshEnviron', 'executableOutput', 'shellOutput'] # TODO : expand environment variables when testing if it already exists in the list def appendEnv(env, value): """ap...
{ "content_hash": "e1322d04c33e83fb630763b056253d14", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 135, "avg_line_length": 40.56043956043956, "alnum_prop": 0.6713627743159035, "repo_name": "shrtcww/pymel", "id": "aee9a0491b06ca79586851be7a6e79b12f3ecac0", "size": "7382"...
from migrate.versioning import api from config import SQLALCHEMY_DATABASE_URI from config import SQLALCHEMY_MIGRATE_REPO from app import db import os.path db.create_all() if not os.path.exists(SQLALCHEMY_MIGRATE_REPO): api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository') api.version_control(SQLALCHEMY_DA...
{ "content_hash": "33a14fdaa75781d1374d4ee0d3e06f1a", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 111, "avg_line_length": 39.583333333333336, "alnum_prop": 0.8021052631578948, "repo_name": "kennethzfeng/flask-project-template", "id": "e18cb034de7f747424dfa477ac11b682dfa62...
import uuid import ddt from oslo_config import cfg from oslo_serialization import jsonutils import six import webob from manila.api.v1 import share_metadata from manila.api.v1 import shares import manila.db from manila import exception from manila import test from manila.tests.api import fakes CONF = cfg.CONF def...
{ "content_hash": "23317500d445bd07511b770065860b19", "timestamp": "", "source": "github", "line_count": 435, "max_line_length": 77, "avg_line_length": 38.38850574712644, "alnum_prop": 0.5745254206838732, "repo_name": "redhat-openstack/manila", "id": "d0e140e6f2cea941745537adbff62a1a4daec7fc", "size...
"""Feature formatter.""" from aquilon.worker.formats.formatters import ObjectFormatter from aquilon.aqdb.model import (Feature, HostFeature, HardwareFeature, InterfaceFeature) class FeatureFormatter(ObjectFormatter): def format_raw(self, feature, indent=""): details = [] ...
{ "content_hash": "fee56a9f7ca5f181f0b3e54553a3a747", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 37.82051282051282, "alnum_prop": 0.6196610169491525, "repo_name": "stdweird/aquilon", "id": "6c13de5d56300800c8976a2020b52304fddeafdb", "size": "2183...
from litmus.device.devicestandalone import devicestandalone class devicestandalone_tm1(devicestandalone): """docstring for device""" _screen_width = 720 _screen_height = 1280
{ "content_hash": "8e07e1ab49e311fb4e7c2f824d154df7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 59, "avg_line_length": 27, "alnum_prop": 0.7513227513227513, "repo_name": "dhs-shine/litmus", "id": "b6f9a7ef3defd454f08872f6e769dab687c2c08e", "size": "810", "binary": fa...
from django.views.generic import TemplateView from django.shortcuts import render from imager_images.models import Photo from random import randint class HomeView(TemplateView): template_name = 'imagersite/home.html' def get_context_data(self): photos = Photo.public.all() if photos: ...
{ "content_hash": "64ca4a3aa7b990669fb640d101703e18", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 60, "avg_line_length": 30.470588235294116, "alnum_prop": 0.666023166023166, "repo_name": "midfies/django-imager", "id": "be0f7923cac07c1c0c866e430fcc8d9c05a5673e", "size": ...
''' This script is used to add stock take counters. ''' from models import * fo = open("users.csv", "r+") lines = fo.readlines() fo.close() for line in lines: line = line.strip('\n') line_fields = line.split(',') username = line_fields[0] password = line_fields[1] admin = line_fields[2] usern...
{ "content_hash": "dd4903198bfcdef4301095179044e91c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 78, "avg_line_length": 25.757575757575758, "alnum_prop": 0.5941176470588235, "repo_name": "charle-k/stocktake-flask", "id": "6cea9c8d5ae988b89f38b6981c03df7a6100c848", "siz...
import pytest import gspread from .conftest import GspreadTest class CellTest(GspreadTest): """Test for gspread.Cell.""" @pytest.fixture(scope="function", autouse=True) def init(self, client, request): # User current test name in spreadsheet name name = self.get_temporary_spreadsheet_ti...
{ "content_hash": "1eda3e89a2152bc132ff3b5abbde9b57", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 37.013513513513516, "alnum_prop": 0.6250456370938299, "repo_name": "burnash/gspread", "id": "bb141daf5e6b45afd2aeb41e5f5ed019fcb4667a", "size": "547...
import logging import threading import pymongo import redis import pexpect import sys import socket import Queue from colorama import * # for now keep the logger. when everything is done, use only one logger or simply remove it logging.basicConfig(format="%(filename)s^^^%(funcName)s:\t%(message)s", level=...
{ "content_hash": "63e9765f5f7971ba35c7826a45ce9874", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 144, "avg_line_length": 37.44588744588744, "alnum_prop": 0.49745664739884393, "repo_name": "Shinpachi8/SubDomainsResultDeal", "id": "3b02c83fc91615f9fa8510eaa5ac4ef0a022fdc5...
from metrics import Metric from telemetry.value import scalar class PowerMetric(Metric): """A metric for measuring power usage.""" def __init__(self): super(PowerMetric, self).__init__() self._browser = None self._running = False self._starting_cpu_stats = None self._results = None def __de...
{ "content_hash": "e3e4f76e377b44e63fb7660b9b1d4880", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 37.134453781512605, "alnum_prop": 0.6791129214754469, "repo_name": "SlimRoms/android_external_chromium_org", "id": "869a023333537b0160180800c903a15177...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('tix', '0011_remove_tickettype_contact'), ] operations = [ migrations.RemoveField( model_name='tickettypeuser', name='ticket'...
{ "content_hash": "451fdb8ea48c55b4c5e7b064b7eb065a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 50, "avg_line_length": 21.916666666666668, "alnum_prop": 0.5608365019011406, "repo_name": "rchacon/moticket", "id": "651a5e8f733df556ddda7508442fd214773674ae", "size": "550...
"""В школе решили набрать три новых математических класса. Так как занятия по математике у них проходят в одно и то же время, было решено выделить кабинет для каждого класса и купить в них новые парты. За каждой партой может сидеть не больше двух учеников. Известно количество учащихся в каждом из трёх классов. Сколь...
{ "content_hash": "feaf688bdfc3589c9a3b15cd917690ba", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 119, "avg_line_length": 33.89473684210526, "alnum_prop": 0.7282608695652174, "repo_name": "g10k/sw_lessons", "id": "a29c8f32bd0b9f5562f4b012dd3d82544e267206", "size": "2550...
from south.db import db, engine from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Category.slug' db.alter_column('qa_category', 'slug', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=255)) # Changing f...
{ "content_hash": "271376f59c4b1ff6c53b53bdb4836de2", "timestamp": "", "source": "github", "line_count": 293, "max_line_length": 199, "avg_line_length": 81.77133105802048, "alnum_prop": 0.5586209775032347, "repo_name": "sharifelguindi/qatrackplus", "id": "df3ab4b216a443b2a966fc28bfedd3516d4b01f0", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0011_auto_20170128_2122'), ] operations = [ migrations.AlterField( model_name='hackathonsponsor', name='tier', ...
{ "content_hash": "f7852dd759564c5dbad8afdf0b57e08a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 141, "avg_line_length": 26.27777777777778, "alnum_prop": 0.5750528541226215, "repo_name": "andrewsosa/hackfsu_com", "id": "7cd4f6413c418a490e67aafb4a800f20d60296a3", "size"...
""" Unit Tests for flavors code """ import time from nova.compute import flavors from nova import context from nova import db from nova.db.sqlalchemy import api as sql_session from nova.db.sqlalchemy import models from nova import exception from nova import objects from nova.objects import base as obj_base from nova i...
{ "content_hash": "d222e65891cbfe94c95c005ee95e435d", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 79, "avg_line_length": 42.78181818181818, "alnum_prop": 0.6218019549511262, "repo_name": "sajeeshcs/nested_quota_latest", "id": "006cb39d4a78ce25d7316435644686bb43bc6b25", ...
import os def pobierz_dane(plikcsv): """ Funkcja zwraca tuplę tupli zawierających dane pobrane z pliku csv. """ dane = [] # deklaracja pustą tabelę if os.path.isfile(plikcsv): # czy plik istnieje na dysku with open(plikcsv, "r") as zawartosc: # otwieramy plik do odczytu for ...
{ "content_hash": "b7b6193d396777ba1aa15463bd6b5a61", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 77, "avg_line_length": 39.421052631578945, "alnum_prop": 0.6114819759679573, "repo_name": "AgataGibas/python101", "id": "1acd130cea24522f61e081ffaa93e92585741f81", "size": ...
from __future__ import absolute_import, division, print_function from six.moves import xrange import tensorflow as tf from polyaxon_lib.layers.core import Dense from polyaxon_lib.models.rl.base import BaseQModel class NAFModel(BaseQModel): """Implements a normalized advantage functions model. Args: ...
{ "content_hash": "8c5f854da9f29479d7e7cf253af1dca7", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 100, "avg_line_length": 46.53389830508475, "alnum_prop": 0.527954835184848, "repo_name": "polyaxon/polyaxon-api", "id": "403b523bc0dc6fa47588c232782bd6f5858e67cc", "size":...
import pytest from flexmock import flexmock from command.extract_dist import to_list, extract_dist class TestExtractDistribution(object): @pytest.mark.parametrize(('var', 'expected'), [ (['pkg'], ['pkg']), (None, []), ('pkg >= 2.5\npkg2', ['pkg >= 2.5', 'pkg2']), (('pkg'), ['pkg...
{ "content_hash": "876a247d61d9f6b40375f533eede8b2b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 29.5625, "alnum_prop": 0.5496828752642706, "repo_name": "yuokada/pyp2rpm", "id": "67f8f8524bd3fa25cdbe3a1864a1f43baf6b1999", "size": "946", "binary...
from unittest import mock import fixtures from nova import test from nova.virt.disk.mount import loop from nova.virt.image import model as imgmodel def _fake_noop(*args, **kwargs): return class LoopTestCase(test.NoDBTestCase): def setUp(self): super(LoopTestCase, self).setUp() self.file =...
{ "content_hash": "c02c6b411f970adfc10fa89c3c6f4624", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 34.10126582278481, "alnum_prop": 0.6288047512991833, "repo_name": "mahak/nova", "id": "312b88db356dde9aa94f22c5d1b064eb2426fa7e", "size": "3324", "...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import sys from textwrap import dedent from pants.backend.jvm.targets.exclude import Exclude from pants.base.build_manual import manual from pants.base.payload_field ...
{ "content_hash": "680a4464efb67d9937d6b35cb1ff00d2", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 112, "avg_line_length": 39.94444444444444, "alnum_prop": 0.6518669091687173, "repo_name": "laurentgo/pants", "id": "3f677d91389839a21bc31af8c51f25545e5dc1af", "size": "949...
from setuptools import setup, find_packages from distarray.__version__ import __version__ def parse_readme(filename='README.rst', sentinel="README"): """ Return file `filename` as a string. Skips lines until it finds a comment that contains `sentinel` text. This effectively strips off any badges or ...
{ "content_hash": "b0b0b3e28e482e95b5f15ec1f67045d0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 79, "avg_line_length": 35.15, "alnum_prop": 0.5718349928876245, "repo_name": "RaoUmer/distarray", "id": "2efba15aa26b6b695bdcce343e4f31a308441185", "size": "2430", "binar...
import tempfile import shutil from os.path import abspath, join, dirname from preggy import expect from thumbor.transformer import Transformer from thumbor.config import Config from thumbor.importer import Importer from thumbor.context import Context, ServerParameters from tests.base import TestCase from tests.fixtur...
{ "content_hash": "b43f41c8900b7fe292279a499cbb63b3", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 102, "avg_line_length": 35.1924882629108, "alnum_prop": 0.6005869797225186, "repo_name": "okor/thumbor", "id": "7a886c4acd9f63c544efd7547ef5da074a30e84a", "size": "7748", ...
"""Tests that all formatters are imported correctly.""" import unittest from tests import test_lib class FormattersImportTest(test_lib.ImportCheckTestCase): """Tests that CLI helper classes are imported correctly.""" _IGNORABLE_FILES = frozenset([ 'default.py', 'interface.py', 'logger.py', 'manager.py', ...
{ "content_hash": "ef3854b29d478d530995053814533cf3", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 77, "avg_line_length": 27.045454545454547, "alnum_prop": 0.6941176470588235, "repo_name": "log2timeline/plaso", "id": "6a1a5ecd749bb207d2c8795cebf5a111ea01d4c9", "size": "6...
import os import random import subprocess import time from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.translation import ugettext as _ from pytz import common_timezones from tastypie.models import ApiKey from daemon import D...
{ "content_hash": "1723b8583d9bd4088d78b05f639c4c39", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 133, "avg_line_length": 31.65, "alnum_prop": 0.6532385466034755, "repo_name": "ibrahimcesar/panda", "id": "392af36e2bc250ae9c7e15c2604e7bb521cd7ded", "size": "2555", "bin...
from __future__ import print_function import unittest from paddle.fluid.tests.unittests.test_gaussian_random_op import TestGaussianRandomOp class TestMKLDNN(TestGaussianRandomOp): def init_kernel_type(self): self.use_mkldnn = True if __name__ == '__main__': unittest.main()
{ "content_hash": "10d5a751f78a5cb74f46327719095964", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 85, "avg_line_length": 21.142857142857142, "alnum_prop": 0.7195945945945946, "repo_name": "baidu/Paddle", "id": "c18bd77bd3e6de08283f3ac3a31c73453f3c9129", "size": "907", ...
__all__ = [ 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event' ] import os import threading import sys import itertools import tempfile import _multiprocessing from time import time as _time from . import context from . import process from . import util # Try to import the mp.synchronize...
{ "content_hash": "27f2dd75c1af9319b9fb571c03fd4111", "timestamp": "", "source": "github", "line_count": 410, "max_line_length": 78, "avg_line_length": 29.334146341463416, "alnum_prop": 0.5522574208031928, "repo_name": "tempbottle/ironpython3", "id": "9d8e2824772e31e713fe95c383efa793a0a55145", "size...
from marionette import Marionette, HTMLElement, Actions, MultiActions from marionette_test import MarionetteTestCase, CommonTestCase, expectedFailure, skip, SkipTest from marionette_touch import MarionetteTouchMixin from emulator import Emulator from runtests import MarionetteTestResult from runtests import MarionetteT...
{ "content_hash": "04a09f96a6caf12fa0c3cdeea9e45804", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 95, "avg_line_length": 52.375, "alnum_prop": 0.8854415274463007, "repo_name": "wilebeast/FireFox-OS", "id": "d0ef66263f3417ed558c9f1b8ee5e8d541abff0e", "size": "619", "bin...
""" Meerkat Auth Tests Unit tests for the utility class User in Meerkat Auth. """ from meerkat_auth.user import User, InvalidCredentialException from meerkat_auth.role import Role, InvalidRoleException from meerkat_auth import app import unittest import jwt import calendar import time import logging import os import ...
{ "content_hash": "50d26e9e9b6250c665a90f5ea63d0c06", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 79, "avg_line_length": 34.04679802955665, "alnum_prop": 0.5482890834117051, "repo_name": "meerkat-code/meerkat_auth", "id": "fce91ff834a22e589c487d32377b26b29bfe477c", "si...
from tempest.lib.services.network import base class LoggableResourceClient(base.BaseNetworkClient): def list_loggable_resources(self, **filters): """List Loggable resources. For a full list of available parameters, please refer to the official API reference: https://docs.openstac...
{ "content_hash": "70993b4e2e4ab022baf937434cb2232d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 34.5, "alnum_prop": 0.6915113871635611, "repo_name": "openstack/tempest", "id": "774046fe4646f7c2632ef3b03f5c05689e8490d9", "size": "1112", "binary...
from setuptools import setup from setuptools import find_packages setup( name='cointrol', version='0.0.1', packages=find_packages(), url='https://github.com/jkbrzt/cointrol', license='MIT', author='Jakub Roztocil', author_email='jakub@roztocil.co', description='Realtime dashboard and B...
{ "content_hash": "cff1cabc1c76a9edb1dc0fd95f556b06", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 26.9, "alnum_prop": 0.6394052044609665, "repo_name": "bradparks/cointrol___bitcoin_trading_bot_bitstamp", "id": "2244f01525c9a2576cb7cb2b12dd3d4699f009...
class NvidiaGpuExtension(object): def __init__(self, gpu_manager): self.gpu_manager = gpu_manager self.hostname = None self.gpu_ids = None self.driver_version = None def options_form(self, context): return """ <select name="num_gpus"> <option ...
{ "content_hash": "0c6fdc7bf2c230f071b1e571e15e8539", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 108, "avg_line_length": 38.46666666666667, "alnum_prop": 0.5586366262276141, "repo_name": "kylemvz/nbhub", "id": "3b80381ae73b6bcf23bb3a5c1f40f0713dd9d6fc", "size": "1731",...
from pylab import * def TryNew( fitnesFunc, Gen, fitnessBest, stepSize ): hit = False n = len(Gen) GenNew = Gen + (rand(n)-0.5)*stepSize fitnessNew = fitnesFunc(GenNew) #print GenNew, fitnessNew if(fitnessNew < fitnessBest ): hit = True Gen = GenNew ...
{ "content_hash": "e2afee5be57fd363ebc14282645e1b9e", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 152, "avg_line_length": 36.5, "alnum_prop": 0.530552562721256, "repo_name": "ProkopHapala/SimpleSimulationEngine", "id": "3dd99c0c92bd6c5e7c2bf77c016e1bfb65068475", "size"...
from django.apps import AppConfig class DigitalOceanConfig(AppConfig): name = 'waldur_digitalocean' verbose_name = 'Waldur DigitalOcean' service_name = 'DigitalOcean' def ready(self): from waldur_core.structure.registry import SupportedServices from .backend import DigitalOceanBacken...
{ "content_hash": "295c7cc9fda2ad903ae7d039403e6595", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 68, "avg_line_length": 27.642857142857142, "alnum_prop": 0.7441860465116279, "repo_name": "opennode/nodeconductor-assembly-waldur", "id": "9bdbc2c18b0604d31de7a8e475340d28050...
import unittest import IECore import Gaffer import GafferTest import GafferScene import GafferSceneTest class SetFilterTest( GafferSceneTest.SceneTestCase ) : def test( self ) : p1 = GafferScene.Plane() p2 = GafferScene.Plane() g = GafferScene.Group() g["in"][0].setInput( p1["out"] ) g["in"][1].setInpu...
{ "content_hash": "75cd5ba7790df9babed166cef7ad64dc", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 101, "avg_line_length": 32.76618705035971, "alnum_prop": 0.6458447689098693, "repo_name": "boberfly/gaffer", "id": "4865b2898ae8d39e36c7b97c1387f9e5401aee41", "size": "109...
from urllib2 import Request, urlopen, URLError from BeautifulSoup import BeautifulSoup from datetime import datetime from urlparse import urlparse from celery.utils.log import get_task_logger from pymongo import MongoClient from bson.objectid import ObjectId import os logger = get_task_logger(__name__) mongo_host = ...
{ "content_hash": "e66683fa0ffc26f4de590038ce96f079", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 26.21212121212121, "alnum_prop": 0.6061657032755299, "repo_name": "ipedrazas/dotmarks-api", "id": "ede51d3e9e932d0ab1e0852fb2e1590a2c163821", "size":...
__author__ = 'chris' from binascii import unhexlify import dht.constants import mock import nacl.signing import nacl.hash from txrudp import packet, connection, rudp, constants from twisted.internet import udp, address, task from twisted.trial import unittest from dht.crawling import RPCFindResponse, NodeSpiderCrawl, ...
{ "content_hash": "2c28096c1d1c927a6beb7ed8992a4348", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 113, "avg_line_length": 42.12396694214876, "alnum_prop": 0.6449545484271794, "repo_name": "the9ull/OpenBazaar-Server", "id": "9ad37d398b61fbd40b81a8fe25f327df17b2eeaa", "s...
import os from pathlib import Path import numpy as np import tempfile import tensorflow as tf import mediapy from PIL import Image import cog from eval import interpolator, util _UINT8_MAX_F = float(np.iinfo(np.uint8).max) class Predictor(cog.Predictor): def setup(self): import tensorflow as tf ...
{ "content_hash": "b020c8df2f06094907e626329afa1831", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 115, "avg_line_length": 35.52272727272727, "alnum_prop": 0.5892514395393474, "repo_name": "google-research/frame-interpolation", "id": "6ecb41b9b4e7710122c646818811309aa35353...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "6630baf0d55058de1ea59ec08bc8b276", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 286, "avg_line_length": 32.556666666666665, "alnum_prop": 0.6813760622504351, "repo_name": "benfinke/ns_python", "id": "75ee7b508d2d32646d4acbd305f83211a149d4e6", "size": ...
from __future__ import unicode_literals import json import re import sys from .common import InfoExtractor from ..compat import ( compat_urllib_parse_urlparse, compat_urllib_request, ) from ..utils import ( ExtractorError, unescapeHTML, unified_strdate, ) from ..aes import ( aes_decrypt_text ...
{ "content_hash": "f7e23ce73120474d7fe4b34a48bec0aa", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 226, "avg_line_length": 36.666666666666664, "alnum_prop": 0.5565909090909091, "repo_name": "Celthi/youtube-dl-GUI", "id": "107c9ac36e4f4f48bd768567e4399af15fd07743", "size...
""" Test Manager WUI - Build categories. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General ...
{ "content_hash": "b30b314d783a7768569b9c12906470e6", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 123, "avg_line_length": 46.58490566037736, "alnum_prop": 0.6452004860267315, "repo_name": "egraba/vbox_openbsd", "id": "2361f26b2d1182091deb72d3d954d044942385a7", "size": ...
import os from studio.util.util import rand_string """ Utility functions for anything shared in common by ec2cloud_worker and gcloud_worker """ INDENT = 4 def insert_user_startup_script(user_startup_script, startup_script_str, logger): if user_startup_script is None: retur...
{ "content_hash": "c387cffc976405e2c761c6c00e32d739", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 77, "avg_line_length": 37.828125, "alnum_prop": 0.567121024370095, "repo_name": "studioml/studio", "id": "a6c3ee5cd0f9ca4a2fa7bb80d486620b42d85ef3", "size": "2421", "bina...
import unittest import mock import numpy as np import chainer from chainer import cuda from chainer import gradient_check from chainer import optimizer from chainer import optimizers from chainer import testing from chainer.testing import attr class TestOptimizerUtility(unittest.TestCase): def setUp(self): ...
{ "content_hash": "89e6c57915aaf9e6d08e10ac57a9e59b", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 79, "avg_line_length": 29.236749116607776, "alnum_prop": 0.6069615663524293, "repo_name": "sinhrks/chainer", "id": "2ae59f28a640d0b8340b2fbdb8657bbc214097bf", "size": "827...
import os import shutil from django.contrib.admin.models import User from projects.models import Project from projects import tasks from rtd_tests.utils import make_test_git from rtd_tests.tests.base import RTDTestCase class TestBuilding(RTDTestCase): """These tests run the build functions directly. They don't...
{ "content_hash": "65aaf949c425e10aaa3a9d062d66eea0", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 29.3, "alnum_prop": 0.6109215017064846, "repo_name": "alex/readthedocs.org", "id": "fe8fa5b3a6aaed90d7f52e7e3866122ed17b06d3", "size": "1465", "bin...
from distutils.core import setup from googleplaces import __author__, __email__, __version__ DESCRIPTION = 'A simple wrapper around the Google Places API.' setup( name = 'python-google-places', version = __version__, url = 'http://github.com/slimkrazy/python-google-places', author = __author__, a...
{ "content_hash": "2367e7f5f4d5a6d606c892e9581247f1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 27.266666666666666, "alnum_prop": 0.6625916870415648, "repo_name": "mandrwg/python-google-places", "id": "ba1e174ada3b256c73204287ddcb9a9179745634", ...
from msrest.serialization import Model class OperationMetricAvailability(Model): """Defines how often data for a metric becomes available. :param time_grain: The granularity for the metric. :type time_grain: str :param blob_duration: Blob created in the customer storage account, per hour. :t...
{ "content_hash": "3481918ed26eac090dc0c1399f2f6663", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 30.80952380952381, "alnum_prop": 0.6445131375579598, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "cc8afabf09b23bd775f0031c53b64dfca9baa380", ...
__title__ = 'syspy' __version__ = '0.1' __author__ = 'Ali GOREN <goren.ali@yandex.com>' __repo__ = 'https://github.com/aligoren/syspy' __license__ = 'Apache v2.0 License' from .network import Network
{ "content_hash": "85dc1813908bc315305a8f017028607e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 28.571428571428573, "alnum_prop": 0.64, "repo_name": "aligoren/syspy", "id": "bdd3ae3c625220ca16c2c8af1bdf3cbe9a8175c2", "size": "200", "binary": fa...
from oslo import i18n _translators = i18n.TranslatorFactory(domain='sahara') # The primary translation function using the well-known name "_" _ = _translators.primary # Translators for log levels. # # The abbreviated names are meant to reflect the usual use of a short # name like '_'. The "L" is for "log" and the o...
{ "content_hash": "4b06d57ff44e169f4698d2edc995662d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 78, "avg_line_length": 30.61111111111111, "alnum_prop": 0.7313974591651543, "repo_name": "keedio/sahara", "id": "6aeca66bc606072af19d2ad64c1264ef112d2567", "size": "1832", ...
"""Generally useful utility functions.""" from __future__ import print_function import collections import six import os import tensorflow as tf from tensorflow.python.framework import function from tensorflow.python.ops import gen_nn_ops def sparse_softmax_crossent_with_logits(logits=None, labels=None, name=None):...
{ "content_hash": "2e38ed34e715146d45606439270fa02c", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 80, "avg_line_length": 39.03448275862069, "alnum_prop": 0.6252650176678445, "repo_name": "mlperf/training_results_v0.5", "id": "cbfb4398730228c0b6f6c8529416fdb7e30c9471", ...
""" Beacon to fire event when we notice a AIX user is locked due to many failed login attempts. .. versionadded:: 2018.3.0 :depends: none """ import logging log = logging.getLogger(__name__) __virtualname__ = "aix_account" def __virtual__(): """ Only load if kernel is AIX """ if __grains__["kernel...
{ "content_hash": "46ed228c4d0680b6970df5077d4dada7", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 93, "avg_line_length": 22.370967741935484, "alnum_prop": 0.6092285508291276, "repo_name": "saltstack/salt", "id": "8a9e0469bd0f59858692d37a7ec4d5b5be2b0b73", "size": "1387"...
import sys def close(): sys.exit('This should not be called') class V1ClassListener: ROBOT_LISTENER_API_VERSION = 1 def close(self): close() class InvalidVersionClassListener: ROBOT_LISTENER_API_VERSION = 'kekkonen' def close(self): close()
{ "content_hash": "56e98000b70ab8701604576c4c3d7a8d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 43, "avg_line_length": 15, "alnum_prop": 0.6526315789473685, "repo_name": "robotframework/robotframework", "id": "b19943f90c06715a1b07f2927747e932136ff713", "size": "285", ...
import hashlib import httplib import os import random import socket import StringIO import time import urllib import simplejson as json from nose import SkipTest from xml.dom import minidom class AuthenticationFailed(Exception): pass class RequestError(Exception): pass class ResponseError(Exception): d...
{ "content_hash": "224acf5212a55d68d73e2c890b4f3534", "timestamp": "", "source": "github", "line_count": 727, "max_line_length": 79, "avg_line_length": 31.759284731774414, "alnum_prop": 0.5247520464290355, "repo_name": "SUSE/swift", "id": "30e1eac58b9ab547e83b716bcf20b445ea704719", "size": "23679", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("forms", "0005_auto_20151026_1600"), ] operations = [ migrations.AlterField( model_name="field", name="help_text", field=models.TextField(blank=True, verb...
{ "content_hash": "b1336cb060abf180600d79f3e065ffc3", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 73, "avg_line_length": 24.666666666666668, "alnum_prop": 0.5540540540540541, "repo_name": "dsanders11/mezzanine", "id": "e5b9757cbb9d8e6eed6a94d41d4ec38f81edc89d", "size": ...
"""Mesh Tensorflow Optimizers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import re import gin from mesh_tensorflow import layers from mesh_tensorflow import ops_with_redefined_builtins as mtf import tensorflow.compat.v1 as tf d...
{ "content_hash": "f07fef16f1b9b0d61670acd93137a65f", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 80, "avg_line_length": 33.66277128547579, "alnum_prop": 0.6477881372743504, "repo_name": "tensorflow/mesh", "id": "a9c6023e820c21b38960b040f0312c7dc2bdf8a8", "size": "2077...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('events', '0059_migrate_event_image_to_m2m'), ] operations = [ migrations.RemoveField( model_name='event', name='image', ), ...
{ "content_hash": "f87f7965d6d4e06484c21ed80ae8a817", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 54, "avg_line_length": 19.11764705882353, "alnum_prop": 0.5846153846153846, "repo_name": "City-of-Helsinki/linkedevents", "id": "3b3e297cf6433d3977717248352d311614868d31", ...
import pytest from plenum.test.helper import view_change_timeout, perf_monitor_disabled from plenum.test.node_catchup.helper import ensure_all_nodes_have_same_data from plenum.test.view_change_with_delays.helper import \ do_view_change_with_unaligned_prepare_certificates @pytest.fixture(scope="module") def tconf...
{ "content_hash": "2c2bc85dbffb12e51bfab0f7db0406bb", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 114, "avg_line_length": 42.074074074074076, "alnum_prop": 0.7147887323943662, "repo_name": "evernym/plenum", "id": "84ba05ba8d342de2dd28550f2506257e52c9a98e", "size": "1136...
from co import *
{ "content_hash": "7bf0f07388d448e9374664c8635a9285", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 16, "avg_line_length": 17, "alnum_prop": 0.7058823529411765, "repo_name": "random-forest/co", "id": "c426ccec48489402b5fe37eec30fdf9b8a18263e", "size": "17", "binary": fal...
"""K-means clustering""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Thomas Rueckstiess <ruecksti@in.tum.de> # James Bergstra <james.bergstra@umontreal.ca> # Jan Schlueter <scikit-learn@jan-schlueter.de> # Nelle Varoquaux # Peter Prettenhofer <peter.prettenh...
{ "content_hash": "958f545cedd41b69b886f19c643fdea9", "timestamp": "", "source": "github", "line_count": 1312, "max_line_length": 79, "avg_line_length": 38.1532012195122, "alnum_prop": 0.6078670315839942, "repo_name": "Sklearn-HMM/scikit-learn-HMM", "id": "d28678971059c2eba2b009eb882d10eb80801b2f", ...
import json from typing import Dict, List, Optional from google.appengine.ext import ndb from pyre_extensions import none_throws from backend.common.consts.alliance_color import ALLIANCE_COLORS from backend.common.manipulators.award_manipulator import AwardManipulator from backend.common.manipulators.event_details_ma...
{ "content_hash": "1add31154b7210e956247d7649eb1973", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 87, "avg_line_length": 38.809859154929576, "alnum_prop": 0.570676828161858, "repo_name": "the-blue-alliance/the-blue-alliance", "id": "da1d461f1cae9de44bf6de98375ce31bea0348...
import urwid from mitmproxy.tools.console.grideditor import base from mitmproxy.tools.console import signals from mitmproxy.net.http import cookies class Column(base.Column): def __init__(self, heading, subeditor): super().__init__(heading) self.subeditor = subeditor def Edit(self, data): ...
{ "content_hash": "6ba940bccbf7756acb748e728b8efc21", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 26.62, "alnum_prop": 0.5334335086401202, "repo_name": "dwfreed/mitmproxy", "id": "4db374620d67db0eae5f9dce9189d06d53b7ed4e", "size": "1331", "binar...
import os import sys workspace = os.path.dirname(os.path.realpath(__file__)) tempfolder = workspace+"\\TestTemp" os.environ ["TEMP"] = tempfolder currenttemp = os.environ.get ("TEMP") print ("Temp folder set to - "+currenttemp) print ("") os.chdir(workspace ) # Run CodeXL Debugger test os.system( 'CodeXLGpuDebuggingT...
{ "content_hash": "f34f9754f5cfd1d2d4eaa2e0c84bb2bc", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 138, "avg_line_length": 44.875, "alnum_prop": 0.7632311977715878, "repo_name": "ilangal-amd/CodeXL", "id": "a7a9d106cf7cc256d402672b96a8f3dba71c519f", "size": "718", "bin...
from django.conf import settings import sys # A few aliases, because there's FQMNs now engine_modules = { 'django.db.backends.postgresql_psycopg2': 'postgresql_psycopg2', 'django.db.backends.sqlite3': 'sqlite3', 'django.db.backends.mysql': 'mysql', 'mysql.connector.django': 'mysql', # MySQL Connector/P...
{ "content_hash": "208ddf6a6a3af2e66e35e87a992a3970", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 88, "avg_line_length": 38.75, "alnum_prop": 0.6364055299539171, "repo_name": "jean/sentry", "id": "7f837d8e9b73765dd3765c0e16c278a350a3f98a", "size": "2300", "binary": fa...
"""Tests for miscellaneous functionality in tensorflow.ops.nn.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf class ZeroFractionTe...
{ "content_hash": "a1ddb04aa3e718469cb73cea388c1964", "timestamp": "", "source": "github", "line_count": 627, "max_line_length": 80, "avg_line_length": 38.577352472089316, "alnum_prop": 0.6041012072101869, "repo_name": "TakayukiSakai/tensorflow", "id": "06269054398d709fd549d8b228e68dd09fd4a384", "si...
from handler.base_plugin import CommandPlugin class AboutPlugin(CommandPlugin): __slots__ = ("version", ) def __init__(self, *commands, prefixes=None, strict=False, version=8.0): """Answers with information about bot.""" if not commands: commands= ("о боте",) super().__i...
{ "content_hash": "e6131508d1cb099ea9d4100cf0571656", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 118, "avg_line_length": 37.28125, "alnum_prop": 0.5699916177703269, "repo_name": "vk-brain/sketal", "id": "175cfd5e9fb5e1ba88729226e93bd2480228b405", "size": "1471", "bin...
import psycopg2 import json reponame = "rethinkdb" CNT_TRESHOLD = 100 # omit links with fewer than CNT_TRESHOLD edits filenameBlacklist = ["railties/doc/guides%%", "guides/%%", "%%jquery%%js", "%%CHANGELOG%%", "%%README%%", "%%COPYING%%", "%%LICENCE%%", "lib/%%", "external/%%", "bench/workloads/baseline/baseline-git/...
{ "content_hash": "0408d7b7570ca1bc8624093b0bb97b80", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 292, "avg_line_length": 28.4375, "alnum_prop": 0.6747252747252748, "repo_name": "ArnoVanLumig/set-seminar", "id": "c67fff57774f692a2e2138c7d51befe8ce38bd86", "size": "2275"...
import sys from java.lang import Thread, Runnable class Timeout(object): def __init__(self, timeout, error): self._timeout = timeout self._error = error def execute(self, runnable): runner = Runner(runnable) thread = Thread(runner, name='RobotFrameworkTimeoutThread') ...
{ "content_hash": "af9aa93cc0718a723a2c1b7ee955200a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 70, "avg_line_length": 26.523809523809526, "alnum_prop": 0.5834829443447038, "repo_name": "robotframework/RIDE", "id": "52e32a0a85e5c77cdb531fc405835636f76a2e17", "size": "...
import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.paging import I...
{ "content_hash": "c8f913ca7e81267c1c6d73bc980c591d", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 111, "avg_line_length": 40.642857142857146, "alnum_prop": 0.6334877776002557, "repo_name": "Azure/azure-sdk-for-python", "id": "f81c989b49093006a877d8df98dcfc48ca76b293", ...
from .decorator import tract_math_operation, set_dictionary_from_use_filenames_as_index from warnings import warn import numpy import nibabel from nibabel.spatialimages import SpatialImage from ..tractography import ( Tractography, tractography_to_file, tractography_from_files ) import sys import traceback fro...
{ "content_hash": "88aea04727301f806fe448209c179918", "timestamp": "", "source": "github", "line_count": 852, "max_line_length": 179, "avg_line_length": 36.49647887323944, "alnum_prop": 0.6070107734362438, "repo_name": "BRAINSia/tract_querier", "id": "2b9ae96355a1baa871763b9cc170c24df94ab74b", "size...
from __future__ import absolute_import, unicode_literals from abc import ABCMeta, abstractmethod from six import add_metaclass from haas.utils import abstractclassmethod @add_metaclass(ABCMeta) class IDiscovererPlugin(object): @abstractclassmethod def from_args(cls, args, arg_prefix, loader): """C...
{ "content_hash": "95700a31a67678a1e02999ec9cd04f19", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 31.87323943661972, "alnum_prop": 0.6301369863013698, "repo_name": "scalative/haas", "id": "7a17ce3c559009f5067d07831f6a652ea91f74c2", "size": "2484",...
from os import environ from os.path import abspath, dirname, join from setuptools import setup from sys import version_info, path as sys_path deps = [] packages = [ "streamlink", "streamlink.stream", "streamlink.plugin", "streamlink.plugin.api", "streamlink.plugins", "streamlink.packages", ...
{ "content_hash": "65df03fc33958cee24c456568cd96a3a", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 109, "avg_line_length": 36.467532467532465, "alnum_prop": 0.6132478632478633, "repo_name": "sbstp/streamlink", "id": "3408bc6cbfadd104d6077642eaa14a6f3df77798", "size": "28...
from io import BytesIO import sys import codecs import mimetypes import random import string from .compat import compat_cookiejar, compat_pickle class ClientCookieJar(compat_cookiejar.CookieJar): """Custom CookieJar that can be pickled to/from strings """ def __init__(self, cookie_string=None, policy=None...
{ "content_hash": "bf0ac75b4e777e69bd6a6bc73a195890", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 119, "avg_line_length": 37.63636363636363, "alnum_prop": 0.5960144927536232, "repo_name": "ping/instagram_private_api", "id": "8971fed10220b4856d7bb2d979a2aa088d0ca857", "s...
from django.db.models import Q from django.core.exceptions import ObjectDoesNotExist def fqdn_search(fqdn, *args, **kwargs): """Find any records that have a name that is the provided fqdn. This name would show up on the left hand side of a zone file and in a PTR's case the right side. :param fqdn: Th...
{ "content_hash": "08032ffb8600d9c699e64376c8ffca66", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 79, "avg_line_length": 37.0126582278481, "alnum_prop": 0.5783173734610123, "repo_name": "murrown/cyder", "id": "de5b9199dcd2a7eb77eebda6ec85b90f09ac2da4", "size": "5848", ...
''' New Perf Test for creating vip. The created number will depends on the environment variable: ZSTACK_TEST_NUM The default max threads are 1000. It could be modified by env variable: ZSTACK_THREAD_THRESHOLD @author: Youyk ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test...
{ "content_hash": "d33bbf878f63f64259590448f6859d90", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 105, "avg_line_length": 34.17886178861789, "alnum_prop": 0.6569933396764985, "repo_name": "SoftwareKing/zstack-woodpecker", "id": "74f1c736f92140bd2944ca1e775e0004d59bc065",...
from setuptools import setup, find_packages from imp import load_source setup( name='shield', version=load_source('', 'shield/_version.py').__version__, description='A permissions framework built around declarative rules.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Aud...
{ "content_hash": "ad68fcb86ca57e325a8f5ec95123aae7", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 29.58139534883721, "alnum_prop": 0.5849056603773585, "repo_name": "concordusapps/python-shield", "id": "76880e0eb4dd0f9785b17e01bc26f8682686eb06", "s...
import requests from bs4 import BeautifulSoup import json import webbrowser def query(key): k = key.split(" ")[1] if not k: return "" r = requests.get('http://movie.douban.com/subject_search?search_text=' + k) bs = BeautifulSoup(r.text) results = [] for i in bs.select(".article table .p...
{ "content_hash": "623c60691f004a27b710135aaa2b6926", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 93, "avg_line_length": 36.333333333333336, "alnum_prop": 0.5638031693077564, "repo_name": "bigstupidx/Wox", "id": "01c855dbb5076cfc60d1e7770ae7f7e836043133", "size": "1214"...
import fixtures from manilaclient import client from manilaclient import shell from tests import utils from tests.v1 import fakes class ShellTest(utils.TestCase): FAKE_ENV = { 'MANILA_USERNAME': 'username', 'MANILA_PASSWORD': 'password', 'MANILA_PROJECT_ID': 'project_id', 'OS_SHA...
{ "content_hash": "9504f50477399cf5dbaeddf0db26a656", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 77, "avg_line_length": 41.40277777777778, "alnum_prop": 0.6023146595102314, "repo_name": "bswartz/python-manilaclient", "id": "c83321769136f6f0118e9ea9546e0c3b997d3e47", "...
""" Backport of `django.test.client.RequestFactory` from Django 1.3 and above. """ import urllib from cStringIO import StringIO from urlparse import urlparse from django.conf import settings from django.core.handlers.wsgi import WSGIRequest from django.http import SimpleCookie from django.utils.encoding import smart_s...
{ "content_hash": "48d5713890ca4f133a84a394e9f53096", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 78, "avg_line_length": 33.48587570621469, "alnum_prop": 0.5393959844778135, "repo_name": "larikov/django-subdomains", "id": "efcb57d0fbbf533ab2b1ee392645ed0d351fc227", "si...
import hashlib import json import os import shutil import socket import subprocess import sys import tempfile import time import uuid from stat import ST_MODE import grpc from apache_beam.portability.api.beam_artifact_api_pb2 import GetManifestResponse, ArtifactChunk from apache_beam.portability.api.beam_artifact_api_...
{ "content_hash": "c9ab250b901b5fc26438a96086b68b7b", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 99, "avg_line_length": 47.70464135021097, "alnum_prop": 0.6261277197947992, "repo_name": "bowenli86/flink", "id": "f5d73523af592c8b0e8384e87339ccb7a050bc83", "size": "1226...
""" Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that: Only one letter can be changed at a time Each intermediate word must exist in the dictionary For example, Given: start = "hit" end = "cog" dict = ["hot","dot","dog","lot","log"] Return [...
{ "content_hash": "5bfc4621743ed79a8da9b6794a0e4bb0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 125, "avg_line_length": 32.56666666666667, "alnum_prop": 0.5475946775844421, "repo_name": "yuzhangcmu/Python-Study", "id": "aad607ae781c6683a547ca719b2ba92607a3c9e2", "size...
"""Test app""" import unittest from yabgp.api.app import app class FlaskrTestCase(unittest.TestCase): def setUp(self): # prepare some peers self.app = app.test_client() def tearDown(self): """""" pass def test_show_bgp_summary(self): result = self.app.get('/') ...
{ "content_hash": "77f33bd76cdebda0ed58a1ea5b6ffd2b", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 40, "avg_line_length": 18.136363636363637, "alnum_prop": 0.5764411027568922, "repo_name": "abn/yabgp", "id": "6052ee4667509f9995de270f455b32b1a27e4c65", "size": "1034", "...
import json from django import forms from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseNotFound, HttpResponseForbidden from django.shortcuts import get_object_or_404, rende...
{ "content_hash": "830b82f5125afca59a8f85eb46184f83", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 93, "avg_line_length": 39.56712328767123, "alnum_prop": 0.5614180861376541, "repo_name": "alanjds/django_object_permissions", "id": "1f955f0667ab3d361962293a6a64f3ff8b8e53c2...
"""Unit tests for the eval_scores module. """ import os import shutil import tempfile import unittest import pydub from . import data_access from . import eval_scores from . import eval_scores_factory from . import signal_processing class TestEvalScores(unittest.TestCase): """Unit tests for the eval_scores modul...
{ "content_hash": "db09d7411f2935ba0df1cb98ff1b23b8", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 80, "avg_line_length": 37.300813008130085, "alnum_prop": 0.7046643417611159, "repo_name": "koobonil/Boss2D", "id": "ddb5d0b07a341df1986f3019ed22be38722ca42e", "size": "498...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('applications', '0017_auto_20170118_1819'), ] operations = [ migrations.AlterModelOptions( name='eventapplication', options={'permiss...
{ "content_hash": "cbcd1ef92946cdc75e942d142d6bc673", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 196, "avg_line_length": 29.705882352941178, "alnum_prop": 0.6514851485148515, "repo_name": "CSchool/SchoolSite", "id": "346ef073ed5452ff5c184081099c6c65043048c5", "size": "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'QuestionContainer' db.delete_table('questionnaire_questioncontainer') # Adding model 'Section' ...
{ "content_hash": "35109d3a5c34058ffd31ac00aea012bb", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 236, "avg_line_length": 68.36029411764706, "alnum_prop": 0.5867484134667097, "repo_name": "pythonbyexample/PBE", "id": "064857d9f3f02fb0af9504500ca14c1533cdf7c9", "size": ...