text
stringlengths
4
1.02M
meta
dict
from tornado.gen import coroutine from tornado.ioloop import IOLoop from smpipi.tornado import ESME def async_run(func): ioloop = IOLoop() ioloop.make_current() work = coroutine(func) ioloop.run_sync(work, timeout=5) def test_bind(smsc): @async_run def work(): esme = ESME() ...
{ "content_hash": "26c8dcadb8082fef2e6fd28bb8153b2c", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 80, "avg_line_length": 26.25, "alnum_prop": 0.6057142857142858, "repo_name": "baverman/smpipi", "id": "8d61ff0fc9349695df60f1cb4c0817d3c6855c87", "size": "1050", "binary"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('project', '0063_auto_20180803_1155'), ] operations = [ migrations.AddField( model_name='assessment', name='is_a_committee_sc...
{ "content_hash": "1575f5de5cc2727e90ed7bf9d2357742", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 166, "avg_line_length": 28.333333333333332, "alnum_prop": 0.6450980392156863, "repo_name": "unicef/un-partner-portal", "id": "f60a02a25ab75fd7ce36a7ac46d4634152dd824d", "si...
from .PBXItem import * class PBXFileReference(PBX_Base_Reference): def __init__(self, identifier, dictionary): super(self.__class__, self).__init__(identifier, dictionary)
{ "content_hash": "2e997ae06077d2c12e9c70c7c308fa8a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 68, "avg_line_length": 36.8, "alnum_prop": 0.6902173913043478, "repo_name": "samdmarshall/pbProj", "id": "5f6502772db4f15a02fabd8398a0379757672f89", "size": "184", "binary...
"""Main program. This file is based on @Greut (https://github.com/greut) 's main file in his TravisBot project (https://github.com/greut/travisbot) """ import asyncio import logging import shutil import discord from discord.ext import commands from pyfiglet import Figlet from bot import AutomaBot from tools import ...
{ "content_hash": "f44a609636ee870813aa873fb5fcdc43", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 29.575757575757574, "alnum_prop": 0.6263661202185792, "repo_name": "WyllVern/AutomaBot", "id": "81feefcc96cb7c92a25c7f7631a03b6efd13030a", "size": "2...
"""Unit tests.""" import pytest from google.rpc import status_pb2 from google.cloud import spanner_admin_database_v1 from google.cloud.spanner_admin_database_v1.proto import spanner_database_admin_pb2 from google.iam.v1 import iam_policy_pb2 from google.iam.v1 import policy_pb2 from google.longrunning import operati...
{ "content_hash": "7e22f3c1eead155cac4f96295b5e087b", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 83, "avg_line_length": 36.65239294710327, "alnum_prop": 0.6288914851212976, "repo_name": "tseaver/gcloud-python", "id": "b3f9d90cea0868e0cbc0ee5358ab78ddb56b1324", "size":...
from copy import deepcopy import httplib as http import time import mock import pytest import pytz import datetime from nose.tools import * # noqa from tests.base import OsfTestCase, fake from osf_tests.factories import ( UserFactory, NodeFactory, ProjectFactory, AuthUserFactory, RegistrationFactory ) from a...
{ "content_hash": "3b3efd0921243e4227a2783cee203af6", "timestamp": "", "source": "github", "line_count": 1422, "max_line_length": 139, "avg_line_length": 43.919127988748244, "alnum_prop": 0.6233967943893808, "repo_name": "icereval/osf.io", "id": "29c22449a012eb85cb7a077bd96b10f1d6e677fc", "size": "6...
from .agendadiaria import AgendaDiaria from .analisis import Analisis from .cupo import Cupo from .documento import Documento from .empleado import Empleado from .telefono import Telefono from .fichapaciente import FichaPaciente from .institucionmedica import InstitucionMedica from .laboratorioexterno import Laboratori...
{ "content_hash": "59cd3beb7148d2d863ef345f50e682ab", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 78, "avg_line_length": 39.8433734939759, "alnum_prop": 0.5606289688539462, "repo_name": "gabofer82/taller_programacion_2017", "id": "94a5836dd42da3e42fb64fdfad1ae11b768e20b8...
"""Tests for iAqualink integration.""" import asyncio import logging from unittest.mock import AsyncMock, patch from iaqualink.device import ( AqualinkAuxToggle, AqualinkBinarySensor, AqualinkDevice, AqualinkLightToggle, AqualinkSensor, AqualinkThermostat, ) from iaqualink.exception import Aqu...
{ "content_hash": "064d0367aa90e06e597d309f2b93fd2f", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 88, "avg_line_length": 33.90677966101695, "alnum_prop": 0.6999083562442723, "repo_name": "rohitranjan1991/home-assistant", "id": "3a35804f447e65dfc94f6be5215e04645f62c15c", ...
import requests import json class TheTVDB(object): token = None def __init__(self, username, api_key, user_key): self.username = username self.api_key = api_key self.user_key = user_key def get_imdb_id(self, tvdb_id): # TODO Cache if not self.token: se...
{ "content_hash": "fcbcd0325f3bf4cc1c9446c5a819b736", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 77, "avg_line_length": 25.776119402985074, "alnum_prop": 0.5118702953097858, "repo_name": "adamgot/python-plexlibrary", "id": "90613f0f919bb53c206c7301a3e22d9cb7fa6528", "s...
""" Django settings for test_project project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impo...
{ "content_hash": "78e51b9de56dcc30dc58f6d1af32a069", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 72, "avg_line_length": 25.933333333333334, "alnum_prop": 0.7146529562982005, "repo_name": "uploadcare/django-loginurl", "id": "560d48e27e6625d13ab727f4a5c660c06258ba14", "s...
import glob import os path = os.path.abspath("../output/matrizesConfusao") filtro = "*.csv" path = os.path.join(path, filtro) files = glob.glob(path) #exemplo de arquivo a ser consumido #[20155293416]-test-with-training[[201552795125]-experimento[class-10-uterances-10-num_loc_masc-8-num_loc_fem-8].csv]-assertiveness...
{ "content_hash": "0221f6609b043fd537c2f4e0b516f64a", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 194, "avg_line_length": 23.263157894736842, "alnum_prop": 0.6713800904977375, "repo_name": "LarryPavanery/tcc-si-facisa", "id": "62740f1ecdcd51726e9426db2085339e804d6388", ...
from __future__ import (absolute_import, print_function, division) class Model(object): pass
{ "content_hash": "112dadf2d5ce864397634746b5bc0895", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 66, "avg_line_length": 19.8, "alnum_prop": 0.7171717171717171, "repo_name": "zbuc/imaghost", "id": "ce8fd8bb4e5fb88848de484a9808efc67642894b", "size": "99", "binary": fals...
from __future__ import unicode_literals from django.core.exceptions import PermissionDenied from django.shortcuts import render def template_failure(request, status=403, **kwargs): """ Renders a SAML-specific template with general authentication error description. """ return render(request, 'djangosaml2/logi...
{ "content_hash": "479e43d373ab9edb813d1c0709732620", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 91, "avg_line_length": 42.588235294117645, "alnum_prop": 0.7651933701657458, "repo_name": "cloudera/hue", "id": "ce993ecabe7a32cbaecc9d5d15fd8074fa0a4d0e", "size": "896", ...
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'_sqlite.so') __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
{ "content_hash": "af732db54a0bc1877e1354e8acaf29ae", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 68, "avg_line_length": 39.57142857142857, "alnum_prop": 0.592057761732852, "repo_name": "2013Commons/HUE-SHARK", "id": "f8336143c2da5bfbb3aa3cd0a4a006617324f123", "size": "2...
from __future__ import absolute_import import mock import os from django.conf import settings def pytest_configure(config): # HACK: Only needed for testing! os.environ.setdefault('_SENTRY_SKIP_CONFIGURATION', '1') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sentry.conf.server') if not setting...
{ "content_hash": "38a8e4044be70f09283c0d179192c2b4", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 99, "avg_line_length": 30.842767295597483, "alnum_prop": 0.6217373572593801, "repo_name": "alexm92/sentry", "id": "0d35032db496cbca5d1d56be965dabd41060765b", "size": "4904...
import unittest from airflow.utils.trigger_rule import TriggerRule class TestTriggerRule(unittest.TestCase): def test_valid_trigger_rules(self): assert TriggerRule.is_valid(TriggerRule.ALL_SUCCESS) assert TriggerRule.is_valid(TriggerRule.ALL_FAILED) assert TriggerRule.is_valid(TriggerRule...
{ "content_hash": "b8951dae2439f2001a0b1956dedba6b4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 71, "avg_line_length": 45.05555555555556, "alnum_prop": 0.7410604192355117, "repo_name": "dhuang/incubator-airflow", "id": "9a03808ac56fb5a17a9e5a0eaed09008c0661282", "size...
import re from inaugurator import sh class Network: _CONFIG_SCRIPT_PATH = "/etc/udhcp_script.sh" _NR_PING_ATTEMPTS = 20 def __init__(self, macAddress, ipAddress, netmask, gateway): self._gateway = gateway interfacesTable = self._interfacesTable() assert macAddress.lower() in inter...
{ "content_hash": "6717fd82e5a016c26590026c39176633", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 105, "avg_line_length": 42.861111111111114, "alnum_prop": 0.5904082955281919, "repo_name": "eliran-stratoscale/inaugurator", "id": "71ad2ed0237b0bb30b7e7eda3359decfa20edcbb",...
import json import os import pretend import pytest from static_precompiler import compilers, exceptions, utils def test_compile_file(monkeypatch, tmpdir): monkeypatch.setattr("static_precompiler.settings.ROOT", tmpdir.strpath) convert_urls = pretend.call_recorder(lambda *args: None) monkeypatch.setattr(...
{ "content_hash": "030d4161d3b5da0d65d0e852c3f01e0f", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 119, "avg_line_length": 31.5, "alnum_prop": 0.6880041634139995, "repo_name": "liumengjun/django-static-precompiler", "id": "f831292aee4cbc8c637f0bab63ecb0e589e58cc9", "siz...
days=10 entries_per_day=100000 # file size calculations # format entries_per_day file_size in MB # csv 10000000 830 M file # json 1000000 169 M # json 3200000 500 M log_format="csv" #log_format="json" ## --- end config import os import datetime as dt ...
{ "content_hash": "c08d5b4434ac198dfe24c9bb90df098d", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 356, "avg_line_length": 33.05494505494506, "alnum_prop": 0.6163563829787234, "repo_name": "hongchhe/myhadoop", "id": "31578309e6249b4808591a2ace8c1a39ed36d5f7", "size": "32...
from distutils.core import setup from setuptools import find_packages setup( name='adminactionview', version='0.2', author='Michiel De Paepe', author_email='[email protected]', packages=find_packages(), url='https://github.com/MichielDePaepe/adminactionview', license='MIT licence, ...
{ "content_hash": "43fc9a4b6e5bfbef192c3ef47e0b6cd8", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 141, "avg_line_length": 36.3125, "alnum_prop": 0.7246127366609294, "repo_name": "MichielDePaepe/adminactionview", "id": "54487296b2604e7844c8e82d2d027fa6d4968218", "size": ...
"""This example gets all active activities. """ # Import appropriate modules from the client library. from googleads import ad_manager def main(client): # Initialize appropriate service. activity_service = client.GetService('ActivityService', version='v202208') # Create a statement to select activities. stat...
{ "content_hash": "1e5b5367c99f7b29090806b264780586", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 35.666666666666664, "alnum_prop": 0.6814641744548287, "repo_name": "googleads/googleads-python-lib", "id": "2d98022cd6c42f78d8681807cd61dcb72a5ffe5d", ...
""" raven.contrib.celery ~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from celery.exceptions import SoftTimeLimitExceeded from celery.signals import ( after_s...
{ "content_hash": "964f7e1e035a8bd9e96b5c4492b9f830", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 109, "avg_line_length": 34.58510638297872, "alnum_prop": 0.6508766533374346, "repo_name": "lightopa/Aiopa-Battles", "id": "edf2c42837f3c1e0b68b720b1617b5b33be145a6", "size"...
import argparse, sys from argparse import RawTextHelpFormatter import pysam __author__ = "Author ([email protected])" __version__ = "$Revision: 0.0.1 $" __date__ = "$Date: 2013-05-09 14:31 $" # -------------------------------------- # define functions def get_args(): parser = argparse.ArgumentParser(formatter_class...
{ "content_hash": "4f1262cc15177286d41bd39938309872", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 125, "avg_line_length": 33.76923076923077, "alnum_prop": 0.5700455580865603, "repo_name": "hall-lab/bamkit", "id": "62c8e7c1c117bf65bc4aa27ebfd9764a568ea76f", "size": "353...
"""Configuration of Flask-OAuthlib provider.""" from datetime import datetime, timedelta from flask import current_app, g from flask_login import current_user from flask_oauthlib.provider import OAuth2Provider from flask_principal import Identity, identity_changed from flask_security.utils import verify_password from...
{ "content_hash": "093fcba486dd76be444e6932b1a7f81b", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 84, "avg_line_length": 30.79605263157895, "alnum_prop": 0.6530655842768639, "repo_name": "inveniosoftware/invenio-oauth2server", "id": "350d2cbf3ec91d0f792da54fcb8762a0046bd...
import json import six _transform_registry = {} def register_transform(from_type, func): _transform_registry[from_type] = func class BaseModel(object): def __str__(self): str_dict = {} for key, value in six.iteritems(self.__dict__): if key.startswith('_'): conti...
{ "content_hash": "6f72365b497514207bf95590da45100a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 69, "avg_line_length": 24.448979591836736, "alnum_prop": 0.5383973288814691, "repo_name": "omninubes/nubes", "id": "402f10fb33748061283595c0b19b4d608f1e96be", "size": "1198...
from cobra.core.loading import feature_hidden from cobra.views.decorators import permissions_required class Application(object): """ Base application class. This is subclassed by each app to provide a customisable container for an app's views and permissions. """ #: Namespace name name = ...
{ "content_hash": "c71569b03f811a82327587aeee8aa1d6", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 32.76146788990825, "alnum_prop": 0.616353962475497, "repo_name": "lyoniionly/django-cobra", "id": "722f53cd797b35264954d362674a7f3f4ce1578c", "size"...
from typing import Union, Any, cast from abc import ABC from abc import abstractmethod import eagerpy as ep from ..devutils import flatten from ..devutils import atleast_kd from ..distances import l2, linf from .base import FixedEpsilonAttack from .base import Criterion from .base import Model from .base import T fr...
{ "content_hash": "9af614f5850bb31b8478674fd17eea42", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 87, "avg_line_length": 27.390845070422536, "alnum_prop": 0.6547114024938938, "repo_name": "bethgelab/foolbox", "id": "29d55f0b4c82bc2600bed2294354c5f529d92875", "size": "7...
from typing import AnyStr, Dict from pyre_extensions import safe_json from backend.common.datafeed_parsers.exceptions import ParserInputException from backend.common.models.keys import EventKey, MatchKey from backend.common.models.match import Match class JSONMatchVideoParser: """ Take a dict of match parti...
{ "content_hash": "e67fd48a2a672c31c8f353b58ffadf58", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 86, "avg_line_length": 31.323529411764707, "alnum_prop": 0.6169014084507042, "repo_name": "the-blue-alliance/the-blue-alliance", "id": "50f26aaf9f2ec0db84f922b4f5da2389f7a0ba...
import logging import os import re import urlparse from subprocess import PIPE import traceback import git from django_git.management.commands.git_pull_utils.connectivity_manager import ConnectivityManager from djangoautoconf.local_key_manager import get_local_key from ufs_tools.app_framework import find_app_in_folder...
{ "content_hash": "fba4fb208f2a718c308bae361fdb4a84", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 110, "avg_line_length": 35.08673469387755, "alnum_prop": 0.5940090155591101, "repo_name": "weijia/django-git", "id": "9f8bf5b2a45706318ef2b423a232fd2f8e49eef1", "size": "6...
""" The VMware API utility module. """ import netaddr import suds def get_moref(value, type_): """Get managed object reference. :param value: value of the managed object :param type_: type of the managed object :returns: managed object reference with given value and type """ moref = suds.sud...
{ "content_hash": "1e784969b0d5740e9979b21fbdaccafb", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 79, "avg_line_length": 40.23770491803279, "alnum_prop": 0.5397569090785632, "repo_name": "JioCloud/oslo.vmware", "id": "c7194c5a1298635e037162d4ec1037c48b221eaa", "size": ...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['RelativeDifference'] , ['MovingMedian'] , ['Seasonal_Hour'] , ['ARX'] );
{ "content_hash": "45f0f549a23238c2165dccf2fd4fdc12", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 95, "avg_line_length": 42, "alnum_prop": 0.7261904761904762, "repo_name": "antoinecarme/pyaf", "id": "329dbb4297b83acc74c3100ed7775bc44a002386", "size": "168", "binary": f...
class interface(object): specs={'port':1234, 'ip':'127.0.0.1'} specsGui={'port':{'name':'Port','tooltip':'port for rtp streaming'}, 'ip':{'name':'IP','tooltip':'ip for rtp streaming'}}
{ "content_hash": "81a51f7d92d276832ce74579288e3840", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 72, "avg_line_length": 22.3, "alnum_prop": 0.5336322869955157, "repo_name": "schristakidis/p2ner", "id": "3d2587ae680787538cefe377618a97b08affd99b", "size": "842", "binar...
""" Structure Residues ================== """ import logging from collections import defaultdict from copy import deepcopy from Bio.Alphabet import IUPAC from Bio.PDB import Polypeptide from Bio.PDB.HSExposure import ExposureCN, HSExposureCA, HSExposureCB from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord im...
{ "content_hash": "e0cb05304647c99aa6e242188cd1de82", "timestamp": "", "source": "github", "line_count": 472, "max_line_length": 121, "avg_line_length": 34.00423728813559, "alnum_prop": 0.591214953271028, "repo_name": "nmih/ssbio", "id": "e2270d76d27a37172a19db2a8aba8064334d8cb1", "size": "16050", ...
"""Testing utilities for PIX.""" import inspect import types from typing import Sequence, Tuple def get_public_functions( root_module: types.ModuleType) -> Sequence[Tuple[str, types.FunctionType]]: """Returns `(function_name, function)` for all functions of `root_module`.""" fns = [] for name in dir(root_m...
{ "content_hash": "0d62e95de8424dd25dcac799e76dd3d3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 28.692307692307693, "alnum_prop": 0.6702412868632708, "repo_name": "deepmind/dm_pix", "id": "e615fd265ccac2963c11dbe746380399e0110969", "size": "1361...
from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Entry', fields=[ ...
{ "content_hash": "9c3e7d870f7508e11fadb57cba8b2c69", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 116, "avg_line_length": 36.82142857142857, "alnum_prop": 0.565470417070805, "repo_name": "ateoto/django-words", "id": "5b63b7fa6f8ca7bc484640b246f3071677d06a7c", "size": "1...
__author__ = 'ShJashiashvili'
{ "content_hash": "0414816e9020a07279b44cd9c51c3480", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 29, "avg_line_length": 30, "alnum_prop": 0.6666666666666666, "repo_name": "unixxxx/simplecms", "id": "4a08984999a35251479c81ae4388e54593656264", "size": "30", "binary": fa...
""" ****** Layout ****** Node positioning algorithms for graph drawing. """ # Copyright (C) 2004-2015 by # Aric Hagberg <[email protected]> # Dan Schult <[email protected]> # Pieter Swart <[email protected]> # All rights reserved. # BSD license. import collections import networkx as nx __author__ = """...
{ "content_hash": "093e8d2c482c17de41182d2eb53d96d1", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 94, "avg_line_length": 29.7156704361874, "alnum_prop": 0.5978036316190062, "repo_name": "OrkoHunter/networkx", "id": "9bbc6f98e3a542560c1c4c5d6d0df4de7601fc87", "size": "1...
from models.usuario import Usuario from config import Config class Tesis: tabla = "tesis" def __init__(self, id, nombre, jurado_id=0, director_id=0): self.id = id self.nombre = nombre self.jurado = Usuario.getById(jurado_id) self.director = Usuario.getById(director_id) @s...
{ "content_hash": "3c9bec75da4e2160019a904e2848e0a1", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 113, "avg_line_length": 29.515625, "alnum_prop": 0.5579671784012705, "repo_name": "carojasq/Evaluaciones-bases-de-datos-2", "id": "2d2da44b971bf4a3cb16078b76bb205a2f0c32c7", ...
""" This module provides a library of Visual classes, which are drawable objects intended to encapsulate simple graphic objects such as lines, meshes, points, 2D shapes, images, text, etc. These classes define only the OpenGL machinery and connot be used directly in a scenegraph. For scenegraph use, see the complement...
{ "content_hash": "d63c029d512d064b3c02314a572a5623", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 43.65909090909091, "alnum_prop": 0.7917751171264966, "repo_name": "Eric89GXL/vispy", "id": "f58334292b1df94feb4843b57294da51c148cbe8", "size": "2080"...
from msrest.serialization import Model class OAuth2PermissionGrant(Model): """OAuth2PermissionGrant. :param odatatype: Microsoft.DirectoryServices.OAuth2PermissionGrant :type odatatype: str :param client_id: The id of the resource's service principal granted consent to impersonate the user when ...
{ "content_hash": "22131ab6e5638a78e184069692e3e59c", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 235, "avg_line_length": 45.01754385964912, "alnum_prop": 0.6484801247077163, "repo_name": "Azure/azure-sdk-for-python", "id": "cb745c9195ffec0312a3468c31518fa5ccbcc3cb", "s...
""" Filters that accept a `CommandLineInterface` as argument. """ from __future__ import unicode_literals from .base import Filter __all__ = ( 'HasArg', 'HasCompletions', 'HasFocus', 'InFocusStack', 'HasSearch', 'HasSelection', 'HasValidationError', 'IsAborting', 'IsDone', 'IsMu...
{ "content_hash": "b6d6d1a6b9a3e7353a16bb5c827cce47", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 78, "avg_line_length": 21.828877005347593, "alnum_prop": 0.5999510044096031, "repo_name": "amjith/python-prompt-toolkit", "id": "f542be817ab3e073833d3abe590176aee764e7b5", ...
import os import ycm_core # These are the compilation flags that will be used in case there's no # compilation database set (by default, one is not set). # CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. flags = [ '-Wall', '-Wextra', '-Werror', '-Wno-long-long', '-Wno-variadic-macros', '-D...
{ "content_hash": "ec5915734bb1d3d90bc9c0a5b20af1c8", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 79, "avg_line_length": 32.62809917355372, "alnum_prop": 0.6859169199594731, "repo_name": "roman-kashitsyn/libdocset", "id": "04e044718f381e122fbe8c6b507463dc447d10d9", "si...
from __future__ import absolute_import from st2tests.mocks.sensor import MockSensorWrapper from st2tests.mocks.sensor import MockSensorService from st2tests.pack_resource import BasePackResourceTestCase __all__ = ["BaseSensorTestCase"] class BaseSensorTestCase(BasePackResourceTestCase): """ Base class for se...
{ "content_hash": "2279b374ebea426d6272e0e9cbf9ee47", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 98, "avg_line_length": 33.45569620253165, "alnum_prop": 0.6341278849791903, "repo_name": "nzlosh/st2", "id": "52c0451f45fb3a0b409d0d7264e02e6398292537", "size": "3271", "...
"""Subprocress execution This module holds a subclass of subprocess.Popen with our own required features, mainly that we get access to the subprocess output while it is running rather than just at the end. This makes it easiler to show progress information and filter output in real time. """ import errno import os im...
{ "content_hash": "bcbf15b77234aa37a8f899026436600e", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 88, "avg_line_length": 39.552699228791774, "alnum_prop": 0.579682828545431, "repo_name": "Mogran/u-boot-2016.09-FS2416", "id": "0fc4a06b5066af43b4207e58d4c9ec33d3e43044", ...
from cherrycommon.excel import XLS import unittest class ExcelTest(unittest.TestCase): def test_cell_names(self): self.assertEqual(XLS.get_cell_name(0, 0), 'A1') self.assertEqual(XLS.get_cell_name(25, 0), 'Z1') self.assertEqual(XLS.get_cell_name(26, 9), 'AA10') if __name__ == '__main__':...
{ "content_hash": "d1692fad0d978009a44039920d732203", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 58, "avg_line_length": 26.23076923076923, "alnum_prop": 0.6422287390029325, "repo_name": "sunrize531/cherry-common", "id": "9751a8c0c8b2ea6ab7e76ad5d28d1a1f5baa177c", "size...
from __future__ import absolute_import import plotly import plotly.graph_objs as go def validate_coerce_fig_to_dict(fig, validate): from plotly.basedatatypes import BaseFigure if isinstance(fig, BaseFigure): fig_dict = fig.to_dict() elif isinstance(fig, dict): if validate: # ...
{ "content_hash": "c1448eb15b578044afb5ab3eed042e96", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 78, "avg_line_length": 27.761904761904763, "alnum_prop": 0.5969125214408233, "repo_name": "plotly/python-api", "id": "b3b376e9d89cf558d22bbfaaef45f4094517c067", "size": "11...
from __future__ import absolute_import, unicode_literals from django.contrib.staticfiles import finders from ..base import BaseTestCase class StaticFilesPanelTestCase(BaseTestCase): def setUp(self): super(StaticFilesPanelTestCase, self).setUp() self.panel = self.toolbar.get_panel_by_id('StaticF...
{ "content_hash": "99d6f06092529d0c3735500c657b72e2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 41.96153846153846, "alnum_prop": 0.6672777268560953, "repo_name": "marcoantoniooliveira/labweb", "id": "be4f267053d8c93be7db410a1e5ff8d0da957428", "s...
from tempfile import mkdtemp from settings import * INSTALLED_APPS += [ 'multipleindex', ] HAYSTACK_CONNECTIONS = { 'default': { 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', 'URL': 'http://localhost:8983/solr', }, 'whoosh': { 'ENGINE': 'haystack.backends.whoosh_backen...
{ "content_hash": "3eacc519a8905748b5414d75ec8da8c3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 80, "avg_line_length": 31.26923076923077, "alnum_prop": 0.6654366543665436, "repo_name": "speedplane/django-haystack", "id": "59dc62effa83c6f0380c287d8c2ae062950214ee", "si...
import json class Task(object): '''An individual task base.''' # Internal task_id _id = None # Internal task state _state = 'WAIT' # & channel name _channel = None # Whether this task should be cleaned up (pushed to end queue) _cleanup = True # Any context for this task ...
{ "content_hash": "68e6b56c7e853163cb5a0f3547051b17", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 80, "avg_line_length": 21.375, "alnum_prop": 0.5672514619883041, "repo_name": "Oxygem/pytask", "id": "7126f5f626ba7734ff8ef755389b94378a572093", "size": "1092", "binary":...
from os import path, urandom basedir = path.abspath(path.dirname(__file__)) dbname = "dbname.db" SQLALCHEMY_DATABASE_URI = "sqlite:///" + path.join(basedir, dbname) SQLALCHEMY_ECHO = False SQLALCHEMY_TRACK_MODIFICATIONS = False DEBUG = False TESTING = False SECRET_KEY = urandom(30)
{ "content_hash": "b906e818da0b2e34c270d2cbd2978137", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 67, "avg_line_length": 23.833333333333332, "alnum_prop": 0.7342657342657343, "repo_name": "JungWinter/yellowid-flask", "id": "917c505f9e786e8e51115f88ca795971bb66b5b1", "si...
import logging from optparse import Values from typing import List from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli.base_command import Command from pip._internal.cli.req_command import SessionCommandMixin, warn_if_run_as_root from pip._internal.cli.status_codes import SUCCESS from pip...
{ "content_hash": "6889ec9411efcd51e43829d725bd37f3", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 82, "avg_line_length": 34.8, "alnum_prop": 0.5818965517241379, "repo_name": "sonntagsgesicht/regtest", "id": "c590627eaa0a12a063bd2eb8a84e2935e11f6e71", "size": "3480", ...
from jsonrpclib.SimpleJSONRPCServer import SimpleJSONRPCServer import threading class RPCApi(): functions = [] def __init__(self, config): self.config = config self.server = SimpleJSONRPCServer((self.config['rpc_host'], self.config['rpc_port'])) self.server.timeout = self.config['rpc_...
{ "content_hash": "f05c0c1ee35fbe7f7c59142ef151c7fe", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 93, "avg_line_length": 37.36585365853659, "alnum_prop": 0.6592689295039165, "repo_name": "CRImier/pyLCI", "id": "51f9bb8f978161fff883a7fa29faf4bf7ea1ed53", "size": "1532", ...
""" sentry.web.forms.fields ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import six from django.forms.widgets import RadioFieldRenderer, TextInput, Widget from django.forms.u...
{ "content_hash": "f49d2a0e338c1e56026a9e7bbd2ce2a7", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 113, "avg_line_length": 33.008849557522126, "alnum_prop": 0.6445040214477212, "repo_name": "camilonova/sentry", "id": "b8722edf59b9ee158677fe845996d925604416d5", "size": "...
from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('ebooks', '0047_auto_20190605_0743'), ] operations = [ migrations.RemoveField( model_name='section', name='super_title', ), ]
{ "content_hash": "b04b95a235392472eb3a64165c135888", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 46, "avg_line_length": 18.933333333333334, "alnum_prop": 0.5633802816901409, "repo_name": "flavoi/diventi", "id": "ffa5980e33f54ce60d2a7add14a6715e997adec5", "size": "333",...
""" Support for the Broadlink RM2 Pro (only temperature) and A1 devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.broadlink/ """ from datetime import timedelta import binascii import logging import socket import voluptuous as vol from homea...
{ "content_hash": "4608d89e69dc2646f7552b450868a749", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 74, "avg_line_length": 32.1865671641791, "alnum_prop": 0.6234639462091351, "repo_name": "eagleamon/home-assistant", "id": "5fda261b61cd79ba1071404712546bea67896e9e", "size...
from .base import * # NOQA import logging.config # For security and performance reasons, DEBUG is turned off DEBUG = False TEMPLATE_DEBUG = False # Must mention ALLOWED_HOSTS in production! # ALLOWED_HOSTS = ["Student_Council_Website.com"] # Cache the templates in memory for speed-up loaders = [ ('dj...
{ "content_hash": "c350c1f7665246eede199d9a2fba6699", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 90, "avg_line_length": 26.96825396825397, "alnum_prop": 0.5632725132430841, "repo_name": "IE-NITK/NITK-Student-Council-Website", "id": "58b679043bfa7c205ce7ca2531e4c277d7d16d...
"""This example demonstrates how to subscribe to topics with WAMP.""" import logging import sys from asphalt.core import ContainerComponent, Context, run_application from asphalt.wamp.context import EventContext logger = logging.getLogger(__name__) def subscriber(ctx: EventContext, message: str): logger.info('...
{ "content_hash": "811ed72db367051ad64482d05f1eae8d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 69, "avg_line_length": 27.8, "alnum_prop": 0.7050359712230215, "repo_name": "asphalt-framework/asphalt-wamp", "id": "485e5fd82a8c4298dfe0a783078b2ebf964667d2", "size": "834...
""" <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> The Doer defines instances that are going to decorate a big family of classes in this framework. Staying on the idea, that one module should associate one class, now a decorated class by a Doer should have a NameStr ...
{ "content_hash": "517815ec639b0f23da7939bc405a4ac3", "timestamp": "", "source": "github", "line_count": 988, "max_line_length": 150, "avg_line_length": 38.22570850202429, "alnum_prop": 0.6674610109354727, "repo_name": "Ledoux/ShareYourSystem", "id": "215e00ae475de5d1834ddf7bdbbe3b0542b3260b", "size...
import logging import sys from django.conf import settings def init_logging(): if settings.DO_LOGGING: logging.basicConfig(filename=settings.LOG_FILENAME, level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(message)s" ) def debug(msg): logging.debug(msg) logInitDone=False if not logInitDone:...
{ "content_hash": "a7ba9e2392b5537b2f1c54d5640584fe", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 131, "avg_line_length": 22.6875, "alnum_prop": 0.71900826446281, "repo_name": "Woseseltops/signbank", "id": "5247783d040635049fc82b02d424eec117655977", "size": "364", "bi...
import datetime try: import json except ImportError: import simplejson as json from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """No-op to help upgrading from CDH 4.7.0 to CDH 5.x""" def backwards(sel...
{ "content_hash": "9bf6d5e1ed70854d993a100c55ffe455", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 194, "avg_line_length": 78.27129337539432, "alnum_prop": 0.5300660970498146, "repo_name": "yongshengwang/builthue", "id": "c7bc5711ae997f45f721b4dd5fdb1c1a10542e9c", "size...
from forms import PhoneNumberForm ff = PhoneNumberForm() ff.set(dict(country='CA', telephone='+41 22 774 0306')) ff.validate() ff.errors ff['country'] = 'CH' ff.validate()
{ "content_hash": "179f60050b52550471fbf4ae89e95da5", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 21.625, "alnum_prop": 0.7167630057803468, "repo_name": "scooterXL/flatland-europython-2010", "id": "aec1f9fc84a23ac063f5714d3df4dc8e130e0488", "size":...
""" Example of how to trace a Fresnel Zone Plate by Lucia Alianelli and Manuel Sanchez del Rio. 1) The source is from get_beam(), is a collimated source of squared cross section (800 microns), monochromatic (1.54 A) 2) fresnel_zone_plane() calculates a fzp, centered at (0,0). It returns a new shadow3 beam cont...
{ "content_hash": "fb8746d42b4433447841335cdc00b123", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 111, "avg_line_length": 26.357487922705314, "alnum_prop": 0.6009897360703812, "repo_name": "srio/shadow3-scripts", "id": "74a1d8b59fab5a85c1f87749bb38a0310604f97e", "size"...
"""Config flow for yolink.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Any from homeassistant.config_entries import ConfigEntry from homeassistant.data_entry_flow import FlowResult from homeassistant.helpers import config_entry_oauth2_flow from .const i...
{ "content_hash": "4f6831e818837a92bdfdd76d4a0876cf", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 83, "avg_line_length": 37.96875, "alnum_prop": 0.6641975308641975, "repo_name": "w1ll1am23/home-assistant", "id": "128cd6cb35c3624a6b4cf5b952c4219e0b6ced12", "size": "2430"...
"""Functions useful to all element classes.""" import sys import argparse from subprocess import Popen, PIPE, STDOUT, CalledProcessError # ============================================================================== __version__ = "0.1" __copyright__ = "Copyright 2017, devops.center" __credits__ = ["Bob Lozano", "Gr...
{ "content_hash": "79e0d43272b009a4d482da5d9610b26b", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 80, "avg_line_length": 38.0990990990991, "alnum_prop": 0.5240009458500827, "repo_name": "devopscenter/dcStack", "id": "63b332c32cf4547c9a95b721ff969e47e65e5662", "size": "...
"""Tests Google Test's throw-on-failure mode with exceptions disabled. This script invokes gtest_throw_on_failure_test_ (a program written with Google Test) with different environments and command line flags. """ __author__ = '[email protected] (Zhanyong Wan)' import os import gtest_test_utils # Constan...
{ "content_hash": "0d6b521e2a68ee68abc85692f088a8e7", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 79, "avg_line_length": 30.886524822695037, "alnum_prop": 0.5908151549942595, "repo_name": "2coding/Codec", "id": "7ede7854ad0dc31f8b11597a8b2cbcb87e54ed84", "size": "5937"...
''' Copyright (c) 2010 openpyxl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
{ "content_hash": "62d680994063347a3f09f0a096cf45b9", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 115, "avg_line_length": 41.84249084249084, "alnum_prop": 0.5385625492427558, "repo_name": "chronossc/openpyxl", "id": "5b500f976f6c2500fce13c1e5814589535bfd31e", "size": "...
"""Tests for collection domain objects and methods defined on them.""" from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules import datetime from constants import constants from core.domain import collection_domain...
{ "content_hash": "10c0f21cbe005a92850cb79e5591cc9c", "timestamp": "", "source": "github", "line_count": 1130, "max_line_length": 80, "avg_line_length": 39.18230088495575, "alnum_prop": 0.6346327581534014, "repo_name": "prasanna08/oppia", "id": "63c855aac942b5cefd1e7cc76a12f82d460ab59f", "size": "44...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class WebChannelTestCase(IntegrationTestCase):...
{ "content_hash": "8d223d43244fea507cc26788640e65ba", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 222, "avg_line_length": 36.01005025125628, "alnum_prop": 0.5597264861847614, "repo_name": "twilio/twilio-python", "id": "dcbb89fea9421245a73c67a53135df72ab2d1038", "size":...
"""The tests for the TCP binary sensor platform.""" from datetime import timedelta from unittest.mock import call, patch import pytest from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.setup import async_setup_component from homeassistant.util.dt import utcnow from tests.common import assert_set...
{ "content_hash": "60b5b0f70701be78ed91210c44df0a52", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 87, "avg_line_length": 32.734939759036145, "alnum_prop": 0.6919396393080604, "repo_name": "adrienbrault/home-assistant", "id": "21dd84b189211674cc224216a38181abcb2e4cbf", "...
from __future__ import absolute_import from .client import Client, get_metadata # noqa
{ "content_hash": "69f1a1bce8dbdb0887cb875714e007dd", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 48, "avg_line_length": 29.666666666666668, "alnum_prop": 0.7528089887640449, "repo_name": "eillarra/irekia", "id": "8d3efcf59f1ae679322dc231bb9a8466aabe9ee1", "size": "89", ...
from django.conf.urls.defaults import * from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # (r'^facebook/', include('django_facebook.urls')), ...
{ "content_hash": "3bcf717732f91c0cc05e49544b166978", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 95, "avg_line_length": 40.425, "alnum_prop": 0.4551638837353123, "repo_name": "fogcitymarathoner/djfb", "id": "45dfcd10d7ab93596a4f33633ed577b3ed2fc07b", "size": "1617", ...
import pytest import txaio def test_is_future_generic(framework): ''' Returning an immediate value from as_future ''' f = txaio.create_future('result') assert txaio.is_future(f) def test_is_future_coroutine(framework_aio): ''' Returning an immediate value from as_future ''' pyte...
{ "content_hash": "9190a75117c936ccd3cb1e6503ae3c6d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 21.433333333333334, "alnum_prop": 0.6671850699844479, "repo_name": "crossbario/txaio", "id": "fcadc7f026ec8e8af8ede05481283d8cccccdb0a", "size": "193...
def setColorCount(qimage, color_count): """Compatibility function btw. Qt4 and Qt5""" try: qimage.setColorCount(color_count) # Qt 4.6 and later except AttributeError: qimage.setNumColors(color_count) def colorCount(qimage): """Compatibility function btw. Qt4 and Qt5""" try: ...
{ "content_hash": "62fadad3ef11424d751d1a84687d4506", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 60, "avg_line_length": 25.5, "alnum_prop": 0.6689734717416378, "repo_name": "hmeine/qimage2ndarray", "id": "002a0e422c61477684ced96264afd4bda93b8a4b", "size": "869", "bin...
import numpy as np import pandas.compat as compat import pandas as pd class TablePlotter(object): """ Layout some DataFrames in vertical/horizontal layout for explanation. Used in merging.rst """ def __init__(self, cell_width=0.37, cell_height=0.25, font_size=7.5): self.cell_width = cel...
{ "content_hash": "cf39b8210df2869362fea9b1c88efe8b", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 77, "avg_line_length": 34.46116504854369, "alnum_prop": 0.516410762079166, "repo_name": "MJuddBooth/pandas", "id": "4aee0a2e5350e0ad1229ca9d209d34a925a4b482", "size": "709...
"""Provide a class for loading data from URL's that handles basic authentication""" ident = '$Id: URLopener.py 541 2004-01-31 04:20:06Z warnes $' from version import __version__ from Config import Config from urllib import FancyURLopener class URLopener(FancyURLopener): username = None passwd = None d...
{ "content_hash": "b57b14dbcfdabb8cebfeb643547804dc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 65, "avg_line_length": 25.391304347826086, "alnum_prop": 0.678082191780822, "repo_name": "asfaltboy/jirash", "id": "2c04c8685418d2126a2bc4f59fd108bd016a9763", "size": "584"...
# # 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 us...
{ "content_hash": "5068538d67299c5e940e939c00b1eeee", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 35.285714285714285, "alnum_prop": 0.6863905325443787, "repo_name": "robertwb/incubator-beam", "id": "262a75b756a814e869369cc7dcb3de75813aeccc", "size...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ from horizon import forms from horizon.utils import functions as utils from openstack_dashboard.dashboards.settings.user import forms as user_forms class UserSettingsView(forms.ModalFormView): form_class = user_forms.UserSet...
{ "content_hash": "ce53c9ba2e521bb2d1329ac2e4b540cf", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 39.925925925925924, "alnum_prop": 0.650278293135436, "repo_name": "tsufiev/horizon", "id": "6f81435948ca3943435083784541ae544e151511", "size": "1683"...
"""Module for logging subtasks. """ import abc from typing import Any, List, Mapping, Optional import dm_env from dm_robotics.agentflow import subtask from dm_robotics.agentflow.loggers import types from dm_robotics.agentflow.loggers import utils import numpy as np class Aggregator(abc.ABC): """Base class for dat...
{ "content_hash": "6e29e9c2efa1a354eaf7ca72ce7abd5f", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 80, "avg_line_length": 36.9468085106383, "alnum_prop": 0.677512237258854, "repo_name": "deepmind/dm_robotics", "id": "b38bbfc59ab010d524e87772067d0d478c08a86e", "size": "40...
""" gridsearch to find best values for max_depth and min_samples_leaf in a decision tree that predicts all the output measures. """ import numpy as np import time from sklearn import tree from sklearn.metrics import mean_squared_error from sklearn.grid_search import GridSearchCV from lignet_utils import gen_train_te...
{ "content_hash": "50db0b71f63dc5e70daa9df942019fa7", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 73, "avg_line_length": 32.1, "alnum_prop": 0.6752336448598131, "repo_name": "houghb/lignet", "id": "35aa54d88ce0e023a5d34058bd8062f81265a172", "size": "1284", "binary": f...
from os.path import join import datetime import logging import time # third party import requests # local modules import fc.utils as utils logger = logging.getLogger() # WARNING level and worse for requests logging.getLogger('requests').setLevel(logging.WARNING) def process_one_email(q, count, id_val, dt, email):...
{ "content_hash": "31ab4ae22f54bf1eb221d6e10ce69ab7", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 81, "avg_line_length": 34.11340206185567, "alnum_prop": 0.5314294348745845, "repo_name": "curtisalexander/fc", "id": "5b1efcfe587a4530e3f82127e35d4a6a5e1dabc8", "size": "6...
""" =============================================================================== Original code copyright (C) 2009-2022 Rudolf Cardinal ([email protected]). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in co...
{ "content_hash": "dc69212bd38c14af154fe1a2e94d960c", "timestamp": "", "source": "github", "line_count": 776, "max_line_length": 119, "avg_line_length": 35.72164948453608, "alnum_prop": 0.6071067821067822, "repo_name": "RudolfCardinal/pythonlib", "id": "a4224084c78870b90238dd432daa2d52f0f866d5", "si...
""" ### Creating a MongoQuery `MongoQuery` is the main tool that lets you execute JSON Query Objects against an SqlAlchemy-handled database. There are two ways to use it: 1. Construct `MongoQuery` manually, giving it your model: ```python from mongosql import MongoQuery from .models import User # Your m...
{ "content_hash": "edff6d6317a9b83edad8b60c5da99db6", "timestamp": "", "source": "github", "line_count": 837, "max_line_length": 128, "avg_line_length": 41.157706093189965, "alnum_prop": 0.6231240384336265, "repo_name": "kolypto/py-mongosql", "id": "1fe75ddca726c1c19838feae5358b0120cc16591", "size":...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import re import subprocess from collections import namedtuple from pants.base.workunit import WorkUnit, WorkUnitLabel from pants.task.task import Task fr...
{ "content_hash": "604c8ded90c072585c965dc0c6531338", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 99, "avg_line_length": 40.71341463414634, "alnum_prop": 0.6794967799910139, "repo_name": "peiyuwang/pants", "id": "efa670fd49e01097d814c823e10797a0a84b4d6f", "size": "6824...
import datetime import decimal from sqlalchemy.engine import create_engine from sqlalchemy.schema import Table, MetaData, Column from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import types, func, case, inspect from sqlalchemy.sql import expression, select, literal_column from sqlalchemy.exc im...
{ "content_hash": "f6b045d32508ceb3737f7437752e2de8", "timestamp": "", "source": "github", "line_count": 752, "max_line_length": 100, "avg_line_length": 33.962765957446805, "alnum_prop": 0.631440877055599, "repo_name": "mxmzdlv/pybigquery", "id": "564c5e68f4844c01df075f1d357d99f9ccc44400", "size": "...
import sys import types import unittest import inspect import datetime from test.test_support import TESTFN, run_unittest from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, # isbuil...
{ "content_hash": "c89fb41767b5fdbf324267e1516d8176", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 83, "avg_line_length": 39.407630522088354, "alnum_prop": 0.5881783439490446, "repo_name": "MalloyPower/parsing-python", "id": "32eeb57d31e8eb4b67f1a8005d2089c57eab62fb", "...
""" """ # Standard library modules. # Third party modules. import pytest # Local modules. from pyxray.cbook import ProgressMixin, ProgressReportMixin # Globals and constants variables. class MockProgress(ProgressMixin): pass class MockProgressReport(ProgressReportMixin): pass @pytest.fixture def progr...
{ "content_hash": "3571fed1a1a2fc514cedca1fa72fdd6d", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 59, "avg_line_length": 18.066666666666666, "alnum_prop": 0.7355473554735548, "repo_name": "ppinard/pyxray", "id": "be71516c513d2de2d9188d3edd408fa0c7da24f9", "size": "835",...
import datetime from tapz.panels.options import PanelOptions from tapz.panels.intervals import Day, Hour from tapz.site import site from tapz import exceptions, tasks COOKIE_INTERVAL = 'interval' class PanelMeta(type): """ Metaclass for all Panels """ def __new__(cls, name, bases, attrs): sup...
{ "content_hash": "223a8f2cc04fbd02b2f07672f961459c", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 89, "avg_line_length": 34.952095808383234, "alnum_prop": 0.5782079835531951, "repo_name": "teopeurt/tapz", "id": "ba87e5b1441219f499c5a43b52f07e1a4bfcaa4e", "size": "5837"...
import os import time from slackclient import SlackClient token = os.environ['SLACK_API_TOKEN'] sc = SlackClient(token) checkforconnection() def getlastmsg(): last_three = sc.api_call("channels.history", channel="C3B6Z61U3", count="1") for m in last_three["messages"]: print(m["user"] + ":...
{ "content_hash": "7e2b41e69fa1ce4ce906f1bed08a5684", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 90, "avg_line_length": 28.6, "alnum_prop": 0.6142191142191142, "repo_name": "xaner4/Slackbot", "id": "3d056dface1eef382501691a22edd44e4586dc2c", "size": "858", "binary": ...
from collections import defaultdict from datetime import timedelta from django.db.models.aggregates import Count from django.http import HttpResponse from corehq.apps.commtrack.models import StockState from corehq.apps.locations.models import SQLLocation from corehq.apps.products.models import SQLProduct from corehq.ap...
{ "content_hash": "1300cf7898ec7c1e31498476a8205e9b", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 114, "avg_line_length": 40.60632688927944, "alnum_prop": 0.5571521315732525, "repo_name": "puttarajubr/commcare-hq", "id": "6da1d08f7c56b0348b95456e0cd714e26faf7a8a", "siz...
""" Django settings for Szkiz project. Generated by 'django-admin startproject' using Django 1.9.5. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # B...
{ "content_hash": "b008dbcc654e87fc8a22facbf0ae00b5", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 91, "avg_line_length": 26.28985507246377, "alnum_prop": 0.6634509371554576, "repo_name": "EricFelixLuther/Szkiz", "id": "e790bbf853f6010cd34ba1c222c0ac94933de823", "size":...
CONSTANT = "SOME OTHER CONSTANT"
{ "content_hash": "a5fbd94442e0a608e82e7dcba683308f", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 32, "avg_line_length": 33, "alnum_prop": 0.7575757575757576, "repo_name": "zpao/buck", "id": "abcde58fb5b77505f65a47a5b705437d01a7ad3d", "size": "33", "binary": false, "...
from pyface.ui.qt4.gui import *
{ "content_hash": "9bd2aa0c1ccf782e941110cade574eef", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 32, "alnum_prop": 0.75, "repo_name": "enthought/etsproxy", "id": "03d19dd393e69b836e3a585132016107796a2a6f", "size": "47", "binary": false, "copie...
import unittest from openmdao.main.api import Component, VariableTree, Assembly, set_as_top from openmdao.main.datatypes.api import Float, VarTree class TstContainer(VariableTree): dummy1 = Float(1.0) class TstComponent(Component): dummy_data = VarTree(TstContainer(), iotype='in') dummy_data_out = VarT...
{ "content_hash": "9f0704e51c0376f0426c1da278fac7af", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 78, "avg_line_length": 38.97727272727273, "alnum_prop": 0.45558794946550046, "repo_name": "DailyActie/Surrogate-Model", "id": "ff39a616a31f0f501fc393995bfd4cfe671ff3c8", "...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 12);
{ "content_hash": "5567e55f1a797957e49d5a3643f0b629", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 161, "avg_line_length": 37.285714285714285, "alnum_prop": 0.7011494252873564, "repo_name": "antoinecarme/pyaf", "id": "f986bc6266186f6687ed6138a84043a0b1f0b478", "size": "26...
""" CoolFoursquareBro twitter bot, replies to foursquare tweets by a specific user with 'cool story bro' responses. Copyright (C) 2013 Barry O'Neill Author: Barry O'Neill <[email protected]> URL: <https://github.com/barryoneill/CoolFoursquareBro> For license information, see LICENSE.txt """ from __future__ import ...
{ "content_hash": "8bb7f73615b4c0bfc6f00d1ad38a18f4", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 120, "avg_line_length": 43.18181818181818, "alnum_prop": 0.5984962406015037, "repo_name": "barryoneill/CoolFoursquareBro", "id": "f38400a9984ff7f3d4549464e8604b01c64f4227", ...
"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation f...
{ "content_hash": "d3b7d3dcce79e3f5993a59f3aeeccd03", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 106, "avg_line_length": 33.040712468193384, "alnum_prop": 0.6006931074316519, "repo_name": "james-dibble/Embedded-Systems-Assignment", "id": "a37da0719e2e0e3c527809df8c5c5b5...
from .resource import Resource class RouteTable(Resource): """Route table resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. ...
{ "content_hash": "7a9b4919f376a1ecaf36437d6fbbd3ea", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 107, "avg_line_length": 37.2, "alnum_prop": 0.6065493646138808, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "4a2c9d6c9e3535c4a1eb31e4c596c5171cbbb0b0", "size": "2...
from kv1_811 import * from inserter import insert,version_imported from bs4 import BeautifulSoup import urllib2 from datetime import datetime,timedelta import logging from settings.const import * logger = logging.getLogger("importer") def getDataSource(): return { '1' : { 'operator_id' ...
{ "content_hash": "0f6aeb2da7da8387fee8ef71cb773a68", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 146, "avg_line_length": 47.953216374269005, "alnum_prop": 0.605, "repo_name": "bliksemlabs/bliksemintegration", "id": "465b22bd319331cbaad9588c2d124824cf654cd4", "size": "...
from ConnectionServer import ConnectionServer from Connection import Connection
{ "content_hash": "3250309376c9b656b00c1687bd59b513", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 45, "avg_line_length": 40, "alnum_prop": 0.9, "repo_name": "kustomzone/Fuzium", "id": "5bd29c6e2ff5403446f834916c6a6e1994e762f7", "size": "80", "binary": false, "copies"...
people = list() people.append("Kiwi") people.append(["Nanu", "Nani"]) people.append("Mama") print people # Using "in", return boolean print "Kiwi" in people # True print "Kiwi Dakri" in people # False
{ "content_hash": "0b37ecd75c9d9c6843a26b1bf4fe532b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 36, "avg_line_length": 22.444444444444443, "alnum_prop": 0.698019801980198, "repo_name": "rahulbohra/Python-Basic", "id": "1d57e71697bae7b4df0ec3529e975ac552ef6d7e", "size":...