text
stringlengths
4
1.02M
meta
dict
from electrum_ltc.i18n import _ fullname = 'Trezor Wallet' description = _('Provides support for Trezor hardware wallet') requires = [('trezorlib','pypi.org/project/trezor/')] registers_keystore = ('hardware', 'trezor', _("Trezor wallet")) available_for = ['qt', 'cmdline']
{ "content_hash": "03d3d62d6f23a0753e148f82c263617f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 63, "avg_line_length": 34.5, "alnum_prop": 0.7065217391304348, "repo_name": "vialectrum/vialectrum", "id": "fdb0a91bfc0caec612869d1ec00402914f23fa6d", "size": "276", "bina...
"""drive_pot_fr Drive the landlab potentiality flow routing component. Created on Wed Mar 4 2015 @author: danhobley """ from __future__ import print_function from landlab import RasterModelGrid, ModelParameterDictionary from landlab.plot.imshow import imshow_node_grid import numpy as np from pylab import imshow, sh...
{ "content_hash": "5723d12d20f6696c1fab919877c7e07b", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 101, "avg_line_length": 37.072463768115945, "alnum_prop": 0.7267396403440187, "repo_name": "decvalts/landlab", "id": "2a1dcafb84f02756eed70206790bcb27aa9ea550", "size": "25...
""" Copyright 2013 Mortar Data Inc. 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 agre...
{ "content_hash": "71486d59d29b7ac778d5180d770434aa", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 106, "avg_line_length": 37.37068965517241, "alnum_prop": 0.5737024221453287, "repo_name": "brekru212/mongo-pig-examples", "id": "a89222a36c9cf6c9febb932d144793173ea07e2d", ...
from __future__ import absolute_import import os import zlib import json import click import logging import six from datetime import datetime from subprocess import Popen, PIPE from contextlib import contextmanager from six.moves.urllib.parse import urlparse HERE = os.path.abspath(os.path.dirname(__file__)) SENTRY_C...
{ "content_hash": "941ac43e90f801d72d5eafff7ea8f232", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 88, "avg_line_length": 29.53211009174312, "alnum_prop": 0.5792171481826655, "repo_name": "ifduyue/sentry", "id": "7ab746e31d74944b9e6b6f17a3c1582cae71b812", "size": "6438"...
from __future__ import unicode_literals from django.db import models, migrations import powerdns.models.powerdns import django.core.validators class Migration(migrations.Migration): dependencies = [ ('powerdns', '0017_auto_20160104_0642'), ] operations = [ migrations.AlterField( ...
{ "content_hash": "cd3cd1a05899d84f719b99dd7385ea55", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 497, "avg_line_length": 48.57692307692308, "alnum_prop": 0.5581947743467933, "repo_name": "dominikkowalski/django-powerdns-dnssec", "id": "578f3c294a10fbcec643f59c202e674e690...
from pythonz.commands import Command, command_map from pythonz.log import logger class HelpCommand(Command): name = "help" usage = "%prog [COMMAND]" summary = "Show available commands" def run_command(self, options, args): if args: command = args[0] if command not in c...
{ "content_hash": "49a54a6fb8e37fb83763bb7fabd6032f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 32.17857142857143, "alnum_prop": 0.5937846836847946, "repo_name": "Mitali-Sodhi/CodeLingo", "id": "bafae83cf59d23ea2140875bf3744c10e47af3d6", "size":...
import time import aiohttp from datetime import timedelta import json import encryption from secret import * from AList_ProfileProcessor import profile_preprocessor import random class AList: def __init__(self, client): self.apiurl = "https://anilist.co/api" self.commands = [['awaifu', self.waifu]...
{ "content_hash": "8cbdf4205806abff87a07249b258ddf9", "timestamp": "", "source": "github", "line_count": 724, "max_line_length": 452, "avg_line_length": 68.0207182320442, "alnum_prop": 0.4691859402603204, "repo_name": "ccubed/AngelBot", "id": "3ec0f9c19a1e18e785d729734c215e2880c430f6", "size": "4924...
from common_fixtures import * # NOQA import os if_upgrade_testing = pytest.mark.skipif( os.environ.get("UPGRADE_TESTING") != "true", reason='UPGRADE_TESTING is not true') pre_upgrade_namespace = "" post_upgrade_namespace = "" pre_port_ext = "" post_port_ext = "" @pytest.fixture(scope='session') def get_env...
{ "content_hash": "cae2511a23f21106d272c9592797716b", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 69, "avg_line_length": 28.48076923076923, "alnum_prop": 0.6772451046590142, "repo_name": "rancherio/validation-tests", "id": "0f27f70f7cc3b87ac20af21aea9d62bcb3c1352a", "si...
class Order: """Allows ordering arbitrary objects with regard to arbitrary binary relation. The primary use case is the gcc toolset, which is sensitive to library order: if library 'a' uses symbols from library 'b', then 'a' must be present before 'b' on the linker's command line. ...
{ "content_hash": "ca3cf88f2b50b4b6f8120a1da39ba80f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 82, "avg_line_length": 34.99145299145299, "alnum_prop": 0.538104543234001, "repo_name": "MisterTea/HyperNEAT", "id": "576229fe90f9a26b47bbdbbcfb0285dc313723e9", "size": "4...
import sys sys.path.append("/vagrant/dockerEE/service") import os from environment_emulation_runner import EnvironmentEmulationRunner from service_daemon import ServiceDaemon ## TestService # # The test service daemon class class TestService(ServiceDaemon): ## constructor def __init__(self): ServiceD...
{ "content_hash": "3ccdbab856adf904e7f4103d10f22aba", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 114, "avg_line_length": 35.372549019607845, "alnum_prop": 0.6751662971175166, "repo_name": "ynaka81/dockerEE", "id": "e5db775d534541fb0a11ad8db674e33592d9f51b", "size": "18...
from oslo.config import cfg from ceilometer import nova_client from ceilometer.openstack.common.gettextutils import _ from ceilometer.openstack.common import log from ceilometer import plugin LOG = log.getLogger(__name__) OPTS = [ cfg.StrOpt('url_scheme', default='snmp://', help='U...
{ "content_hash": "4c1fd0ce336f6b4410547ca4ae47a1cb", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 34.38095238095238, "alnum_prop": 0.5433979686057249, "repo_name": "luogangyi/Ceilometer-oVirt", "id": "44a156824a98bb5a62b2e4f903d2be52825609e4", "si...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('autotrader', '0016_markethistory'), ] operations = [ migrations.RemoveField( model_name='markethistory'...
{ "content_hash": "697f07dfc95335183d7586d0ec9f4f13", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 123, "avg_line_length": 26.428571428571427, "alnum_prop": 0.5878378378378378, "repo_name": "scealiontach/cryptotrading", "id": "6dbf4ef8670efdbc61986e388316db3e00dadc7f", "...
import binascii from os import urandom from urllib.parse import urljoin from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _, pgettext_lazy from shop.models import order class Order(order.BaseOrder): """Default materialized model for Order""" n...
{ "content_hash": "3710ec7a9bc55c779d549e78137d5769", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 115, "avg_line_length": 34.134020618556704, "alnum_prop": 0.6097855632739354, "repo_name": "awesto/django-shop", "id": "54c809d690afb934d3444cabb1538e367f398dca", "size": "...
import bob.ip.base import numpy import math # create test image image = numpy.zeros((21,21)) image[5:16, 5:16] = 1 # perform Sobel filtering sobel = bob.ip.base.sobel(image) # compute direction-independent and direction-dependent results abs_sobel = numpy.sqrt(numpy.square(sobel[0]) + numpy.square(sobel[1])) angle =...
{ "content_hash": "81a8ae8f264af0bb51d416537b655047", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 105, "avg_line_length": 37.07692307692308, "alnum_prop": 0.7064315352697096, "repo_name": "tiagofrepereira2012/bob.ip.base", "id": "dbd69fd0c2fbdfb63cb445a4dedbc6903dbbcede",...
"""Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('ck.sitetheme') def initialize(context): """Initializer called when used as a Zope 2 product."""
{ "content_hash": "904c7c24a1d887075aacbef7293b309a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 21.333333333333332, "alnum_prop": 0.71875, "repo_name": "a25kk/ck", "id": "ebe3e6540e64f085139cdb3fc030148def179c09", "size": "216", "binary": false...
import IECore import Gaffer import GafferScene ## \todo Nice geometry class ShaderBall( GafferScene.SceneNode ) : def __init__( self, name = "ShaderBall" ) : GafferScene.SceneNode.__init__( self, name ) # Public plugs self["shader"] = GafferScene.ShaderPlug() self["resolution"] = Gaffer.IntPlug( defaultV...
{ "content_hash": "614a20ab41b355c2787f210e8ad6958d", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 93, "avg_line_length": 37.246153846153845, "alnum_prop": 0.6534489880214788, "repo_name": "chippey/gaffer", "id": "28d621a7447dd35fc2312de3e6ebb1b99804e970", "size": "4224"...
import logging import time import os import sys from ConfigParser import ConfigParser from subprocess import Popen, PIPE class JavaConfig: '''Enable access to properities in java siteConfig file''' def __init__(self, fname): self.prop_d = {} for line in open(fname): line = line.stri...
{ "content_hash": "d5c1b07bbf7ea4ed6dbbe3610ed47472", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 211, "avg_line_length": 33.65217391304348, "alnum_prop": 0.615848406546081, "repo_name": "joshelser/accumulo", "id": "df8654501ef2529555ebcb591b7a4a58d9265348", "size": "7...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.append(os.path.abspath('sphinxext')) sys.path.append(os.p...
{ "content_hash": "e92fca20de2f586544df8a3c28ac53a0", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 314, "avg_line_length": 34.3034188034188, "alnum_prop": 0.7106017191977078, "repo_name": "jdsika/TUM_HOly", "id": "7566f69a313285f542b937a20befc90aed9dc047", "size": "8446...
from __future__ import unicode_literals import acads.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Files', fields...
{ "content_hash": "d3d2850858ea0ce1f7d22beff963984d", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 114, "avg_line_length": 35.95652173913044, "alnum_prop": 0.5532043530834341, "repo_name": "Vipul999ujawane/acad-search", "id": "ac7c97cd22d72c06f959d17caa95e9d4772b958d", "...
from PIL.Image import Image class VideoEncoder: """ Video encoder interface. Implemented to provide a means of encoding frames to a video file. """ def get_options(self): return None def open(self, path, width, height): """ Opens a stream to a file""" raise NotImplemented d...
{ "content_hash": "3601a55a61ffa35f414874dd66f3321f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 103, "avg_line_length": 24.677419354838708, "alnum_prop": 0.6339869281045751, "repo_name": "VISTAS-IVES/pyvistas", "id": "48c64de650967b1cb23dbb0bbe469b9cc8f806cc", "size":...
"""Implements ThreadPoolExecutor.""" __author__ = 'Brian Quinlan (brian@sweetapp.com)' from concurrent.futures.multithreaded import Future from concurrent.futures.old.executor import Executor import atexit import queue import threading import weakref import logging logger = logging.getLogger(__package__) # Workers ...
{ "content_hash": "88c265a8b52cb6a6c9406cb23b5bf29d", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 81, "avg_line_length": 32.034246575342465, "alnum_prop": 0.5976053025443661, "repo_name": "mikhtonyuk/rxpython", "id": "dc494cb2e09d7a763547954973d637b37b43fff4", "size": ...
from ec2.base.action import Action from ec2.error import UndefinedError, MissingParameter from ec2.helpers.parse import parseFilters from ec2.helpers.filters import applyEc2Filters """@package src.ec2.region EC2 actions for regions @copyright Copyright (c) 2012 Institute of Nuclear Physics PAS <http://www.ifj.edu.pl/...
{ "content_hash": "5e105ea08b1ed127181f3945503de89a", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 87, "avg_line_length": 27.436363636363637, "alnum_prop": 0.6686547382372432, "repo_name": "cc1-cloud/cc1", "id": "8ea5a8d3ca42df6a62824c0e24fb39ddc74c0429", "size": "2209",...
import time #imports the time module which allows for a pause inbetween printing score = 0 #defines the user's score before starting name = input("What is your name? ") #takes the user's name so it can be used elsewhere print("Welcome to The Quiz, ",name,"\nWe'll be asking a series of general knowledge q...
{ "content_hash": "91850bc781a6a61fb2abd7a77ba94729", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 199, "avg_line_length": 29.127906976744185, "alnum_prop": 0.6622754491017964, "repo_name": "AlexEaton1105/Computer-Science", "id": "c9205c3cb4721ff4301c48ce35148c32323f1e16",...
from imports import * def get_user_id(nick): """Get userid by nickname Args: nick: the nickname of the user Returns: the user id of the nickname """ user_id = db_session.query(User.user_id).filter_by(nick=nick).first() return user_id[0] def getNick(): """Get nickname ...
{ "content_hash": "707a32635b86384d3b0e47353637b411", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 101, "avg_line_length": 19.22222222222222, "alnum_prop": 0.5878612716763005, "repo_name": "NewBeeStudio/xichao-new", "id": "14a351818c70ce250f8d93b0c66017e3002c919d", "size...
"""Add room principals table Revision ID: cbe630695800 Revises: 252c0015c9a0 Create Date: 2018-12-13 11:10:12.684382 """ from __future__ import print_function import json import sqlalchemy as sa from alembic import context, op from sqlalchemy.dialects import postgresql from indico.core.auth import multipass from i...
{ "content_hash": "165419879890496c21faa3cfa3a14e36", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 120, "avg_line_length": 52.61214953271028, "alnum_prop": 0.6203037569944044, "repo_name": "mvidalgarcia/indico", "id": "7addcba8575254c522730836f989807af7a39efa", "size": ...
from kubernetes import simplejson class TypeMeta(object): '''A Class representing the TypeMeta structure used by the kubernetes API TypeMeta is shared by all objects sent to, or returned from the client. The TypeMeta structure exposes the following properties: TypeMeta.Kind TypeMeta.ID TypeMeta.UID TypeMeta...
{ "content_hash": "7c6dea1c26f8ec1e1e42b6b166b206ee", "timestamp": "", "source": "github", "line_count": 626, "max_line_length": 96, "avg_line_length": 26.517571884984026, "alnum_prop": 0.7137349397590361, "repo_name": "pkilambi/python-kubernetes", "id": "f564725317c323eb85dfeae37fe0cf68a9d916d6", "...
from .partition_safety_check import PartitionSafetyCheck class WaitForPrimaryPlacementSafetyCheck(PartitionSafetyCheck): """Safety check that waits for the primary replica that was moved out of the node due to upgrade to be placed back again on that node. :param Kind: Polymorphic Discriminator :type ...
{ "content_hash": "f85ce8b454030bb11e3ec097f2e810fe", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 91, "avg_line_length": 33.333333333333336, "alnum_prop": 0.7014285714285714, "repo_name": "v-iam/azure-sdk-for-python", "id": "216fc1af569b4e99c8f8a494841f2f413a0d56ae", "s...
from __future__ import print_function import unittest import imp import operator import sys is_pypy = '__pypy__' in sys.builtin_module_names import wrapt from compat import PY2, PY3, exec_ OBJECTS_CODE = """ class TargetBaseClass(object): "documentation" class Target(TargetBaseClass): "documentation" def...
{ "content_hash": "d1d91d14e8a0cf51843bb3bb4d848392", "timestamp": "", "source": "github", "line_count": 1795, "max_line_length": 77, "avg_line_length": 25.95431754874652, "alnum_prop": 0.5805786897913626, "repo_name": "GrahamDumpleton/wrapt", "id": "e2493063f0af060655cb335f47a9cd9cc69fa6af", "size"...
import os import sys from conary import conarycfg from conary.deps import deps from conary.lib import log from conary.lib import options from rmake import compat, errors from rmake.compat import cvccmd as cvc from rmake.cmdline import query (NO_PARAM, ONE_PARAM) = (options.NO_PARAM, options.ONE_PARAM) (OPT_PARAM,...
{ "content_hash": "d9c6461b82bb99d3a1ab1533c82f833a", "timestamp": "", "source": "github", "line_count": 920, "max_line_length": 125, "avg_line_length": 39.10434782608696, "alnum_prop": 0.5595952857460529, "repo_name": "fedora-conary/rmake-2", "id": "39cf0b56366a629fe03ddb2401064915eaaabf9d", "size"...
from pgmpy import exceptions class Independencies(object): """ Base class for independencies. independencies class represents a set of Conditional Independence assertions (eg: "X is independent of Y given Z" where X, Y and Z are random variables) or Independence assertions (eg: "X is independe...
{ "content_hash": "258e18722b93051a3f3847b1e5abea0c", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 111, "avg_line_length": 33.032, "alnum_prop": 0.5635747154274643, "repo_name": "yashu-seth/pgmpy", "id": "d5a155571eb5c651e66424c4280b741d2e73cedc", "size": "8258", "bin...
class Spam: def doit(self, message): print(message) object1 = Spam() object1.doit('hello world!') x = object1.doit x('hello world!') t = Spam.doit t(object1, 'howdy!') class Eggs: def m1(self, n): print(n) def m2(self): x = self.m1 x(42) Eggs().m2() class Selfless: de...
{ "content_hash": "0e23143bea34a3730024730b6333545b", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 51, "avg_line_length": 20.705263157894738, "alnum_prop": 0.5922724961870869, "repo_name": "eroicaleo/LearningPython", "id": "6681478395c5d0c52304669ade34a0a768447917", "siz...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General conf...
{ "content_hash": "5c03224eae5f2938f1ec860ef28e7eae", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 80, "avg_line_length": 31.41640378548896, "alnum_prop": 0.7075007530876594, "repo_name": "Wizcorp/marathon-client.py", "id": "c32c0dedf0805269d4f35651d10188a3bb1cf746", "s...
""" Budgetting Module - Controllers """ module = request.controller resourcename = request.function # Requires 'project' module too if module not in deployment_settings.modules or not deployment_settings.has_module("project"): session.error = T("Module disabled!") redirect(URL(r=request, c="default", f="i...
{ "content_hash": "631ed17be99899ad4c963b021b2a36d9", "timestamp": "", "source": "github", "line_count": 1466, "max_line_length": 370, "avg_line_length": 46.10709413369713, "alnum_prop": 0.5799565043717545, "repo_name": "ptressel/sahana-eden-madpub", "id": "d0226e32241f7eaeaa10cd7c47b108345997366c", ...
import inspect import mock import tests.unit.responses as responses class MockAWS(object): def __init__(self, profile=None, region=None): self.response_map = {} for name, value in inspect.getmembers(responses): if name.startswith('__'): continue if '_' in...
{ "content_hash": "02759b3f2cdf04b2df994311c8c72b2c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 73, "avg_line_length": 30.8125, "alnum_prop": 0.5821501014198783, "repo_name": "ryansb/kappa", "id": "b0da5ab17fccd035af158a13500ce06536edc3de", "size": "986", "binary": ...
import unittest, random, sys sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_rf, h2o_import as h2i params = { 'nbins': 1000, 'ntrees': 10, # apparently fails with undecided node assertion if all inputs the same # 'cols': '0,1,2,3,4,', # 'cols': '8,9', 'cols': 'C9,C10', ...
{ "content_hash": "8aac13f8aa7d6aae1cf48d0d86577253", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 119, "avg_line_length": 29.097560975609756, "alnum_prop": 0.5850796311818944, "repo_name": "100star/h2o", "id": "338cf17f67063adc09249bf12d4b9a5daa3491cb", "size": "1193", ...
"""Test the fundrawtransaction RPC.""" from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import ( assert_equal, assert_fee_amount, assert_greater_than, assert_greater_than_or_equal, assert_raises_rpc_error, connect_nodes_bi, ...
{ "content_hash": "b22262c6bbcdbfb5b03daa9d8768e131", "timestamp": "", "source": "github", "line_count": 751, "max_line_length": 223, "avg_line_length": 45.26897470039947, "alnum_prop": 0.5635497249757332, "repo_name": "myriadteam/myriadcoin", "id": "8aae249362f84f94585fa788dc2f3ec9138faa4e", "size"...
"""Install script for setuptools.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import imp from setuptools import find_packages from setuptools import setup setup( name='dm-hard-eight', version=imp.load_source('_version', ...
{ "content_hash": "61a7c796faedcffbcf2a97ef01bb18c7", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 32.869565217391305, "alnum_prop": 0.6044973544973545, "repo_name": "deepmind/dm_hard_eight", "id": "b76b197f094b0bc1bb69bdb26e287177612b9167", "size"...
import random ################################################################## ###################### Testing Tools ############################# ################################################################## ''' Generates inputs for gradient descent. Inputs: voters: the number of voters, or n fr...
{ "content_hash": "783acd340c595dc5403e67b4d126220c", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 115, "avg_line_length": 37.446308724832214, "alnum_prop": 0.5660901514472623, "repo_name": "artuchavez/6006-Projects", "id": "32fd6b7d494a97f1188113125915469d95f343b3", "s...
from ..selinux import SELinux from ...parsers.grub_conf import Grub1Config, Grub2Config from ...parsers.selinux_config import SelinuxConfig from ...parsers.sestatus import SEStatus from ...tests import context_wrap GRUB_DISABLED = 'grub_disabled' GRUB_NOT_ENFORCING = 'grub_not_enforcing' RUNTIME_DISABLED = 'sestatus_d...
{ "content_hash": "39055a80809be67bc94c2563e462c0db", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 304, "avg_line_length": 39.300683371298405, "alnum_prop": 0.6548426360632933, "repo_name": "PaulWay/insights-core", "id": "f57db0c2d92b0257cc48f9e153fa48085c00c248", "size...
from lib.python_actions import PuppetBasePythonAction __all__ = [ 'PuppetCertRevokeAction' ] class PuppetCertRevokeAction(PuppetBasePythonAction): def run(self, environment, host): success = self.client.cert_revoke(environment=environment, host=host) return success
{ "content_hash": "34314513311e21f1d22da575351e3010", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 77, "avg_line_length": 26.636363636363637, "alnum_prop": 0.7406143344709898, "repo_name": "lmEshoo/st2contrib", "id": "97f36c382c40b121bf1687275067b895f868b1c5", "size": "2...
import os from setuptools import setup, find_packages from glob import glob setup(name='AjaxTerm2', version='1.1.0', py_modules=['ajaxterm2'], install_requires=['webob','paste','pastedeploy'], data_files=[('', glob('*.ini')), ('www', glob('www/*.html')), ('w...
{ "content_hash": "6d40596ba915cc70758f573f29b15641", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 55, "avg_line_length": 28.933333333333334, "alnum_prop": 0.4838709677419355, "repo_name": "selboo/starl-mangle", "id": "e1ce3eaf54b226912a9c466428909da496583fdd", "size": "...
import collections import inspect from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy.sql import text def _convert(data): if isinstance(data, basestring): return str(data) elif isinstance(data, collections.Mapping): return dict(map(_convert, data.iteritems())) elif isinstance(data, ...
{ "content_hash": "38f367656855842df5a2023b4c73d679", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 182, "avg_line_length": 36.333333333333336, "alnum_prop": 0.6065839179708581, "repo_name": "RydrDojo/Ridr_app", "id": "0d746229532057823acdd89aa7afb4642ab1be0f", "size": "1...
from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ ("objects", "0001_initial"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("typeclasses", "0001_initial"), ] operations = [ migr...
{ "content_hash": "80198854ede94df4e4c30c364edaa85d", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 255, "avg_line_length": 41.18260869565217, "alnum_prop": 0.4197635135135135, "repo_name": "jamesbeebop/evennia", "id": "fd07a9317133512ee513aab8bf04f11ba4bfea09", "size": ...
import binascii from graph.filter_base import FilterBase, FilterState, FilterType from graph.pad_template import PadTemplate from graph.pad_capabilities import PadCapabilities from graph.input_pin import InputPin from graph.output_pin import OutputPin class LoggerSink(FilterBase): """ A logger sink filter. ...
{ "content_hash": "55ec964568aef209ae9e9e87753d02c8", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 130, "avg_line_length": 41.96666666666667, "alnum_prop": 0.636219221604448, "repo_name": "koolspin/rosetta", "id": "a9910750fb76fcea0985b69271e924f8066fb4df", "size": "3777...
""" Remove massive tip and internal node labels from Richard Liang's simulated phylogeny. While we're at it, we need to rescale the coalescence times (branch lengths) to confirm to a logistic growth model because the earliest coalescence events are way too deep. """ import sys import math from Bio import Phy...
{ "content_hash": "58c61cd86db17bfdc1900a8a71d95b09", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 112, "avg_line_length": 31.60759493670886, "alnum_prop": 0.6567881457749299, "repo_name": "cfe-lab/Umberjack", "id": "c91a3e61cd9a95556b94e78c2ee595ba38c8e9e0", "size": "24...
import errno import logging import os import socket import subprocess from time import sleep from ghpythonremote import rpyc from .helpers import ( get_python_path, get_extended_env_path_conda, get_rhino_executable_path, WINDOWS, ) logger = logging.getLogger("ghpythonremote.connectors") class Grassh...
{ "content_hash": "f5441b29299b76b4b480f94809a0d1c4", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 87, "avg_line_length": 36.08796296296296, "alnum_prop": 0.5303399615137909, "repo_name": "pilcru/ghpythonremote", "id": "52e0b99ae87495fbcc6d2a3b55e836b4c4a104ca", "size":...
"""Gradients for operators defined in data_flow_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.framework import dtypes from tensorflow.python.framework impo...
{ "content_hash": "ec0e7c1595720b56566aefb034a2d121", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 80, "avg_line_length": 34.01470588235294, "alnum_prop": 0.7518374405533939, "repo_name": "EvenStrangest/tensorflow", "id": "af04d41f02304f6792ff8099926d6c4f56866184", "size...
"""The tests for Media player device conditions.""" import pytest import homeassistant.components.automation as automation from homeassistant.components.media_player import DOMAIN from homeassistant.const import ( STATE_IDLE, STATE_OFF, STATE_ON, STATE_PAUSED, STATE_PLAYING, ) from homeassistant.he...
{ "content_hash": "ce0ad309ba5253521ef8b7c8bf73334f", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 106, "avg_line_length": 35.82716049382716, "alnum_prop": 0.45945325063174824, "repo_name": "robbiet480/home-assistant", "id": "c52daa80320b619df722ac90e1087edb290c96fc", "...
import config from middleware.graphers.turtle_utils import generate_hash, generate_uri as gu, link_uris from middleware.blazegraph.upload_graph import queue_upload from middleware.graphers.turtle_utils import actual_filename from rdflib import Namespace, Graph, Literal, plugin from Bio import SeqIO from os.path import ...
{ "content_hash": "78a8f21f68dc4e6f0f58ab05851718c1", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 142, "avg_line_length": 46.27433628318584, "alnum_prop": 0.6731688659399503, "repo_name": "superphy/backend", "id": "ae72c7ee0e4d722029855b26b44fc5ad3410f7c5", "size": "55...
import sys import time sys.path.append("../config/common/tests") from test_utils import * import fixtures import testtools import test_common import test_case import discoveryclient.client as client server_list = {} class DiscoveryServerTestCase(test_case.DsTestCase): def setUp(self): extra_config_knobs ...
{ "content_hash": "7fce153b80090bc1280e5ee0c3751ec9", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 136, "avg_line_length": 38.46938775510204, "alnum_prop": 0.5854995579133511, "repo_name": "sajuptpm/contrail-controller", "id": "3f7eb03c12d8e15dc3db495e8e81cadc95ff86af", ...
""" Example Plugin (dice roller) (botbot plugins.example) """ # Copyright 2013 Facebook # # 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 # # Unle...
{ "content_hash": "1f5da20f1aab46eca21cfb8c4e74f5cd", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 77, "avg_line_length": 32.04132231404959, "alnum_prop": 0.521279339695641, "repo_name": "facebook/pyaib", "id": "ec7cb6b3160f699ef90251a708326b408ffe332d", "size": "3877",...
import os import re from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence from airflow.configuration import conf from airflow.models import BaseOperator from airflow.providers.apache.hive.hooks.hive import HiveCliHook from airflow.utils import operator_helpers from airflow.utils.operator_helpers import conte...
{ "content_hash": "bea2ff1f042f2e7d3890b95cccdeb9ba", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 110, "avg_line_length": 39.65605095541401, "alnum_prop": 0.6222293607452618, "repo_name": "danielvdende/incubator-airflow", "id": "45cae0fa4e31f38d69e19e43f5852010f859221c",...
from django.db.models import Q from django.contrib.auth import get_user_model from rest_framework.filters import ( SearchFilter, OrderingFilter, ) from rest_framework.response import Response from rest_framework.status import HTTP_200_OK, HTTP_400_BAD_REQUEST from rest_framework.views import APIView from rest...
{ "content_hash": "c53107da8933fe9a05891ae9b3cdf662", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 84, "avg_line_length": 24.918032786885245, "alnum_prop": 0.7519736842105263, "repo_name": "lichi6174/django-api-lab", "id": "04619846b7e157e5f422808e9c5fe3d86c8678c6", "siz...
import Gaffer import GafferScene Gaffer.Metadata.registerNode( GafferScene.ClosestPointSampler, "description", """ Samples primitive variables from the closest point on the surface of a source primitive, and transfers the values onto new primitive variable on the sampling objects. """, plugs = { "positio...
{ "content_hash": "c64ff70f13e4ee7ce369059129fb60d9", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 60, "avg_line_length": 18.970588235294116, "alnum_prop": 0.7054263565891473, "repo_name": "boberfly/gaffer", "id": "3493917b608188d34c95bc58f0b8ec32a218eae5", "size": "2441...
from __future__ import absolute_import from thrift.Thrift import * from .ttypes import * from thrift.Thrift import TProcessor from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except ImportError: fastbinary = None class Ifac...
{ "content_hash": "bbef9b8045c280e96c0b89adb1dc7c55", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 188, "avg_line_length": 29.553488372093025, "alnum_prop": 0.6487252124645893, "repo_name": "Yelp/pyes", "id": "a17cfabe3920e7e1bd7fe21a6a7dc22c0d00f238", "size": "6453", ...
"""Tests for db.api layer.""" import datetime as dt import ddt from six import moves from rally.common import db from rally.common.db import api as db_api import rally.common.db.sqlalchemy.api as s_api from rally import consts from rally import exceptions from tests.unit import test NOW = dt.datetime.now() class ...
{ "content_hash": "14164e17d2da44c6bd20e7a090222f6f", "timestamp": "", "source": "github", "line_count": 544, "max_line_length": 79, "avg_line_length": 40.83639705882353, "alnum_prop": 0.5944632005401755, "repo_name": "varuntiwari27/rally", "id": "a3aa598f47ae30cf61f7d918b8d957e43876d99c", "size": "...
import graph_tool.all as gt import numpy as np import itertools def get_modified_adjacency_matrix(g, k): # Get regular adjacency matrix adj = gt.adjacency(g) # Initialize the modified adjacency matrix X = np.zeros(adj.shape) # Loop over nonzero elements for i, j in zip(*adj.nonzero()): ...
{ "content_hash": "e830e15b4fb81ed71f53792d3a911419", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 113, "avg_line_length": 31.6625, "alnum_prop": 0.6517962889853928, "repo_name": "HanKruiger/tsnetwork", "id": "249a7c78021e76dd4b3eb731970e204bf0bdaad1", "size": "2533", ...
from __future__ import unicode_literals from django.apps import AppConfig class AccountsConfig(AppConfig): name = 'home'
{ "content_hash": "3c4c6837ca7816f088b17d38d67cee4b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18.285714285714285, "alnum_prop": 0.75, "repo_name": "jrdbnntt/facetags", "id": "ab43b6a597a290c9b93ae3111349f8c54fc5b97a", "size": "128", "binary":...
import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinx...
{ "content_hash": "985dc15f91eea26df6839c20fcbc73b0", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 31.508474576271187, "alnum_prop": 0.6750941366325982, "repo_name": "openstack/ansible-role-jenkins-plugins", "id": "dbb6a1bf825c68101126522dd71af41fdf9...
""" Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs # #################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} for c in str: if ord(c) < 128: ...
{ "content_hash": "72ada9de94e353a2bd7de5d010098e3c", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 75, "avg_line_length": 27.015810276679844, "alnum_prop": 0.5482077542062912, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "da2daf7edd6cb2bac9141c7453aed72ab0b18d25",...
import asynqp from asynqp import spec from asynqp import frames from asynqp import amqptypes from asynqp import message from .base_contexts import ProtocolContext, MockDispatcherContext class WhenConnectionStartArrives(MockDispatcherContext): def given_a_connection_start_method_I_copied_from_the_rabbitmq_server(s...
{ "content_hash": "cb2002ba98757982090499bf6eb7d9c1", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 138, "avg_line_length": 44.92168674698795, "alnum_prop": 0.6528094407938849, "repo_name": "benjamin-hodgson/asynqp", "id": "5c0fc23690dc3b75bff10e49c92f5abcafaad478", "siz...
def not_equal_backward(grad_inputs, inputs, input_shapes, outputs, output_shapes): """ Args: grad_inputs (list of :obj:`nnabla.Variable`): Propagated grads to this backward function. inputs (list of :obj:`nnabla.Variable` and None): Input Variables of the forward function if this backward ...
{ "content_hash": "5496dc672d71ee45780862f96d662f4b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 97, "avg_line_length": 62.5, "alnum_prop": 0.6995555555555556, "repo_name": "sony/nnabla", "id": "356773fe0e50d29ba672713b5e4c7d8cda8214e2", "size": "1759", "binary": fal...
from oslo_config import cfg from oslo_log import log as logging from oslo_versionedobjects import fields from cinder import db from cinder import exception from cinder.i18n import _ from cinder import objects from cinder.objects import base from cinder import utils CONF = cfg.CONF OPTIONAL_FIELDS = [] LOG = logging.g...
{ "content_hash": "344c16f1ee87e7da541392495dd39374", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 77, "avg_line_length": 33.77777777777778, "alnum_prop": 0.6371299342105263, "repo_name": "saeki-masaki/cinder", "id": "d32aff26af73ce9d18b4e641d71fd901e260e64b", "size": "...
""" :mod:`extn_test` --- lib.packet.spse.scmp_auth.extn unit tests ============================================================================== """ # Stdlib from unittest.mock import patch import nose import nose.tools as ntools from lib.packet.spse.defines import SPSESecModes, SPSEValidationError from lib.packet.s...
{ "content_hash": "7502f1ad286ce5fd3586322e24cdef86", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 100, "avg_line_length": 39.93877551020408, "alnum_prop": 0.6584057230454777, "repo_name": "klausman/scion", "id": "5cc3f801ff74bb70fa89c6cdae9be2dd664bf75e", "size": "4486"...
from django.conf.urls import url from .views import home, base_files, documentation urlpatterns = [ url(r'^$', home, name='home'), url(r'^ayuda/', documentation, name='ayuda'), url(r'^(?P<filename>(robots.txt)|(humans.txt))$', base_files, name='base_files') ]
{ "content_hash": "3f35909009ad36b46d72df08171c5367", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 84, "avg_line_length": 34.125, "alnum_prop": 0.6556776556776557, "repo_name": "erikiado/jp2_online", "id": "40e49617f09ed59df708698a17fd8b5afeddb6c2", "size": "273", "bina...
import warnings import pymongo import re from pymongo.read_preferences import ReadPreference from bson.dbref import DBRef from mongoengine import signals from mongoengine.common import _import_class from mongoengine.base import ( DocumentMetaclass, TopLevelDocumentMetaclass, BaseDocument, BaseDict, ...
{ "content_hash": "2575d6e9c30f2cf4d8cb82e928b76d1d", "timestamp": "", "source": "github", "line_count": 991, "max_line_length": 108, "avg_line_length": 41.761856710393545, "alnum_prop": 0.5845454984777461, "repo_name": "touilleMan/mongoengine", "id": "52353523eb903361cc4612298eb268120b74f850", "siz...
""" This module cotains definitions for functions or methods which are generally useful for translating instances. """ def filter_non_alnum(string): """ filter_non_alnum is a helper function which, given a string, returns it with all non-aplha-numric characters removed. This is required for fields ...
{ "content_hash": "3bca9bd938c7758e82206079cb778458", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 79, "avg_line_length": 36.166666666666664, "alnum_prop": 0.7119815668202765, "repo_name": "cloudbase/heat2arm", "id": "2929f33e12273b4445b723f8322805708f702116", "size": "1...
import logging import os import shutil import subprocess import tempfile import textwrap import fortranformat as ff import numpy logger = logging.getLogger(__name__) INPUT_TEMPLATE = """ DIPOLE CHARACTERISTIC PARAMETERS: IFACT(Without-1/With-2 Displacement Current Factor) Format(I5) {calc_disp_currs} IDIPOL(VMD-1,...
{ "content_hash": "f1f0e476239bd13603c46fab8753728b", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 112, "avg_line_length": 36.10096153846154, "alnum_prop": 0.6091357038220802, "repo_name": "kinverarity1/emdpler_wrapper", "id": "008f31c00faec3fee536bd9a9ceb18321fecc679", ...
import os from packaging.version import Version import pytest import matplotlib.ft2font from urllib.request import urlopen, URLError from oggm import cfg from oggm.utils import SAMPLE_DATA_COMMIT # Some logic to see which environment we are running on # Matplotlib version changes plots, too HAS_MPL_FOR_TESTS = Fals...
{ "content_hash": "f8e2304a526f467b8595c07f826002a7", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 31.875, "alnum_prop": 0.6352941176470588, "repo_name": "OGGM/oggm", "id": "c0cdc7af00981ccf4772eba84337a3346511bd07", "size": "1020", "binary": fal...
from flask import Flask from .view_classes import DefaultMethodsView, NoDefaultMethodsView from nose.tools import eq_ app = Flask('default_methods') DefaultMethodsView.register(app) NoDefaultMethodsView.register(app) def test_default_methods(): client = app.test_client() resp = client.get('/default-methods/...
{ "content_hash": "e480fba3e8f552f77a1a98a70221ce30", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 66, "avg_line_length": 27.208333333333332, "alnum_prop": 0.6921898928024502, "repo_name": "teracyhq/flask-classy", "id": "32459f28025cf6aa33e7f52d5a11c2aef9f6760b", "size":...
import contextlib import os import sys if os.name != "nt": # Linux/macOS: remove current script directory to avoid importing this file # as a module; we want to import the installed esptool module instead with contextlib.suppress(ValueError): if sys.path[0].endswith("/bin"): sys.path.po...
{ "content_hash": "29dfd0391722d73de05d60ba6f1bdea3", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 31.5, "alnum_prop": 0.683982683982684, "repo_name": "nabovarme/MeterLogger", "id": "60e5bd3397d82ea42545adae185fc579807a6080", "size": "1084", "bin...
import _plotly_utils.basevalidators class ColorsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="colorsrc", parent_name="scatterternary.hoverlabel.font", **kwargs ): super(ColorsrcValidator, self).__init__( plotly_name...
{ "content_hash": "e9cd9d5d5d3cbd64856892a0f160df68", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 67, "avg_line_length": 29.529411764705884, "alnum_prop": 0.5756972111553785, "repo_name": "plotly/python-api", "id": "a9011be7e3c1e976ac731a6a83368a8670f3a7d6", "size": "50...
""" Una app para cargar contenidos multimedia """ import mimetypes import datetime import os import logging logger = logging.getLogger(__name__) try: from Pillow import Image except ImportError: try: from PIL import Image except ImportError: import Image from django.db import models from...
{ "content_hash": "6374cd7fba5bc50f637fdfb20b420e9a", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 128, "avg_line_length": 36.252873563218394, "alnum_prop": 0.6076939336292538, "repo_name": "ninjaotoko/django-mediacontent", "id": "7ccb6af0a68ccf702e55d847240a166a4029e519"...
import cgi import datetime import urllib import urlparse from django.conf import settings from django.contrib.staticfiles.storage import staticfiles_storage from django.template import defaultfilters from django.utils.encoding import smart_str from django.utils.html import strip_tags from jingo import register import...
{ "content_hash": "c8415779110d2d72d59dc67c11e068c7", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 77, "avg_line_length": 27.91891891891892, "alnum_prop": 0.6926427879961278, "repo_name": "hfeeki/djfactory", "id": "643619c6f7bf54e5bca255185ccf7c141f85c567", "size": "2066...
""" Parser for various Hi-C data. """ import numpy as np from collections import defaultdict class HiCData(object): """HiCData Simple class for storing and filtering contact data from single-cell HiC experiments. """ def __init__(self, data): """HiCData This is a list of tuples s...
{ "content_hash": "aa215eb01e8f3b6d82e8ed98270e66a0", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 26.467153284671532, "alnum_prop": 0.5717043574186431, "repo_name": "michaelhabeck/isdhic", "id": "73be4628d408c4b5bac245f00564b452eddc47a6", "size":...
import logging import yaml import io from redash.utils.requests_session import requests_or_advocate, UnacceptableAddressException from redash.query_runner import * from redash.utils import json_dumps logger = logging.getLogger(__name__) try: import pandas as pd import numpy as np enabled = True except I...
{ "content_hash": "d7f62f3018452687c6f65246af3f9c73", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 130, "avg_line_length": 30.53, "alnum_prop": 0.5280052407468064, "repo_name": "getredash/redash", "id": "22aa148d5792080b902b359a0fc840255ebab034", "size": "3053", "bina...
""" Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys from argparse import ArgumentParser import django from django.core import checks from django.core.exceptions i...
{ "content_hash": "8c09bc962475a16aebc517c1b7d543b4", "timestamp": "", "source": "github", "line_count": 537, "max_line_length": 114, "avg_line_length": 41.245810055865924, "alnum_prop": 0.5973633121134136, "repo_name": "yephper/django", "id": "ad175d4def18d1e21cefe54511a52d2101fae776", "size": "221...
""" core implementation of testing process: init, session, runtest loop. """ import os import sys import _pytest import _pytest._code import py import pytest try: from collections import MutableMapping as MappingMixin except ImportError: from UserDict import DictMixin as MappingMixin from _pytest.runner impor...
{ "content_hash": "0bc4054e897c0af33111d175fe0d945c", "timestamp": "", "source": "github", "line_count": 736, "max_line_length": 125, "avg_line_length": 35.53532608695652, "alnum_prop": 0.5923376921312228, "repo_name": "userzimmermann/pytest", "id": "df99687ade59aba6b726f4847de7f7916a5f8e7c", "size"...
from test.test_support import verbose import select import os # test some known error conditions try: rfd, wfd, xfd = select.select(1, 2, 3) except TypeError: pass else: print 'expected TypeError exception not raised' class Nope: pass class Almost: def fileno(self): return 'fileno' try: ...
{ "content_hash": "4386a60a6aa511c596c4dc30d7723c75", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 75, "avg_line_length": 23.926470588235293, "alnum_prop": 0.5457897971727105, "repo_name": "MalloyPower/parsing-python", "id": "eaec52be194b7c20b7ce7aaaa35afc63273b6fb3", "s...
def main(): largestProduct = 0 for i in range(999,100,-1): for j in range(i,100,-1): product = i*j if str(product) == str(product)[::-1] and product > largestProduct: largestProduct = product print(largestProduct) if __name__ == "__main__": main()
{ "content_hash": "feac2e978a248e3e7054d1da5379dee6", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 79, "avg_line_length": 28.454545454545453, "alnum_prop": 0.5303514376996805, "repo_name": "clairejaja/project-euler", "id": "c7742eccab86c5c046c69a6c6dfdd9b665e535ad", "siz...
"""Starter script for Nova Conductor.""" import sys from oslo.config import cfg from nova import config from nova import objects from nova.openstack.common import log as logging from nova import service from nova import utils CONF = cfg.CONF CONF.import_opt('topic', 'nova.conductor.api', group='conductor') def ma...
{ "content_hash": "d5bcf079139be84acc89cbbfb999cd87", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 67, "avg_line_length": 25.923076923076923, "alnum_prop": 0.6602373887240356, "repo_name": "shootstar/novatest", "id": "3fc25eb8c6986a632c1f92efbc02ab84ad8a11ba", "size": "1...
from django.contrib import admin from links.models import Link # Settings for link class LinkAdmin(admin.ModelAdmin): # Fields to list list_display = ('user', 'kintera_id', 't4k_url', 'url', 'clicks', 'last_click') # Filter by list_filter = ('user', ) # Fields to order by ordering = ('user',) # Add to ...
{ "content_hash": "78e5e8d81fbbe3513def9125d0e8c43f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 24.133333333333333, "alnum_prop": 0.6795580110497238, "repo_name": "ethanperez/t4k-rms", "id": "9ee1cac8365cf58dae8d68309417fbca352ece89", "size": "3...
__author__ = 'greghines' import numpy as np import os import pymongo import sys import urllib import matplotlib.cbook as cbook from PIL import Image import matplotlib.pyplot as plt import warnings if os.path.exists("/home/ggdhines"): sys.path.append("/home/ggdhines/PycharmProjects/reduction/experimental/clustering...
{ "content_hash": "b398ab9e1aa56fd85a399604040820d7", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 204, "avg_line_length": 32.30113636363637, "alnum_prop": 0.570976253298153, "repo_name": "zooniverse/aggregation", "id": "ad16f449b4418e86ce090be6678e196865609c11", "size"...
from cudatypes import dim3, Pointer from cudaarray import BaseCudaArray, CudaArray class CudaPyError (Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value) # Handle grid and block dims, coerce CudaArrays into bare pointers def wrapper(fun, sig, funName): ...
{ "content_hash": "a6a5195dae22d6fa532286e0e6156360", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 105, "avg_line_length": 27.82608695652174, "alnum_prop": 0.6338541666666667, "repo_name": "tammyyang/CudaPy", "id": "09ca4503a68188ed598b2fdd4ee82ea15351e008", "size": "192...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Quotes', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=...
{ "content_hash": "aa98bba3a7de7f18346989f8b4f506d5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 114, "avg_line_length": 24.105263157894736, "alnum_prop": 0.5698689956331878, "repo_name": "rjelte/web-dev-demos", "id": "2ab1116801250e6dd89f2baa3d0dc2f8bc317b8b", "size":...
from .base import BaseCaptcha from .enums import ReCaptchaEnm class BaseReCaptcha(BaseCaptcha): def __init__(self, pageurl: str, googlekey: str, method: str = ReCaptchaEnm.USER_RECAPTCHA.value, *args, **kwargs): super().__init__(method=method, *args, **kwargs) self.post_payload.update({"googlekey...
{ "content_hash": "2c309fae190506c234bdc4278c87c507", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 119, "avg_line_length": 40.610169491525426, "alnum_prop": 0.6519198664440734, "repo_name": "AndreiDrang/python-rucaptcha", "id": "071a46829c33e84e7b66f94faf8f3ffe76537891", ...
""" * ******************************************************* * Copyright (c) VMware, Inc. 2016-2018. All Rights Reserved. * SPDX-License-Identifier: MIT * ******************************************************* * * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, WHET...
{ "content_hash": "938d10e445971ff65831f9f95f9ed6f6", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 91, "avg_line_length": 38.869565217391305, "alnum_prop": 0.5942793224672419, "repo_name": "pgbidkar/vsphere-automation-sdk-python", "id": "18c31cde5ea12204b7b48a6c1dbf319a82...
from typing import ( Any, AsyncIterator, Awaitable, Callable, Sequence, Tuple, Optional, Iterator, ) from google.cloud.asset_v1p1beta1.types import asset_service from google.cloud.asset_v1p1beta1.types import assets class SearchAllResourcesPager: """A pager for iterating through `...
{ "content_hash": "f4428064ba78e2931d3a626e21d3d657", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 90, "avg_line_length": 39.438661710037174, "alnum_prop": 0.6547271184843058, "repo_name": "googleapis/python-asset", "id": "a2aea41b482369d808176168b8068dae4e18b4fe", "siz...
from django.conf import settings from django.utils.translation import ugettext_lazy as _ DEFAULT_SUBMENU_PLUGIN_TEMPLATE_CHOICES = ( ('publication_backbone/plugins/sub_menu/default.html', _("Default sub menu")), ('publication_backbone/plugins/sub_menu/horizontal.html', _("As string submenu")), ) S...
{ "content_hash": "503b07a299aa68d592a35cbf2b275681", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 127, "avg_line_length": 49.55555555555556, "alnum_prop": 0.7511210762331838, "repo_name": "Excentrics/publication-backbone", "id": "b35866e95be781fede1bcc49dd98942e3b54fc44", ...
from django.shortcuts import render_to_response from django.template import RequestContext from markitup import settings from markitup.markup import filter_func def apply_filter(request): markup = filter_func(request.POST.get('data', '')) return render_to_response( 'markitup/preview.html', ...
{ "content_hash": "f10a559cc66c2494c200841f63303897", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 71, "avg_line_length": 38.54545454545455, "alnum_prop": 0.6698113207547169, "repo_name": "chrisdev/django-markitup", "id": "df89c50bee8fdd4bac925c1ed4e9a463367b3928", "size...
""" The plugin for capturing and storing the page source on errors and failures. """ import os import codecs from nose.plugins import Plugin from seleniumbase.config import settings from seleniumbase.core import log_helper class PageSource(Plugin): """ This plugin will capture the page source when a test fai...
{ "content_hash": "e57296c62a11a5f387cf5c06947bd59d", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 35.333333333333336, "alnum_prop": 0.62848158131177, "repo_name": "seleniumbase/SeleniumBase", "id": "af9e217e5a7e3e4d03a7c5410171a81751e22c2f", "size...
import logging from django.conf import settings from django.utils.importlib import import_module from django.core.management.base import BaseCommand from mapentity import registry from mapentity.registry import create_mapentity_model_permissions logger = logging.getLogger(__name__) class Command(BaseCommand): ...
{ "content_hash": "6dbcee6e3430dda002c1ebdb8e050d62", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 66, "avg_line_length": 28.185185185185187, "alnum_prop": 0.7293035479632063, "repo_name": "Anaethelion/django-mapentity", "id": "f6f076bab0832d978c8dd2e6bca3e87459d575c0", ...
"""Class representing an X.509 certificate.""" from utils.ASN1Parser import ASN1Parser from utils.cryptomath import * from utils.keyfactory import _createPublicRSAKey class X509: """This class represents an X.509 certificate. @type bytes: L{array.array} of unsigned bytes @ivar bytes: The DER-encoded ASN...
{ "content_hash": "36f8d619e92f61792f03fa39e52f3e02", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 77, "avg_line_length": 32.45390070921986, "alnum_prop": 0.607298951048951, "repo_name": "Crystalnix/house-of-life-chromium", "id": "d8b8bccb1414c62093fbfb3e20259ea711bfe2a3"...
""" A Marketplace only reindexing that indexes only apps. This avoids a lot of complexity for now. We might want an all encompassing reindex command that has args for AMO and MKT. """ import datetime import logging import os import sys import time from optparse import make_option import pyelasticsearch from celery ...
{ "content_hash": "5ef712ea608d4f3c58e609c9ad768d3e", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 79, "avg_line_length": 31.129151291512915, "alnum_prop": 0.6256519677572309, "repo_name": "Joergen/zamboni", "id": "380075ab5795f20fd444979584b96e513382d9eb", "size": "843...
""" @package mi.core.instrument.playback @file mi/core/instrument/playback.py @author Ronald Ronquillo @brief Playback process using ZMQ messaging. Usage: playback datalog <module> <refdes> <event_url> <particle_url> [--allowed=<particles>] [--max_events=<events>] <files>... playback ascii <module> <refdes> <...
{ "content_hash": "ede243f7b94a3ee04f8b33d25daffaa2", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 125, "avg_line_length": 34.876288659793815, "alnum_prop": 0.5979899497487438, "repo_name": "renegelinas/mi-instrument", "id": "041d2f912bd4f617f6239adb4e905580af112355", "...
import re from os.path import join import setuptools setuptools.setup( version=re.search("__version__ = '([^']+)'", open(join('mock', 'mock.py')).read()).group(1), long_description=open('README.rst').read(), )
{ "content_hash": "abd160b889261ad2ddd66302dd12c48f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 69, "avg_line_length": 24.2, "alnum_prop": 0.5826446280991735, "repo_name": "cloudera/hue", "id": "d47345f06da697db05c825a97c8b72edb64f73bb", "size": "242", "binary": fal...
from dashmat.core_modules.base import Module class Status(Module): @classmethod def npm_deps(self): return { "moment": "^2.11.2" }
{ "content_hash": "12338c22a89edd740ef693bd5f3fe022", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 44, "avg_line_length": 19.444444444444443, "alnum_prop": 0.5485714285714286, "repo_name": "realestate-com-au/dashmat", "id": "1f26742206c84960e92abbde34d4ed190a350ed2", "siz...
""" This example demonstrates the justify argument to print. """ from rich.console import Console console = Console(width=20) style = "bold white on blue" console.print("Rich", style=style) console.print("Rich", style=style, justify="left") console.print("Rich", style=style, justify="center") console.print("Rich", s...
{ "content_hash": "3c6677fb2e694d611566e1a774374c7e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 56, "avg_line_length": 26.846153846153847, "alnum_prop": 0.7363896848137536, "repo_name": "willmcgugan/rich", "id": "670988206de985adfc46daef2e924b48073161cd", "size": "349...
"""This file is a casapy script. Do not use it as a module. It is also not intended to be invoked directly through pkcasascript. See `pwkit.environments.casa.tasks.plotcal`. """ def in_casapy (helper, caltable=None, selectcals={}, plotoptions={}, xaxis=None, yaxis=None, figfile=None): """This func...
{ "content_hash": "d89418f99610b19c5ed21e5864ece877", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 28.606060606060606, "alnum_prop": 0.6673728813559322, "repo_name": "pkgw/pwkit", "id": "115cd592f06bc1151f9a42d9b75982d1880a1d79", "size": "1084", ...
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse fr...
{ "content_hash": "22990018329063de86141aeaea6c2ccf", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 166, "avg_line_length": 44.34634146341463, "alnum_prop": 0.6819931800681993, "repo_name": "Azure/azure-sdk-for-python", "id": "79f530ef9c237e14cf8eaecd7d732122a25a586c", "...