text
stringlengths
4
1.02M
meta
dict
from ..config import mmtwfs_config from ..secondary import SecondaryFactory from ..custom_exceptions import WFSConfigException, WFSCommandException def test_secondaries(): for s in mmtwfs_config['secondary']: sec = SecondaryFactory(secondary=s, test="foo") assert(sec.test == "foo") def test_bogu...
{ "content_hash": "45e043abb0e49a98652265a7100e96ce", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 71, "avg_line_length": 22.370786516853933, "alnum_prop": 0.5951783023606229, "repo_name": "MMTObservatory/mmtwfs", "id": "39a08a5684202b93cad32cf7d80f02883235d7d1", "size":...
"""The internals for the unit of work system. The session's flush() process passes objects to a contextual object here, which assembles flush tasks based on mappers and their properties, organizes them in order of dependency, and executes. """ from . import attributes from . import exc as orm_exc from . import util ...
{ "content_hash": "8952857fb96f937a37533901df1cf063", "timestamp": "", "source": "github", "line_count": 777, "max_line_length": 79, "avg_line_length": 34.557271557271555, "alnum_prop": 0.5681352649808201, "repo_name": "monetate/sqlalchemy", "id": "f29d11bcd59b9969a7de2c863d122cf6d6dc59ea", "size": ...
__version__ = "1.6.1" from .TerminalNotifier import Notifier
{ "content_hash": "c5af612803ef248b718f2072a0e217b6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 38, "avg_line_length": 20.666666666666668, "alnum_prop": 0.7096774193548387, "repo_name": "dalimatt/Instastalk", "id": "d90298e7e0178e2f2092fab14aff0ad7692622e4", "size": "6...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scheduling', '0017_update_ui_type'), ] operations = [ migrations.RemoveField( model_name='alertevent', name='time_to_wait', ), migrations.AddField( ...
{ "content_hash": "b951120a57803e8e1f6d34bdf51f50eb", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 49, "avg_line_length": 23.571428571428573, "alnum_prop": 0.5535353535353535, "repo_name": "dimagi/commcare-hq", "id": "9b7ce972fe134926d41a445e812ac5235e9dd713", "size": "5...
from processing.actions.sendmessage import SendMessage from processing.pipelines.basepipeline import Pipeline class SendSparqlQueryResponse(Pipeline): """Pipeline that handles outgoing SPARQL-query responses""" name = 'SendSparqlQuery' description = 'Pipeline that handles outgoing SPARQL-query responses' ...
{ "content_hash": "582cb91059e3f08ed920f6e4416dfbbe", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 27.72222222222222, "alnum_prop": 0.7134268537074149, "repo_name": "onnovalkering/sparql-over-sms", "id": "66f210836687198b911d7454c3827b43768e5b82", ...
import optparse import sys from smimeX509validation import TrustAnchor import logging, logging.config import os.path from smimeX509validation import TrustStore, LoadDirChainOfTrust,smimeX509validation def main(): p = optparse.OptionParser() p.add_option('-m', '--message', action ='append', help='adds a...
{ "content_hash": "43d4148d9799c64df933ac2305f388d4", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 83, "avg_line_length": 35.31428571428572, "alnum_prop": 0.6545307443365695, "repo_name": "osynge/deb-python-smimex509validation", "id": "d4b844fa8bf97cf02abc4a1ea9eccfe8da2ca...
""" Defines standard features and rules. """ import b2.build.targets as targets import sys from b2.build import feature, property, virtual_target, generators, type, property_set, scanner from b2.util.utility import * from b2.util import path, regex, bjam_signature, is_iterable_typed import b2.tools.types from b2.mana...
{ "content_hash": "2f25686ab12c8f8a6d3da5e45c6d53b4", "timestamp": "", "source": "github", "line_count": 803, "max_line_length": 153, "avg_line_length": 41.60024906600249, "alnum_prop": 0.6153869181260291, "repo_name": "davehorton/drachtio-server", "id": "ecec2c9e3332fd3f1580762598262f46bceeeb84", "...
"""Test largefile support on system where this makes sense. """ import os import stat import sys import unittest from test.support import run_unittest, TESTFN, verbose, requires, \ unlink import io # C implementation of io import _pyio as pyio # Python implementation of io try: impo...
{ "content_hash": "d34edc587540480cf789d5d5177ea6ff", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 89, "avg_line_length": 38.427083333333336, "alnum_prop": 0.5612632149634047, "repo_name": "MalloyPower/parsing-python", "id": "1e868e059dc0fcdbf6a8a1634f0568f976a72b99", "...
import asyncio import inspect from collections import defaultdict, namedtuple from typing import Awaitable, Callable, Iterable, Mapping from aioworkers.core.base import LoggingEntity from aioworkers.net.web.exceptions import HttpException from .request import Request Route = namedtuple('Route', 'handler kwargs') c...
{ "content_hash": "57138172a1a6a29ab828ae300569784a", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 70, "avg_line_length": 33.608695652173914, "alnum_prop": 0.4884494548142672, "repo_name": "aamalev/aioworkers", "id": "850fc95849dd1b7c604dc34ec4ed018d1c03f528", "size": "...
import re import csv import ipaddress __version__ = 1.0 routes_key = {"C" : "Connected", "S" : "Static", "R" : "RIP", "B" : "BGP", "B*" : "BGP*", "D" : "EIGRP", "D*" : "EIGRP*", "D EX" : "EIGRP...
{ "content_hash": "86c297960f22284cc9471548b12e1555", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 139, "avg_line_length": 40.94117647058823, "alnum_prop": 0.43139367816091956, "repo_name": "abbacode/ciscorouteparser", "id": "821cfa0700fa86eeed6daaf70da6f99d8bdf4ef9", "...
"""Export metadata to YAML for Datasette.""" import argparse import logging import sys import coloredlogs from pudl.metadata.classes import DatasetteMetadata logger = logging.getLogger(__name__) def parse_command_line(argv): """Parse command line arguments. See the -h option. Args: argv (str): Co...
{ "content_hash": "94c282b663703c4dddc1244211c162aa", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 87, "avg_line_length": 25.510204081632654, "alnum_prop": 0.6624, "repo_name": "catalyst-cooperative/pudl", "id": "cb8f0a89df66b17b8d505371d2b0911b55d5a3d4", "size": "1250",...
from django.test import TestCase from django.utils import timezone from chords.models import Artist, Song from .helper_functions import create_artist, create_song, create_user class UserModelTests(TestCase): def test_cannot_bookmark_same_song_twice(self): """ User must not be able to bookmark the...
{ "content_hash": "d81fe3e7c245edb098ee97280f3b6f8b", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 78, "avg_line_length": 33.081761006289305, "alnum_prop": 0.6131178707224335, "repo_name": "Ilias95/guitarchords", "id": "c4efb0f24f563a9ec9202a5ee5febfb8df9b61be", "size":...
import base64 import json import logging from google.appengine.api import urlfetch from google.appengine.ext import ndb from consts.event_type import EventType from controllers.api.api_status_controller import ApiStatusController from datafeeds.datafeed_base import DatafeedBase from models.event_team import EventTea...
{ "content_hash": "d654a93402f400a99774c71e364a4f56", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 187, "avg_line_length": 50.81428571428572, "alnum_prop": 0.6363040014993909, "repo_name": "synth3tk/the-blue-alliance", "id": "483869f5a20bfd0e4f9996a7435bd84c6a923d72", "...
import csv import datetime import json import logging import urlparse from io import BytesIO from django.conf import settings from django.core.exceptions import ValidationError as DjangoValidationError from django.core.urlresolvers import reverse from django.core.validators import validate_ipv4_address, validate_ipv46...
{ "content_hash": "f0ba339ae69995350f2352465aea9474", "timestamp": "", "source": "github", "line_count": 1358, "max_line_length": 122, "avg_line_length": 39.57216494845361, "alnum_prop": 0.5661065520385568, "repo_name": "dreardon/crits", "id": "2a0dba3321b579db03bcdc7c33e292487a39d093", "size": "537...
from cvars.public import PublicConVar from plugins.info import PluginInfo info = PluginInfo() info.name = "KillerInfo" info.basename = 'killerinfo' info.author = 'Luka "craziest" Volovec' info.version = '0.1' info.variable = 'killerinfo_version' info.convar = PublicConVar( info.variable, info.version, "{} version...
{ "content_hash": "f208516db61c849cce55bfd164a67805", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 64, "avg_line_length": 28.285714285714285, "alnum_prop": 0.7474747474747475, "repo_name": "craziest/sp-killerinfo", "id": "1df76e17282fabcd52ac0593fdfc4d2d786f796a", "size"...
from ansible.cache.base import BaseCacheModule class CacheModule(BaseCacheModule): def __init__(self, *args, **kwargs): self._cache = {} def get(self, key): return self._cache.get(key) def set(self, key, value): self._cache[key] = value def keys(self): return self._c...
{ "content_hash": "7de58577fba225273859c15a1ff09ccf", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 46, "avg_line_length": 20.555555555555557, "alnum_prop": 0.5783783783783784, "repo_name": "mith1979/ansible_automation", "id": "735ed32893e035647993eaa50762593e6c12a45d", "...
""" This is the main module in vnc_cfg_api_server package. It manages interaction between http/rest, address management, authentication and database interfaces. """ from gevent import monkey monkey.patch_all() from gevent import hub # from neutron plugin to api server, the request URL could be large. # fix the const ...
{ "content_hash": "d5caf1c5e8b612f7021d928ddefb8ad4", "timestamp": "", "source": "github", "line_count": 3500, "max_line_length": 119, "avg_line_length": 41.46, "alnum_prop": 0.5487009854593067, "repo_name": "tcpcloud/contrail-controller", "id": "98d32e81b0148a265dab33bb81d847e8f3cf15cb", "size": "1...
from pymongo import MongoClient import pymongo.errors import config class Writer(object): """Storage Reader Object""" def __init__(self, doc_type=None): super(Writer, self).__init__() self.db_name = config.db_name self.doc_type = doc_type # self.conn = motor.motor_asyncio.As...
{ "content_hash": "89179d3151e2c429bcd3eb1874504653", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 29.10576923076923, "alnum_prop": 0.5189957053187975, "repo_name": "cloudconsole/cloudconsole", "id": "76982b05964995e156a30938ac96578195dd5430", "si...
"""Emacs and Flymake compatible Pylint. This script is for integration with emacs and is compatible with flymake mode. epylint walks out of python packages before invoking pylint. This avoids reporting import errors that occur when a module within a package uses the absolute import path to get another module within t...
{ "content_hash": "682930364052aa99d562783b54b73324", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 96, "avg_line_length": 36.34228187919463, "alnum_prop": 0.6513388734995383, "repo_name": "yongshengwang/hue", "id": "db2ed82f19b027dd2a9175406e6eea85770f883c", "size": "63...
from collections import Callable from enum import Enum from .freezing import freeze_data, unfreeze_data from .protocols import DEFAULT_PROTOCOL __REGISTRY__ = {} class OperationType(Enum): INSERTION = 'insert' DELETION = 'delete' REPLACEMENT = 'replace' class OperationMetaclass(type(Callable)): d...
{ "content_hash": "7427079de9dbf4228b59056e778a9c6e", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 76, "avg_line_length": 28.36082474226804, "alnum_prop": 0.5826972010178118, "repo_name": "szopu/datadiffs", "id": "f24939de203090f2db2a7c6baf5b270ae62c118d", "size": "5502...
import os import sys from telemetry import benchmark from telemetry.core import util from telemetry.core import wpr_modes from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module from telemetry.page import page_test from telemetry.page import record_wpr from telemetry.unitt...
{ "content_hash": "eb900b91749add74acb1ecb70af816ea", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 80, "avg_line_length": 39.24193548387097, "alnum_prop": 0.6928346348814907, "repo_name": "ondra-novak/chromium.src", "id": "85d60da4d4924bd2f0deb7a4ab4285f12979b5f7", "siz...
from functools import singledispatch from llvmlite.llvmpy.core import Type, Constant from numba.core import types, typing, cgutils from numba.core.imputils import Registry from numba.cuda import nvvmutils registry = Registry() lower = registry.lower voidptr = Type.pointer(Type.int(8)) # NOTE: we don't use @lower ...
{ "content_hash": "404c51820160dd1b3710afc0f4d70e80", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 32.54430379746835, "alnum_prop": 0.6938934266822249, "repo_name": "sklam/numba", "id": "03cc9144e5d2bb2f53ce8053c45ed828347704ea", "size": "2571", ...
from typing import Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from goog...
{ "content_hash": "279a92fd813733ee70a782d15d04854e", "timestamp": "", "source": "github", "line_count": 377, "max_line_length": 101, "avg_line_length": 43.824933687002655, "alnum_prop": 0.6171165718436025, "repo_name": "googleapis/google-cloud-python", "id": "af4734dc9c87a2acec1fafc89fe74a0f68a4e88a"...
import logging import os import pytest from funcy import first from voluptuous import MultipleInvalid, Schema from dvc.ignore import _no_match from dvc.output import CHECKSUM_SCHEMA, Output from dvc.stage import Stage def test_save_missing(dvc, mocker): stage = Stage(dvc) out = Output(stage, "path", cache=F...
{ "content_hash": "e43c54fb75f4a06e56f0bd45554a8b19", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 79, "avg_line_length": 32.794117647058826, "alnum_prop": 0.6017937219730942, "repo_name": "dmpetrov/dataversioncontrol", "id": "46e892b18997654cf885843f485a90cb5443488f", ...
from xml.sax.handler import ContentHandler from xml.sax.xmlreader import Locator import sys import xml.sax import xml.sax.handler class AimlParserError(Exception): pass class AimlHandler(ContentHandler): # The legal states of the AIML parser _STATE_OutsideAiml = 0 _STATE_InsideAiml = 1 _STATE_I...
{ "content_hash": "5462d22310d88ccd107bdbbea3a0d30a", "timestamp": "", "source": "github", "line_count": 546, "max_line_length": 121, "avg_line_length": 43.85164835164835, "alnum_prop": 0.658898216597753, "repo_name": "jstnhuang/chatbot", "id": "d54c6932f494e9cb3e422b1a5b8d906559fc83f8", "size": "23...
from enum import Enum class PageErrorCode(Enum): GRAPHQL_ERROR = "graphql_error" INVALID = "invalid" NOT_FOUND = "not_found" REQUIRED = "required" UNIQUE = "unique" DUPLICATED_INPUT_ITEM = "duplicated_input_item" ATTRIBUTE_ALREADY_ASSIGNED = "attribute_already_assigned"
{ "content_hash": "04dc1cb76a6894ccdf3d14315fe8c673", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 27.363636363636363, "alnum_prop": 0.6910299003322259, "repo_name": "mociepka/saleor", "id": "06eac6a48589df1d9439fb787bebadf9ee6df7fa", "size": "301"...
import atexit import sys import logging import os import pickle import socket import string from cybld import cybld_helpers from cybld.cybld_command_handler import CyBldCommandHandler from cybld.cybld_config_command_group import CyBldConfigCommandGroup from cybld.cybld_config_settings import CyBldConfigSettings from c...
{ "content_hash": "05ecd1f47389d4ff92c000c8d14ef412", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 91, "avg_line_length": 40.38157894736842, "alnum_prop": 0.5804822417725644, "repo_name": "dcvetko/cybld", "id": "89c8b6b11299b84ab8882762ab55dd3fdb7daf52", "size": "6330",...
from flask import Flask from coh2stats.dao import DAO from coh2stats.config import Config from coh2stats.config import schedule from coh2stats.weeklystats.tasks import * from coh2stats.personalstats.tasks import * dao = DAO() def create_app(): app = Flask(__name__, static_folder='assets') from coh2stats.wee...
{ "content_hash": "02b4819cfd06faadd990cb774d724f46", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 50, "avg_line_length": 23.470588235294116, "alnum_prop": 0.7619047619047619, "repo_name": "ZEDGR/coh2stats", "id": "d9f06c5aca79f36afd028fa6253d3a0e474aa03d", "size": "399"...
""" Single interface for code that varies across Python environments. """ from builtins import zip from builtins import next import inspect import sys # backport of inspect.getcallargs from 2.7 def getcallargs(func, *positional, **named): """Get the mapping of arguments to values. A dict is returned, with k...
{ "content_hash": "23d1caa31c36dc2cedd579fa8f053c97", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 80, "avg_line_length": 38.8421052631579, "alnum_prop": 0.570189701897019, "repo_name": "venmo/btnamespace", "id": "0e81810f8d78c05d47706a468a4be7e45086d5b8", "size": "3690"...
"""Utility functions for providing data directories.""" import os import sys import zipfile import rarfile from urllib.request import FancyURLopener import shutil import numpy as np import matplotlib.image as mpimg class Data(): # Should be a list containing all subdirectories of the main data dir which # be...
{ "content_hash": "ec16e38353aa6299e44160f51e12d1db", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 98, "avg_line_length": 35.90845070422535, "alnum_prop": 0.5465777603451657, "repo_name": "simonmeister/UnFlow", "id": "f4715b2327d6b14f26b307cbde250f3a11afa9fc", "size": "...
from potatoes.vector import Vector import math class Circle: @staticmethod def collision(circle1, circle2): diff = circle1._pos - circle2._pos return diff.magnitude <= circle1.rad + circle2.rad def __init__(self, pos, radius): self._pos = pos self.rad = radius def upda...
{ "content_hash": "893fe9fb476f2d68cb0f787fe1fc74b8", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 79, "avg_line_length": 33.63076923076923, "alnum_prop": 0.5699908508691675, "repo_name": "RSteyn/Potatoes", "id": "006087f2465d3613a4b3f09c41caf9696e4b8f87", "size": "4372...
import serial from platformio.commands.device import DeviceMonitorFilter class Hexlify(DeviceMonitorFilter): NAME = "hexlify" def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._counter = 0 def rx(self, text): result = "" for b in serial.iterbyte...
{ "content_hash": "0fcd9a9fe47795760eb3faad6aa59bd7", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 61, "avg_line_length": 27.25, "alnum_prop": 0.5061162079510704, "repo_name": "platformio/platformio", "id": "7b7538b5f68c5b4c6998f3c9b24214781e6cff20", "size": "1265", "b...
""" command to speak to a socket """ import os import sys import getopt import yaml import json import socketalk import getpass CONFIG_FILE="speak.yaml" def speak(message): if not os.path.exists(CONFIG_FILE): sys.exit("Error: Can not exists %s" % CONFIG_FILE) with open(CONFIG_FILE, 'r') as f: ...
{ "content_hash": "92d08b4809a9db443886c0b0ad2f1e47", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 72, "avg_line_length": 23.476923076923075, "alnum_prop": 0.5373525557011796, "repo_name": "suitai/work-py", "id": "d13dd87ce3da19bd5c5bcbf67b76d4606bacd65e", "size": "1548"...
from __future__ import absolute_import, print_function import errno import json import logging import os import shutil import sys import warnings from shutil import rmtree as _rmtree import pytest import requests from pipenv._compat import Path from pipenv.exceptions import VirtualenvActivationException from pipenv...
{ "content_hash": "84cb9ffa3154a23e09c4bef70c6f29a9", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 108, "avg_line_length": 34.75591985428051, "alnum_prop": 0.6074105130758346, "repo_name": "kennethreitz/pipenv", "id": "20374e013cbdbcf3e04fa90c51a577becf114739", "size": ...
"""Define row constructs including :class:`.Row`.""" import operator from .. import util from ..sql import util as sql_util from ..util.compat import collections_abc MD_INDEX = 0 # integer index in cursor.description # This reconstructor is necessary so that pickles with the C extension or # without use the same...
{ "content_hash": "3428201aeb834289ae529381a42bcacf", "timestamp": "", "source": "github", "line_count": 493, "max_line_length": 80, "avg_line_length": 30.04259634888438, "alnum_prop": 0.5866585645803795, "repo_name": "jam-py/jam-py", "id": "b58b350e25a7f4ff2f4bbbd4ba6b5c507c0afb31", "size": "15045"...
""" .. module:: lesscpy.plib :synopsis: Parse Nodes for Lesscpy Copyright (c) See LICENSE for details. .. moduleauthor:: Johann T. Mariusson <jtm@robot.is> """ __all__ = [ 'Block', 'Call', 'Deferred', 'Expression', 'Identifier', 'Mixin', 'Node', 'Property', 'Statement', ...
{ "content_hash": "1564b49b6a5682d8d5468a73f551e381", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 52, "avg_line_length": 20.9375, "alnum_prop": 0.682089552238806, "repo_name": "neumerance/cloudloon2", "id": "fe6d5fe4a868da5b228e75e97da517ccd46db268", "size": "693", "b...
from docutils.parsers.rst import Directive, directives from docutils import nodes from string import upper class configurationblock(nodes.General, nodes.Element): pass class ConfigurationBlock(Directive): has_content = True required_arguments = 0 optional_arguments = 0 final_argument_whitespace = ...
{ "content_hash": "0e650ec4b661d491b31c9513044ffffc", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 108, "avg_line_length": 33.23287671232877, "alnum_prop": 0.5869744435284419, "repo_name": "DionPieters/Symfony", "id": "1f99687c37558729571fcd634cf0befdcde664ed", "size": "...
import jpype class ParserError(Exception): def __init__(self, *args, **margs): Exception.__init__(self, *args,**margs) stanford_parser_classpath = None def startJvm(): import os os.environ.setdefault("STANFORD_PARSER_CLASSPATH", "/usr/stanford-parser/stanford-parser.jar:/usr/stanford-parser/stanf...
{ "content_hash": "b59e3d3af9e0859efcc3a0c7a61e5139", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 152, "avg_line_length": 39.214285714285715, "alnum_prop": 0.6342440801457195, "repo_name": "kahitomi/Stanford-parser-Python-Chniese", "id": "99794463de6b7c97267fc75190a2ead17...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'RegistrationProfile' db.create_table('registration_registrationprofile', ( ('id', self.gf('djang...
{ "content_hash": "9698e077acf7ddddba92e782e91c822a", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 182, "avg_line_length": 62.42857142857143, "alnum_prop": 0.5665903890160183, "repo_name": "bruth/django-registration2", "id": "39f32cb245dee5e615820ab2298088f8f73e2d37", "s...
from distutils.version import LooseVersion import warnings import tensorflow as tf from tensorflow_recommenders_addons.version import MIN_TF_VERSION from tensorflow_recommenders_addons.version import MAX_TF_VERSION def _check_tf_version(): """Warn the user if the version of TensorFlow used is not supported. ...
{ "content_hash": "51d02c633d5995e831dee630ce9e3af4", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 93, "avg_line_length": 39.833333333333336, "alnum_prop": 0.6940376569037657, "repo_name": "tensorflow/recommenders-addons", "id": "74c9c1fe4a6d1f2f5a09d61bc64b74ab8674a1b5", ...
import logging from os import environ as env from . import logship from . import logstamp from . import logtag from . import logtext __all__ = ['logship', 'logstamp', 'logtag', 'logtext'] _log_level_default = logging.INFO _log_level = getattr(logging, env.get('TAGALOG_LOGLEVEL', '').upper(), _log_level_default) log...
{ "content_hash": "889c79a6ab1f4c61a225099efeb625cc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 90, "avg_line_length": 28, "alnum_prop": 0.7142857142857143, "repo_name": "alphagov/tagalog", "id": "44a6e81e1f824c7b8a6aebf3e0815d86be006985", "size": "392", "binary": f...
"""Test bitcoind with different proxy configuration. Test plan: - Start bitcoind's with different proxy configurations - Use addnode to initiate connections - Verify that proxies are connected to, and the right connection command is given - Proxy configurations to test on bitcoind side: - `-proxy` (proxy everythin...
{ "content_hash": "a4ccc74f97697d58b3d0806ccdc30a59", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 121, "avg_line_length": 41.27918781725889, "alnum_prop": 0.6083374323659616, "repo_name": "maaku/bitcoin", "id": "2eb1be47a53a5d1f153ef77ff4ec914f6104ff2e", "size": "8346"...
import json import unittest from django.test import SimpleTestCase, TestCase from django.urls import reverse from django.utils import translation from wagtail.blocks.field_block import FieldBlockAdapter from wagtail.contrib.table_block.blocks import DEFAULT_TABLE_OPTIONS, TableBlock from wagtail.models import Page fr...
{ "content_hash": "6a5c0f75ed6ac60b0add770f93d6d54b", "timestamp": "", "source": "github", "line_count": 535, "max_line_length": 141, "avg_line_length": 35.05607476635514, "alnum_prop": 0.5118635030658492, "repo_name": "rsalmaso/wagtail", "id": "1c302fdaa0df851920f3f402b5367aac7252ff5e", "size": "18...
from django.contrib.auth.models import User from django.test import TestCase from volunteers.models import Volunteer, Task, Shift, Preference, VolunteerShift, VolunteerUnavailability, \ VolunteerPresence class VolunteerTestCase(TestCase): def setUp(self): self.user = User.objects.create_user(usernam...
{ "content_hash": "7666648c2757bee8953f5d12d439ec85", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 120, "avg_line_length": 50, "alnum_prop": 0.6288461538461538, "repo_name": "NBajanca/django-non-profit", "id": "78b97a14ed071f5c34da4e325e80c5ff4e7ad19d", "size": "2614", ...
"""The blocking connection adapter module implements blocking semantics on top of Pika's core AMQP driver. While most of the asynchronous expectations are removed when using the blocking connection adapter, it attempts to remain true to the asynchronous RPC nature of the AMQP protocol, supporting server sent RPC comman...
{ "content_hash": "17d41fceacd27b176212b03fdcfc20e2", "timestamp": "", "source": "github", "line_count": 2477, "max_line_length": 93, "avg_line_length": 40.828017763423496, "alnum_prop": 0.605284235298771, "repo_name": "jstnlef/pika", "id": "09051dae61312b7501faf2ebd1776a4fee0b762d", "size": "101131...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'DatabaseUpgrade.source_plan_name' db.add_column(u'maintenance_databaseupgrade', '...
{ "content_hash": "d9adddeb0e20c30a9c7b8f28b22f4f61", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 227, "avg_line_length": 94.05405405405405, "alnum_prop": 0.5709106984969053, "repo_name": "globocom/database-as-a-service", "id": "67a4f610c5271bb5aaa8fc19f079634e59a09f78",...
import _plotly_utils.basevalidators class PlacementValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="placement", parent_name="layout.mapbox.layer.symbol", **kwargs ): super(PlacementValidator, self).__init__( plotl...
{ "content_hash": "100d61d30d483bd4559c292ccb16de7c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 32.388888888888886, "alnum_prop": 0.5728987993138936, "repo_name": "plotly/python-api", "id": "06cc0216f4ef6ac9dd4f422d02d544d7e70632ad", "size": "58...
"""Tests that HTML generation is awesome.""" import os.path, re, sys import coverage import coverage.html from coverage.misc import CoverageException, NotPython, NoSource from tests.coveragetest import CoverageTest class HtmlTestHelpers(CoverageTest): """Methods that help with HTML tests.""" def create_init...
{ "content_hash": "5516bd3e4d617fc0f4777bc5e6a2935a", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 79, "avg_line_length": 38.53521126760563, "alnum_prop": 0.5942251461988304, "repo_name": "I-Valchev/UrPas", "id": "06132fb46514e85a162ea9eea93066ad387dc795", "size": "1372...
import discord from discord.ext import commands import asyncio import html import logging import sys import traceback from more_itertools import chunked import tweepy import tweepy.asynchronous from utilities import checks errors_logger = logging.getLogger("errors") async def setup(bot): await bot.add_cog(Twitter...
{ "content_hash": "277ec56d93e0beb46f4cda25ba21914d", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 120, "avg_line_length": 30.05974025974026, "alnum_prop": 0.6732048734122527, "repo_name": "Harmon758/Harmonbot", "id": "55a7faff23eacfb724f7f11548bf70656f7c0be7", "size": ...
""" ====================== GeoIP2 Database Reader ====================== """ import inspect import geoip2 import geoip2.models import geoip2.errors import maxminddb # pylint: disable=unused-import from maxminddb import (MODE_AUTO, MODE_MMAP, MODE_MMAP_EXT, MODE_FILE, MODE_MEMORY) class Reade...
{ "content_hash": "95d77febc2c7d65d222766dfcbaa5921", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 78, "avg_line_length": 35.3903743315508, "alnum_prop": 0.6030522816560895, "repo_name": "simudream/GeoIP2-python", "id": "18fe1e58365224d20314be46ebeeae9f73f8b274", "size"...
from functools import partial from json import dumps, loads from collections import defaultdict from tornado.web import authenticated from qiita_core.qiita_settings import qiita_config from qiita_core.util import execute_as_transaction from qiita_core.qiita_settings import r_client from qiita_pet.handlers.base_handle...
{ "content_hash": "1a414e70f72a835abceff2004cecb73f", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 39.57142857142857, "alnum_prop": 0.6191335740072202, "repo_name": "ElDeveloper/qiita", "id": "c92b3af0ce0593a75923521ef1550a44bcd0e4a4", "size": "47...
__author__ = 'ksen' import os from mutagen.easyid3 import EasyID3 def update(): import argparse parser = argparse.ArgumentParser() parser.add_argument('arguments', metavar='args', type=str, nargs=2, help='1. Path to music directory, 2. Text which sets into album') ...
{ "content_hash": "e93f95370bb1dabad019e933801cde77", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 89, "avg_line_length": 25.818181818181817, "alnum_prop": 0.5845070422535211, "repo_name": "HrundelB/radio-jam", "id": "5f8c9bebb8dcae52bce348162d105fdd49a146a4", "size": "6...
from .base import AppTemplate class BalancedDocs(AppTemplate): """Balanced docs""" ENV = 'misc' CHEF_RECIPE = 'balanced-docs' STACK_TAG = 'docs' PUBLIC = True def elb(self): """Load balancer for BalancedDocs.""" elb = super(BalancedDocs, self).elb() elb['HealthUrl'] =...
{ "content_hash": "b5646a5c789be25fc33c2663b568c60e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 60, "avg_line_length": 22.857142857142858, "alnum_prop": 0.5854166666666667, "repo_name": "coderanger/brix", "id": "d76be34a3f6597a596ee189792a068b158ab5eee", "size": "1111...
from __future__ import print_function, division, unicode_literals, absolute_import import os.path as op def get_flirt_schedule(name): if name == 'ecc': return op.abspath(op.join(op.dirname(__file__), 'ecc.sch')) elif name == 'hmc': return op.abspath(op.join(op.dirnam...
{ "content_hash": "2c32860cf443a4a99457c654489f46c8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 82, "avg_line_length": 31.571428571428573, "alnum_prop": 0.5678733031674208, "repo_name": "carolFrohlich/nipype", "id": "390dbe81f393ec3c0a313d29d644c0dca39204c6", "size": ...
from tools.load import LoadMatrix from sg import sg lm=LoadMatrix() traindna=lm.load_dna('../data/fm_train_dna.dat') testdna=lm.load_dna('../data/fm_test_dna.dat') trainlabel=lm.load_labels('../data/label_train_dna.dat') parameter_list=[[traindna,testdna,trainlabel,10,3,0,'n',False,'FULL'], [traindna,testdna,trainla...
{ "content_hash": "bfb7f7e9f6c7453583650cd770982fbe", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 89, "avg_line_length": 37.9375, "alnum_prop": 0.6836902800658978, "repo_name": "Saurabh7/shogun", "id": "d8c4cd45b3d983715edb2a5f13d3de6ef69a4b25", "size": "1214", "binar...
from flask import Flask, render_template, request, jsonify from flask_restful import Resource, Api from random import choice import itertools import random import numpy import json import pandas import pickle import re # SERVER CONFIGURATION ############################################## class BodyMapServer(Flask): ...
{ "content_hash": "a7efe82c6f4f57d376fbaac8096e7518", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 109, "avg_line_length": 40.47540983606557, "alnum_prop": 0.5805319292561091, "repo_name": "vsoch/bodymap", "id": "98c7abebd873e71f2f887d764ccd91b71daf52e3", "size": "7407"...
from django.conf import settings from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('analytics', '0006_add_subgroup_to_unique_constraints'), ] operations = [ migrations.AlterUniqueTogether( name='installationcount', unique_tog...
{ "content_hash": "493db9c0cad7c8cc1a69da12d863bdc0", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 82, "avg_line_length": 30.767441860465116, "alnum_prop": 0.546485260770975, "repo_name": "dhcrzf/zulip", "id": "6b114e1527cdd11f60d9748d0cf34c14d7213ada", "size": "1396", ...
from setuptools import setup, find_packages __version__ = 'undefined' exec(open('ipylayoutwidgets/version.py').read()) with open('README.md') as f: readme = f.read() setup( name='ipylayoutwidgets', version=__version__, description='A collection of IPython widgets to position.size other widgets', ...
{ "content_hash": "0aba99a66aad826bda1b65e189224716", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 81, "avg_line_length": 28.59090909090909, "alnum_prop": 0.6947535771065183, "repo_name": "openseat/ipylayoutwidgets", "id": "2f619370536b7374bc0111c4733a3b783aebd752", "siz...
from msrest.serialization import Model class RecentJob(Model): """Information about the most recent job to run under the job schedule. :param id: The ID of the job. :type id: str :param url: The URL of the job. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'st...
{ "content_hash": "0e10d1efcd30f270d79de0f38108d7f4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 24.142857142857142, "alnum_prop": 0.5443786982248521, "repo_name": "lmazuel/azure-sdk-for-python", "id": "f4aa8661a8a41fdfa1d68577c3574adb7ab464ca", ...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "770782375ad34dac0a4ed3e4d1c1fd2b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 174, "avg_line_length": 39.142857142857146, "alnum_prop": 0.7153284671532847, "repo_name": "antoinecarme/pyaf", "id": "d0017aaca5a2584d0610e73f33b7a1a755cf4398", "size": "27...
""" Module for working with Load Balancers """ __all__ = ["base", "providers", "types", "drivers"]
{ "content_hash": "efde47c897e1de63bf729c4b9dd0dcba", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 51, "avg_line_length": 20, "alnum_prop": 0.61, "repo_name": "apache/libcloud", "id": "ec6c80c61271cb0c56c01f85d4bb7b8327f06e25", "size": "882", "binary": false, "copies"...
"""End-to-End tests for CIFuzz.""" import os import unittest import run_cifuzz import test_helpers CIFUZZ_DIR = os.path.dirname(os.path.abspath(__file__)) EXTERNAL_PROJECT_PATH = os.path.join(CIFUZZ_DIR, 'test_data', 'external-project') # This test will fail if not run as root b...
{ "content_hash": "c5e31e4473f9ac4ccbdae42df1fe604e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 36.17142857142857, "alnum_prop": 0.6800947867298578, "repo_name": "skia-dev/oss-fuzz", "id": "30e28beda330c621ac3a0f5b9d1ee2dc11a5e463", "size": "184...
import json from django.core.urlresolvers import resolve from django.http import HttpRequest from django.http import QueryDict from django.test import TestCase from django.test import Client from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout from django.contrib.auth....
{ "content_hash": "268fb8354e7006b255307b82542dcd8b", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 77, "avg_line_length": 35.82941176470588, "alnum_prop": 0.5956329010014776, "repo_name": "AcademicsToday/academicstoday-django", "id": "d35c95fb58041a35e01026ea9e3c733d39541...
from test_framework.test_framework import DeuscoinTestFramework from test_framework.util import * # Create one-input, one-output, no-fee transaction: class MempoolCoinbaseTest(DeuscoinTestFramework): alert_filename = None # Set by setup_network def setup_network(self): args = ["-checkmempool", "-deb...
{ "content_hash": "400bc5d8dafa857e4f51a41b3acb74ef", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 119, "avg_line_length": 45.77894736842105, "alnum_prop": 0.6449758565187399, "repo_name": "deuscoin-org/deuscoin-core", "id": "0a852b78d4ff03af3cdc624fcf908b7ff35a2e75", "s...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="pie.hoverlabel.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
{ "content_hash": "a1a18b0de59b8c641c4d123a63258a4d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 33.357142857142854, "alnum_prop": 0.5931477516059958, "repo_name": "plotly/plotly.py", "id": "cee4bff0cd94c90f39f9342d774af53fd77c46ce", "size": "467...
from __future__ import print_function import sys import textwrap from pyspark.sql import SparkSession from pyspark.sql.functions import col, lit, coalesce, concat, concat_ws, regexp_replace, udf if __name__ == "__main__": if len(sys.argv) != 4: print("Usage: trove-load.py <input json> <api json> <output ...
{ "content_hash": "dcc45ef885bce54873ce3c38fcd1f3ac", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 95, "avg_line_length": 41.509803921568626, "alnum_prop": 0.49031648559282004, "repo_name": "ViralTexts/vt-passim", "id": "8b6ae5906d1e2d1703f416d05eceb4257727136a", "size":...
import numpy as np import pandas as pd from skbio import OrdinationResults from scipy.spatial import procrustes from numpy.random import default_rng def procrustes_analysis(reference: OrdinationResults, other: OrdinationResults, dimensions: int = 5, permutations: int =...
{ "content_hash": "9a48a8819a6b804dd5b31feb982a0df6", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 79, "avg_line_length": 37.55555555555556, "alnum_prop": 0.5860453648915187, "repo_name": "jakereps/q2-diversity", "id": "16720f436662640684a72b9ceacdcca9cab2c10f", "size":...
"""Kernel Principal Components Analysis.""" # Author: Mathieu Blondel <mathieu@mblondel.org> # Sylvain Marie <sylvain.marie@schneider-electric.com> # License: BSD 3 clause import numpy as np from scipy import linalg from scipy.sparse.linalg import eigsh from ..utils._arpack import _init_arpack_v0 from ..util...
{ "content_hash": "a8da417a0509d25ba312ddd6455cf8f7", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 87, "avg_line_length": 37.75, "alnum_prop": 0.6127624621387134, "repo_name": "huzq/scikit-learn", "id": "938c2b6902b15e5517194535e5d8f3aab1251275", "size": "19479", "bin...
from io import BytesIO from typing import TYPE_CHECKING, Any, IO, Optional, overload, Union from azure.core.exceptions import ( ClientAuthenticationError, ResourceNotFoundError, ResourceExistsError, HttpResponseError, map_error, ) from azure.core.paging import ItemPaged from azure.core.tracing.decor...
{ "content_hash": "39754124242a03049c8914589563d7c8", "timestamp": "", "source": "github", "line_count": 940, "max_line_length": 119, "avg_line_length": 45.32659574468085, "alnum_prop": 0.6027648039054615, "repo_name": "Azure/azure-sdk-for-python", "id": "27beca99775716c644bdcf54c65202cce4211392", "...
import mock import unittest import urllib from allura.lib.spam.akismetfilter import AKISMET_AVAILABLE, AkismetSpamFilter @unittest.skipIf(not AKISMET_AVAILABLE, "Akismet not available") class TestAkismet(unittest.TestCase): @mock.patch('allura.lib.spam.akismetfilter.akismet') def setUp(self, akismet_lib): ...
{ "content_hash": "ecc2a19d09647d14419f76c6414136aa", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 79, "avg_line_length": 43.29059829059829, "alnum_prop": 0.6416584402764067, "repo_name": "lym/allura-git", "id": "79802c3d7f768f0c350b6610089e72cb886045b3", "size": "5965"...
import logging import sys from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop from app.main import create_app logging.basicConfig(stream=sys.stdout, level=logging.debug) logger = logging.getLogger(__name__) class AmillerImTestCases(AioHTTPTestCase): def get_app(loop): return create_app(...
{ "content_hash": "1268493db6e94ae248cb36a15e817f2a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 65, "avg_line_length": 22.48148148148148, "alnum_prop": 0.6952224052718287, "repo_name": "atm08e/amiller.im-py3", "id": "39ee2d7e4825b301ab15f0873ba5e1cd2909d831", "size": ...
"""Create the mesa driver. This defers to a Docker container with the build_mesa.sh script.""" import argparse import subprocess # TODO(dogben): In the future, it might be simpler to build the docker image as # part of this script so that we don't need to push it to the container repo. # Doing so would make this ...
{ "content_hash": "7907e716921656d1954e62558b66886f", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 28.47222222222222, "alnum_prop": 0.6848780487804879, "repo_name": "HalCanary/skia-hc", "id": "279360f50a8db24e528090d5e22db840feb345a8", "size": "118...
from setuptools import find_packages, setup setup(name='Fun Views', version='0.0.5', description='Functional generic views and view utils.', url='https://bitbucket.org/keithasaurus/fun_views', packages=find_packages(exclude=['tests']))
{ "content_hash": "0706e1ce82d953ef16243d5446d49e35", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 61, "avg_line_length": 37.285714285714285, "alnum_prop": 0.6934865900383141, "repo_name": "keithasaurus/django_fun_views", "id": "5d0ad6d45a4cb5f1ad3e0d20455d832836433756", ...
from fab_deploy import utils from fab_deploy.system import aptitude_install __all__ = ['java_install'] @utils.run_as_sudo def java_install(): ''' Installs JRE ''' aptitude_install('default-jre')
{ "content_hash": "5a49c9d157595cbe8e7f867f10667378", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 46, "avg_line_length": 22.666666666666668, "alnum_prop": 0.696078431372549, "repo_name": "futurecolors/django-fabdeploy-extensions", "id": "f796422ae2afe19dd0b0435a37a2c599d20...
"""Fichier contenant la volonté HisserVoiles""" import re from secondaires.navigation.equipage.ordres.hisser_voile import HisserVoile from secondaires.navigation.equipage.ordres.long_deplacer import LongDeplacer from secondaires.navigation.equipage.volonte import Volonte class HisserVoiles(Volonte): """Classe r...
{ "content_hash": "4f747a52d592b82831d71247db5302b0", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 83, "avg_line_length": 33.677083333333336, "alnum_prop": 0.5663470460872255, "repo_name": "stormi/tsunami", "id": "e6508db190414fd648d447ace4ab93ab26283d92", "size": "4813"...
import logging from ailment import Expr from .engine_base import SimplifierAILEngine, SimplifierAILState from .optimization_pass import OptimizationPass, OptimizationPassStage _l = logging.getLogger(name=__name__) class ModSimplifierAILEngine(SimplifierAILEngine): def _ail_handle_Sub(self, expr): ope...
{ "content_hash": "9cec95cc5661de0333a55d50567e7eca", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 101, "avg_line_length": 37.82051282051282, "alnum_prop": 0.5772881355932203, "repo_name": "angr/angr", "id": "6575b389a9f49552df4f7b61d52078e5f6f7fe7e", "size": "2950", "...
"""Tests for the Heos Media Player platform.""" import asyncio from pyheos import CommandFailedError, const from homeassistant.components.heos import media_player from homeassistant.components.heos.const import ( DATA_SOURCE_MANAGER, DOMAIN, SIGNAL_HEOS_UPDATED, ) from homeassistant.components.media_playe...
{ "content_hash": "fbda3069f53daa99ce911de164815f77", "timestamp": "", "source": "github", "line_count": 806, "max_line_length": 88, "avg_line_length": 36.76674937965261, "alnum_prop": 0.6650131605588175, "repo_name": "partofthething/home-assistant", "id": "4d979f8e5560e1c0cd5c5e5c6ff575bb25d373c2", ...
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import scadasim
{ "content_hash": "0aed8aec83748e4231e7e2a31dafa8f7", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 82, "avg_line_length": 24.2, "alnum_prop": 0.7024793388429752, "repo_name": "sintax1/scadasim", "id": "2518a514a6247e93fa7d660c6d1f4049484e3860", "size": "121", "binary": ...
import collections import os import sys from optparse import OptionParser, NO_DEFAULT import imp import warnings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError, handle_default_options from django.core.management.color import color_style from dj...
{ "content_hash": "2c060af6f6956b5b0c0a7e927f617eca", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 98, "avg_line_length": 38.82051282051282, "alnum_prop": 0.6087626596213122, "repo_name": "chrisfranzen/django", "id": "bb26c206660c7b934996bc3c910c1c9a152b86e2", "size": "...
from collections import Counter from corehq.apps import es from corehq.apps.data_pipeline_audit.dbacessors import ( get_es_counts_by_doc_type, get_es_user_counts_by_doc_type, get_primary_db_case_counts, get_primary_db_form_counts, ) from corehq.apps.data_pipeline_audit.utils import map_counter_doc_type...
{ "content_hash": "018cb7ce591b83f99e7eaa01b609caee", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 106, "avg_line_length": 32.111111111111114, "alnum_prop": 0.6764705882352942, "repo_name": "dimagi/commcare-hq", "id": "8606686305c70d696ff23546b36922edc33fa186", "size": "...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "b1a7b51ea581bab1043c549adf27f3b2", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 141, "avg_line_length": 44.06349206349206, "alnum_prop": 0.6643852065321806, "repo_name": "JunHe77/bigtop", "id": "f933e9172579f43ff40e4a54cf5150f009e30a13", "size": "8328...
""" Defines components for holding properties of rocks or samples or whatevers. :copyright: 2015 Agile Geoscience :license: Apache 2.0 """ import re class ComponentError(Exception): """ Generic error class. """ pass class Component(object): """ Initialize with a dictionary of properties. Yo...
{ "content_hash": "27d280b69b31206ae8bc527995810462", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 75, "avg_line_length": 29.17391304347826, "alnum_prop": 0.5095007451564829, "repo_name": "EvanBianco/striplog", "id": "94d652c9e89b92da3717e49eaf93ae3fc33eda67", "size": "...
from falcon import errors from falcon import testing from oslo_policy import policy as os_policy from monasca_api.api.core import request from monasca_api.common.policy import policy_engine as policy from monasca_api.tests import base import monasca_api.v2.reference.helpers as helpers from monasca_api.common.rest im...
{ "content_hash": "f2f312c9e518953b5f4870de9208ccf2", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 89, "avg_line_length": 33.02238805970149, "alnum_prop": 0.5633898305084746, "repo_name": "stackforge/monasca-api", "id": "231477eca891080ca807d2165d518090ba64553a", "size"...
""" Created on Feb 13, 2016 File: tuplet.py Purpose: Defines Tuplet note construct @author: donald p pazel """ from structure.abstract_note_collective import AbstractNoteCollective from structure.note import Note from timemodel.duration import Duration class Tuplet(AbstractNoteCollective): """ Tuplet is a ...
{ "content_hash": "e250b0987c3629592a1a196b053c7327", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 120, "avg_line_length": 42.61805555555556, "alnum_prop": 0.6048557927326055, "repo_name": "dpazel/music_rep", "id": "e36688651b89756422d2421d241d8294d969a1b1", "size": "61...
from __future__ import absolute_import, print_function, division, unicode_literals import argparse import gzip import os import os.path import re # Makes the default extension list look a bit nicer class PrettyTuple(tuple): def __repr__(self): return ', '.join(self) CHUNK_SIZE = 64 * 1024 # Extensions...
{ "content_hash": "ad4be6728e44564f5edf87758c685d08", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 97, "avg_line_length": 32.31111111111111, "alnum_prop": 0.6124484181568088, "repo_name": "andela-bojengwa/talk", "id": "93be4e929172a8dd6fa9def2c3cc9b133a2fbdee", "size": "...
from django.shortcuts import render from django.http import HttpResponse from lists.models import Item # Create your views here. def home_page(request): if request.method == 'POST': first_item = Item() first_item.text = request.POST['item_text'] first_item.save() ...
{ "content_hash": "e61222920816957ba3eb09241fb160e6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 54, "avg_line_length": 24.470588235294116, "alnum_prop": 0.6394230769230769, "repo_name": "Hongqing-Hu/TDD-Django", "id": "e49ca2ef1406c0a37c36aaef086a1a00680a8455", "size"...
""" Testing with statements that use generators. This should not crash. """ class Base(object): """ Base class. """ val = 0 def gen(self): """ A generator. """ yield self.val def fun(self): """ With statement using a generator. """ with self.gen(): # [not-context-mana...
{ "content_hash": "9626167ce50abe8d081a2e15e90756da", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 24.428571428571427, "alnum_prop": 0.543859649122807, "repo_name": "mcking49/apache-flask", "id": "25c6b3776702546dbbfc8576ff089f1de4acf3da", "size": ...
"""Documentation menu.""" import bits.pyfs import os import os.path created_documentation_cfg = False def grub_escape(s): return "'{}'".format("'\\''".join(s.split("'"))) def create_documentation_cfg(): global created_documentation_cfg if created_documentation_cfg: return cfg = "" docpat...
{ "content_hash": "e26ccf402541b840a1a6252b52ec785b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 103, "avg_line_length": 32.25925925925926, "alnum_prop": 0.6199770378874856, "repo_name": "mfleming/bits", "id": "596cced2faf0b22de90421fb9fef17f36f1be0af", "size": "2440",...
from session import session sess1 = session('184.105.247.71') sess1.connect('pyclass','88newclass') for line in sess1.sendCmd('config t'): print line.rstrip() for line in sess1.sendCmd('logging buffer 10000'): print line for line in sess1.sendCmd('end'): print line for line in sess1.sendCmd('sho run | i l...
{ "content_hash": "6947c9c7b4da201bab28a327a63636eb", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 25.642857142857142, "alnum_prop": 0.7075208913649025, "repo_name": "patrebert/pynet_cert", "id": "33d8bb79321600b96a56492510feea7306526f07", "size": ...
""" Module images2gif Provides functionality for reading and writing animated GIF images. Use writeGif to write a series of numpy arrays or PIL images as an animated GIF. Use readGif to read an animated gif as a series of numpy arrays. Note that since July 2004, all patents on the LZW compression patent have expired....
{ "content_hash": "031e6a9935a33c6b8ccf93e220c91203", "timestamp": "", "source": "github", "line_count": 1061, "max_line_length": 130, "avg_line_length": 33.3449575871819, "alnum_prop": 0.5621696486616354, "repo_name": "HallaZzang/gersang-spritelib", "id": "264ffb9e6c599cefe72a45e4bf3c872023505573", ...
import math from functools import cmp_to_key from django.db import models import json from accounts.models import PlayerUser from pmtour.models import BaseModel, Tournament class Player(BaseModel): user = models.ForeignKey(PlayerUser, on_delete=models.CASCADE) name = models.CharField("name", max_length=100, d...
{ "content_hash": "f2aa6e8f1aceb089b00c00be3c8da58a", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 95, "avg_line_length": 34.3593220338983, "alnum_prop": 0.5226913970007893, "repo_name": "sunoru/pokemon_tournament", "id": "d0d7a396ad9e6c9263b622e650757607a86dc599", "siz...
''' Created on Feb 15, 2017 @author: julien ''' from copy import deepcopy import unittest from keras.layers.core import Dense from minos.experiment.experiment import Experiment, ExperimentParameters,\ check_experiment_parameters from minos.experiment.training import Training, EpochStoppingCondition from minos.mo...
{ "content_hash": "65099393c099d11715b6556622299ee3", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 97, "avg_line_length": 39.12865497076023, "alnum_prop": 0.5597070691974294, "repo_name": "guybedo/minos", "id": "9ac872ea265d05a8f4dd63a37086c510b257b13b", "size": "6691",...
from six import text_type from typing import Any, Dict from zerver.lib.test_classes import WebhookTestCase class TransifexHookTests(WebhookTestCase): STREAM_NAME = 'transifex' URL_TEMPLATE = u"/api/v1/external/transifex?stream={stream}&api_key={api_key}&{data_template}" URL_DATA_TEMPLATE = "project={projec...
{ "content_hash": "6a5407464a8c291dd21e9c8762c947d1", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 110, "avg_line_length": 42.041666666666664, "alnum_prop": 0.6565906838453914, "repo_name": "vikas-parashar/zulip", "id": "7d8c4aff43559f77dd0eb9460c6ebbc2854fd0f3", "size":...
import random from tempest import config from tempest import test from oslo_log import log as logging from tempest_lib.common.utils import data_utils import test_subnets as SNET CONF = config.CONF LOG = logging.getLogger(__name__) VLAN_PHYSICAL_NETWORK = CONF.nsxv.vlan_physical_network or None VLAN_ID_PROVIDER = CO...
{ "content_hash": "4b8d1a01a45c3903896a9fd69361b343", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 78, "avg_line_length": 43.69620253164557, "alnum_prop": 0.6100811123986095, "repo_name": "gravity-tak/vmware-nsx-tempest", "id": "020f5a380579d8c7da0e6a68cf45b19169e6e6df", ...
import pytest from vcx.error import ErrorCode, VcxError from vcx.api.credential_def import CredentialDef source_id = '123' schema_id = 'schema_id1' name = 'schema name' schema_no = 44 @pytest.mark.asyncio @pytest.mark.usefixtures('vcx_init_test_mode') async def test_create_credential_def(): credential_def = awai...
{ "content_hash": "ce068fae2ad39eee54a9db4fa077352d", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 115, "avg_line_length": 37.518181818181816, "alnum_prop": 0.7307971892415799, "repo_name": "Artemkaaas/indy-sdk", "id": "2349fd289d1b94bc6318976c4f54f7770c13aba4", "size":...
""" The Predictor module estimates future values using the monitoring data. @author: fernandez """ # pylint: disable=E0611,E1101 import numpy as np import statsmodels.api as sm from pandas import Series, DataFrame from statsmodels.datasets.utils import Dataset from scipy import stats import math """ This predict...
{ "content_hash": "defa77c3e439e8cbb9942bdd65d96be5", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 192, "avg_line_length": 38.348993288590606, "alnum_prop": 0.5426146307315366, "repo_name": "ConPaaS-team/conpaas", "id": "026c1bf08ca4226e810ea18105db0d052cd18b93", "size"...
from threading import Thread, Event, Lock from utils import get_username, get_next_id, find_work_dir, mkdir_if_not_exists import RPi.GPIO as GPIO import subprocess import logging import json import time import os import re import sys logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) pedal = 18 led_red = 1...
{ "content_hash": "edc20a952c229f39753ec77f9589b91c", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 98, "avg_line_length": 25.915441176470587, "alnum_prop": 0.556390977443609, "repo_name": "quatrix/rekt", "id": "b33e6caa08f1347186c85a978035d56a238bbad1", "size": "7071", ...
from __future__ import absolute_import from . import simple import sys if __name__ == "__main__": verbose = False if len(sys.argv) > 1: verbose = int(sys.argv[1]) test_list = None if len(sys.argv) > 2: test_list = sys.argv[2:] simple.tests.run(test_list, verbose)
{ "content_hash": "0d97724a334f284d5076bf349aa641bf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 40, "avg_line_length": 19.0625, "alnum_prop": 0.5836065573770491, "repo_name": "pavanky/arrayfire-python", "id": "603ae9f374d37d075cc7aa784ed9732e888253bb", "size": "648", ...
""" This script looks in the symbol cache directory (defaulting to c:\symbols, but you can specify a directory) and for each sub-directory deletes all but the most recent symbols or PE files. This can free up large amounts of space. The idea is that the old symbols are unlikely to be needed again, and if they ...
{ "content_hash": "ba6d44cf40a06fff7d033a7c2a6c3f39", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 89, "avg_line_length": 43.25925925925926, "alnum_prop": 0.6175085616438356, "repo_name": "randomascii/tools", "id": "7f1174f8c5443a40aedc048fb6e95eb67cd14f00", "size": "52...
import sublime, sublime_plugin import os class MochaCoffeeScriptDetectFileTypeCommand(sublime_plugin.EventListener): """ Detects current file type if the file's extension isn't conclusive """ def on_load(self, view): filename = view.file_name() if not filename: # buffer has never been saved return ...
{ "content_hash": "9f1ac2f6547aa7326c5e7888a1917726", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 85, "avg_line_length": 36.3, "alnum_prop": 0.7011019283746557, "repo_name": "octoblu/sublime-text-mocha-coffeescript", "id": "a682497e75521944b917694a69fd5bc208a0d860", "si...