text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function from burlap import Satchel from burlap.constants import * from burlap.decorators import task from burlap.common import only_hostname RSYNC = 'rsync' #DEPRECATED: TODO: remove tarball functionality, and rename to CodeSatchel class TarballSatchel(Satchel): name = 'tarball' ...
{ "content_hash": "dd9764de1572401517affbd4a8efd53f", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 109, "avg_line_length": 31.346666666666668, "alnum_prop": 0.5767758400680562, "repo_name": "chrisspen/burlap", "id": "cc3c0143b11ceebd895aae70fcb0da13f716a344", "size": "4...
"""Google App Engine platform and testing support for SpinnakerTestScenario.""" import citest.gcp_testing as gcp from spinnaker_testing.base_scenario_support import BaseScenarioPlatformSupport class AppEngineScenarioSupport(BaseScenarioPlatformSupport): """Provides SpinnakerScenarioSupport for Google App Engine.""...
{ "content_hash": "728cc2fc25ecf252f9b1a3960ad9a29f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 40.028169014084504, "alnum_prop": 0.6949331456720619, "repo_name": "duftler/spinnaker", "id": "5ecf767a9300ae5bfba873ed9d17d184d74c2e97", "size": "34...
from ajenti.api import * from ajenti.plugins import * info = PluginInfo( title='Teamspeak', icon='leaf', dependencies=[ PluginDependency('main'), PluginDependency('dashboard'), ], ) def init(): import main
{ "content_hash": "91ef3aa7ef3890547527826e7f4a992d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 38, "avg_line_length": 15.375, "alnum_prop": 0.6178861788617886, "repo_name": "emcx/ajenti-ts", "id": "dca968c0b9e386c3e8689177380c331d4fd04f1d", "size": "246", "binary":...
""" File: vocabstrings.py Demonstrates uses of VocabString for STIX Controlled Vocabularies. """ from stix.core import STIXHeader from stix.common.vocabs import VocabString, PackageIntent def main(): # Create STIXHeader instance header = STIXHeader() header.package_intents.append(PackageIntent.TERM_INDIC...
{ "content_hash": "4607cec8469ffa7ed7cc5c776d46eace", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 75, "avg_line_length": 30.666666666666668, "alnum_prop": 0.6751918158567775, "repo_name": "STIXProject/python-stix", "id": "6fd5f7f67955d3fbf9e13a33d25a876d8eb16167", "size...
"""Unit tests for collections.py.""" import collections import copy import doctest import inspect import operator import pickle from random import choice, randrange from itertools import product, chain, combinations import string import sys from test import support import types import unittest from collections import...
{ "content_hash": "7cb65650f7db561f5a6d7d20e32a7ef9", "timestamp": "", "source": "github", "line_count": 2375, "max_line_length": 107, "avg_line_length": 39.654315789473685, "alnum_prop": 0.5315303836311704, "repo_name": "brython-dev/brython", "id": "fa1d0e014dee923f0f3539a31375b95db9225f1f", "size"...
from pathlib import Path from typing import Dict, Optional from azure.ai.ml._restclient.v2022_10_01_preview.models import ComputeResource from azure.ai.ml._restclient.v2022_10_01_preview.models import VirtualMachine as VMResource from azure.ai.ml._restclient.v2022_10_01_preview.models import ( VirtualMachineSchema...
{ "content_hash": "c7fede0fb8cde7cbad930e3b6c4709c3", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 97, "avg_line_length": 40.06993006993007, "alnum_prop": 0.6521815008726003, "repo_name": "Azure/azure-sdk-for-python", "id": "5f0a64ef2516b111a364b5a0b72439a6c742cc89", "s...
""" This program provides an agent that sends and responds to health-check packets in order to determine the liveliness of the configured MPLS tunnels. """ import eossdk import eossdk_utils import functools import json import os import pyinotify import scapy import scapy.fields import scapy.layers.l2 import scapy.lay...
{ "content_hash": "30d64882d029b58fc6b0c4bac1f90aa0", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 85, "avg_line_length": 41.78225806451613, "alnum_prop": 0.6367979154603358, "repo_name": "aristanetworks/EosSdk", "id": "8c1df1ae7d234b49c44ebd3ae1735f87641989de", "size":...
from ..base import model import numpy from ..util.preprocessing import as_matrix from autoencoder import autoencoder import nn class dbn(model): def __init__(self, layers, pretrain=True): """ Initialization of the deep belief network with given layers. arguments: layers - lis...
{ "content_hash": "a8fa0dee378b53e0884b6575e942fefd", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 74, "avg_line_length": 32.888888888888886, "alnum_prop": 0.5574324324324325, "repo_name": "arider/riderml", "id": "7e6299e8701eed4d4be609945cace3099264febf", "size": "2960"...
"""This package is responsible for modeling the energy consumers and the system load as curves and associated curve data. Special circumstances that may affect the load, such as seasons and daytypes, are also included here. This information is used by Load Forecasting and Load Management. """ from CIM14.CPSM.Equipmen...
{ "content_hash": "dcfd1b7a31f5c2cd8dbd44a7505a9f89", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 290, "avg_line_length": 59.74074074074074, "alnum_prop": 0.8462492250464972, "repo_name": "rwl/PyCIM", "id": "3df37941eca0c4a59f94082e7ff5c380a37186c1", "size": "2713", "...
import bisect import cv2 import os import pickle import Queue import sys import threading import time import traceback import json from collections import namedtuple class BaseRecorder(object): monitor_period = 3 # seconds def __init__(self, device=None, workdir=".", realtime_analyze=Fals...
{ "content_hash": "7d36e9018d350fbe1440db17f205cf00", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 106, "avg_line_length": 32.44202898550725, "alnum_prop": 0.5090462363189636, "repo_name": "Andy-hpliu/AirtestX", "id": "ac51fb33e2f7418596dc84c22004aa6b449a8210", "size": ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf import wide_deep tf.logging.set_verbosity(tf.logging.ERROR) TEST_INPUT = ('18,Self-emp-not-inc,987,Bachelors,12,Married-civ-spouse,abc,' 'Husband,zyx,wvu,34,56,78,tsr,<...
{ "content_hash": "8481348292d1875797aa524c7cd5e109", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 76, "avg_line_length": 31.054945054945055, "alnum_prop": 0.6493276716206653, "repo_name": "zlpmichelle/crackingtensorflow", "id": "55fa00fa6cc00dee724ce376b78440163a19e205", ...
"""mock_generator.py: module for creating mock objects for unittesting mainly for common/tests/python/utils""" # pylint: disable=unused-argument # pylint: disable=missing-docstring import random from mock import patch from heronpy.api.task_hook import ITaskHook from heronpy.api.custom_grouping i...
{ "content_hash": "87a920c80216afd12f5def20cf2d2a0a", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 99, "avg_line_length": 35.930851063829785, "alnum_prop": 0.6786084381939305, "repo_name": "lucperkins/heron", "id": "e727acaa1f48762adbffd09d82b7a9b7e93cb255", "size": "73...
""" Functions --------- .. autosummary:: :toctree: generated/ fmin_l_bfgs_b """ ## License for the Python wrapper ## ============================== ## Copyright (c) 2004 David M. Cooke <cookedm@physics.mcmaster.ca> ## Permission is hereby granted, free of charge, to any person obtaining a ## copy of this so...
{ "content_hash": "2d138b3301771947f2722aaefa0e70a0", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 91, "avg_line_length": 36.3440170940171, "alnum_prop": 0.5882767946381328, "repo_name": "lhilt/scipy", "id": "5425ffff3f32b4d8dd9a942a020cb6058d2c51a1", "size": "17009", ...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1beta1Lo...
{ "content_hash": "475ed28c8d0d6f70e7ba51200a20c9a4", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 272, "avg_line_length": 34.06018518518518, "alnum_prop": 0.6165556612749762, "repo_name": "skuda/client-python", "id": "8bdd22802a3824c6fcc38d1a2fd94fda37321fda", "size": ...
import quiz def loadProblems(a): a.problems.append(quiz.Problem( "What is an adiabatic wall?", "No net heat transfer to or from the working fluid. (Insulated)", "B", "C", "A")) a.problems.append(quiz.Problem( "What is a control mass?", "A closed system: a volume that has no mass trans...
{ "content_hash": "91b563b440cd8fc12e908050c4167951", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 84, "avg_line_length": 19.40277777777778, "alnum_prop": 0.5855404438081604, "repo_name": "nicholasmalaya/arcanus", "id": "40206f32c6870837b3251e71891e3f715deb546e", "size":...
import input_array_choice_mixin from input_array_choice_mixin import InputArrayChoiceMixin from module_base import ModuleBase from module_mixins import ScriptedConfigModuleMixin import module_utils import vtk INTEG_TYPE = ['RK2', 'RK4', 'RK45'] INTEG_TYPE_TEXTS = ['Runge-Kutta 2', 'Runge-Kutta 4', 'Runge-Kutta 45'] IN...
{ "content_hash": "16a82f0b7741dc61405155ca0b7d62dc", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 86, "avg_line_length": 36.5, "alnum_prop": 0.620217288615966, "repo_name": "ivoflipse/devide", "id": "ced8950c08a0cfdb2b70a7469dc2183de906b042", "size": "4234", "binary"...
__author__ = 'magic_full_name_magic' __email__ = 'magic_email_magic' __version__ = 'magic_version_magic'
{ "content_hash": "978bcb275ce8354814745b73c0521c86", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 36, "avg_line_length": 35, "alnum_prop": 0.6476190476190476, "repo_name": "amjith/py-template", "id": "aeb59022336fdfe24c66416599cbede7b556efe6", "size": "130", "binary": ...
import pytest def pytest_collect_file(parent, file_path): if file_path.suffix == ".yaml" and file_path.name.startswith("test"): return YamlFile.from_parent(parent, path=file_path) class YamlFile(pytest.File): def collect(self): # We need a yaml parser, e.g. PyYAML. import yaml ...
{ "content_hash": "3c8705a0a254ea723c615d288b10fee1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 79, "avg_line_length": 31.02173913043478, "alnum_prop": 0.5711282410651717, "repo_name": "pytest-dev/pytest", "id": "bc39a1f6b204888e14e8ec66815f99793202ded8", "size": "145...
from rfid import RFIDClient ip_address = "192.168.1.20" controller_serial = 123106461 client = RFIDClient(ip_address, controller_serial) client.open_door(1)
{ "content_hash": "518375c3817e3776d05b6eaae7a25945", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 50, "avg_line_length": 22.714285714285715, "alnum_prop": 0.7735849056603774, "repo_name": "pawl/Chinese-RFID-Access-Control-Library", "id": "9dca995919ed4f6b96b75603ccc93217f8...
from typing import Dict, List, Optional, Tuple # noqa: F401 from libqtile.command_client import InteractiveCommandClient from libqtile.command_interface import CommandInterface from libqtile.command_graph import CommandGraphCall, CommandGraphNode, SelectorType class LazyCall: def __init__(self, call: CommandGra...
{ "content_hash": "2b0447934ce0f54c2816abe201c19880", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 94, "avg_line_length": 31.238095238095237, "alnum_prop": 0.6158536585365854, "repo_name": "soulchainer/qtile", "id": "7e8856690c1710feda48d2b545f12884e181049a", "size": "37...
from __future__ import unicode_literals import re from netmiko.base_connection import BaseConnection class PaloAltoPanosSSH(BaseConnection): """ Implement methods for interacting with PaloAlto devices. Disables `enable()` and `check_enable_mode()` methods. Overrides several methods for PaloAlto-spe...
{ "content_hash": "2623d1615b18251c4bd03113f1f93c30", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 92, "avg_line_length": 35.12337662337662, "alnum_prop": 0.5838417452394158, "repo_name": "shsingh/netmiko", "id": "3208a34399c7c57630ec349b41363372b382d912", "size": "5409...
""" Parser for PPAPI IDL """ # # IDL Parser # # The parser is uses the PLY yacc library to build a set of parsing rules based # on WebIDL. # # WebIDL, and WebIDL grammar can be found at: # http://heycam.github.io/webidl/ # PLY can be found at: # http://www.dabeaz.com/ply/ # # The parser generates a tree by recursi...
{ "content_hash": "abcfd2f4995adfbee59e46ee01a10b32", "timestamp": "", "source": "github", "line_count": 1085, "max_line_length": 88, "avg_line_length": 29.62027649769585, "alnum_prop": 0.5785051963407803, "repo_name": "CyanogenMod/android_external_chromium_org", "id": "fabe2daa0008874928d3ddec526cc84...
import requests import simplejson as json from requests.auth import HTTPBasicAuth from configs import etcd_config class Etcd(object): def __init__(self, room): user = etcd_config.get(room).get('username') password = etcd_config.get(room).get('username') endpoint = etcd_config.get(room).get...
{ "content_hash": "26bc9127d5a07dae0aa2d092560b5881", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 59, "avg_line_length": 31.07777777777778, "alnum_prop": 0.5520200214515553, "repo_name": "xiaomatech/ops", "id": "506febed0a723a56d0c3c2db318b6fa8e8d27cc1", "size": "2842",...
from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('runs', '0002_auto_20170608_1312'), ] operations = [ migrations.AlterModelOptions( name='contentchannel', ...
{ "content_hash": "6767beb3f3474421b83f04f552f2e3c5", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 93, "avg_line_length": 30.772727272727273, "alnum_prop": 0.5790251107828656, "repo_name": "ivanistheone/waiter", "id": "bd3e29c1bb651ef1136e1798fb44eb655e9f3755", "size": "...
from click import Option from versio.version import Version from unleash import log, opts, issues, commit, info from .utils_assign import find_assign, replace_assign from .utils_tree import require_file PLUGIN_NAME = 'versions' def require_setup_py(): return require_file( 'setup.py', 'No setup.py found'...
{ "content_hash": "034a44cc085916c7b65d82f570d11244", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 79, "avg_line_length": 34.05095541401274, "alnum_prop": 0.5974560419004863, "repo_name": "mbr/unleash", "id": "b41714bede5bf27ebc69d812cae46ba8d88d4c35", "size": "5346", ...
"""A command line interface to Gerrit-on-borg instances. Internal Note: To expose a function directly to the command line interface, name your function with the prefix "UserAct". """ from __future__ import print_function import collections import functools import inspect import json import re import sys from chromi...
{ "content_hash": "8da5b054f4f55ff2672676485fa342bb", "timestamp": "", "source": "github", "line_count": 923, "max_line_length": 80, "avg_line_length": 30.63163596966414, "alnum_prop": 0.6365083295016447, "repo_name": "endlessm/chromium-browser", "id": "5b4d741daad36373d47eab8c8b7ec5fc197efdf4", "si...
from pyparsing import * from decl import * from ..keywords.deff import keywords from ...constants.articles.deff import EACH from ...constants.connectors.deff import IF from ...constants.modifiers.deff import ABLE from ...constants.prepositions.deff import UNTIL, OF from ...constants.verbs.deff import HAVE, GET, BE, G...
{ "content_hash": "48933de35ddac19d4c2adf5f1f051910", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 94, "avg_line_length": 29.26086956521739, "alnum_prop": 0.736255572065379, "repo_name": "jrgdiz/cardwalker", "id": "8826a65686d46cf51d0a8c6ea371c88d1cbf07a1", "size": "1346...
from gruffy import base from pgmagick import Coordinate, CoordinateList, DrawableBezier, \ DrawableFillColor, DrawableFillOpacity, DrawableList, \ DrawableStrokeColor, DrawableStrokeWidth class Bezier(base.Base): """Bezier Graph Object""" def draw(self): Bezi...
{ "content_hash": "b400ed464bc9101071463c3329d178a6", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 135, "avg_line_length": 42.108108108108105, "alnum_prop": 0.5860077021822849, "repo_name": "hhatto/gruffy", "id": "31c791c0bc919bc8525cf428ae67bdecd864e5b6", "size": "1558"...
#!/usr/bin/env python # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Extracts network traffic annotation definitions from C++ source code. """ from __future__ import print_function import argparse i...
{ "content_hash": "437eaccc5cd7ec2ff3868816a1c3bbd2", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 80, "avg_line_length": 32.70498084291188, "alnum_prop": 0.6836925960637301, "repo_name": "endlessm/chromium-browser", "id": "b239ffc25dbe79b2206bdbfb8cd0fa6a218a665f", "si...
from assopy import models from assopy import settings from django import forms from django import template from django.conf import settings as dsettings from django.core import paginator from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ import urllib register = template....
{ "content_hash": "180da1d7450ea9e54ce14e4e7a69b5ca", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 172, "avg_line_length": 31.14765100671141, "alnum_prop": 0.5985778926955397, "repo_name": "barrachri/epcon", "id": "6100ced99685f41e8cdcd252829c945d6c36cc10", "size": "931...
import os, pathlib DIR = os.listdir(str(pathlib.Path(__file__).parent)) COMMANDS = [i[:-3] for i in DIR if i.endswith('.py') and not i.startswith('_')] COMMANDS_LINES = COMMANDS[0:8], COMMANDS[8:] COMMANDS_PRINTABLE = '\n'.join(', '.join(i) for i in COMMANDS_LINES)
{ "content_hash": "37f5dbf15dcb46d93c42657df96d5cb1", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 79, "avg_line_length": 44.5, "alnum_prop": 0.6666666666666666, "repo_name": "ManiacalLabs/BiblioPixel", "id": "0704a5087d9a7db2c3bc4478542f228ee78e9a0c", "size": "267", "b...
""" MINDBODY Public API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class Sto...
{ "content_hash": "4ade070d0ba30003a145c0484a2a9cb6", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 119, "avg_line_length": 27.646017699115045, "alnum_prop": 0.5425736235595391, "repo_name": "mindbody/API-Examples", "id": "312ede49252f57eaf3a549554118995af2e0a4f5", "size...
from __future__ import absolute_import, division, print_function from sentry.constants import STATUS_CHOICES from sentry.models import EventUser, User from sentry.utils.auth import find_users def get_user_tag(project, key, value): if key == 'id': lookup = 'ident' elif key == 'ip': lookup = 'i...
{ "content_hash": "60d6346dbe398c53aae0c94bba276c09", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 79, "avg_line_length": 29.36082474226804, "alnum_prop": 0.488061797752809, "repo_name": "Natim/sentry", "id": "488af414c1460370ec4f28306c8ce7d6780385ac", "size": "2848", ...
import mymodule mymodule.sayhi() print('Version:', mymodule.__version__)
{ "content_hash": "6132cbed532fb2794caaaafd9f4c20f9", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 24.333333333333332, "alnum_prop": 0.7397260273972602, "repo_name": "louistin/thinkstation", "id": "e01910fdfd52f18ee0b88f03c8fae323e68bbf19", "size": ...
from setuptools import setup, find_packages from docs import getVersion # Variables =================================================================== changelog = open('CHANGELOG.rst').read() long_description = "\n\n".join([ open('README.rst').read(), changelog ]) # Actual setup definition ================...
{ "content_hash": "82a3ec6c36c72d27866f9c350e8c6d35", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 26.555555555555557, "alnum_prop": 0.5578800557880056, "repo_name": "edeposit/edeposit.amqp.aleph_link_export", "id": "acca6549f19a77363b62b7d8867aa389c...
import price import workcenter_load import order import bom_structure import mrp_report import mrp_production_order # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "content_hash": "4afd08f735ac5fe874ce9c4d05efef89", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 65, "avg_line_length": 20.444444444444443, "alnum_prop": 0.8315217391304348, "repo_name": "chjw8016/GreenOdoo7-haibao", "id": "471e3440af3c7891cb8d7d440f86c04ddeab1f65", "si...
"""Network package exceptions.""" __version__ = '$Revision: #2 $' class Error(Exception): """Base exception for all network package exceptions.""" def __str__(self): return self.__repr__() class IPValidationError(Error): """IP address is invalid. :IVariables: - `address`: The addr...
{ "content_hash": "626cd8050ff8a802fb9fe3320259a10a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 77, "avg_line_length": 24.071428571428573, "alnum_prop": 0.592482690405539, "repo_name": "ironport/aplib", "id": "60301f497d3369df4c806b7518635ef25e2cc323", "size": "2202",...
from numpy import array from pyspark import RDD from pyspark import SparkContext from pyspark.mllib.common import callMLlibFunc, callJavaFunc from pyspark.mllib.linalg import DenseVector, SparseVector, _convert_to_vector from pyspark.mllib.stat.distribution import MultivariateGaussian __all__ = ['KMeansModel', 'KMean...
{ "content_hash": "2e1358fb032644196d7de46fad84cd9f", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 97, "avg_line_length": 38.10179640718563, "alnum_prop": 0.5662423385195663, "repo_name": "trueyao/spark-lever", "id": "949db5705abd7ce8aa7f7b958bf7e48c809a19b1", "size": "...
from django.conf import settings from .models import Recipient class RecipientsMixin(object): """ A mixin for sending the results to a list of recipients. """ def get_recipients(self): emails = [recipient.user.email for recipient in Recipient.objects.all().select_related('user...
{ "content_hash": "dd813ad8c5f4cb794992a6e35cb84321", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 31.5625, "alnum_prop": 0.6495049504950495, "repo_name": "bennylope/django-contact-recipients", "id": "09bac8d0029f825a01e3999f8bbe3277eb7e6014", "siz...
"""Logging Module. This module handles logging to the standard python logging subsystem and to the console. """ from __future__ import absolute_import import logging import os import sys LOG = logging.getLogger(__name__) class DebugFormatter(logging.Formatter): """Log formatter. Outputs any 'data' value...
{ "content_hash": "36b08933ba59bbdd40254a052a18bcdc", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 79, "avg_line_length": 31.71875, "alnum_prop": 0.6517241379310345, "repo_name": "mgeisler/satori", "id": "7600290ab7b05c7747a81e3812f65107ebfe7986", "size": "4625", "bin...
import cbox @cbox.stream() # we can pass default values and use type annotations for correct types def nth_item(line, n: int = 0): """returns the nth item from each line. :param n: the number of item position starting from 0 """ return line.split()[n] if __name__ == '__main__': cbox.main(nth_it...
{ "content_hash": "3a24fc5896d8b0040fdc78630dff6260", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 21.6, "alnum_prop": 0.6450617283950617, "repo_name": "shmuelamar/cbox", "id": "e3db4a9e781eb37d2c02cfddaa66a7c5677e6783", "size": "347", "binary": ...
from energy_demand import model
{ "content_hash": "7b644434a23c0a1c1f0b2aa231e6cbe4", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 31, "avg_line_length": 31, "alnum_prop": 0.8709677419354839, "repo_name": "nismod/energy_demand", "id": "9009659fc41ac80a80410a340cf63b3a6419c9ab", "size": "31", "binary":...
import models import permissions def ensure(app): with app.app_context(): user = models.db.session.query(models.User).get(1) if not user: user = models.User(id=1, username='freddie') models.db.session.add(user) models.db.session.commit() post = models.db...
{ "content_hash": "d43c94f0c18a7a26440c29eee72170cb", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 90, "avg_line_length": 33.19047619047619, "alnum_prop": 0.5796269727403156, "repo_name": "jmcarp/guardrail", "id": "2972c7f0a7b47331990f2b79582c7fb15933cd1e", "size": "722"...
from openerp import api, models class ReportSession(models.AbstractModel): _name = "report.openacademy.report_session_view" @api.multi def _get_report_values(self, docids, data=None): # report_obj = self.env["report"] # report = report_obj._get_report_from_name("openacademy.report_session...
{ "content_hash": "12e7dde19c7a54dc4f7908b19482772e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 81, "avg_line_length": 36.166666666666664, "alnum_prop": 0.5737327188940092, "repo_name": "vauxoo-dev/openacademy-project", "id": "c36712be6bd843616cc08b94c5c59b4c2ac8ce4a", ...
from django.shortcuts import render, render_to_response, redirect from django.http import HttpResponseRedirect, HttpResponse, HttpRequest #from django.contrib.auth import authenticate, login as auth_login from social_auth.models import UserSocialAuth from play.models import * from charity.models import * from shop.mode...
{ "content_hash": "19556c1b4aa729006b9f8d7d52154367", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 121, "avg_line_length": 35.796875, "alnum_prop": 0.5986468790920996, "repo_name": "fraferra/PlayCity", "id": "3277d9eebc579a96641054d41f3095b27ca9c088", "size": "4608", ...
from thrift.Thrift import TType, TMessageType, TException, TApplicationException import impala._thrift_gen.Status.ttypes import impala._thrift_gen.Types.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbin...
{ "content_hash": "e835a9c8769682e6634ecd8e43134fdd", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 188, "avg_line_length": 33.146288209606986, "alnum_prop": 0.6131348396021342, "repo_name": "schaffino/impyla", "id": "2a194b77aaa875944858870f23168e564481ebca", "size": "1...
__author__ = 'sandeep' class Error(Exception): """ Generic Error for client """ pass class ValidationError(Error): """ Error in case of invalid input """ pass class HTTPError(Error): """ Error Response from API """ pass
{ "content_hash": "f99037649e23ce6f291be21faf76fde2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 42, "avg_line_length": 15.625, "alnum_prop": 0.616, "repo_name": "Sandeep4/opinio", "id": "53e6c2f5929d5f73d5ff515e0a3fec6b40f65ca3", "size": "250", "binary": false, "c...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetHistoricalUpdates(Choreography): def __init__(self, temboo_session): """ C...
{ "content_hash": "8e7af16d78f30f03d408e13054bc5048", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 236, "avg_line_length": 50.257425742574256, "alnum_prop": 0.7023246650906225, "repo_name": "lupyuen/RaspberryPiImage", "id": "80800c237ae0968e4c6d6c97b694129ce5248b32", "s...
from RGT.XML.SVG.Filters.baseFilterNode import BaseFilterNode from types import StringType from RGT.XML.SVG.basicSvgNode import BasicSvgNode class FeSpecularLightingNode(BaseFilterNode): svgNodeType = BasicSvgNode.SVG_FE_SPECULAR_LIGHTING_NODE ATTRIBUTE_IN = 'in' ATTRIBUTE_SURFACE_SCALE = 'surfa...
{ "content_hash": "29f7452b756c7e186b4720377bc842eb", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 116, "avg_line_length": 35.666666666666664, "alnum_prop": 0.6297627606038821, "repo_name": "danrg/RGT-tool", "id": "3e2e2e1e1af3a63a322fe232cab1a90d327cb6e4", "size": "2782...
import json class SdsNamespace(object): """description of class""" @property def Id(self): return self.__id @Id.setter def Id(self, id): self.__id = id def toString(self): return json.dumps(self.toDictionary()) def toDictionary(self): # required properties...
{ "content_hash": "e18ce1210e4884452ce1b540079b1394", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 55, "avg_line_length": 21.324324324324323, "alnum_prop": 0.5792141951837769, "repo_name": "osisoft/Qi-Samples", "id": "af3e08e7137aff5502b58f30ca47b5037f520cad", "size": "1...
from numpy import arange from numpy.testing import TestCase, assert_ from scipy.weave import standard_array_spec def remove_whitespace(in_str): out = in_str.replace(" ","") out = out.replace("\t","") out = out.replace("\n","") return out class TestArrayConverter(TestCase): def test_type_match_s...
{ "content_hash": "e111e2a80a704eece6f35c250af228f6", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 49, "avg_line_length": 25.333333333333332, "alnum_prop": 0.6236842105263158, "repo_name": "lesserwhirls/scipy-cwt", "id": "b021dbc5f7fa9e51b7301d547583cc519062b046", "size"...
''' This class is only a model, to use it is necessary to extend it, and add the table proprieties such name, columns, primary keys, etc... The _columns atribute have to be initiated in the __init__(self, connection) method, and when overwrite this method, is necessary execute the parent init first: parent().__init_...
{ "content_hash": "8c071a152dd9af2f1fbab94636345706", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 79, "avg_line_length": 38.57990867579909, "alnum_prop": 0.5311871227364185, "repo_name": "welblade/pyrom", "id": "e7cadbd008dede08308458fe7ddc52786fbf7f6b", "size": "8498"...
""" Copyright 2012 GroupDocs. 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 w...
{ "content_hash": "f89219d8ae3ab4a1f49be0827985a07a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 77, "avg_line_length": 28.366666666666667, "alnum_prop": 0.6839012925969448, "repo_name": "liosha2007/temporary-groupdocs-python-sdk", "id": "c85777537ef8621a5c87edbb99cb3278...
''' The internationalization handler ''' import gettext TRANS = gettext.translation('tmppackages', 'locale', fallback=True) _ = TRANS.ugettext
{ "content_hash": "3154ec31ea9ba84f1e3b60ab5879e825", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 67, "avg_line_length": 24.166666666666668, "alnum_prop": 0.7448275862068966, "repo_name": "mweb/python_template_project", "id": "292e249b3f65347cc20e4d197a16e9869d1043d7", "...
from django.http import HttpResponseRedirect, Http404, HttpResponse from django.template import RequestContext, loader from django.shortcuts import get_object_or_404, render_to_response from django.contrib.auth.decorators import login_required from django.views.generic.list_detail import object_list from django.conf im...
{ "content_hash": "f0294f04da4167e76e6639d967f734c9", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 33.108333333333334, "alnum_prop": 0.6332746035741253, "repo_name": "amitu/gitology", "id": "ba9ad758c3a702ef5fff550e4d8950c419100b4e", "size": "3989...
import argparse import codecs import datetime import json import logging import os.path import subprocess import tempfile import inseven.finance PDF_TABLE_COLUMNS = ["Date", "Payment ", "type ", "and ", "details", "Paid ", "out", "Paid ", "in", "Balance"] PDF_TABLE_START = ["BALANCE ", "BROUGHT ", "FORWARD"] PDF_TAB...
{ "content_hash": "7490079ef3da96b3e3261977e5acdf55", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 111, "avg_line_length": 29.848101265822784, "alnum_prop": 0.5623409669211196, "repo_name": "jbmorley/html-to-qif", "id": "994d5c85d05e152211bd3c4afef65bb8012e89a3", "size"...
default_app_config = 'map.apps.MapConfig'
{ "content_hash": "ac5ed509342e0a047726338a50663de4", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 41, "avg_line_length": 42, "alnum_prop": 0.7619047619047619, "repo_name": "jayArnel/crimemapping", "id": "d6dc6afadca64b7cf44901cb1da8d878e3544eb9", "size": "42", "binary"...
"""Test config flow for Insteon.""" from __future__ import annotations import logging from pyinsteon import async_connect import voluptuous as vol from homeassistant import config_entries from homeassistant.components import dhcp, usb from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE, CONF_HOST...
{ "content_hash": "baaa20cc9cd13152ce8dffcd5cb87f19", "timestamp": "", "source": "github", "line_count": 370, "max_line_length": 88, "avg_line_length": 37.616216216216216, "alnum_prop": 0.6108636298318724, "repo_name": "nkgilley/home-assistant", "id": "d9261a65c32d74352f99fc1ad0ef68993168a46a", "siz...
from datetime import datetime import sqlalchemy as sa from celery import states from celery.db.session import ResultModelBase # See docstring of a805d4bd for an explanation for this workaround ;) from celery.db.a805d4bd import PickleType class Task(ResultModelBase): """Task result/status.""" __tablename__ =...
{ "content_hash": "c7d6e8c59cefe3e063fe5c6ee8f88b47", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 69, "avg_line_length": 32.833333333333336, "alnum_prop": 0.6142131979695431, "repo_name": "mitsuhiko/celery", "id": "0ff98b7a937ebce17058374df0cc4a3ccb50d570", "size": "197...
import json import webob from cinder import context from cinder import db from cinder import test from cinder.tests.api import fakes from cinder.tests import fake_notifier def return_volume_type_encryption(context, volume_type_id): return stub_volume_type_encryption() def stub_volume_type_encryption(): va...
{ "content_hash": "6d974bb44aadc36559a7b97f0fb99718", "timestamp": "", "source": "github", "line_count": 591, "max_line_length": 79, "avg_line_length": 40.653130287648054, "alnum_prop": 0.5367934737367851, "repo_name": "alex8866/cinder", "id": "9bf1f9852acadaa5d51889db0e2f208c25d82b43", "size": "247...
def is_prime(n): """Returns True is n is prime, False if not""" for i in range(2,n-1): if n%i == 0: return False return True def all_primes(n): primes = [] for number in range(1,n): if is_prime(number): primes.append(number) return primes
{ "content_hash": "c0b691dfd31b88d824176624a93d6dcd", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 49, "avg_line_length": 22.615384615384617, "alnum_prop": 0.5578231292517006, "repo_name": "Serulab/Py4Bio", "id": "80f9bfb2f2298adca4bb2fbb9fa702375e6dc5db", "size": "294",...
from django.conf import settings from django.shortcuts import render from django.http import JsonResponse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.wagtailcore import models from wagtail.wagtailsearch.models import Query def search( request, template=None, ...
{ "content_hash": "3a799ad261f4ef9bceaa36670b6d9e35", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 98, "avg_line_length": 30.8265306122449, "alnum_prop": 0.5958291956305859, "repo_name": "JoshBarr/wagtail", "id": "1680b4a21f5977059ee53208da5f58ce9fb10b6a", "size": "3021"...
from neutron.api.v2 import attributes as attrs from neutron.common import exceptions as n_exc from neutron import context from neutron.db import api as qdbapi from neutron.db.loadbalancer import loadbalancer_db as ldb from neutron.db import servicetype_db as st_db from neutron.openstack.common import log as logging fro...
{ "content_hash": "b9c29e75a905fa9b60e96d52b617e130", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 78, "avg_line_length": 42.80701754385965, "alnum_prop": 0.6092622950819672, "repo_name": "citrix-openstack-build/neutron", "id": "ea7eff3aac6da321fd4563e8ca694febd2978f0a", ...
from msrest.serialization import Model class WorkflowTriggerCallbackUrl(Model): """The workflow trigger callback URL. Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Gets the workflow trigger callback URL. :vartype value: str :ivar method:...
{ "content_hash": "8449689104faa12a479ea32b5e1757ee", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 87, "avg_line_length": 39.25, "alnum_prop": 0.6523354564755839, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "e2d2b9f9b624ab111c080a566dd03725ffb996af", "size": "2...
import pytest import sockeye.constants as C import sockeye.arguments as arguments import argparse @pytest.mark.parametrize("test_params, expected_params", [ # mandatory parameters ('--source test_src --target test_tgt ' '--validation-source test_validation_src --validation-target test_validation_tgt ' ...
{ "content_hash": "cbed860ec9c6239892b0c522eeccd560", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 137, "avg_line_length": 62.99315068493151, "alnum_prop": 0.6700010873110797, "repo_name": "KellenSunderland/sockeye", "id": "b4dd0caf302fe278c39a2b5596493c7cb332115c", "si...
from ipc import vetor primos = vetor.gera_primos() print(primos)
{ "content_hash": "9db6bab1c3aeb478be74e9b357d6cfcd", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 28, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7692307692307693, "repo_name": "jucimarjr/IPC_2017-1", "id": "3dbdbe8567627ed06daebe2040fcca2d7889b313", "size": "...
class HealthCheck(object): """ Represents an EC2 Access Point Health Check. See :ref:`elb-configuring-a-health-check` for a walkthrough on configuring load balancer health checks. """ def __init__(self, access_point=None, interval=30, target=None, healthy_threshold=3, timeout=5,...
{ "content_hash": "bbec381b285030c52f629bacfcab0e1c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 120, "avg_line_length": 38.43939393939394, "alnum_prop": 0.6286953094205755, "repo_name": "Didacti/botornado", "id": "6661ea15a2523b5a446f2c325cdc5856aea7eb43", "size": "36...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from pants.backend.core.wrapped_globs import Globs from pants.base.address import Address from pants.base.build_environment import get_buildroot from pants....
{ "content_hash": "b2aeca52e72b9f0cf604912485d921a3", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 99, "avg_line_length": 40.513888888888886, "alnum_prop": 0.6448405896468975, "repo_name": "kslundberg/pants", "id": "2b72a4188098c9076c341426edb88a6474149fb9", "size": "306...
"""Modified Olivetti faces dataset. The original database was available from (now defunct) http://www.uk.research.att.com/facedatabase.html The version retrieved here comes in MATLAB format from the personal web page of Sam Roweis: http://www.cs.nyu.edu/~roweis/ There are ten different images of each of 40...
{ "content_hash": "ddf3b44003e1a4474ae7a1b1884f47a7", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 78, "avg_line_length": 35.29090909090909, "alnum_prop": 0.6813498196805771, "repo_name": "joshbohde/scikit-learn", "id": "6ce33ebfd19d5c40b4d65f4d4826f6b75f46547d", "size"...
import unittest import numpy.testing as npt import numpy as np from skbio import Sequence, DNA, RNA from skbio.io.format._base import (_decode_qual_to_phred, _encode_phred_to_qual, _get_nth_sequence, _parse_fasta_like_header, ...
{ "content_hash": "dfa3d229ea5b252e8c316eb23c93aa73", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 79, "avg_line_length": 41.27444794952682, "alnum_prop": 0.5652705594619383, "repo_name": "gregcaporaso/scikit-bio", "id": "059a45785024d83a11d90542649a6049892b023a", "size...
import os from easyprocess import EasyProcess str = 'Total time: ' def main(): dir = os.getcwd() # this returns current directory of monaTest.py dir = os.path.join(dir, 'lift') # this joins the current directory and the directory to MonaFiles #print header of the output in format #print '%-25s %-25s'%(...
{ "content_hash": "5c2ff285b16e6c2154c68d2490cef230", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 117, "avg_line_length": 39.92156862745098, "alnum_prop": 0.6075638506876228, "repo_name": "lorisdanto/automatark", "id": "d4a4ef98eae1c66925d0c1437971c3f05d3afffd", "size":...
from __future__ import print_function from builtins import str from builtins import object from lib.common import helpers class Module(object): def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-BypassUAC', 'Author': ['Leo Davidson', '@meatballs__', '@TheColon...
{ "content_hash": "09a7b99e989b0be5acbaa9986575cd6c", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 151, "avg_line_length": 41.8109756097561, "alnum_prop": 0.5365320110835642, "repo_name": "byt3bl33d3r/Empire", "id": "373eaa6b5954b37b3bf6138d45d92c276440dad3", "size": "6...
import pytest # local imports from shpkpr import exceptions @exceptions.rewrap(ValueError) def _this_doesnt_raise(): """Dummy func for testing the exceptions.rewrap decorator """ return 'something' @exceptions.rewrap(ValueError) def _this_raises_a_key_error(): """Dummy func for testing the exceptio...
{ "content_hash": "930bca451e8fa002267f3ceb7cdafedf", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 67, "avg_line_length": 25.61842105263158, "alnum_prop": 0.6985105290190036, "repo_name": "shopkeep/shpkpr", "id": "2723b817502957ac0b7ec2a4576a4cd7ed0beb80", "size": "1969"...
import database as d import matplotlib import matplotlib.pyplot as plt import matplotlib.image as mpimg matplotlib.use('TkAgg') from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.figure import Figure import tkinter as tk import copy #WARNING: throws error if run from here. Import to eco...
{ "content_hash": "a267811e385022f7c11128c003db6fa0", "timestamp": "", "source": "github", "line_count": 1476, "max_line_length": 147, "avg_line_length": 33.6890243902439, "alnum_prop": 0.5939668174962293, "repo_name": "markemus/economy", "id": "27c0b6c1857256ba17c4e094893c03714673225e", "size": "49...
import argparse from pipeline.backend.pipeline import PipeLine from pipeline.component import DataTransform from pipeline.component import Reader from pipeline.interface import Data from pipeline.utils.tools import load_job_config def main(config="../../config.yaml", namespace=""): # obtain config if isinst...
{ "content_hash": "ae982ed71ce432d2081cc81d24beb8a2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 104, "avg_line_length": 38.52, "alnum_prop": 0.6339563862928349, "repo_name": "FederatedAI/FATE", "id": "776b3b07cef130376e2a066d235e80c9d4571cd5", "size": "2543", "binar...
""" Helper functions and shared datasets for tests """ from __future__ import print_function, division, absolute_import import os from varcode import Variant, VariantCollection from pyensembl import ensembl_grch38 def data_path(name): """ Return the absolute path to a file in the varcode/test/data directory...
{ "content_hash": "a58f265ccdfb05eeafade57695822307", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 74, "avg_line_length": 27.523809523809526, "alnum_prop": 0.7231833910034602, "repo_name": "hammerlab/topiary", "id": "d2f9d3fd6034717ea44b56bae635053c0f95d8d2", "size": "17...
from hashlib import md5 from urllib import urlencode from django import forms from robokassa.conf import LOGIN, PASSWORD1, PASSWORD2, TEST_MODE from robokassa.conf import STRICT_CHECK, FORM_TARGET, EXTRA_PARAMS from robokassa.models import SuccessNotification class BaseRobokassaForm(forms.Form): def __init__(sel...
{ "content_hash": "f0daaf22f4b7693ea3efaabad61b181c", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 103, "avg_line_length": 35.96951219512195, "alnum_prop": 0.6484149855907781, "repo_name": "kmike/django-robokassa", "id": "0c1a2841ffb8e29c0470a6411c48e2338ade7fc4", "size...
from __future__ import absolute_import, division, print_function from os.path import join from plottool import draw_func2 as df2 import numpy as np import os import utool print, print_, printDBG, rrr, profile = utool.inject(__name__, '[viz_allres]', DEBUG=False) # Global variables BROWSE = True DUMP = False FIGNUM = 1 ...
{ "content_hash": "5b3125e5ab52207aea964e4355f21f26", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 91, "avg_line_length": 37.67634854771784, "alnum_prop": 0.6105726872246696, "repo_name": "SU-ECE-17-7/ibeis", "id": "7f81317d0feba9a3d867246906bee6cf4aee0e7b", "size": "90...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('django_chatterbot', '0005_statement_created_at'), ] operations = [ migrations.CreateMo...
{ "content_hash": "45c2bd39349d54c64da8a1d947de7d57", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 155, "avg_line_length": 33.645161290322584, "alnum_prop": 0.6241610738255033, "repo_name": "davizucon/ChatterBot", "id": "f468701ea5e30c02996e77daf5a26875eef0422d", "size":...
import platform import os def autodetect(): """ Returns ------- bool True if current platform matches, otherwise False """ if 'CI' in os.environ: if os.environ['CI'] != 'true': return False if not 'JENKINS_HOME' in os.environ: return False return...
{ "content_hash": "b5d44697b07a852339f17a3f2eb6eec7", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 57, "avg_line_length": 15.96, "alnum_prop": 0.543859649122807, "repo_name": "schreiberx/sweet", "id": "5a185412fef37544d7ae50b061bad829176ad4ca", "size": "399", "binary":...
"""RADOS Block Device Driver""" from __future__ import absolute_import import io import json import os import tempfile import urllib from oslo.config import cfg from cinder import exception from cinder.image import image_utils from cinder.openstack.common import fileutils from cinder.openstack.common import log as l...
{ "content_hash": "59c85485ce8a883404bf681347050c9e", "timestamp": "", "source": "github", "line_count": 805, "max_line_length": 79, "avg_line_length": 38.54782608695652, "alnum_prop": 0.5549611678643936, "repo_name": "cloudbau/cinder", "id": "ddcf16dcde07adee8d67c1571f6b842ed6899a84", "size": "3164...
""" editorcontainer ================== **Module**: ``editorcontainer.editorcontainer.py`` Module that contains all that's necessary to create the file tabs """ import os import math from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty from kivy.properties import StringProperty from ki...
{ "content_hash": "578380cd7f0bc3d16a39df8ce1b155ed", "timestamp": "", "source": "github", "line_count": 630, "max_line_length": 135, "avg_line_length": 38.7, "alnum_prop": 0.5503055658094418, "repo_name": "Errantgod/azaharTEA", "id": "43728d005d0219cb673470a9a0cdb72538f580b0", "size": "24381", "b...
import time import json import Queue import logging import threading import cookie_utils import tornado.ioloop import tornado.httputil import tornado.httpclient from tornado.curl_httpclient import CurlAsyncHTTPClient from tornado.simple_httpclient import SimpleAsyncHTTPClient from pyspider.libs import dataurl, counter ...
{ "content_hash": "f7757da07afd7d33482346640647c7b6", "timestamp": "", "source": "github", "line_count": 421, "max_line_length": 110, "avg_line_length": 38.32541567695962, "alnum_prop": 0.5089556863960335, "repo_name": "jorik041/pyspider", "id": "9e1564886e344b63aa022863c5aac83c9b2ec56f", "size": "1...
"""Ops to convert between RaggedTensors and other tensor types.""" from tensorflow.python.framework import dtypes from tensorflow.python.framework import indexed_slices from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import gen_ragged_conversion_ops fr...
{ "content_hash": "8d302eaddbd4fee981cb7087dc18a63f", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 80, "avg_line_length": 38.51204819277108, "alnum_prop": 0.6788675113405287, "repo_name": "gautam1858/tensorflow", "id": "e71f5cad7929fc034eaa2bad2f6b81110c36b1ed", "size":...
""" 移动止损策略:对从策略进行移动止损操作 请按命名规则在策略配置文件中配置 """ from __future__ import division from vnpy.app.cta_strategy.ctaTemplatePatch import CtaTemplatePatch import copy ######################################################################## class TrailingStopStrategy(CtaTemplatePatch): """移动止损策略""" className = 'Trailin...
{ "content_hash": "cf6eacb999165a191ed3d5c7edc31e75", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 82, "avg_line_length": 37.381188118811885, "alnum_prop": 0.46656072043437957, "repo_name": "bigdig/vnpy", "id": "6ed3a91345fb87f25b70451150d56a276e0855ac", "size": "8173",...
"""Package contenant la commande 'pedit'.""" from primaires.interpreteur.commande.commande import Commande class CmdPedit(Commande): """Commande 'pedit'""" def __init__(self): """Constructeur de la commande""" Commande.__init__(self, "pedit", "pedit") self.groupe = "administr...
{ "content_hash": "00be591929b74b8bdd8d29f73512351c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 77, "avg_line_length": 39.9375, "alnum_prop": 0.622848200312989, "repo_name": "vlegoff/tsunami", "id": "1460948e28a22a847192c273eebe7fd1806c9b80", "size": "2855", "binary...
from __future__ import unicode_literals import logging import argparse import unittest import os # Set up logger for the sub-commands to use. # Note that this setup must occur before the other modules are imported. # Code stub courtesy of http://stackoverflow.com/questions/7621897/python-logging-module-globally log_fo...
{ "content_hash": "6c702d54b24a28e5d183a6299ed41960", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 98, "avg_line_length": 38.21848739495798, "alnum_prop": 0.6561125769569042, "repo_name": "andrewhead/Package-Qualifiers", "id": "71d2389b433f1a05494041ae980b3d4fefb3e5c0", ...
from __future__ import unicode_literals from django.db import models, migrations import workshift.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('managers', '0002_auto_20140801_1108'), ...
{ "content_hash": "6f7aa4aa6b113e1cf3917f5550c3d093", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 321, "avg_line_length": 68.42696629213484, "alnum_prop": 0.6079365079365079, "repo_name": "knagra/farnsworth", "id": "786a674727648b4347e20eb7e42a6f227e486843", "size": "1...
"""Extracts Problem definitions from projecteuler.net and saves each to seperate file with common Python Template""" from __future__ import print_function import urllib2 import sys from bs4 import BeautifulSoup def main(): if len(sys.argv) != 3: print('usage: ./eulergen.py <start problem number> <end p...
{ "content_hash": "0bf7c106f5ba57869ac05e02492543c4", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 81, "avg_line_length": 24.137254901960784, "alnum_prop": 0.5637692932575142, "repo_name": "sai-prasanna/python-scripts", "id": "4738e4b898d68584e8273a01269a7c8091ec4f20", "...
from rqalpha.api import api_base, api_extension def get_apis(): apis = {name: getattr(api_base, name) for name in api_base.__all__} apis.update((name, getattr(api_extension, name)) for name in api_extension.__all__) return apis
{ "content_hash": "12e8a22764d555f45541d1b506fd276c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 87, "avg_line_length": 34.57142857142857, "alnum_prop": 0.6818181818181818, "repo_name": "xclxxl414/rqalpha", "id": "f4c057b06039822736a7d4fa3927957a27b61e9f", "size": "847"...
""" Created on 2017-4-25 @author: cheng.li """ from alphamind.data.neutralize import neutralize from alphamind.data.rank import rank from alphamind.data.standardize import standardize from alphamind.data.winsorize import winsorize_normal as winsorize __all__ = ['standardize', 'winsorize', ...
{ "content_hash": "fcb98ce2d9d2d6a4138428c342686411", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 24.2, "alnum_prop": 0.6694214876033058, "repo_name": "wegamekinglc/alpha-mind", "id": "a15dcf3cadd9ae5f02598c0736544137a6c639c8", "size": "388", "b...
from oslo_policy import policy from nova.policies import base BASE_POLICY_NAME = 'os_compute_api:os-rescue' UNRESCUE_POLICY_NAME = 'os_compute_api:os-unrescue' DEPRECATED_REASON = """ Rescue/Unrescue API policies are made granular with new policy for unrescue and keeping old policy for rescue. """ DEPRECATED_POLIC...
{ "content_hash": "19ae4cb22a3c5113ad51880110404dd2", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 65, "avg_line_length": 25.41176470588235, "alnum_prop": 0.6041666666666666, "repo_name": "openstack/nova", "id": "f9f72e92ef338396376177deda99797f7226fc5e", "size": "1935",...
import json import mock from neutron.common import exceptions from neutron.plugins.nicira.common import exceptions as nvp_exc from neutron.plugins.nicira.common import utils from neutron.plugins.nicira.nsxlib import lsn as lsnlib from neutron.plugins.nicira import NvpApiClient from neutron.tests import base class LS...
{ "content_hash": "f5304e9eff4fb085b7b706f40d372f73", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 78, "avg_line_length": 39.38650306748466, "alnum_prop": 0.5407320872274143, "repo_name": "Comcast/neutron", "id": "86daa39aa241ef309006a09add032f77e7f33330", "size": "1346...
AUTHOR = u'Adrian Sampson' # General configuration extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks'] exclude_patterns = ['_build'] source_suffix = '.rst' master_doc = 'index' project = u'beets' copyright = u'2012, Adrian Sampson' version = '1.3' release = '1.3.17' pygments_style = 'sphinx' # External li...
{ "content_hash": "9bb795e3d1532cb3b7506550ce1a3c7d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 21.875, "alnum_prop": 0.6502857142857142, "repo_name": "LordSputnik/beets", "id": "a636220792688f770f3876cea94332394923852b", "size": "900", "binar...
"""Test the Dyson air quality component.""" import json from unittest import mock import asynctest from libpurecool.dyson_pure_cool import DysonPureCool from libpurecool.dyson_pure_state_v2 import DysonEnvironmentalSensorV2State from homeassistant.components import dyson as dyson_parent from homeassistant.components....
{ "content_hash": "1b8a02df7ab1da8653c6c004d23cd243", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 83, "avg_line_length": 35.716981132075475, "alnum_prop": 0.6849797499559782, "repo_name": "Teagan42/home-assistant", "id": "ed2fbed34f3d8fc3fe1df1b34b271fa6ef462719", "siz...
"""Game Tests.""" import pytest from spykeball import game from spykeball import util @pytest.fixture(scope='session') def sample_games(sample_players): """Create Sample Games from sample_players.""" length = sample_players['length'] / 4 players = sample_players['players'] games = [] for p1, p2,...
{ "content_hash": "91771d835ae7d2b556214b8e6073cd85", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 69, "avg_line_length": 28.20689655172414, "alnum_prop": 0.6699266503667481, "repo_name": "bhgomes/spykeball", "id": "fc19dbea4891f452b8a47f3a78ca4db1f5d05952", "size": "818...
import unittest from llvmcpy import llvm from packaging import version module_source = """; ModuleID = 'example.c' target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" ; Function Attrs: nounwind uwtable define i32 @function2() { ret i32 42 } ; Function Attrs: nounwind u...
{ "content_hash": "a61c1d4fdfbbcaa6f6298f962fdb9963", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 84, "avg_line_length": 33.850467289719624, "alnum_prop": 0.6300386526780785, "repo_name": "revng/llvmcpy", "id": "56ff6d2788f4811926fb205e3a7878ae240f43e2", "size": "3622"...
""" Unit tests for the sql backend """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import ga4gh.sqliteBackend as sqliteBackend import tests.paths as paths class SqliteDB(sqliteBackend.SqliteBackedDataSource): def __init__(self, d...
{ "content_hash": "051a4f0a294ee79a0d544fd16acd7be8", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 67, "avg_line_length": 29.74074074074074, "alnum_prop": 0.6229763387297634, "repo_name": "ohsu-computational-biology/server", "id": "d0dbd558ff82e5a67c2a72b6fe231058021892f1...
import os import yaml from astropy import units as u from pocs import hardware from pocs.utils import listify from warnings import warn def load_config(config_files=None, simulator=None, parse=True, ignore_local=False): """ Load configuation information """ # Default to the pocs.yaml file if config_file...
{ "content_hash": "924abf596b4a3a647e8914951d61c114", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 93, "avg_line_length": 29.175257731958762, "alnum_prop": 0.5752650176678445, "repo_name": "AstroHuntsman/POCS", "id": "9250eafc8a08f790507a2515a4d3911856553738", "size": "2...
import logging import string import re from external.BeautifulSoup import BeautifulSoup, Comment acceptable_tags = ['a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', 'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', ...
{ "content_hash": "ef5bf406a36b959c06a1f75b863380c8", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 85, "avg_line_length": 43.067796610169495, "alnum_prop": 0.6042896497441952, "repo_name": "bcherry/adequatelygood", "id": "daa981e2f7e118d4711cdee80ce9cd06f2fdd77c", "size...