text
stringlengths
4
1.02M
meta
dict
import logging import json from webob import Response import time from threading import Timer from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.controller import dpset # from ryu.app.wsgi impor...
{ "content_hash": "341b48eb7d3a1310c5875c4c8b8b7dbb", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 99, "avg_line_length": 32.5514705882353, "alnum_prop": 0.5873051728032528, "repo_name": "umkcdcrg01/ryu_openflow", "id": "bdb3b85725935049a0fef68b07f447a5e7d9392a", "size"...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/furniture/shared_furniture_armoire_modern.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "71de1fa94a38228290752319a48a6027", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 24.46153846153846, "alnum_prop": 0.7044025157232704, "repo_name": "obi-two/Rebelion", "id": "d0a2193c425b707be51f51187e992b361c71a6b8", "size": "463"...
from ctypes import CDLL import itertools as it import os import platform import shlex import tempfile from appdirs import user_cache_dir from pytools.prefork import call_capture_output from pyfr.ctypesutil import platform_libname from pyfr.nputil import npdtype_to_ctypestype from pyfr.util import digest, lazyprop, mv...
{ "content_hash": "c062541110d8a8c0317b5274193de5a9", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 74, "avg_line_length": 35.1203007518797, "alnum_prop": 0.5626204238921002, "repo_name": "BrianVermeire/PyFR", "id": "0f364c5dc55cc78cee04d6013306efaa717d501d", "size": "46...
import base64 import time import uuid import importlib from flask import Flask from flask import render_template, request, make_response, redirect, g from Crypto.Cipher import DES from Crypto.Util.Padding import pad, unpad import jwt BLOCK_SIZE = 32 # Bytes cookies_max_age = 7 * 24 * 60 * 60 # 1week app = Flask(__nam...
{ "content_hash": "79a35d0c6e227ec66e0cea35ab5b713f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 207, "avg_line_length": 41.0735294117647, "alnum_prop": 0.6577157178660938, "repo_name": "akurdyukov/nginxauthdaemon", "id": "bf342e5a8f8110e9955c054121307e54f4529202", "s...
from .adapt_service import AdaptService, AdaptIntent from .base import IntentMatch from .fallback_service import FallbackService from .padatious_service import PadatiousService, PadatiousMatcher
{ "content_hash": "b9e7bd7c4324d97c60643e9bd570f156", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 65, "avg_line_length": 48.75, "alnum_prop": 0.8615384615384616, "repo_name": "forslund/mycroft-core", "id": "8603aad314d4602a94bd3b7e3f89104f4244ab9a", "size": "195", "bin...
"""Computational environment validation script for the 2014 SciPy Conference Tutorial: Reproducible Research: Walking the Walk. https://github.com/reproducible-research/scipy-tutorial-2014 """ import sys import subprocess return_value = 0 required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK'] for pac...
{ "content_hash": "8330aec4ce010a923bdacbd2fdd85fea", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 86, "avg_line_length": 26.3125, "alnum_prop": 0.6033254156769596, "repo_name": "cpcloud/scipy-tutorial-2014", "id": "451e755ab4158ae5a6e9ccc728e498feb709e1f3", "size": "128...
import os import praw import time import sqlite3 import traceback from random import randint from random import choice print ("\n\nOpening database...") #SQL database setup/ignition. sql = sqlite3.connect('sql.db') cur = sql.cursor() cur.execute('CREATE TABLE IF NOT EXISTS cid_storage(ID TEXT)') cur.execute('CREATE TA...
{ "content_hash": "45652297c04e60833e73a8f14233a1de", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 218, "avg_line_length": 46.56502242152467, "alnum_prop": 0.6434899845916795, "repo_name": "Saroekin/GoldFact", "id": "7d1e94d96a93a95cb0e5a54d57fe363a9de8e105", "size": "1...
from kraken import plugins from kraken.core.objects.locator import Locator from kraken.core.objects.operators.kl_operator import KLOperator from kraken.core.traverser.traverser import Traverser locInA = Locator("locatorInA") locInB = Locator("locatorInB") locOutA = Locator("locatorOutA") locOutB = Locator("locatorOutB...
{ "content_hash": "587964e1da1d1d459a17babb2de2f3ee", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 66, "avg_line_length": 32.22222222222222, "alnum_prop": 0.7793103448275862, "repo_name": "oculusstorystudio/kraken", "id": "04fc4fb1fcdba34f290ce04d269d6a4434bdbdcb", "size...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/furniture/city/shared_streetlamp_large_02.iff" result.attribute_template_id = 6 result.stfName("frn_n","streetlamp_2") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "91307fe90245abad2645bd41fde264bf", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 23.846153846153847, "alnum_prop": 0.7, "repo_name": "anhstudios/swganh", "id": "60c5b03fb30c46726bbd2dd7ec95f655feeba201", "size": "455", "binary":...
"""Imports to tensorflow_quantum.core.* level.""" # Import getters for constructing ops. from tensorflow_quantum.core.ops import (get_expectation_op, get_sampled_expectation_op, get_sampling_op, get_state_op, ...
{ "content_hash": "a470ba4b534ec29cdac7ba2d475daa89", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 80, "avg_line_length": 47.214285714285715, "alnum_prop": 0.5915279878971256, "repo_name": "tensorflow/quantum", "id": "fb24ad4a8c1f98f75937814b000c9f8167ecefaa", "size": "1...
import os from urllib.request import urlretrieve import pandas as pd FREMONT_URL = 'https://data.seattle.gov/api/views/65db-xm6k/rows.csv?accessType=DOWNLOAD' def get_fremont_data(filename='Fremont.csv', url=FREMONT_URL, force_download=False): """Download and cache the fremont data Parameters ----------...
{ "content_hash": "ba12f6c762f8de4bccb1b5a232ccb8a3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 89, "avg_line_length": 28.82857142857143, "alnum_prop": 0.6382556987115956, "repo_name": "muxuezi/jupyterworkflow", "id": "79e4a3d575d3663d01c19f7cef18cc22c6603932", "size"...
import os import sys import yaml import numpy as np featuresDir = 'logs/features' features = [yaml.load(''.join([l for l in open(os.path.join(featuresDir, logFile)) if not l.startswith('[')])) for logFile in sorted(os.listdir(featuresDir))] fisher_vectorsDir = 'logs/fisher_vectors' fisher_vectors = [yaml.load(open(os...
{ "content_hash": "681885545a415269bc7bbf3f835f7ff8", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 413, "avg_line_length": 74.55882352941177, "alnum_prop": 0.6568047337278107, "repo_name": "vadimkantorov/cvpr2014", "id": "33570f54a0fe52b1deaf015e07981c831400f529", "size"...
"""Definition of the audio service backends base classes. These classes can be used to create an Audioservice plugin extending Mycroft's media playback options. """ from abc import ABCMeta, abstractmethod class AudioBackend(metaclass=ABCMeta): """Base class for all audio backend implementations. Args: ...
{ "content_hash": "e040c2ef4d158953c49a7405181d9108", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 79, "avg_line_length": 25.328767123287673, "alnum_prop": 0.607355327203894, "repo_name": "MycroftAI/mycroft-core", "id": "9a387dc7da0f179d8279dcddf7200c5faa3d29b8", "size"...
"""Extract reference documentation from the NumPy source tree. """ import inspect import textwrap import re import pydoc from warnings import warn, catch_warnings # Try Python 2 first, otherwise load from Python 3 try: from StringIO import StringIO except: from io import StringIO class Reader(object): "...
{ "content_hash": "6986930fc340ae757ba9b6d610f6a8a2", "timestamp": "", "source": "github", "line_count": 512, "max_line_length": 78, "avg_line_length": 30.294921875, "alnum_prop": 0.47495325897749985, "repo_name": "wronk/mne-python", "id": "5e01fd82be9284676090d3782b856cbf4ccf460b", "size": "15511",...
import dota2api import greetings import o1 import o2 import os ############################################## ################GLOBAL VARIABLES################ fileDirectory = '../txtResults/' apiKey = os.environ['dota2_api_key'] ################################################ def main(): myAccountID = greetings.log...
{ "content_hash": "54acab143844a425bcbab20f509c14cf", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 58, "avg_line_length": 26.586206896551722, "alnum_prop": 0.47470817120622566, "repo_name": "divinoob/DotaScene", "id": "f4a23bf40392aa85a94da11539341f6d70f4fd68", "size": "...
import requests url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=0%2C0&key=YOUR_API_KEY" payload={} headers = {} response = requests.request("GET", url, headers=headers, data=payload) print(response.text) # [END maps_http_geocode_zero_results]
{ "content_hash": "8a7a15c0ab33e13acc198164c8bfb1df", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 21.916666666666668, "alnum_prop": 0.7376425855513308, "repo_name": "googlemaps/openapi-specification", "id": "fb4f6e645d3c1d0c0f4a577ffb3f8d0742d5405c"...
from elasticsearch_dsl import Date, Boolean, Text, Integer, Byte, Float, Keyword from {{appname}}.models.elastic.dsl_basemodel import ElasticDSLBaseModel from {{appname}}.lib.powlib import relation from elasticsearch_dsl import DocType from {{appname}}.database.elasticdblib import dbname from datetime import datetime ...
{ "content_hash": "d29c5a5744b0ee1052cf77d59b9fdb7a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 83, "avg_line_length": 27.87037037037037, "alnum_prop": 0.5375415282392026, "repo_name": "pythononwheels/pow_devel", "id": "44f0bf125a266af13c9d3bf525b68b9560119718", "size...
from __future__ import absolute_import import logging import mock import re import unittest2 import prompt_toolkit from prompt_toolkit.document import Document from six.moves import StringIO from st2client.utils import interactive import six LOG = logging.getLogger(__name__) class TestInteractive(unittest2.TestCa...
{ "content_hash": "c0e628f6d5350f5f1d411ff8c1658d17", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 99, "avg_line_length": 36.85310734463277, "alnum_prop": 0.6037099494097807, "repo_name": "Plexxi/st2", "id": "dce4c6748ddfa2605b0b1deb096d8c03f7c143ab", "size": "13674", ...
"""Mix provider which read config from different other providers. .. moduleauthor:: Xiaodong Wang <xiaodongwang@huawei.com> """ from compass.config_management.providers import config_provider from compass.utils import setting_wrapper as setting class MixProvider(config_provider.ConfigProvider): """mix provide...
{ "content_hash": "9726256dd942356b77707ddfaaa44e6c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 72, "avg_line_length": 35.638297872340424, "alnum_prop": 0.6770149253731343, "repo_name": "SysCompass/compass-core", "id": "b858ea9d4588da361c33de738f6fd01979266133", "size...
""" find_only_repeat.py Find the only element in an array that only occurs once. Author: Corwin Brown <blakfeld@gmail.com> """ from __future__ import print_function import sys from collections import defaultdict def find_only_repeat(list_to_search): """ Search a list for a single repeating int. Arg...
{ "content_hash": "41dc59aa627ef41e365d6cf915dcb594", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 60, "avg_line_length": 18.333333333333332, "alnum_prop": 0.6013986013986014, "repo_name": "blakfeld/Data-Structures-and-Algoritms-Practice", "id": "2b15d10ec5527a8ccf4af518b5...
from __future__ import division, absolute_import, print_function import collections import operator import re import sys import warnings import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d, transpose from numpy.core.numeric import ( ones, zeros, arange, conc...
{ "content_hash": "228d69aa138e4818f3f1097bd5798571", "timestamp": "", "source": "github", "line_count": 5130, "max_line_length": 88, "avg_line_length": 32.910526315789475, "alnum_prop": 0.5687877226338764, "repo_name": "chatcannon/numpy", "id": "4a07815e84acb8e0e44ebecaecc3982f1555eca9", "size": "1...
""" Django settings for oopsallbaddies project. Generated by 'django-admin startproject' using Django 1.11.2. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ im...
{ "content_hash": "66bc1dbc2a2f875f1c89cde99db1d93e", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 92, "avg_line_length": 26.753424657534246, "alnum_prop": 0.6853558627752177, "repo_name": "MotherGinger/oopsallbaddies", "id": "e9c7f2f24f8dd3d3b3e90b2c513548c3e72a0945", ...
import numpy as np from pystruct.models.base import StructuredModel from sklearn.utils.extmath import safe_sparse_dot from label import Label def _validate_params(unary_potentials, pairwise_params, edges): n_states = unary_potentials.shape[-1] if pairwise_params.shape == (n_states, n_states): # onl...
{ "content_hash": "6a4257057573a125b94b11f3bfed6c8e", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 110, "avg_line_length": 37.80607476635514, "alnum_prop": 0.5474321735368642, "repo_name": "kondra/latent_ssvm", "id": "244649998d3df1f3b59ac36377fb3811d0309920", "size": "...
import os # try/except added for compatibility with python < 3.8 try: from unittest import mock from unittest.mock import AsyncMock # pragma: NO COVER except ImportError: # pragma: NO COVER import mock import math from google.api_core import ( future, gapic_v1, grpc_helpers, grpc_helper...
{ "content_hash": "b47cb304c5b73e2188c9c6ee12b6765d", "timestamp": "", "source": "github", "line_count": 1864, "max_line_length": 153, "avg_line_length": 36.737124463519315, "alnum_prop": 0.6552761470837349, "repo_name": "googleapis/python-documentai", "id": "782f9b608fc04208a9270e247840b2cda4e97aa9",...
import click from arrow.cli import pass_context, json_loads from arrow.decorators import custom_exception, dict_output @click.command('delete_organism') @click.argument("organism_id", type=str) @pass_context @custom_exception @dict_output def cli(ctx, organism_id): """Remove an organism completely. Output: ...
{ "content_hash": "0ea1e1747b1f1d4004e8be495cff2f36", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 60, "avg_line_length": 24.38888888888889, "alnum_prop": 0.7562642369020501, "repo_name": "galaxy-genome-annotation/python-apollo", "id": "6b3dfdda71de4f0bb39266ae85732594478a...
""" Test Gemini Astroquery module. For information on how/why this test is built the way it is, see the astroquery documentation at: https://astroquery.readthedocs.io/en/latest/testing.html """ from datetime import date import json import os import pytest import requests from astropy import units from astropy.coordin...
{ "content_hash": "0cb2060244e36085544b4fda9721c3ae", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 109, "avg_line_length": 33.774566473988436, "alnum_prop": 0.6482971076501797, "repo_name": "imbasimba/astroquery", "id": "494751350315edb40781bc338ee65787eca45107", "size"...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.pr...
{ "content_hash": "ccdc4e277c3b1192b45ccb9b0aa7729f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 181, "avg_line_length": 32.15068493150685, "alnum_prop": 0.7115466553046442, "repo_name": "MaxNoe/cta_event_viewer", "id": "44fd4c705f27800ca8fba540aa01e28d1b4804f8", "size...
from django.db import models from mongo_storage.fields import MongoFileField __all__ = ( 'DeleteFileMixin', 'MongoDeleteFileModel', 'MongoFileModel', ) class DeleteFileMixin(object): """ Will delete the file from the database when the model is deleted. The file field MUST be named 'content'. ...
{ "content_hash": "2704c389e2dcfacb5c33c0832b93cc10", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 69, "avg_line_length": 27.76923076923077, "alnum_prop": 0.7026777469990766, "repo_name": "madisona/django-mongo-storage", "id": "2c7b514ebdfef6e26bcbf14be9f961ed18b08c1f", ...
''' codegen.codegen -- shortdesc codegen.codegen is a description It defines classes_and_methods @author: OnApp @copyright: 2013 organization_name. All rights reserved. @license: license @contact: user_email @deffield updated: Updated ''' # TODO - Need to add actions and designators...
{ "content_hash": "aa299a75f4c934a4e23959967b5dbf5f", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 138, "avg_line_length": 34.367816091954026, "alnum_prop": 0.5759197324414715, "repo_name": "ow2-compatibleone/accords-platform", "id": "d2342ab02d1aa3a2426334d829d74501a1353...
""" Copyright 2015 Logvinenko Maksim Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
{ "content_hash": "ac58587881b0b6b5544d69d271b2d23b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 88, "avg_line_length": 32.95454545454545, "alnum_prop": 0.6751724137931034, "repo_name": "logarithm/photon-python", "id": "d7cc9a785a2427702e69f3da36e71cd4ead7fe58", "size"...
from .development import * ######################################### ## GENERIC ######################################### DEBUG = True ADMINS = ( ("mritd", "mritd1234@gmail.com"), ) SECRET_KEY = "DuEitHBCmausDXQpQJqY7QnJ" DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', ...
{ "content_hash": "b2fa46b43b1d445dd06304d5a7b9326e", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 89, "avg_line_length": 28.81025641025641, "alnum_prop": 0.5717337130651478, "repo_name": "mritd/docker-compose", "id": "92322c1b9de58fdad04c82cd9a4c3c56561913c2", "size": ...
__doc__=""" Doubles single-unit distances. """ thisFont = Glyphs.font # frontmost font selectedLayers = thisFont.selectedLayers # active layers of selected glyphs def process( thisLayer ): for thisPath in thisLayer.paths: for thisNode in thisPath.nodes: prevNode = thisNode.prevNode if prevNode.type != OFFCUR...
{ "content_hash": "8d7aec906bb7faf7e074e9a8b0c9c186", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 33.25, "alnum_prop": 0.7379162191192267, "repo_name": "schriftgestalt/Mekka-Scripts", "id": "936d121833313397e9faddc1aff3cf91f65ed52d", "size": "990"...
"""Support for Dyson Pure Cool Link Sensors.""" import logging from libpurecool.dyson_pure_cool import DysonPureCool from libpurecool.dyson_pure_cool_link import DysonPureCoolLink from homeassistant.const import PERCENTAGE, STATE_OFF, TEMP_CELSIUS, TIME_HOURS from homeassistant.helpers.entity import Entity from . im...
{ "content_hash": "f2bdd6d560d859c06e9c71d6e097c3f7", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 83, "avg_line_length": 31.770731707317072, "alnum_prop": 0.6262858897589436, "repo_name": "tchellomello/home-assistant", "id": "98c69a7a7db1c91b9b702d0f0d0005ab8c55a13a", ...
import os import sys import random import math import time class BadInputError(Exception): pass class Player(): def __init__(self, name): self.id = None self.name = name self.type = 'Human' self.hand = Hand() self.legalCards = [] self.wildCards = [] sel...
{ "content_hash": "a913bdd3b824728c38e0c2f172ef8e5d", "timestamp": "", "source": "github", "line_count": 1535, "max_line_length": 439, "avg_line_length": 43.715309446254075, "alnum_prop": 0.47483719058760415, "repo_name": "ActiveState/code", "id": "04cccec53e500fdd1bf45b3d570ec76b31c5ca98", "size": ...
"""Support for Netatmo Smart thermostats.""" from __future__ import annotations import logging import pyatmo import voluptuous as vol from homeassistant.components.climate import ClimateEntity from homeassistant.components.climate.const import ( CURRENT_HVAC_HEAT, CURRENT_HVAC_IDLE, DEFAULT_MIN_TEMP, ...
{ "content_hash": "9597807f92b9bbbce7a62bcaa49f57b1", "timestamp": "", "source": "github", "line_count": 610, "max_line_length": 107, "avg_line_length": 35.29672131147541, "alnum_prop": 0.5787933677023827, "repo_name": "kennedyshead/home-assistant", "id": "ce1eba11b70ab63569d1662570ba498059f00848", ...
from flask import session from flask_admin.contrib.sqla import ModelView from flask_admin.form import SecureForm class TalkView(ModelView): list_columns = ['id', 'speaker_facebook_id', 'speaker', 'title', 'description', 'likes'] form_base_class = SecureForm def is_accessible(self): if not session....
{ "content_hash": "90cb9db7ba0bc6b8b0e79408c49e5c5d", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 92, "avg_line_length": 30.615384615384617, "alnum_prop": 0.6633165829145728, "repo_name": "Stark-Mountain/meetup-facebook-bot", "id": "adc458abe2e0e5d548e0a1042446c2ed4d3c481...
from unittest import mock from unittest.mock import call from osc_lib import exceptions from osc_lib import utils from openstackclient.tests.unit.volume.v1 import fakes as volume_fakes from openstackclient.volume.v1 import volume_transfer_request class TestTransfer(volume_fakes.TestVolumev1): def setUp(self): ...
{ "content_hash": "998ee76e63382a7ea134c3800f3329c9", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 78, "avg_line_length": 30.02981029810298, "alnum_prop": 0.5842432993412147, "repo_name": "openstack/python-openstackclient", "id": "97700fbb7ffa3bd1ae758780be4c2e51e319f8a1"...
""" Aravind Veerappan BNFO 601 - Exam 2 Question 2. Protein BLAST """ import math from PAM import PAM class BLAST(object): FORWARD = 1 # These are class variables shared by all instances of the BLAST class BACKWARD = -1 ROW = (0, 1) COLUMN = (1, 0) def __init__(self, query=None,...
{ "content_hash": "47c2e2c9e43a5126ec3063605d4fb94e", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 120, "avg_line_length": 48.26865671641791, "alnum_prop": 0.5958049886621315, "repo_name": "aravindvrm/bnfo", "id": "233559cbbce20a6e666ce90f9a2459c195da1807", "size": "194...
""" List the name and path of every buildable project. """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import re import operator import qibuild.parsers import qisys.parsers from qisys import ui def configure_parser(parser): """ Configure p...
{ "content_hash": "632344a0448d121d13f20d937a9fb824", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 75, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6433150183150184, "repo_name": "aldebaran/qibuild", "id": "8291df2280e12140ae62b554cab7b0d1380a3935", "size": "23...
import pika import logging import traceback import json import se.api from bs4 import BeautifulSoup class Dullu: RABBITMQ_QUEUE_URL_NAME = 'dullu_url_queue' RABBITMQ_QUEUE_ENTITY_NAME = 'dull_entity_queue' # Entity queue, up for change though. Other side not coded. JSON_KEY__ENTITYQ__ID = 'Id' JS...
{ "content_hash": "e1c256ee5521c740de233f5cde4dfa6f", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 133, "avg_line_length": 40.61344537815126, "alnum_prop": 0.6184564452720878, "repo_name": "IntrepidBrit/dullu", "id": "d35f0427b25d42ca20f116b3df15b0a9ff9447d3", "size": "...
from subtlenet import config from subtlenet.generators import gen as generator config.limit = 10 generator.truncate = 7
{ "content_hash": "89ec80718b71ffe3228ef800a5b2036c", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 49, "avg_line_length": 30, "alnum_prop": 0.825, "repo_name": "sidnarayanan/BAdNet", "id": "716314ab85d45e35aec2fa51c7cc29ec8856acb3", "size": "121", "binary": false, "co...
"""K-prototypes clustering""" # Author: Nico de Vos <njdevos@gmail.com> # License: MIT from collections import defaultdict import numpy as np from .KModes import KModes def euclidean_dissim(a, b): """Euclidean distance dissimilarity function""" return np.sum((a - b) ** 2, axis=1) def move_point_num(point,...
{ "content_hash": "182d4526a7b13370b17ca146738e29a2", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 79, "avg_line_length": 37.850467289719624, "alnum_prop": 0.5761316872427984, "repo_name": "bejar/kemlglearn", "id": "3e71c6288384ff27bbed3688f266054c140c612a", "size": "12...
""" sentry.search.django.constants ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :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 SORT_CLAUSES = { 'priority': 'sentry_groupedmessage.score', 'date': 'EXTRACT(E...
{ "content_hash": "5d9f4ed46369889e537637c280986838", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 133, "avg_line_length": 38.61904761904762, "alnum_prop": 0.6794081381011098, "repo_name": "mitsuhiko/sentry", "id": "d07708d74a015bdd0bd4f0411ae69587e4b956d6", "size": "162...
import elasticsearch_dsl as es from pyjobsweb.lib.elasticsearch_ import compute_index_name class Geocomplete(es.DocType): class Meta: index = 'geocomplete' doc_type = 'geoloc-entry' french_elision = es.token_filter( 'french_elision', type='elision', articles_case=True...
{ "content_hash": "b04c79eb37333522f676e96f3719fb81", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 65, "avg_line_length": 24.504065040650406, "alnum_prop": 0.559721300597213, "repo_name": "pyjobs/web", "id": "30dc64bbb6a95ef5d8ec283a235b1cca8e6523f7", "size": "3038", ...
from async import async import redis_wrap import urllib2 from cron import has_cron, add_cron @async(queue='clock') def bgrewriteaof(): """ 将redis的AOF文件压缩 """ redis = redis_wrap.get_redis() redis.bgrewriteaof() def set_bgrewriteaof(): # 自动定时压缩reids if not has_cron(bgrewriteaof): add_cron({'...
{ "content_hash": "2639b692d44080636afd46db03472c9d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 69, "avg_line_length": 25.083333333333332, "alnum_prop": 0.6710963455149501, "repo_name": "everydo/ztq", "id": "cf1f79795dd263f0f748cfae221c97602da80acf", "size": "648", ...
import json from vnpy.event import Event from vnpy.rpc import RpcServer from vnpy.trader.vtFunction import getJsonPath from vnpy.trader.vtObject import VtLogData EVENT_RTDSERVICE_LOG = 'eRtdServiceLog' ######################################################################## class RtdServer(RpcServer): """RTD服务...
{ "content_hash": "269a863d05e1d4da26c745c9d9fc91aa", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 75, "avg_line_length": 30.375, "alnum_prop": 0.42421124828532236, "repo_name": "wisfern/vnpy", "id": "3d4463e924a3ece5be6bf72ca0635de4c80a5e9d", "size": "3059", "binary":...
"""Implementation of the metadata abstraction for gRPC Asyncio Python.""" from typing import List, Tuple, Iterator, Any, Text, Union from collections import abc, OrderedDict MetadataKey = Text MetadataValue = Union[str, bytes] class Metadata(abc.Mapping): """Metadata abstraction for the asynchronous calls and in...
{ "content_hash": "fea727779a1102a105ca5d5c0e3d7b63", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 93, "avg_line_length": 37.47826086956522, "alnum_prop": 0.6102088167053364, "repo_name": "jboeuf/grpc", "id": "ff970106748dc5c84df6729e8224d726260a030a", "size": "4025", ...
from SNMApp import ObservableList, SnapshotBranch, Snapshot from CDPs import SphereCDP, BoxCDP, PlaneCDP, CapsuleCDP from RigidBody import RigidBody, ArticulatedRigidBody from ArticulatedFigure import ArticulatedFigure, Character from Joints import BallInSocketJoint, UniversalJoint, HingeJoint, StiffJoint from Sim...
{ "content_hash": "b1170aee1738fd2b5f02d32206bd9a22", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 194, "avg_line_length": 84.33333333333333, "alnum_prop": 0.8695652173913043, "repo_name": "Banbury/cartwheel-3d", "id": "f587d9353e985f91513c82a0a889b323479b0d17", "size": "...
import http.server import threading import socket import tdl import hunting.level.parser as parser import hunting.level.encoder as encoder from hunting.display.render import Renderer import hunting.sim.runner as runner import hunting.resources as resources UTF_8 = 'utf-8' def get_random_open_port(): s = socket...
{ "content_hash": "1d3a355a6aba7d6c4f920465883b092e", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 75, "avg_line_length": 28.557377049180328, "alnum_prop": 0.6050516647531573, "repo_name": "MoyTW/RL_Arena_Experiment", "id": "107416085c0c3bb0226edf05dd52436a057c262a", "s...
import Queue as queue import threading import collectd class BaseWriter(threading.Thread): """ Base class for all writers. :param formatter: Formatter instance. """ MAX_BUFFER_SIZE = 1000 """The maximum size of values in the output buffer.""" def __init__(self, formatter): co...
{ "content_hash": "77a919ac389fbfd23e20b9354ce8d462", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 86, "avg_line_length": 23.484848484848484, "alnum_prop": 0.5670967741935484, "repo_name": "mjuenema/collectd-plugins", "id": "78073f80c2017fc28586e01a85e05afb432814ef", "si...
from random import random, uniform from math import inf from pygame import Color as PyGameColor from colormath.color_objects import sRGBColor, LabColor, HSVColor from colormath.color_conversions import convert_color from colormath.color_diff import delta_e_cie2000 class Color(sRGBColor): def __init__(...
{ "content_hash": "6477a66ccb465dd722a5b9aad93f5a7a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 84, "avg_line_length": 36.44186046511628, "alnum_prop": 0.5682833439693682, "repo_name": "thdb-theo/Zombie-Survival", "id": "2edf7706abce7e7ab4f262f2c141ad6bf85c8279", "siz...
""" @author: Sebi File: write_OME-XML_from_file.py Date: 11.05.2015 Version. 1.1 """ from __future__ import print_function import bftools as bf # use for BioFormtas <= 5.1.10 #urlnamespace = 'http://www.openmicroscopy.org/Schemas/OME/2015-01' # use for BioFormtas > 5.2.0 urlnamespace = 'http://www.openmicroscopy.org...
{ "content_hash": "3520242ad0fa5a44c61e1b1b96aaa9f0", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 67, "avg_line_length": 25.68, "alnum_prop": 0.7383177570093458, "repo_name": "sebi06/BioFormatsRead", "id": "eb106f20b76ea8610418626e7580ef48c6a5a5c2", "size": "666", "bi...
"""The Clang Compiler. @see: Cake Build System (http://sourceforge.net/projects/cake-build) @copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon. @license: Licensed under the MIT license. """ from cake.library import memoise from cake.target import getPaths, getPath from cake.library.compilers import Compiler, ...
{ "content_hash": "3066d698338aae5ac1b6eb08d99e2bb3", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 95, "avg_line_length": 26.511627906976745, "alnum_prop": 0.6368421052631579, "repo_name": "lewissbaker/cake", "id": "353e63a0f24769aec209588ebcc63596a54df8cd", "size": "57...
from pandac.PandaModules import * from direct.gui.DirectGui import * from toontown.toonbase import ToontownGlobals, TTLocalizer from toontown.cogdominium import CogdoBarrelRoomConsts class CogdoBarrelRoomRewardPanel(DirectFrame): def __init__(self): DirectFrame.__init__(self, relief=None, geom=DGG.getDefa...
{ "content_hash": "70622de87afda08477782dc780fd5fa3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 198, "avg_line_length": 56.94444444444444, "alnum_prop": 0.6170731707317073, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "d96ab630a7a1ebbc224e715f1a36569d266a...
"""Package metadata for enn. This is kept in a separate module so that it can be imported from setup.py, at a time when enn's dependencies may not have been installed yet. """ __version__ = '0.1.0'
{ "content_hash": "8fb51746d223d1027b403b31e9987e0a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 78, "avg_line_length": 28.571428571428573, "alnum_prop": 0.715, "repo_name": "deepmind/enn", "id": "a73e776481bf5aa9c81d72f04651bf8fd450540a", "size": "930", "binary": fal...
import contextlib import sys import mitmproxy.master import mitmproxy.options from mitmproxy import addonmanager from mitmproxy import command from mitmproxy import eventsequence from mitmproxy.addons import script class TestAddons(addonmanager.AddonManager): def __init__(self, master): super().__init__(...
{ "content_hash": "18b0d53c37931f427c54bb601e9b7252", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 136, "avg_line_length": 31.257142857142856, "alnum_prop": 0.5744972577696527, "repo_name": "MatthewShao/mitmproxy", "id": "d966f1d5dd0ef6e1f61bc6ea3d086b87333e42c8", "size...
"""Compute Wasserstein distance between two random subsets of CIFAR10. Note: comparing two fixed sets is a sanity check, not the target use case. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import tensorflow as ...
{ "content_hash": "07352a645bcc6e19a38a312adeec5328", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 31.065217391304348, "alnum_prop": 0.7130860741777467, "repo_name": "google/wasserstein-dist", "id": "d964f54a4a42b6fce74c42b243e83877c2fc6bbc", "size...
from django.shortcuts import * from contacts.models import * from django.utils.text import slugify def index(request): companies = Company.objects.all() return render(request, 'contacts/index.html', {'companies': companies}) def create_company(request): categories = Category.objects.all() if ...
{ "content_hash": "f32623ef77c74665fb2be110dc6a9aed", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 114, "avg_line_length": 32.344086021505376, "alnum_prop": 0.6313164893617021, "repo_name": "kikeh/contacts", "id": "b56ca746678ae52d01184fbbd1284a36c2db7b6d", "size": "3008...
import mock import os import tempfile from cinder import db from cinder import exception from cinder.image import image_utils from cinder.openstack.common import log as logging from cinder.openstack.common import timeutils from cinder import test from cinder.tests.image import fake as fake_image from cinder.tests.test...
{ "content_hash": "217bdadb2a15c1e1b09ca97c585ed7f8", "timestamp": "", "source": "github", "line_count": 963, "max_line_length": 79, "avg_line_length": 39.6822429906542, "alnum_prop": 0.5800753650494583, "repo_name": "Thingee/cinder", "id": "c2c572c3b5be9346b4d51218afc42b32df31b959", "size": "38875"...
from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
{ "content_hash": "a8df14b4fcd2ddee7eb2973571bd892c", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 97, "avg_line_length": 32.15303430079155, "alnum_prop": 0.5378302970622025, "repo_name": "SergeyCherepanov/ansible", "id": "a0f5d45e871561fca8aa1bfe6ed05eb3f1953538", "siz...
from __future__ import with_statement, print_function # The Figure object is used to create backend-independent plot representations. from matplotlib.figure import Figure GUI_TOOLKIT = "qt5" from matplotlib.backends.qt_compat import QtCore, QtWidgets class EmbeddedPylab(object): """ Define a 'with' context ma...
{ "content_hash": "fcfc0e7763b6d7da7479e80228b1915b", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 88, "avg_line_length": 35.913419913419915, "alnum_prop": 0.6030617164898746, "repo_name": "SasView/sasview", "id": "b52cdcf8f710fda7b9c3d242fd536ab3cc3ed0ea", "size": "829...
__version__ = "1.0.0" """ Python script that converts WEBVTT subtitle files to the SRT format. The script is written in Python 3.5 See: https://github.com/sverrirs/ruvsarpur Author: Sverrir Sigmundarson info@sverrirs.com https://www.sverrirs.com Example WEBVTT file contents: ---------------------------...
{ "content_hash": "1b54645f9c780d8316589a9ebb124595", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 156, "avg_line_length": 38.93788819875776, "alnum_prop": 0.6103046737916733, "repo_name": "sverrirs/ruvsarpur", "id": "92bb04e88a79c006ffe6f058141b17a921a3b743", "size": "...
# import statvfs import os import ganglia descriptors = list() def Find_Metric (name): '''Find the metric definition data given the metric name. The metric name should always be unique.''' for d in descriptors: if d['name'] == name: return d pass def Remote_Mount(device, t...
{ "content_hash": "847affc46f33d61d66f94b37e83769e0", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 96, "avg_line_length": 29.53846153846154, "alnum_prop": 0.5699869791666666, "repo_name": "sdgdsffdsfff/monitor-core", "id": "8dbe92ff0237e145240afb4c023684c3f28f5009", "si...
import urllib import urllib2 import re import getopt import sys import xml.dom.minidom trips_url = 'http://trips.ihmc.us/parser/cgi/drum' def send_query(text, query_args=None): if query_args is None: qa = {} qa['input'] = text data = urllib.urlencode(qa) req = urllib2.Request(trips_url, data)...
{ "content_hash": "6648f21708a71273cbe156f0b5692e02", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 98, "avg_line_length": 28.67948717948718, "alnum_prop": 0.5502905677246313, "repo_name": "decarlin/indra", "id": "768e704e30b137b0523a1bec3724d25a33d6444c", "size": "2237",...
from .fight_logic import FightLogic
{ "content_hash": "5eda04c337574d22476acd5d3372c034", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8333333333333334, "repo_name": "HueyPark/Unreal-Knights", "id": "ddac396322126040bcf873f3430e10fa11af6b4a", "size": "36", "binar...
from pony.orm import * from base_entities import db class Teacher(db.User): degree = Required(str) courses = Set("Course") class Student(db.User): group = Required("Group") courses = Set("Course") gpa = Required(float) class Group(db.Entity): number = PrimaryKey(int) students = Set(Studen...
{ "content_hash": "fb83013e989f5db27dccafe15e2856aa", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 29, "avg_line_length": 21.5, "alnum_prop": 0.6627906976744186, "repo_name": "kozlovsky/ponymodules", "id": "f7243b66f9c1cefc6724cfff38cd884d864c2db8", "size": "531", "bin...
"""Provide analysis of input files by chromosomal regions. Handle splitting and analysis of files from chromosomal subsets separated by no-read regions. """ import collections import os import toolz as tz from bcbio.distributed.split import parallel_split_combine def get_max_counts(samples): """Retrieve number ...
{ "content_hash": "cb61c1839562dc317fa6ffb9cbe1f2e3", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 116, "avg_line_length": 40.53947368421053, "alnum_prop": 0.5676728334956183, "repo_name": "verdurin/bcbio-nextgen", "id": "cd018c7d8eb35a824d0bd14ad2ef99414b36624e", "size...
"""Support for MQTT room presence detection.""" from __future__ import annotations from datetime import timedelta import json import logging import voluptuous as vol from homeassistant.components import mqtt from homeassistant.components.mqtt import CONF_STATE_TOPIC from homeassistant.components.sensor import PLATFO...
{ "content_hash": "356901b7c55767fcd14364f3e9ad995d", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 88, "avg_line_length": 31.48235294117647, "alnum_prop": 0.593796711509716, "repo_name": "w1ll1am23/home-assistant", "id": "a69270480510072d3b04cea1bf05effd97358f82", "size...
from IPython.core.magic import cell_magic, Magics, magics_class from IPython import get_ipython from IPython.display import HTML, display_javascript from .proc import Pybind11Processor @magics_class class Pybind11Magics(Magics): @cell_magic def pybind11(self, line, cell): """IPython magic inside Jup...
{ "content_hash": "9ef2eddc7ea791847d5c009430aa31e9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 77, "avg_line_length": 29.2, "alnum_prop": 0.6164383561643836, "repo_name": "Xilinx/PYNQ", "id": "7f02d9ca5ad07c37efe12d0647eff2e19eb6ebda", "size": "1687", "binary": fal...
import random import socket import unittest import os import errno from manticore.core.smtlib import * from manticore.platforms import linux, linux_syscall_stubs from manticore.platforms.platform import SyscallNotImplemented def get_random_filename(): return f"/tmp/mcore_test_{int(random.getrandbits(32))}" cl...
{ "content_hash": "81bc78903f9b5dfcdbdcfd4002b9ada4", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 104, "avg_line_length": 35.708920187793424, "alnum_prop": 0.6273994215093347, "repo_name": "montyly/manticore", "id": "9d3f3e97ba2480398252642cc2613fc6ea387ff2", "size": "...
students = [] def get_students_titlecase(): students_titlecase = [] for student in students: students_titlecase = student.title() return students_titlecase def print_students_titlecase(): # students_titlecase = [] # for student in students: # students_title...
{ "content_hash": "eca2f89c66d7defd8d1e37ac02cf7b1f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 69, "avg_line_length": 27.75862068965517, "alnum_prop": 0.653416149068323, "repo_name": "derrick12/pythonapp", "id": "e5bd61b5b84afc94b92265d14889bc36c5ca65d2", "size": "80...
''' Google File Uploader -------------------- This program is open source. Licenced under Apache Licence v2.0: http://www.apache.org/licenses/LICENSE-2.0.txt @author: Juha Kervinen juha@apptomation.com props to: Ryan Tucker, 2009/04/28 for the captcha solution ''' import os.path try: import gdata.docs.client im...
{ "content_hash": "53d189f0c9949dd6f72e0594855cc5a2", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 136, "avg_line_length": 33.44210526315789, "alnum_prop": 0.6994019515265975, "repo_name": "jkervine/GoogleFileUploader", "id": "1b3782f1c8c042df8ec8701ca3f3ce4bdfd3025e", "...
from oslo_policy import policy from cinder.policies import base DELETE_POLICY = 'message:delete' GET_POLICY = 'message:get' GET_ALL_POLICY = 'message:get_all' deprecated_get_policy = base.CinderDeprecatedRule( name=GET_POLICY, check_str=base.RULE_ADMIN_OR_OWNER ) deprecated_get_all_policy = base.CinderDepr...
{ "content_hash": "141c97280c4a8257af6d449f19be7617", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 55, "avg_line_length": 24.87878787878788, "alnum_prop": 0.5889159561510353, "repo_name": "openstack/cinder", "id": "25a0277ecba201b350562e125bd4c3b899c6ca64", "size": "2291...
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 field 'UserProfile.show_login_help' db.add_column('panda_userprofile', 'show_login_help', self.gf('dj...
{ "content_hash": "7399c2f63ae35e8dbfefd2ad6c0c5598", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 202, "avg_line_length": 78.45142857142856, "alnum_prop": 0.5445407531502658, "repo_name": "NUKnightLab/panda", "id": "679b604872d70aa5536e985e557254c284ae3882", "size": "1...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('inventory', '0001_initial'), ] operations = [ migrations.CreateModel( name='Order',...
{ "content_hash": "af9a248e52d16b9fdcd383b36235d3dc", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 144, "avg_line_length": 40.88636363636363, "alnum_prop": 0.5630906058921623, "repo_name": "delitamakanda/jobboard", "id": "791bedd5a47a72350c932727b80ff6e1600c4328", "size"...
from mint.django_rest.test_utils import XMLTestCase, RepeaterMixIn from mint.django_rest.rbuilder.jobs import models from mint.django_rest.rbuilder.jobs import testsxml from xobj import xobj class BaseJobsTest(XMLTestCase): def _mock(self): pass def setUp(self): XMLTestCase.setUp(self) ...
{ "content_hash": "09139ad7c6660bef9e8b4791c6b844a8", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 115, "avg_line_length": 37.263959390862944, "alnum_prop": 0.6277073968124234, "repo_name": "sassoftware/mint", "id": "2b37b4242c49df619dc20529b946948eb035cb3d", "size": "7...
import unittest try: import collections.abc as abc except ImportError: import collections as abc from dimod.variables import Variables class TestDuplicates(unittest.TestCase): def test_duplicates(self): # should have no duplicates variables = Variables(['a', 'b', 'c', 'b']) self....
{ "content_hash": "91bed57f87a6d06f84e9db5dcb304e25", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 77, "avg_line_length": 28.762886597938145, "alnum_prop": 0.6372759856630824, "repo_name": "oneklc/dimod", "id": "532c99ed1a235e3ae0965ec14aabd929afcb7c56", "size": "3482", ...
from oslo_config import cfg from oslo_log import log as logging import oslo_messaging from oslo_utils import timeutils from osprofiler import profiler from senlin.common import consts from senlin.common import context from senlin.common import messaging as rpc from senlin.common import service from senlin.engine impor...
{ "content_hash": "fa4f12ac6f0f9356f91ff6cfcb0acc57", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 36.06140350877193, "alnum_prop": 0.6348820238384821, "repo_name": "stackforge/senlin", "id": "b2592d93ff1d57082df7c5bef32b8e679d1a6722", "size": "46...
import numpy import pandas as pd import numpy as np import datetime import dateutil.parser import hashlib import logging log = logging.getLogger(__name__) __author__ = 'Rafael Santos' __version__ = '0.1' class SlowlyChangingDimension(object): """Class to insert and update rows in a slowly changing dimension. ...
{ "content_hash": "b818ec79eceed189835986c7f53c5462", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 80, "avg_line_length": 34.35014836795252, "alnum_prop": 0.5638389771941948, "repo_name": "rtogo/pyscd-pandas", "id": "f80efac5174a7bc2caeb33b84fed8bceabb713eb", "size": "1...
""" Tests For Scheduler Host Filters. """ import ddt import mock from oslo_serialization import jsonutils from requests import exceptions as request_exceptions from cinder.compute import nova from cinder import context from cinder import db from cinder import exception from cinder.scheduler import filters from cinder...
{ "content_hash": "19f25d5dfd1dec3da3d016834a4d3d1c", "timestamp": "", "source": "github", "line_count": 1773, "max_line_length": 79, "avg_line_length": 41.94641849971799, "alnum_prop": 0.5018757311317583, "repo_name": "bswartz/cinder", "id": "996737275990bc21083e4ab6de10caed525c0704", "size": "7500...
from setuptools import setup, find_packages VERSION='0.4' setup( name='namesync', version=VERSION, packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), description='Sync DNS records stored in a flat file format to your DNS provider.', author='Mark Sandstrom', author_em...
{ "content_hash": "9dd047fd454aa209645a457642474709", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 89, "avg_line_length": 33.054054054054056, "alnum_prop": 0.6058871627146362, "repo_name": "dnerdy/namesync", "id": "a3ca51d6b4de4b537d277cb51ebbee9fe3253d3a", "size": "1270...
"""Heat API Server. An OpenStack ReST API to Heat. """ import eventlet eventlet.monkey_patch(os=False) import sys from oslo_config import cfg import oslo_i18n as i18n from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr from oslo_service import systemd import six from heat.com...
{ "content_hash": "0dff522700cfd28198c2f2b1a05cfb06", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 59, "avg_line_length": 24.864406779661017, "alnum_prop": 0.6796182685753238, "repo_name": "noironetworks/heat", "id": "5a03682fb20fe6acc53ed958b95d77e0806bc4cc", "size": "2...
import unittest from test import support from test import test_urllib import os import io import socket import array import sys import urllib.request # The proxy bypass method imported below has logic specific to the OSX # proxy config data structure but is testable on all platforms. from urllib.request import Reques...
{ "content_hash": "662f41d86b35a60a64064e2c8d89ca19", "timestamp": "", "source": "github", "line_count": 1646, "max_line_length": 94, "avg_line_length": 41.023693803159176, "alnum_prop": 0.5700703443169196, "repo_name": "robobrobro/ballin-octo-shame", "id": "c746b9a6bb2168622e292400fcc3012e6b572c44", ...
''' - login and get token - process 2FA if 2FA is setup for this account - Gets data needed to plot a chart for a ticker (these are Canopy tickers e.g. IBM_US or HPQ_US) ''' import requests import json get_token_url = "https://api.canopy.cloud:443/api/v1/sessions/" validate_otp_url = "https://api.canopy.cloud:443/a...
{ "content_hash": "312d65f7010e78ac9711b5893753a8ca", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 137, "avg_line_length": 35.12280701754386, "alnum_prop": 0.7282717282717283, "repo_name": "Mesitis/community", "id": "e6379a894066178e57e6307c9d12646f69a7d864", "size": "20...
"""Test Alexa config.""" import contextlib from unittest.mock import patch from homeassistant.components.cloud import ALEXA_SCHEMA, alexa_config from homeassistant.util.dt import utcnow from homeassistant.helpers.entity_registry import EVENT_ENTITY_REGISTRY_UPDATED from tests.common import mock_coro, async_fire_time_c...
{ "content_hash": "807c01acd7729649905636cf7526bd15", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 87, "avg_line_length": 36.093333333333334, "alnum_prop": 0.6686368673808645, "repo_name": "fbradyirl/home-assistant", "id": "688d69c16f1987d45d4897c3046118747c7f8c35", "si...
from flask import Flask, render_template from api import api import scraper_control import json import os app = Flask(__name__) app.register_blueprint(api, url_prefix='/api') @app.route('/') def index(): print os.listdir('templates') return render_template('index.html') @app.route('/home') def home(): ...
{ "content_hash": "515f27947388f743288f6c2ffc7b1f31", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 75, "avg_line_length": 20.333333333333332, "alnum_prop": 0.6764452113891286, "repo_name": "WesApps/wes_api", "id": "7e374dddd571bce71b525499098c0e6f0eeb6b08", "size": "1159...
import sys class MultiStack: def __init__(self, stacksize): self.numstacks = 3 self.array = [0] * (stacksize * self.numstacks) self.sizes = [0] * self.numstacks self.stacksize = stacksize self.minvals = [sys.maxint] * (stacksize * self.numstacks) def Push(self, item, ...
{ "content_hash": "34a4e1d348ead2c2224d86a2908e748a", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 66, "avg_line_length": 29.238095238095237, "alnum_prop": 0.5956840390879479, "repo_name": "Kiandr/CrackingCodingInterview", "id": "a884a0447d88db6750c4c9eca224e395e193de16", ...
from .test_mocks import * from .cpython.testmock import * from .cpython.testwith import *
{ "content_hash": "fa9d75d39f6e394f3fc13ec1996027bb", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 31, "avg_line_length": 30, "alnum_prop": 0.7666666666666667, "repo_name": "nivbend/mock-open", "id": "1b37b50d2da07a4da9022d21aad1edad50a4c5b9", "size": "161", "binary": f...
import time import uuid import fixtures from lxml import etree import six from nova.compute import arch from nova.virt.libvirt import config as vconfig # Allow passing None to the various connect methods # (i.e. allow the client to rely on default URLs) allow_default_uri_connection = True # Has libvirt connection b...
{ "content_hash": "8b43bbb0cb8db533a6bfd1b77177d3f2", "timestamp": "", "source": "github", "line_count": 1294, "max_line_length": 79, "avg_line_length": 30.10355486862442, "alnum_prop": 0.5757816912255481, "repo_name": "CloudServer/nova", "id": "13665b9dd3816234e6bf44de7dc2cfd490165904", "size": "39...
from django.core.mail.backends.smtp import EmailBackend from django.core.mail import get_connection from django.conf import settings class JumoEmailBackend(EmailBackend): def send_messages(self, email_messages): for msg in email_messages: super(JumoEmailBackend, self).send_messages([msg]) d...
{ "content_hash": "c5e7ea0b89dac9c22fe6889fa6c00797", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 62, "avg_line_length": 33.416666666666664, "alnum_prop": 0.7306733167082294, "repo_name": "jumoconnect/openjumo", "id": "8743dd277f53b17f3f4baeee3ebcd308574d03a4", "size": ...
"""This example updates the CPC bid and status for a given ad group. To get ad groups, run get_ad_groups.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication i...
{ "content_hash": "23da9eb8a3f76476e40b8412f5797f40", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 78, "avg_line_length": 29.231884057971016, "alnum_prop": 0.6351016360932077, "repo_name": "Aloomaio/googleads-python-lib", "id": "1385903f1e1f3b7d4650a656fe018215b5ffcf9b", ...
import string import os def PathCorrection(inData): outData=inData for i in string.ascii_lowercase: #Replace drive letters with /mnt/ outData=outData.replace(i+':','/mnt/'+i) #if drive letter is supplied in lowercase outData=outData.replace(i.upper()+':','/mnt/'+i) #if drive letter is supplied as uppercase outD...
{ "content_hash": "30c3ff955643224e681b6f89d1b2de4c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 92, "avg_line_length": 37.81818181818182, "alnum_prop": 0.7451923076923077, "repo_name": "mrirecon/bart", "id": "e447651ba06d02f9f85c1f646dc257f12b21df21", "size": "416", ...
""" FILE: sample_recognize_custom_forms_async.py DESCRIPTION: This sample demonstrates how to analyze a form from a document with a custom trained model. The form must be of the same type as the forms the custom model was trained on. To learn how to train your own models, look at sample_train_model_wit...
{ "content_hash": "559850bc3bde8a3947b01ad15c91d77c", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 121, "avg_line_length": 47.68503937007874, "alnum_prop": 0.5696829590488771, "repo_name": "Azure/azure-sdk-for-python", "id": "ee67d6b7e06f318d1f04d376693edfe66be3b0e8", "...
import pika import time server = "hostname" port = 5672 vhost = "yourvhost" username = "username" password = "password" exchangeName = "testEx" requestQueue = "requestQ" requestKey = "request" #callback funtion on receiving request messages, reply to the reply_to header def onMessage(channel, method, properties, body...
{ "content_hash": "21555d90c6a32f4e3d9809df5cbab066", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 167, "avg_line_length": 37.395348837209305, "alnum_prop": 0.7475124378109452, "repo_name": "robomq/robomq.io", "id": "721700bf2a1ee7042856d208a56d5db3ecb9e2a5", "size": "19...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/encoded_disk/shared_message_fragment_base.iff" result.attribute_template_id = -1 result.stfName("item_n","message_fragment_base") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return resul...
{ "content_hash": "6cc79fe0df197f4a5149b1d727c7c516", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 24.692307692307693, "alnum_prop": 0.7040498442367601, "repo_name": "anhstudios/swganh", "id": "0a06032ad904d18c95fad5c4faf4ca8e8ffbb647", "size": "46...
import urllib2 import re import itertools import datetime import gzip import urllib import os, os.path import StringIO import string import shutil UNIPROT_BASEURL="ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/proteomes/" BACKGROUND_BUILD_DIR = "bg_freqs_build" BACKGROUND_WEB_DIR = "../web...
{ "content_hash": "8503e67c2a1daa0984d8dae67eb0bea5", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 130, "avg_line_length": 33.24444444444445, "alnum_prop": 0.6811497326203209, "repo_name": "whitehead/plaac", "id": "d3e3f011e7f33bcba1088e77a1b79b4ef2599040", "size": "3302...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('feer', '0012_auto_20160206_1329'), ] operations = [ migrations.AlterField( model_name='rating', name='index', fi...
{ "content_hash": "828cf5d6740f529b1d858adc603e4d32", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 44, "avg_line_length": 20.22222222222222, "alnum_prop": 0.5796703296703297, "repo_name": "mKaloer/Feer-Club", "id": "32dd6a944cae3fcf26bd6b188dc93fc77c86389c", "size": "436...
from __future__ import absolute_import, unicode_literals from django.db import migrations def create_homepage(apps, schema_editor): # Get models ContentType = apps.get_model('contenttypes.ContentType') Page = apps.get_model('wagtailcore.Page') Site = apps.get_model('wagtailcore.Site') HomePage = ...
{ "content_hash": "76e05fd67c24c80f19f5dd8bb9cdc872", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 75, "avg_line_length": 29.017241379310345, "alnum_prop": 0.6690433749257279, "repo_name": "gasman/wagtaildraftail", "id": "f0de656729e1a5c685e3fe3c995bc1629cc9cb73", "size"...
import datetime import itertools import os import random import sys import unittest from collections import OrderedDict from unittest import mock import pandas as pd from hmsclient import HMSClient from airflow import DAG, configuration from airflow.exceptions import AirflowException from airflow.hooks.hive_hooks imp...
{ "content_hash": "f5d50293154511770d849cce31d9d21d", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 106, "avg_line_length": 40.73449612403101, "alnum_prop": 0.5650601836433703, "repo_name": "r39132/airflow", "id": "59c39d3f97f3f7c28ee76e30ffeaf1467cd3376d", "size": "2183...
from twisted.internet import reactor from twisted.web.server import Site from twisted.web.resource import Resource import time class ClockPage(Resource): isLeaf=True def render_GET(self,request): return "The local time is %s"%(time.ctime(),) resource=ClockPage() factory=Site(resource) reacto...
{ "content_hash": "9bc6fad967892d7e7198eadb8090f59e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 22.5, "alnum_prop": 0.7388888888888889, "repo_name": "yangdw/repo.python", "id": "7350c13a1f7498e8401935a2f9d7e44d829812bf", "size": "375", "binary...