text
stringlengths
4
1.02M
meta
dict
import unittest from wiring.dependency import inject, injected from wiring.providers import ( FactoryProvider, FunctionProvider, InstanceProvider, IProvider ) from . import ModuleTest class ProvidersModuleTest(ModuleTest): module = 'wiring.providers' class FactoryProviderTest(unittest.TestCase...
{ "content_hash": "528ccfafe13c6affd2c8ca106a136f3d", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 75, "avg_line_length": 29.074324324324323, "alnum_prop": 0.542644666511736, "repo_name": "msiedlarek/wiring", "id": "52c4b3003c324d32145d4416aa2cca4163c2ef19", "size": "43...
from sqlalchemy import Column, Integer, String from app import Base, engine class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) username = Column(String(30), nullable=False) first_name = Column(String(30), nullable=True) last_name = Column(String(30), nullable=True) ...
{ "content_hash": "82d7eb2701029df3ff390b407208f71c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 28.352941176470587, "alnum_prop": 0.6763485477178424, "repo_name": "duoduo369/python-social-auth", "id": "784f2cf40cef66b36a7b848876e360b1c2bbcd4d", ...
""" Django accounts management made easy. """ default_app_config = 'userena.apps.UserenaConfig' VERSION = (2, 0, 1) __version__ = '.'.join((str(each) for each in VERSION[:4])) def get_version(): """ Returns string with digit parts only as version. """ return '.'.join((str(each) for each in VERSION...
{ "content_hash": "49f8b077dd4630b6f127af69c7dc71f7", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 59, "avg_line_length": 19.235294117647058, "alnum_prop": 0.6238532110091743, "repo_name": "mortenwh/django-userena", "id": "2fcbd7dece7093cb54fc002f7a638e777a115c76", "size...
import argparse from fabric.api import * from fabric.contrib.files import exists from dlab.meta_lib import * import os from dlab.fab import * parser = argparse.ArgumentParser() parser.add_argument('--cluster_name', type=str, default='') parser.add_argument('--spark_version', type=str, default='') parser.add_argument('...
{ "content_hash": "514a694d0e805486ce1bac0f3a0a6cc0", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 135, "avg_line_length": 50.36538461538461, "alnum_prop": 0.6655211912943871, "repo_name": "epam/DLab", "id": "2e5cfb56127fa68ffd69050c9d7e586b9496a166", "size": "3388", "...
from pathlib import Path from setuptools import find_packages from setuptools import setup def read(fname: str) -> str: file_path = Path(__file__).parent / fname return file_path.read_text(encoding="UTF-8") setup( name="pytest-regressions", use_scm_version=True, setup_requires=[ "setupt...
{ "content_hash": "8d159e20c3cbd40a2bbcb66a3dcd860b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 75, "avg_line_length": 30.88235294117647, "alnum_prop": 0.5585714285714286, "repo_name": "ESSS/pytest-regressions", "id": "b7cf9da38d970403cf5221dc93ecb6e20f24e629", "size"...
from distutils.core import setup setup( name='django-wsgi', version='0.1alpha1', description="A library for better integration between django and the WSGI world.", long_description=open('README.txt').read(), author='Alex Gaynor', author_email='[email protected]', license='BSD', url=...
{ "content_hash": "600afe7008d6b6171ef15b33d58feba9", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 86, "avg_line_length": 33.17391304347826, "alnum_prop": 0.6159895150720839, "repo_name": "alex/django-wsgi", "id": "da534d6f99b706b333244062ee693d328a97b192", "size": "763"...
from django.contrib import admin from .models.job_post import JobPost from .models.company import Company admin.site.register(JobPost) admin.site.register(Company)
{ "content_hash": "8fc8e0ef64057e5a05a3a1660ce7ba3d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 36, "avg_line_length": 23.571428571428573, "alnum_prop": 0.8242424242424242, "repo_name": "abernet2/job-searcherv2", "id": "72f054e5debadbda6582949111448ec9a0d9eab8", "size"...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_aakuan_defender_human_male_01.iff" result.attribute_template_id = 9 result.stfName("npc_name","human_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "cb921b38126dd6559509e60bf0e368f4", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 83, "avg_line_length": 24.384615384615383, "alnum_prop": 0.7003154574132492, "repo_name": "obi-two/Rebelion", "id": "592a11bab3d9b9de993d35e5a1541e0894da7fb3", "size": "462...
from __future__ import absolute_import, division, print_function from __future__ import unicode_literals from citext import CIText from sqlalchemy import ( Table, Column, CheckConstraint, ForeignKey, Index, UniqueConstraint, ) from sqlalchemy import Boolean, DateTime, Integer, String, Unicode from sqlalchemy impor...
{ "content_hash": "80c3e454e63bb66a828c027d3c6a4cb4", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 74, "avg_line_length": 32.03508771929825, "alnum_prop": 0.6544359255202629, "repo_name": "mattrobenolt/warehouse", "id": "17f0c68d29bf8ce86d81fc062b6508b0260b739a", "size":...
"""Wrappers for protocol buffer enum types.""" import enum class Likelihood(enum.IntEnum): """ A bucketized representation of likelihood, which is intended to give clients highly stable results across model upgrades. Attributes: UNKNOWN (int): Unknown likelihood. VERY_UNLIKELY (int): It ...
{ "content_hash": "13fac439843e1e56a98125c4385a4597", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 106, "avg_line_length": 38.244680851063826, "alnum_prop": 0.568567454798331, "repo_name": "tseaver/google-cloud-python", "id": "caf4d634339eaa9c68e1747239896d99f196074d", ...
"""Run Inception V3 benchmarks. Tutorials: https://cloud.google.com/tpu/docs/tutorials/inception Code: https://github.com/tensorflow/tpu/blob/master/models/experimental/inception/inception_v3.py This benchmark is equivalent to tensorflow_benchmark with the inception3 model except that this can target TPU. """ # TODO(t...
{ "content_hash": "c791e2cf408e22d40cb8d904c4df83c2", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 97, "avg_line_length": 39.543103448275865, "alnum_prop": 0.6726618705035972, "repo_name": "GoogleCloudPlatform/PerfKitBenchmarker", "id": "124498826d0bf52ed8f9c512859fb5c09f...
"""Genesis Tab :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ #from pykern.pkdebug import pkdc, pkdp from radtrack.rt_qt import QtGui from radtrack import genesis_controller class GenesisTab(QtGui.QWidget): defaultTitle = 'Genesi...
{ "content_hash": "258bd592fa6fc4d28d33e00fa2e6fce2", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 67, "avg_line_length": 29.25, "alnum_prop": 0.6552706552706553, "repo_name": "radiasoft/radtrack", "id": "fd8d9de6b304c6ac7a66a9c5e141ed2975d44c11", "size": "1077", "bina...
from requests_oauthlib import OAuth1Session import json import time import constants import identify as i def query_twitter(kwd, count, times, since_id): session = OAuth1Session( constants.TW_CONSUMER_KEY, constants.TW_CONSUMER_SEC, constants.TW_ACCESS_TOKEN, constants....
{ "content_hash": "bdafc028c68fec63efb1eb03184fe64e", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 192, "avg_line_length": 35.08450704225352, "alnum_prop": 0.5210758731433159, "repo_name": "kotori-sonoda/suwameter", "id": "9c7dd6d7f56c2b13db010771036b9f9c8e2147f2", "size...
#------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://w...
{ "content_hash": "fd09bd2e6d49193967bdf8d34745e775", "timestamp": "", "source": "github", "line_count": 1094, "max_line_length": 104, "avg_line_length": 51.39396709323583, "alnum_prop": 0.6149933303690529, "repo_name": "dstrockis/outlook-autocategories", "id": "eeb0e3e9a14ec4c5e7ecb33d46b93adbf2af391...
""" Helper module for celery to run a worker. .. moduleauthor:: Martijn Vermaat <[email protected]> .. Licensed under the MIT license, see the LICENSE file. """ from . import celery, create_app # Todo: Should we make it possible to use create_reverse_proxied_app here? create_app().app_context().push()
{ "content_hash": "5157d233d8a7afdb489382f66424dc2a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 74, "avg_line_length": 22.285714285714285, "alnum_prop": 0.7243589743589743, "repo_name": "sndrtj/varda", "id": "5a555d2c7fe608bd6799b35da6a413f07cc8a588", "size": "312", ...
from django.core.urlresolvers import reverse from django.http.response import HttpResponseRedirect def index_redirect(request): return HttpResponseRedirect(reverse('events:up_next'))
{ "content_hash": "ba20810faae06186788861055e79374c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 58, "avg_line_length": 31.5, "alnum_prop": 0.8201058201058201, "repo_name": "qsic/qsic3", "id": "df2bda813381912f20a4ad9995594a48a6f89b88", "size": "189", "binary": false,...
from __future__ import absolute_import import os from oslo.config import cfg import pbr.version from keystone import assignment from keystone.common import openssl from keystone.common import sql from keystone.common.sql import migration_helpers from keystone.common import utils from keystone import config from keys...
{ "content_hash": "21bb5af3b4b3071735ef115264a1dffd", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 79, "avg_line_length": 35.16161616161616, "alnum_prop": 0.5881451690127358, "repo_name": "blueboxgroup/keystone", "id": "d86349cd1e876cdfa3699d63a1abd64ba5b76c03", "size":...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('otp_twilio_encrypted', '0001_initial'), ] operations = [ migrations.AddField( model_name='twiliosmsdevice', name='last_t', ...
{ "content_hash": "3a8a689883fd7d0300e0991e0844716f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 154, "avg_line_length": 27.68421052631579, "alnum_prop": 0.6254752851711026, "repo_name": "gustavrannestig/otp_twilio_encrypted", "id": "e42aba264969abf8c190646f86699f7ec0f85...
"""Asserts and Boolean Checks.""" import collections import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import dtypes from tensorflow.python.framework import errors from tensorflow.python.framework import ops from tensorflow.python.framework import sparse_tensor from tens...
{ "content_hash": "3faf2b1def69f3652655e56c360d0445", "timestamp": "", "source": "github", "line_count": 2347, "max_line_length": 120, "avg_line_length": 35.96335747763102, "alnum_prop": 0.6581641115560505, "repo_name": "Intel-tensorflow/tensorflow", "id": "884816b65acfee49b1a2d3f0d968005f22915f7e", ...
from builtins import str import csv from django.http import HttpResponse # Admin action for a generic "CSV Export" # Django snippets: http://djangosnippets.org/snippets/2369/ def export_as_csv_action(description="Export selected objects as CSV file", fields=None, exclude=None, header=True): ...
{ "content_hash": "993f368ed6f9a3cc87fcfd321c48ded4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 33.75555555555555, "alnum_prop": 0.6122448979591837, "repo_name": "onepercentclub/bluebottle", "id": "f56ffc575240ce97737a50f6df08841995ed0d0e", "siz...
from __future__ import absolute_import from datetime import datetime from .. import states from ..db.models import Task, TaskSet from ..db.session import ResultSession from ..exceptions import ImproperlyConfigured from ..utils.timeutils import maybe_timedelta from .base import BaseDictBackend def _sqlalchemy_insta...
{ "content_hash": "239a31584e9565433481c22f91983f89", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 34.51048951048951, "alnum_prop": 0.5657548125633232, "repo_name": "KarimAllah/celery", "id": "c93086774051b00a7c259125d438f41f628fa770", "size": "49...
"""Provides utilities to preprocess images for the Inception networks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function # Standard Imports from absl import flags import tensorflow.compat.v1 as tf flags.DEFINE_float('cb_distortion_range', 0.1, 'Cb distort...
{ "content_hash": "aa97ccc3d17b3f458d6ebd8a4d2d299d", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 80, "avg_line_length": 41.119680851063826, "alnum_prop": 0.6498286009960546, "repo_name": "tensorflow/tpu", "id": "12ff79f755460890c4ddb231c598d3c84ffb4bfe", "size": "1615...
"""Fixtures for IntelliFire integration tests.""" from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, Mock, patch from aiohttp.client_reqrep import ConnectionKey import pytest @pytest.fixture def mock_setup_entry() -> Generator[AsyncMock, None, None]: """Mock setting up a config...
{ "content_hash": "ecf63e16ead022fd4acb34af4fea1dce", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 99, "avg_line_length": 31.89830508474576, "alnum_prop": 0.6976620616365569, "repo_name": "toddeye/home-assistant", "id": "3f73834226ceac8e9d91569047ed3ba2c9eaba56", "size":...
""" Generator registration and query support. """ import pkg_resources from collections import namedtuple # An instance of this namedtuple must be registered in textx_gen entry point. GenDesc = namedtuple('GenDesc', 'name lang desc genconf render validate') def iter_generators(): """ Iterates over registere...
{ "content_hash": "dbbb170b6265dfd911bdbf8cede818de", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 25, "alnum_prop": 0.6938461538461539, "repo_name": "igordejanovic/textx-tools", "id": "029efc31d3438a41f32b5b0e4e70a80d62b53a03", "size": "650", "b...
import logging import subprocess import sys import time from desktop.supervisor import DjangoCommandSupervisee from desktop.conf import KERBEROS as CONF LOG = logging.getLogger(__name__) SPEC = DjangoCommandSupervisee("kt_renewer") NEED_KRB181_WORKAROUND=None def renew_from_kt(): cmdv = [CONF.KINIT_PATH.get(), ...
{ "content_hash": "06382b8cefb4634b7aebc21f5619e995", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 78, "avg_line_length": 33.75, "alnum_prop": 0.6421052631578947, "repo_name": "pwong-mapr/private-hue", "id": "6e6e41b504b8d4d5d281242fec5574ef6f52d242", "size": "3357", "...
import sys import types import warnings import unittest # Decorator used in the deprecation tests to reset the warning registry for # test isolation and reproducibility. def warningregistry(func): def wrapper(*args, **kws): missing = [] saved = getattr(warnings, '__warningregistry__', missing).cop...
{ "content_hash": "34af95ad9141de19feb0664e300226c7", "timestamp": "", "source": "github", "line_count": 1529, "max_line_length": 83, "avg_line_length": 39.74166121648136, "alnum_prop": 0.626248662881593, "repo_name": "batermj/algorithm-challenger", "id": "31e2f0fc3d61dfb54f7c99866eca3b4f3cf226ae", ...
import Image, ImageFile _handler = None ## # Install application-specific FITS image handler. # # @param handler Handler object. def register_handler(handler): global _handler _handler = handler # -------------------------------------------------------------------- # Image adapter def _ac...
{ "content_hash": "428ad47b5231a8eacbf1ef0b62f156a2", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 73, "avg_line_length": 24.285714285714285, "alnum_prop": 0.5647058823529412, "repo_name": "robiame/AndroidGeodata", "id": "ca7b0d46ef411092089c0d0be29c6a4c01df73c3", "size"...
from .rocon_servicemanager import *
{ "content_hash": "ec6fe066c272fc877056d07e5ae9bc1c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8055555555555556, "repo_name": "jihoonl/orchestra", "id": "bea3d6f5797f69041b2b09983efbdf99fdda611c", "size": "59", "binary": fa...
from __future__ import (division, print_function, absolute_import, unicode_literals) import webbrowser import shutil import pathlib # Use subprocess32 if available try: import subprocess32 as subprocess except: import subprocess as subprocess from invoke import task cwd = pathlib....
{ "content_hash": "27850b3aff3147633ab02e78baef64ac", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 77, "avg_line_length": 24.28125, "alnum_prop": 0.6383526383526383, "repo_name": "marohngroup/kpfm", "id": "035bd0aaabf44d2d60b76631b612b18686446f35", "size": "2599", "bin...
import logging from c7n.actions import Action as BaseAction from c7n.utils import local_session, chunks, type_schema from c7n.exceptions import PolicyValidationError from kubernetes.client import V1DeleteOptions log = logging.getLogger('custodian.k8s.actions') class Action(BaseAction): pass class MethodActio...
{ "content_hash": "4f542b55847d74fe778d56b2b2b18bf4", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 84, "avg_line_length": 31.39855072463768, "alnum_prop": 0.626355873528733, "repo_name": "ocampocj/cloud-custodian", "id": "c9a7673c41eea382b25b178186167e167b39f98c", "size...
""" Este processamento gera uma tabulação de idiomas de publicação de cada artigo da coleção SciELO. Formato de saída: "PID","ISSN","título","área temática","ano de publicação","tipo de documento","idiomas","pt","es","en","other","pt-es","pt-en","en-es","exclusivo nacional","exclusivo estrangeiro","nacional + estrangei...
{ "content_hash": "c6ecae7c8d5ef53ea59895411c0dc0b5", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 240, "avg_line_length": 33.020270270270274, "alnum_prop": 0.6020053202373644, "repo_name": "fabiobatalha/processing", "id": "5dc3742371c145af4faa909bb21a76676bc6dbbe", "si...
import datetime import os from google.appengine.ext import ndb from google.appengine.ext.webapp import template from helpers.data_fetchers.team_details_data_fetcher import TeamDetailsDataFetcher from helpers.award_helper import AwardHelper from helpers.event_helper import EventHelper from helpers.match_helper import...
{ "content_hash": "5351685634ec1adb27f82e6274e42f53", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 145, "avg_line_length": 41.40555555555556, "alnum_prop": 0.5721186099557225, "repo_name": "1fish2/the-blue-alliance", "id": "f236e76372f5bed247bf992d8cb8a150c22ccea5", "si...
from .sparseTensorWrapper import SparseTensor from .canoTensor import CanoTensor from .tucker import Tucker from .tensorTrain import TensorTrain
{ "content_hash": "b0e463af01f5672f0ee16aacb6ade823", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 45, "avg_line_length": 36.25, "alnum_prop": 0.8620689655172413, "repo_name": "vondrejc/FFTHomPy", "id": "eb4c7c3ecc6ceb7d0c36f0ecc12b53f36f5480cd", "size": "145", "binary"...
import datetime import logging from decimal import Decimal from django.core.urlresolvers import reverse, NoReverseMatch from django.conf import settings from django.db import models from django.db.models.query import QuerySet from django.utils.safestring import mark_safe from django.utils.html import escape from djang...
{ "content_hash": "de769997af14f1f0a711860f92061a48", "timestamp": "", "source": "github", "line_count": 511, "max_line_length": 115, "avg_line_length": 37.56360078277886, "alnum_prop": 0.6087001823391508, "repo_name": "samuelcolvin/django-crud", "id": "5f3c06583b34f5fa00434d97b10a229e707e44cc", "si...
""" A Python "serializer". Doesn't do much serializing per se -- just converts to and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for other serializers. """ from __future__ import unicode_literals from django.conf import settings from django.core.serializers import base from django.db...
{ "content_hash": "a5e65d41c1b9213705a681acdb8174fe", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 126, "avg_line_length": 40.2027972027972, "alnum_prop": 0.572621325447904, "repo_name": "aleida/django", "id": "333161c929560b5a1b650056fe23115b7763a10e", "size": "5749", ...
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pagin...
{ "content_hash": "0c76e5d4276841d59cef3c652a930fd5", "timestamp": "", "source": "github", "line_count": 898, "max_line_length": 204, "avg_line_length": 44.770601336302896, "alnum_prop": 0.6386180479554273, "repo_name": "Azure/azure-sdk-for-python", "id": "057babf218d14889164c4a9ab82412e069ed2166", ...
from room import Room r = Room() r.roomname = 'house56' r.exits = {'west brook': 'westbrook'} r.roomdesc = """ a house it is orange """ r.looktargets = {'door': 'its closed\n\n'}
{ "content_hash": "ca770e0a9cb88aab9cf6aa8bbf4f2c60", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 43, "avg_line_length": 20.11111111111111, "alnum_prop": 0.6353591160220995, "repo_name": "elstupido/rpg", "id": "f3fcbcb37e6083871d380262d7046c6499d826ca", "size": "181", ...
import sys import warnings import itertools import operator from abc import ABCMeta, abstractmethod import numpy as np from scipy import sparse from .base import LinearModel, _pre_fit from ..base import RegressorMixin from .base import center_data from ..utils import array2d, atleast2d_or_csc from ..cross_validation ...
{ "content_hash": "c6c7a00fa82c3881c31eb67d7317ed2f", "timestamp": "", "source": "github", "line_count": 1471, "max_line_length": 79, "avg_line_length": 35.784500339904824, "alnum_prop": 0.5897908394916317, "repo_name": "Tong-Chen/scikit-learn", "id": "9213ff53f0bfb20d0ac7ea077b10ba96073d97fa", "siz...
from secret import twitter_instance from json import dump import sys tw = twitter_instance() # [1] response = tw.blocks.create(screen_name='showa_yojyo') # [2] dump(response, sys.stdout, ensure_ascii=False, indent=4, sort_keys=True)
{ "content_hash": "5c349df379fcdd09be0289725ed9376c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 72, "avg_line_length": 21.454545454545453, "alnum_prop": 0.7415254237288136, "repo_name": "showa-yojyo/notebook", "id": "258a497bc42b1e28cf08431a2d5dce1f971aeb85", "size": ...
import lx import lxifc # Item Events ITEM_ADD = 0 ITEM_DELETE = 1 ITEM_RENAME = 2 VALUE_CHANGED = 3 #---------------------------------------------------------------------------------------------------------------------- # SceneItemListener - Helper class #-----------------------------...
{ "content_hash": "62e388c00a6a4d482d993379260a3230", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 119, "avg_line_length": 22, "alnum_prop": 0.625, "repo_name": "tcrowson/Modo_LightBank", "id": "b207ec9db161fb55180f5b7c0e57b9ce81a35bbd", "size": "2513", "binary": fals...
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
{ "content_hash": "0a0c9ba3c829df498272024bc4b1a27c", "timestamp": "", "source": "github", "line_count": 1999, "max_line_length": 133, "avg_line_length": 43.42421210605303, "alnum_prop": 0.5706122919186682, "repo_name": "akaihola/django", "id": "7f331bfe7f837eab1596ff85d69b73dc3a6e1c71", "size": "86...
import widget import curses import traceback _stop = False _WindowWidget = None _cursorPos = (0,0) _cursorEnabled = False COLORPAIR_RED = 1 COLORPAIR_GREEN = 2 def _initColors(): curses.init_pair(COLORPAIR_RED, curses.COLOR_RED, curses.COLOR_BLACK) curses.init_pair(COLORPAIR_GREEN, curses.COLOR_GREEN, curses...
{ "content_hash": "84cc57fa5a78683dc73a748d0845eea9", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 77, "avg_line_length": 24.91025641025641, "alnum_prop": 0.6258363355635616, "repo_name": "thijsmie/madmin", "id": "39cfaa008f77889c6ca7b0b8a98dcc5ef0ac7438", "size": "1943"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "byte_orbit.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is ...
{ "content_hash": "9bbb1a893c594267da47c201b0537c27", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.42857142857143, "alnum_prop": 0.6208651399491094, "repo_name": "roansong/weatherapp", "id": "751b1762b0da5284393c267fc6630c731f0c8b19", "size": "8...
import json import re import os.path # BEGIN OPENSOURCE import sys sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)) # END OPENSOURCE import tmp.benchmarks_pb2 as benchmarks_pb2 __file_size_map = {} def __get_data_size(filename): if filename[0] != '/': filename = os.path.dirn...
{ "content_hash": "2cae16d990651cc3edc973fc2cdf32b9", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 118, "avg_line_length": 28.778523489932887, "alnum_prop": 0.5502565298507462, "repo_name": "endlessm/chromium-browser", "id": "b09f387a6b07abad782f56c617b359afa26b5c49", "...
import os import time from platformio import __accounts_api__, app from platformio.clients.http import HTTPClient, HTTPClientError from platformio.exception import PlatformioException class AccountError(PlatformioException): MESSAGE = "{0}" class AccountNotAuthorized(AccountError): MESSAGE = "You are not...
{ "content_hash": "74550ea236cca4ce82248bac5663ed52", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 86, "avg_line_length": 30.68421052631579, "alnum_prop": 0.5225843339050886, "repo_name": "platformio/platformio", "id": "2afe6fbe3da474a4d9ac80041b862549300f51df", "size":...
from blackbook.lib import collection_plus_json __author__ = 'ievans3024' class APIError(collection_plus_json.Error, BaseException): """ Wrapper class for API Errors May be raised as a python exception, i.e.: raise APIError() May be inserted into a collection_plus_json.Collection instance, i...
{ "content_hash": "453b73c89a061c6fb26e12ea8e923f4b", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 120, "avg_line_length": 36.99707602339181, "alnum_prop": 0.6005690350114598, "repo_name": "ievans3024/BlackBook", "id": "5247625dc193d492e5ee491119c60319436eb694", "size":...
""" Copyright (c) 2016 Alexandr Menkin
 Use of this source code is governed by an MIT-style license that can be
 found in the LICENSE file at https://github.com/sanchousic/diploma17-test-data-generation/blob/master/LICENSE This file contains a set of functions for work with blender's nodes. """ import bpy """ How d...
{ "content_hash": "78d0823eda0273193fa0bd7fdcb0315e", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 109, "avg_line_length": 36.277372262773724, "alnum_prop": 0.6704225352112676, "repo_name": "sanchousic/diploma17-test-data-generation", "id": "8046338059c8e4e23f688797cccb90...
from twisted.internet import reactor import goldenrod, config def execute(parser, bot, user, args): if not parser.checkPerms(bot, user, "owner") or not bot.isWhisperRequest(): return from goldenrod import channelInstances channelsIamIn = "I am in: " channelsIamIn += ", ".join(channel fo...
{ "content_hash": "be930d6f1c60bc5dcc5dbdc7bcc0995c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 29.235294117647058, "alnum_prop": 0.6720321931589537, "repo_name": "Dabomstew/goldenrod", "id": "e5c63d36124c014407ca92a268ffb96f9321d474", "size": "...
''' Make a signal mask and moment maps for the CO(2-1) data cube. ''' from cube_analysis import run_pipeline from paths import iram_co21_data_path # Find a signal mask and derive moment arrays run_pipeline(iram_co21_data_path("m33.co21_iram.fits"), iram_co21_data_path("", no_check=True), m...
{ "content_hash": "1b2649e95724ab87143e6af66b600d5b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 78, "avg_line_length": 35.23809523809524, "alnum_prop": 0.46621621621621623, "repo_name": "e-koch/VLA_Lband", "id": "bd383e5d7cba3d6bbdac9854d74b4975e6b05cc1", "size": "741...
from __future__ import absolute_import import six from sentry.tagstore.base import TagKeyStatus class TagType(object): def __repr__(self): return '<%s: %s>' % ( type(self).__name__, ', '.join('%s=%r' % (name, getattr(self, name)) for name in self.__slots__), ) def __...
{ "content_hash": "f2d9a7eeb96a0d6c2ead1d42c07c2480", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 99, "avg_line_length": 29.387596899224807, "alnum_prop": 0.5871801635452387, "repo_name": "ifduyue/sentry", "id": "a4d66887af35fec8a5c3b7d0840e480a5fd9219f", "size": "3791...
from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _, string_concat import datetime from .models import Ad class LatestAdFeed(Feed): title = _('Latest AGEPoly\'s classified ads') link = reverse('polyclassifieda...
{ "content_hash": "76564690c66d2215c1e49b37ebb4914c", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 151, "avg_line_length": 30.68421052631579, "alnum_prop": 0.6552315608919382, "repo_name": "PolyLAN/polyclassifiedads", "id": "4c681ee145ff5ce45572fda54ec213d461103e2b", "si...
import gc import os import sys import signal import weakref from cStringIO import StringIO import unittest @unittest.skipUnless(hasattr(os, 'kill'), "Test requires os.kill") @unittest.skipIf(sys.platform =="win32", "Test cannot run on Windows") @unittest.skipIf(sys.platform == 'freebsd6', "Test kills regrtest on f...
{ "content_hash": "2834f9cc72c89521be6000d05f96e5ec", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 96, "avg_line_length": 34.221830985915496, "alnum_prop": 0.6258874369791131, "repo_name": "slozier/ironpython2", "id": "850324a3a044c973dd04052522d5fc2c74c4998d", "size": ...
'''Common parsing rules relevant for all grammars. See accompanying docs for more information.''' from camkes.ast import Import, Include from .. import Exceptions def p_import_statement(t): '''import_statement : relative_import_statement | builtin_import_statement''' t[0] = t[1] def p...
{ "content_hash": "9f5e0000e2ca9384abb1ce109c434f3a", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 78, "avg_line_length": 29.321428571428573, "alnum_prop": 0.5477060495330898, "repo_name": "smaccm/camkes-tool", "id": "febde111e5756d436e502f8ecefbfb32832cc8ef", "size": "2...
source = '''# line 1 'A module docstring.' import sys, inspect # line 5 # line 7 def spam(a, b, c, d=3, (e, (f,))=(4, (5,)), *g, **h): eggs(b + d, c + f) # line 11 def eggs(x, y): "A docstring." global fr, st fr = inspect.currentframe() st = inspect.stack() p = x q = y / 0 # line 20 clas...
{ "content_hash": "a8163d2c6bb6b7ec82a2325793f6d329", "timestamp": "", "source": "github", "line_count": 425, "max_line_length": 76, "avg_line_length": 30.094117647058823, "alnum_prop": 0.6308053166536357, "repo_name": "MalloyPower/parsing-python", "id": "e3bf73a85c20b9c90a609c87d38308b879a6f4fd", "...
import os from unittest import mock from tacker.sol_refactored.common import exceptions as sol_ex from tacker.sol_refactored.common import vnfd_utils from tacker.sol_refactored.infra_drivers.kubernetes import helm from tacker.sol_refactored import objects from tacker.tests.unit import base CNF_SAMPLE_VNFD_ID = "b1bb...
{ "content_hash": "467c3f2862cf5bd7ccbbbc06691a5e4d", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 35.644067796610166, "alnum_prop": 0.6019971469329529, "repo_name": "openstack/tacker", "id": "53c291e0c46184662164e901abbaefde215a644b", "size": "276...
from psi.app.views.components import ReadonlyStringField from flask_admin.model import InlineFormAdmin from flask_babelex import lazy_gettext from psi.app.views.base import ModelViewWithAccess class PaymentMethodLineInlineAdmin(InlineFormAdmin): form_args = dict( account_name=dict(label=lazy_gettext('Acc...
{ "content_hash": "c64cd4514e78df0f7e01a3a6b97808f1", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 88, "avg_line_length": 39.8125, "alnum_prop": 0.6114599686028257, "repo_name": "betterlife/psi", "id": "2907e5acab72056d12757c920353ae6c6898d510", "size": "2563", "binary...
import itertools import numpy as np from ConfigSpace.forbidden import ForbiddenAndConjunction, ForbiddenEqualsClause from autosklearn.pipeline.constants import ( DENSE, INPUT, PREDICTIONS, SIGNED_DATA, SPARSE, UNSIGNED_DATA, ) def get_match_array(pipeline, dataset_properties, include=None, e...
{ "content_hash": "fbc6d7cfa33c94d58b62886dfc30c79b", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 88, "avg_line_length": 38.88, "alnum_prop": 0.5041152263374485, "repo_name": "automl/auto-sklearn", "id": "dff69acc6ee528dacde194a06da1e6ba0a9b07fa", "size": "11664", "b...
from setuptools import setup PACKAGE = 'timingandestimationplugin' setup(name='EduTracTimingAndEstimation', description='Plugin to make EduTrac support time estimation and tracking', keywords='trac plugin estimation timetracking', version='1.2.7b', url='http://www.trac-hacks.org/wiki/TimingAnd...
{ "content_hash": "dbb0d65ed0e784b4ceb3376af1e2020e", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 98, "avg_line_length": 29.054054054054053, "alnum_prop": 0.7037209302325581, "repo_name": "lexqt/EduTracTimingAndEstimation", "id": "27e2a877972da867dd42f11d86003946c22a6db0"...
fname='h:\\tmp.reg' import win32api, win32con, win32security, ntsecuritycon, pywintypes,os ## regsave will not overwrite a file if os.path.isfile(fname): os.remove(fname) new_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE_SECURITY_NAME),win32con.SE_PRIVILEGE_ENABLED), (win32...
{ "content_hash": "32ac5fde2ed7c8f6b1e62fddc8b34f1a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 115, "avg_line_length": 42.32432432432432, "alnum_prop": 0.768837803320562, "repo_name": "ntuecon/server", "id": "100451441381363f56b48350592e7be2819e8f4a", "size": "1566",...
from collections import namedtuple import configparser import hashlib import os import subprocess import sys Result = namedtuple("Result", ["returncode", "output"]) def git(*args, git_dir=None, capture_output=False, checked=True): # Avoid forgetting this arg. assert git_dir is None or os.path.isdir(git_dir) ...
{ "content_hash": "7d5c1566f4213108ae8d6a3cd04cb148", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 79, "avg_line_length": 35.01, "alnum_prop": 0.6428163381890888, "repo_name": "buildinspace/peru", "id": "4f1b9b6b7d74877d0ff67c49a4142193e569f71c", "size": "7027", "bina...
from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() from builtins import object import threading class TaskManager(object): """ Multi threading manager """ def __init__(self): """ Initializes a TaskManager """ self.threads =...
{ "content_hash": "4e9e9206aba93eb428984272d647e411", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 74, "avg_line_length": 25.27777777777778, "alnum_prop": 0.6032967032967033, "repo_name": "nuagenetworks/monolithe", "id": "852977666a0cd0be2b59ad7390397347c1355e8e", "size"...
"""Integration tests for the "client download" utility""" from __future__ import absolute_import import dtf.testutils as testutils import dtf.core.utils as utils class ClientDownloadTests(testutils.BasicIntegrationDeviceTest): """Wraper for integration tests""" def test_download(self): """Do an dow...
{ "content_hash": "729eb87b5b1deb771fc1c5741fa37135", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 25.22641509433962, "alnum_prop": 0.6260284218399401, "repo_name": "android-dtf/dtf", "id": "95a8ab61c1497abbbb3035490026f68567336377", "size": "1977"...
""" prune.py Remove people and organizations we definitely don't want to add to the graph. Takes in a CSV (input.csv) Creates a modified CSV (input_pruned.csv) Creats a log of what it rejected (pruned.csv) """ import unicodecsv import re import os.path import sys def prune(filename, type): ...
{ "content_hash": "ed0bfda35536a39434c360270f127f21", "timestamp": "", "source": "github", "line_count": 256, "max_line_length": 79, "avg_line_length": 31.92578125, "alnum_prop": 0.4826868958766671, "repo_name": "ec-geolink/d1lod", "id": "d230a12d305b4c836ab9c27d99d99f97b35fd1f3", "size": "8173", ...
''' Camera ====== Core class for acquiring the camera and converting its input into a :class:`~kivy.graphics.texture.Texture`. ''' __all__ = ('CameraBase', 'Camera') import sys from kivy.event import EventDispatcher from kivy.logger import Logger from kivy.core import core_select_lib class CameraBase(EventDispatc...
{ "content_hash": "0b5cbc122e5cf9ff6a01f670b5758961", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 76, "avg_line_length": 28.194244604316548, "alnum_prop": 0.5958152589946415, "repo_name": "5y/kivy", "id": "6e061e831859090c61a17b67afb1b349c4ccbedb", "size": "3919", "b...
from django.contrib.auth.models import AnonymousUser from django.contrib.sessions.middleware import SessionMiddleware from django.core.exceptions import ImproperlyConfigured from django.test import RequestFactory, TestCase class DummyStorage: def __init__(self): self.store = [] def add(self, level, m...
{ "content_hash": "932f547f89dd66a270b759561ec42c0d", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 29.367924528301888, "alnum_prop": 0.6209444265981369, "repo_name": "incuna/incuna-test-utils", "id": "bfd54d3ee6e2f3378fe0f8a01247afb276eb698e", "si...
from __future__ import absolute_import import abc import typing as tp from PIL import Image from applitools.utils import ABC, image_utils, argument_guard if tp.TYPE_CHECKING: from applitools.utils.custom_types import AnyWebElement, Num from applitools.selenium.frames import FrameChain from applitools.se...
{ "content_hash": "d9b3558f404d927749eb740db39d4596", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 96, "avg_line_length": 32.53472222222222, "alnum_prop": 0.6271077908217716, "repo_name": "applitools/eyes.selenium.python", "id": "3d516c1d53dd307921112641b3831c1ba12a3ed6",...
from gql import gql, Client from gql.transport.aiohttp import AIOHTTPTransport QUERY = gql(""" query ($username: String!, $after: String) { user(login: $username) { starredRepositories(first: 100, after: $after, orderBy: {direction: DESC, field: STARRED_AT}) { totalCount nodes { ...
{ "content_hash": "3b2da0436772362477f930e7e33b2010", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 152, "avg_line_length": 35.616279069767444, "alnum_prop": 0.5527260855370552, "repo_name": "maguowei/starred", "id": "b301917a7a89be422e298dc6a44b79cab6460c91", "size": "30...
import datetime import os import shutil import socket import sys import threading try: import docker from docker.errors import DockerException, APIError, InvalidVersion from girder_worker.docker import nvidia from requests.exceptions import ReadTimeout except ImportError: # These imports will not be...
{ "content_hash": "bab8972e8d4b0dd2ad5149b7824710f4", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 100, "avg_line_length": 36.67333333333333, "alnum_prop": 0.6105556565472944, "repo_name": "girder/girder_worker", "id": "b22a5b068b01c9782149db8179b5f8f94c92ec8d", "size":...
""" CPIncomp - Jorrit's collection of routines for fitting incompressible liquids ===== readme.md - General instructions and copyright information / credits. """ from __future__ import division, absolute_import, print_function import inspect from . import DataObjects,ExampleObjects,PureFluids,CoefficientFluids,...
{ "content_hash": "f07b0141f499499ea4fa9ca6c4483b74", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 115, "avg_line_length": 30.227544910179642, "alnum_prop": 0.6614500792393027, "repo_name": "JonWel/CoolProp", "id": "38438150f656035313dd7f45fc5c965e1bc72787", "size": "50...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ticketing', '0021_auto_20151222_1744'), ] operations = [ migrations.AlterField( model_name='order', name='email', ...
{ "content_hash": "9d349025921455b5cc66a22b2c85636d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 22.38888888888889, "alnum_prop": 0.6004962779156328, "repo_name": "tfiers/arenberg-online", "id": "57ff47f6d179fb0ddec6763f32049ea087333786", "size":...
def topological_sort_as_sets(dependency_graph): """ Variation of Kahn's algorithm (1962) that returns sets. Take a dependency graph as a dictionary of node => dependencies. Yield sets of items in topological order, where the first set contains all nodes without dependencies, and each following set...
{ "content_hash": "99de23df8f70c012ed7dac8f43243b4f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 35.46875, "alnum_prop": 0.6431718061674009, "repo_name": "ebar0n/django", "id": "e0a22c92362f738caec241cc9cf7808fc59c6544", "size": "1135", "binary...
from dataclasses import dataclass from typing import TYPE_CHECKING, Iterable, List import datahub.emitter.mce_builder as builder from datahub.ingestion.api.workunit import MetadataWorkUnit from datahub.ingestion.source.aws.sagemaker_processors.common import ( SagemakerSourceReport, ) from datahub.metadata.com.link...
{ "content_hash": "504cbddf253194a2e9928b1b2c2a7597", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 143, "avg_line_length": 37.04982206405694, "alnum_prop": 0.5839976947459418, "repo_name": "linkedin/WhereHows", "id": "381ab4ef88af8a5fb2dab37a67cbfc905230cf62", "size": "...
import copy import mock import six from rally.plugins.openstack.context.ceilometer import samples from rally.plugins.openstack.scenarios.ceilometer import utils as ceilo_utils from tests.unit import test CTX = "rally.plugins.openstack.context.ceilometer" class CeilometerSampleGeneratorTestCase(test.TestCase): ...
{ "content_hash": "b61ffcd7232d387c94da8c25f9db6625", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 78, "avg_line_length": 41.18881118881119, "alnum_prop": 0.5084889643463497, "repo_name": "group-policy/rally", "id": "93e5447f879351ff39be02983795488f56e7b20a", "size": "6...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/chemistry/shared_medpack_enhance_action_a.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "12b011f83269773120eb8c4c03dcc8f0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 24.46153846153846, "alnum_prop": 0.7012578616352201, "repo_name": "anhstudios/swganh", "id": "dea92fd2a692ff0d858b0863d4bf41a7d6805aad", "size": "463...
import sys import gc from pathlib import Path from datetime import datetime, timedelta import logging import numpy as np import ephem from astropy.table import Table, Column from astropy import stats from astroquery.vizier import Vizier ##------------------------------------------------------------------------- ## F...
{ "content_hash": "639c0f69d3d19dbfc3c8b462776ba42c", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 113, "avg_line_length": 44.03703703703704, "alnum_prop": 0.49184188393608075, "repo_name": "joshwalawender/IQMon", "id": "d07db0148215b8a374eaaf6ab035cc46b0fc1799", "size"...
import unittest from biicode.common.model.bii_type import CPP from biicode.common.model.cells import SimpleCell from biicode.common.edition.processors.deps_configuration import DependenciesConfigurationProcessor from biicode.common.model.brl.block_cell_name import BlockCellName from biicode.common.model.blob import Blo...
{ "content_hash": "faa142f22cbeea3f3ee1a7f8cd7bfad4", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 99, "avg_line_length": 46.8235294117647, "alnum_prop": 0.6670854271356784, "repo_name": "drodri/common", "id": "7aae2b443851703ad313d47d9558b3a4f16895ac", "size": "7960", ...
import typing as tp TIME_MODIFIERS = [ ('s', 1), ('m', 60), ('h', 60 * 60), ('d', 24 * 60 * 60), ('w', 7 * 24 * 60 * 60) ] def parse_time_string(s: tp.Union[int, float, str]) -> float: """ Parse a time string into seconds, so eg. '30m' will be equal to 1800, and so will be '30 min'. ...
{ "content_hash": "437ef6fcffcc380d4faa5b6050333438", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 85, "avg_line_length": 21.444444444444443, "alnum_prop": 0.5595854922279793, "repo_name": "piotrmaslanka/satella", "id": "329ac8636abaace5a8b519ed4abf8dad7a2397c9", "size":...
import random from tests.ggrc import TestCase from freezegun import freeze_time import os from mock import patch from ggrc import notification from ggrc.models import Person from tests.ggrc_workflows.generator import WorkflowsGenerator from tests.ggrc.api_helper import Api from tests.ggrc.generator import GgrcGenerat...
{ "content_hash": "682aba1bc215410fe86b70104dc75c54", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 67, "avg_line_length": 29.57758620689655, "alnum_prop": 0.6377149519090645, "repo_name": "uskudnik/ggrc-core", "id": "c7d39781cff0cadf6adaaa3f8cabb1897662ec1e", "size": "3...
import pytest pytestmark = [pytest.mark.asyncio, pytest.mark.needs_net] async def test_pagure(get_version): ver = await get_version("example", { "source": "pagure", "pagure": "nvchecker-test", }) assert ver == "0.2" async def test_pagure_with_ignored(get_version): ver = await get_versi...
{ "content_hash": "45970f54f724bcf3fa85de3bfab94964", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 57, "avg_line_length": 28.346153846153847, "alnum_prop": 0.5780189959294437, "repo_name": "lilydjwg/nvchecker", "id": "daeb966b8ffa547abbf5db973dc7b3394bed7c9a", "size": "8...
import sys from setuptools import setup import versioneer requirements = ['click >= 6.7', 'future >= 0.12.0', 'jinja2 >= 2.9', 'pyyaml >= 3.12', 'six'] if sys.version_info.major == 2: requirements.append('backports.functools_lru_cache >= 1.4') setup( name="conda-verify", version=versioneer.get_version(...
{ "content_hash": "5f6cd06a3c67e70be094b5c5328aa7f9", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 93, "avg_line_length": 28.214285714285715, "alnum_prop": 0.6544303797468355, "repo_name": "mandeep/conda-verify", "id": "6ebdcea568fcd1aaf122fe231fb27438b417a154", "size": ...
from conans import ConanFile class CatchConan(ConanFile): name = "Catch" version = "1.12.2" description = "A modern, C++-native, header-only, framework for unit-tests, TDD and BDD" author = "philsquared" generators = "cmake" exports_sources = "single_include/*" url = "https://github.com/ph...
{ "content_hash": "a4820f01cbc06e58795a3d3526d26bbc", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 92, "avg_line_length": 32.833333333333336, "alnum_prop": 0.6531302876480541, "repo_name": "ric2b/Vivaldi-browser", "id": "d5072afc00e4b0a247935a0ab74cc365a1afec26", "size":...
"""NApp responsible to update links detail and create a network topology."""
{ "content_hash": "7d0148874bac646db8e7f376e7aa8427", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 76, "avg_line_length": 77, "alnum_prop": 0.7662337662337663, "repo_name": "kytos/kyco-core-napps", "id": "f6b6db092affedc49b0506b0e6a7299771835866", "size": "77", "binary"...
from .character_span_instance import CharacterSpanInstance, IndexedCharacterSpanInstance from .mc_question_passage_instance import McQuestionPassageInstance, IndexedMcQuestionPassageInstance from .question_passage_instance import QuestionPassageInstance, IndexedQuestionPassageInstance
{ "content_hash": "7badbf6f66752aa67522d6ccfb36f183", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 101, "avg_line_length": 95.33333333333333, "alnum_prop": 0.9020979020979021, "repo_name": "allenai/deep_qa", "id": "140406d8a33d4aff1e62a485fe7fe9d73b64e9a1", "size": "286",...
import os # Configure the bind address _host = os.environ.get("GUNICORN_HOST", "0.0.0.0") _port = os.environ.get("GUNICORN_PORT", "8080") bind = os.environ.get("GUNICORN_BIND", '{}:{}'.format(_host, _port)) # Configure the workers workers = int(os.environ.get("GUNICORN_WORKERS", "2")) threads = int(os.environ.get("GU...
{ "content_hash": "80a67074ca26ea9df2c4998f36007852", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 98, "avg_line_length": 37.18181818181818, "alnum_prop": 0.6540342298288508, "repo_name": "ESGF/esgf-docker", "id": "28bd525b7cc343d3707b95758bc8084d3695e5f5", "size": "907"...
import time import logging from dockerevent import DockerEvent, InvalidDockerEventError from notifyable import Notifyable logger = logging.getLogger(__name__) class EventBroadcaster: def __init__(self): self.events_to_watch = ['die', 'stop', 'kill', 'start', 'health_status: healthy', 'health_status: un...
{ "content_hash": "6e4a9a55c0e097115edd1b2e5f1c7469", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 137, "avg_line_length": 43.68939393939394, "alnum_prop": 0.6330847927865442, "repo_name": "szyszy/dockermon", "id": "7cae83dc99d9fad062635093ad473eda48baeccb", "size": "57...
""" code from https://github.com/TyMaszWeb/django-template-finder """ import fnmatch import logging import os import re from django.conf import settings from django.utils.text import capfirst try: from importlib import import_module except ImportError: from django.utils.importlib import import_module try...
{ "content_hash": "ed2f7ca0a6f3b44b094fad3064581a6c", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 80, "avg_line_length": 36.5735294117647, "alnum_prop": 0.625653397667873, "repo_name": "amboycharlie/Child-Friendly-LCMS", "id": "b5005fb026d285f1257e979604eef82409f58522", ...
import warnings from sqlalchemy.test.testing import eq_, assert_raises, assert_raises_message from sqlalchemy import * from sqlalchemy import exc as sa_exc, util from sqlalchemy.orm import * from sqlalchemy.orm import exc as orm_exc from sqlalchemy.test import testing, engines from sqlalchemy.util import function_name...
{ "content_hash": "2be8db3313c73626d97c6193708e171b", "timestamp": "", "source": "github", "line_count": 1262, "max_line_length": 108, "avg_line_length": 33.401743264659274, "alnum_prop": 0.542262709652931, "repo_name": "simplegeo/sqlalchemy", "id": "2f9295e17e8170ef7de497d4475707d4e29ef404", "size"...
import os, sys, time folders = sys.argv[1:] nameWidth = max([len(f) for f in folders]) currSize = dict((x, 0) for x in folders) totalSize = dict((x, 0) for x in folders) maxSize = dict((x, 0) for x in folders) fmts = "%*s %13s%s %13s%s %13s%s" n = 0 while True: print fmts % (nameWidth, "directory", "curr siz...
{ "content_hash": "ddd676c1e1261ff4b77570cb59a49469", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 110, "avg_line_length": 38.94285714285714, "alnum_prop": 0.5077035950110051, "repo_name": "jskora/scratch-nifi", "id": "711514136e2189c7eab08f47b3c4152e26583164", "size": "...
""" Tests the h5py.File object. """ from __future__ import absolute_import import threading import h5py from ..common import ut, TestCase class TestErrorPrinting(TestCase): """ Verify the error printing is squashed in all threads. """ def test_printing(self): """ No console me...
{ "content_hash": "1363dfcfae62b7dd3e2228fc8e066334", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 83, "avg_line_length": 26.326923076923077, "alnum_prop": 0.5427319211102994, "repo_name": "ryfeus/lambda-packs", "id": "49e76d31803a6705063f87de0ff68aaf959eb784", "size": "...
import gen_utils from module_base import ModuleBase from module_mixins import NoConfigModuleMixin import module_utils import vtk import vtkdevide class greyReconstruct(NoConfigModuleMixin, ModuleBase): def __init__(self, module_manager): # initialise our base class ModuleBase.__init__(self, module_...
{ "content_hash": "c22d14d1cdc4711958a935bdbbe0738d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 74, "avg_line_length": 27.464788732394368, "alnum_prop": 0.6241025641025642, "repo_name": "chrisidefix/devide", "id": "8842acbc574af328ef1ebc4b7b4106d81c2281e1", "size": "1...
from .. import utilities def test_header_population_returns_list_of_dicts(): fake_headers = ['one', 'two', 'three'] populated = utilities.header_population(fake_headers) assert type(populated) == list assert type(populated[0]) == dict assert len(populated) == 3 def test_data_population_returns_l...
{ "content_hash": "0a9aa6c0afb743266abc896c98d54907", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 75, "avg_line_length": 33.84615384615385, "alnum_prop": 0.6261363636363636, "repo_name": "chrisseto/modular-file-renderer", "id": "021a3b1564dae833388f9ed662d2a2d02e717af4", ...
import mock from oslo_utils import uuidutils from neutron.agent.l3 import ha_router from neutron.tests import base _uuid = uuidutils.generate_uuid class TestBasicRouterOperations(base.BaseTestCase): def setUp(self): super(TestBasicRouterOperations, self).setUp() def _create_router(self, router=None...
{ "content_hash": "b46cd2fef35a02cf7d8768a84334ca95", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 78, "avg_line_length": 40.28333333333333, "alnum_prop": 0.5436491518411254, "repo_name": "sebrandon1/neutron", "id": "dc67327ce18c773e9b50353c8d606f5b53da5285", "size": "30...
from phycas.utilities.PhycasCommand import * from phycas.utilities.CommonFunctions import CommonFunctions from phycas.commands.CPOImpl import CPOImpl from phycas import mcmc class CPO(PhycasCommand): def __init__(self): args = (("patterns_only", False, "If True, each row of the sitelike output file will co...
{ "content_hash": "7383e091ebba49c7b4906714aaf07286", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 409, "avg_line_length": 48.77358490566038, "alnum_prop": 0.662669245647969, "repo_name": "plewis/phycas", "id": "5a212992c29927ffabda90a64b659a6843d0af5c", "size": "2585", ...
import base64 import string import urllib2 from lxml import etree from oslo_config import cfg from oslo_log import log as logging from cinder import context from cinder import exception from cinder.i18n import _LE, _LI, _LW from cinder.openstack.common import loopingcall from cinder.volume import driver from cinder.v...
{ "content_hash": "977980e2a76422329037f56790959592", "timestamp": "", "source": "github", "line_count": 1633, "max_line_length": 79, "avg_line_length": 41.78567054500918, "alnum_prop": 0.5513951579811244, "repo_name": "tmenjo/cinder-2015.1.0", "id": "c44f0ba4865df214913365d6cd517e4d20dc33a0", "size...
""" $description Turkish live TV channels from Dogus Group, including Euro Star, Star and NTV. $url eurostartv.com.tr $url kralmuzik.com.tr $url ntv.com.tr $url startv.com.tr $type live """ import re from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream....
{ "content_hash": "c702f0d1ac8173c37c5301ae5b78d1ab", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 95, "avg_line_length": 39.23076923076923, "alnum_prop": 0.6225490196078431, "repo_name": "chhe/streamlink", "id": "3664a1ecc546e829d20a60c7a3d51f959fd18995", "size": "2040"...
import requests def generate_html(top_lessons): rows = "" for lesson in top_lessons: rows += """<tr> <td><a href="https://stepik.org/lesson/{id}">{title}</a></td> <td>{viewed_by}</td> <td>{passed_by}</td> <td>{vote_delta}</td> </tr>""".format(**...
{ "content_hash": "d30fad30af01d0914556f5bdf0eed0b4", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 104, "avg_line_length": 25.23076923076923, "alnum_prop": 0.49390243902439024, "repo_name": "StepicOrg/Stepic-API", "id": "041a7908e05b22ed9d2adc23b52ede3ccd87d933", "size":...
"""Keras implementation of StableDiffusion. Credits: - Original implementation: https://github.com/CompVis/stable-diffusion - Initial TF/Keras port: https://github.com/divamgupta/stable-diffusion-tensorflow The current implementation is a rewrite of the initial TF/Keras port by Divam Gupta. """ import math import ...
{ "content_hash": "627f9fa34510e85131b7ca2fa1e9c11b", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 99, "avg_line_length": 40.62096774193548, "alnum_prop": 0.5986202104427238, "repo_name": "keras-team/keras-cv", "id": "73f5055051d3bb2d26950163c666ab0f991a45b4", "size": "...
""" Defines classes that can be used to build up a set of symbols similar to those of C# (namespace, type, method, property, etc.) that may be manipulated and subsequently emitted as C# source code. """ import sys import re import copy import itertools from odict import odict #========================================...
{ "content_hash": "952eca0c761e322e58b96681eae42eca", "timestamp": "", "source": "github", "line_count": 1004, "max_line_length": 173, "avg_line_length": 35.91434262948207, "alnum_prop": 0.49262299628376505, "repo_name": "mjp41/corert", "id": "991b469422eb12071eb9140456fd265063f27da2", "size": "3625...
import itertools from collections import defaultdict import logging from operator import mul import networkx as nx import numpy as np import pandas as pd from pgmpy.base import DirectedGraph from pgmpy.factors import TabularCPD, JointProbabilityDistribution, Factor from pgmpy.independencies import Independencies from...
{ "content_hash": "c82e197329372ca1894d57b7d1cf9ada", "timestamp": "", "source": "github", "line_count": 729, "max_line_length": 111, "avg_line_length": 37.79835390946502, "alnum_prop": 0.5126111413536564, "repo_name": "liquidmetal/pgmpy", "id": "95d8a5d0ba11816c68a5895af9f08b321f7c7beb", "size": "2...
"""Test configs for fill.""" import tensorflow.compat.v1 as tf from tensorflow.lite.testing.zip_test_utils import create_scalar_data from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests from tensorflow.lite.testing.zip_test_utils impo...
{ "content_hash": "8d9b6681983a222a2d34edcfcb632045", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 35.69047619047619, "alnum_prop": 0.6537691794529686, "repo_name": "Intel-Corporation/tensorflow", "id": "47fe75adafcaaf5c3a8b98aa9d3003ca1a811972", "...