text
stringlengths
4
1.02M
meta
dict
from runner.koan import * class AboutIteration(Koan): def test_iterators_are_a_type(self): it = iter(range(1,6)) total = 0 for num in it: total += num self.assertEqual(15, total) def test_iterating_with_next(self): stages = iter(['alpha','beta','gamma'])...
{ "content_hash": "c95d4985146689befb77d739bec7e029", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 81, "avg_line_length": 29.029850746268657, "alnum_prop": 0.5141388174807198, "repo_name": "welenofsky/python_koans", "id": "3ea241f2376109cd3a30ccf049031595bd0cfd40", "siz...
from msrest.serialization import Model class ClientScriptForConnect(Model): """Client script details for file / folder restore. :param script_content: File content of the client script for file / folder restore. :type script_content: str :param script_extension: File extension of the client scri...
{ "content_hash": "dbed0f9ef9a83388243e69b7b70b26eb", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 116, "avg_line_length": 41.28947368421053, "alnum_prop": 0.6469088591459529, "repo_name": "lmazuel/azure-sdk-for-python", "id": "2cc3977710e354b00e0e54342f66a7bd752c2c95", ...
import logging from discord.ext import commands from discord.ext.commands import Context from cogbot import checks from cogbot.cog_bot import CogBot from cogbot.extensions.groups.error import * from cogbot.extensions.groups.group_directory import GroupDirectory log = logging.getLogger(__name__) class GroupsConfig:...
{ "content_hash": "0b7dbcc9962dde721dc79046ad297653", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 119, "avg_line_length": 38.502347417840376, "alnum_prop": 0.5944397024753079, "repo_name": "Arcensoth/cogbot", "id": "b65bcd791a9ecec1b701900c722a26b98a148c27", "size": "8...
from tensorboardX import SummaryWriter import torch import torchvision.utils as vutils import numpy as np import torchvision.models as models from torchvision import datasets import datetime try: import soundfile skip_audio = False except ImportError: skip_audio = True resnet18 = models.resnet18(False) wr...
{ "content_hash": "c3604e5a0c3269bec530a68443ee1443", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 110, "avg_line_length": 44.01980198019802, "alnum_prop": 0.5962663067926226, "repo_name": "lanpa/tensorboardX", "id": "4d6ed7a31b3a658fc773171b90c92ca4dd87f548", "size": "...
""" Module to enable color terminal output """ import os import string _ansi = {} def ansi(key): """Returns the escape sequence for a given ansi color key""" global _ansi return _ansi[key] def enable_ANSI_colors(): """ Populates the global module dictionary `ansi` with ANSI escape sequences. ...
{ "content_hash": "cfdedeb0972f865d9b3b4f845d22bb1b", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 84, "avg_line_length": 28.25581395348837, "alnum_prop": 0.5584362139917696, "repo_name": "rhaschke/catkin_tools", "id": "5b202f567cd486f4999af3b8345af4459121945f", "size":...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Vimeo.playlist' db.alter_column('cmsplugin_vimeo', 'playlist', self.gf('django.db.models.fields.CharField')(max_l...
{ "content_hash": "f88343830fb82a6745f481433b68cd8d", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 156, "avg_line_length": 78.18446601941747, "alnum_prop": 0.56885632683472, "repo_name": "sternoru/goscalecms", "id": "5fe4910132fcdbd9fbcc26dd9711ec64bdbec112", "size": "8...
try: import urllib2 as request except: from urllib import request import json from .choices import FUEL_TYPES TOKEN = '6M5jaVAzPS' def get(fuel_type, commune=None, dist=None): result = {} url = 'http://api.cne.cl/api/listaInformacion/%s' % TOKEN response = request.urlopen(url) encoding = re...
{ "content_hash": "a6b49c099597d991ff8747d371657045", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 70, "avg_line_length": 24.261904761904763, "alnum_prop": 0.5799803729146222, "repo_name": "lgaticaq/python-cne", "id": "783f4200a58dbbe916672b5605e7a88271b3caf7", "size": "...
from DAO.Connection import conn from Model.TelefoneModel import Telefone def list(): query = "SELECT * FROM telefone" conn.cursor.execute(query) if not conn.cursor.rowcount: print "Nenhum dado encontrado" return telefones = [] columns = [i[0] for i in conn.cursor.description] ...
{ "content_hash": "34d86824b64be3ff1cdb655b6a3bf548", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 111, "avg_line_length": 24.729508196721312, "alnum_prop": 0.6446801458402387, "repo_name": "rennancockles/gigapy", "id": "9bc11f58127f109ed2615b806e51da7371771ca3", "size"...
""" Data classes and parser implementations for "chart parsers", which use dynamic programming to efficiently parse a text. A chart parser derives parse trees for a text by iteratively adding "edges" to a "chart." Each edge represents a hypothesis about the tree structure for a subsequence of the text. The chart is ...
{ "content_hash": "a4dd810595d4c938110cc5f43aadb6a2", "timestamp": "", "source": "github", "line_count": 1731, "max_line_length": 90, "avg_line_length": 36.89023685730791, "alnum_prop": 0.5542853563430791, "repo_name": "syllog1sm/TextBlob", "id": "5fa2166f4f3a06788bde481d9a3ad6640fc16d06", "size": "...
'''Base module for calling SoX ''' import subprocess from pathlib import Path from subprocess import CalledProcessError from typing import Union, List, Optional, Tuple, Iterable, Any import numpy as np from typing_extensions import Literal from . import NO_SOX from .log import logger SOXI_ARGS = ['B', 'b', 'c', 'a'...
{ "content_hash": "984097437ba881716056fa479f1bb7ad", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 81, "avg_line_length": 26.844106463878326, "alnum_prop": 0.5814447592067988, "repo_name": "rabitt/pysox", "id": "6860cb43de8c66639615f98626039b8395f20307", "size": "7060",...
""" Module to handle iterating over geodataframe points. """ ## MIT License ## ## Copyright (c) 2017, krishna bhogaonker ## Permission is hereby granted, free of charge, to any person obtaining a ## copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction...
{ "content_hash": "548e03789f93cafdfb89136dd0e4d5c6", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 463, "avg_line_length": 30.041666666666668, "alnum_prop": 0.7059639389736477, "repo_name": "krishnab-datakind/mining-data-acquisition", "id": "afa7e6152e57bb92a54596d24e326f7...
""" Internal validation functions. :copyright: (c) 2015 by Mark Richards. :license: BSD 3-Clause, see LICENSE.txt for more details. """ from pyeto.convert import deg2rad # Internal constants # Latitude _MINLAT_RADIANS = deg2rad(-90.0) _MAXLAT_RADIANS = deg2rad(90.0) # Solar declination _MINSOLDEC_RADIANS = deg2rad(-...
{ "content_hash": "1159f74af6b7a12c5152f8abc3bde11e", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 78, "avg_line_length": 27.608695652173914, "alnum_prop": 0.6230971128608924, "repo_name": "woodcrafty/PyETo", "id": "1c39feaeae94c0bc499563a7804647f96374a2a2", "size": "190...
"""Anchor box and labeler definition.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import tensorflow.compat.v2 as tf from official.vision.detection.utils.object_detection import argmax_matcher from official.vision.detection.utils.ob...
{ "content_hash": "327f33f46ea74ec4fd6bc54f76a77ba8", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 95, "avg_line_length": 43.46762589928058, "alnum_prop": 0.6623634558093346, "repo_name": "alexgorban/models", "id": "bb7fca8ba83043beba0b27d49201435dd500400b", "size": "12...
"""This module contains an interface for using the GPy library in ELFI.""" # TODO: make own general GPRegression and kernel classes import copy import logging import GPy import numpy as np logger = logging.getLogger(__name__) logging.getLogger("GP").setLevel(logging.WARNING) # GPy library logger class GPyRegress...
{ "content_hash": "4097be99db94cecf4c9f6dcdc11c1287", "timestamp": "", "source": "github", "line_count": 367, "max_line_length": 98, "avg_line_length": 34.3433242506812, "alnum_prop": 0.5489527134243097, "repo_name": "HIIT/elfi", "id": "8999a45f0302097bfa6c479022a44c6ad9fa0314", "size": "12604", "...
from jsb.lib.commands import cmnds from jsb.lib.examples import examples from jsb.lib.persist import PlugPersist gadgeturls = PlugPersist('gadgeturls') gadgeturls.data['gadget'] = 'https://jsonbot.appspot.com/gadget.xml' gadgeturls.data['poll'] = 'https://jsonbot.appspot.com/poll.xml' gadgeturls.data['iframe'] = 'htt...
{ "content_hash": "fb1eb2445b7c9fe2a0ada44e3c4fd01b", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 111, "avg_line_length": 30.513333333333332, "alnum_prop": 0.6443084990168233, "repo_name": "melmothx/jsonbot", "id": "baab32a610ebf34f524cd63d97cce72902e76c86", "size": "4...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'network'} DOCUMENTATION = ''' --- module: nxos_portchannel extends_documentation_fragment: nxos version_added: "2.2" deprecated: removed_in: "2.9" why: Replaced with common C(*_linkagg)...
{ "content_hash": "c01ca792be12f78780cb8200ea8e2c53", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 98, "avg_line_length": 31.67099567099567, "alnum_prop": 0.6173455440131219, "repo_name": "SergeyCherepanov/ansible", "id": "838dbd65f7a58b34f447cb9e27d9c646d3fe80cb", "siz...
from setuptools import setup, Command import os, sys, re class RunTestsCommand(Command): description = "Test command to run testr in virtualenv" user_options = [ ('coverage', 'c', "Generate code coverage report"), ] boolean_options = ['coverage'] def initialize_options(self): ...
{ "content_hash": "f20c7048da1fd99dde1848e6710ab239", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 61, "avg_line_length": 25.48780487804878, "alnum_prop": 0.5320574162679426, "repo_name": "DreamLab/contrail-controller", "id": "a0a5b9380a153682b9234580cc952e9fbe96d3b1", "...
""" Description: Convert mmpi.c output.dat into matlab matrix file for plotting Author: Philip Maechling Date: 20 March 2008 """ import os import sys from core import core from matrix import Matrix # # The processor names are reported differently by each site # Here, we define a subroutine for each site so t...
{ "content_hash": "6b9b54a1b29081b478c3c457a48350ed", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 75, "avg_line_length": 23.114583333333332, "alnum_prop": 0.5856241550247859, "repo_name": "pjmaechling/mmpi", "id": "f488d36d93bf7b4c3433935b135a20cca2edba34", "size": "44...
""" Abstraction for an SSH2 channel. """ import binascii import os import socket import time import threading from functools import wraps from paramiko import util from paramiko.common import cMSG_CHANNEL_REQUEST, cMSG_CHANNEL_WINDOW_ADJUST, \ cMSG_CHANNEL_DATA, cMSG_CHANNEL_EXTENDED_DATA, DEBUG, ERROR, \ cMS...
{ "content_hash": "a4edbb4868810efdfdef2653ff01157b", "timestamp": "", "source": "github", "line_count": 1218, "max_line_length": 96, "avg_line_length": 36.185550082101805, "alnum_prop": 0.583881653582611, "repo_name": "drpaneas/linuxed.gr", "id": "9de278cb37489481cff6a8e3c6c2f903fcbf6822", "size": ...
""" This module implements the base LaTeX object. .. :copyright: (c) 2014 by Jelte Fennema. :license: MIT, see License for more details. """ from ordered_set import OrderedSet from pylatex.utils import dumps_list from abc import abstractmethod, ABCMeta class LatexObject(metaclass=ABCMeta): """The class th...
{ "content_hash": "202c135a012679460bba1daecceab1e0", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 77, "avg_line_length": 25.679012345679013, "alnum_prop": 0.6307692307692307, "repo_name": "sebastianhaas/PyLaTeX", "id": "2bda989981dbd439a20aae160ff9d096dac969a7", "size":...
import django.views.generic # Preferrably use yo django:route to create new views and corresponding urls class OtherAccount(django.views.generic.View): def get(self, request, *args, **kwargs): pass def post(self, request, *args, **kwargs): pass
{ "content_hash": "26bc4f1835e92349bd62b50679a23d38", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 76, "avg_line_length": 24.818181818181817, "alnum_prop": 0.6923076923076923, "repo_name": "matiboy/generator-django", "id": "5e0442830b2bd3162d1c0f310f41a2c0bd86f390", "siz...
""" polySymmetry Support script for polySymmetry plugin. """ from maya import cmds def polySymmetryTool(*args): cmds.setToolTo(cmds.polySymmetryCtx())
{ "content_hash": "c832b967264407cdb4f460004a09bf71", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 42, "avg_line_length": 15.9, "alnum_prop": 0.7484276729559748, "repo_name": "yantor3d/polySymmetry", "id": "4b2e76314c5c78d8c270ef4fa5a706d545e7e7b5", "size": "159", "bin...
from django_db_sanitizer.exceptions import SanitizerValidationException from django_db_sanitizer.sanitizers.password import PasswordSanitizer from test_app.models import Profile, User from test_app.tests.utils import SanitizerTestCase class PasswordSanitizerTest(SanitizerTestCase): fixtures = ("profiles",) ...
{ "content_hash": "8c02ceb34bffa0287830ee644e5caaa3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 34.22857142857143, "alnum_prop": 0.7028380634390651, "repo_name": "resulto-admin/django-db-sanitizer", "id": "dc0b737683efea5b600e2caf851160784f7fbd9e"...
import re import sqlalchemy from keystone.identity.backends import sql as identity_sql def export_db(db): table_names = db.table_names() migration_data = {} for table_name in table_names: query = db.execute("select * from %s" % table_name) table_data = [] for row in query.fetcha...
{ "content_hash": "5242e5fa71c6ad10ff1070c0a013dac4", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 78, "avg_line_length": 33.92805755395683, "alnum_prop": 0.48982188295165396, "repo_name": "sileht/deb-openstack-keystone", "id": "ca19ccb6316c372df56a62b2bc6012d1e8aa4e88", ...
import re from sqlalchemy.sql import text from sqlalchemy.orm import load_only from sqlalchemy.dialects.postgresql import UUID from .. import app, db STRIP_ID = re.compile("_id$") def to_dict(object, fields): """Generate dictionary with specified fields.""" output = {} fields = set(["id"] + (fields if ...
{ "content_hash": "8a78acfc6b96264fc999c8fc4346627d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 28.813333333333333, "alnum_prop": 0.5886163813049514, "repo_name": "eResearchSA/reporting-unified", "id": "f6a63b557ed4b7d8a912440d1c72c7874407f406", ...
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..compat import compat_str from ..utils import int_or_none class TEDIE(InfoExtractor): IE_NAME = 'ted' _VALID_URL = r'''(?x) (?P<proto>https?://) (?P<type>www|embed(?:-ssl)?)(?P<urlmain>\.te...
{ "content_hash": "d01c02719a872c862aa6115580ead1c2", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 118, "avg_line_length": 38.08695652173913, "alnum_prop": 0.48199859501229364, "repo_name": "bosstb/HaberPush", "id": "1b1afab32c349be119f3db8c19c6ed68e5c5ccce", "size": "1...
#!/usr/bin/python ''' ''' import os import sys from configuration import * import optparse import xlsxwriter import xml.etree.ElementTree as ET import glob import datetime as dt #import ntpath import shutil from os.path import basename try : import xlsxwriter except : print('Install xlsxwriter by sudo easy...
{ "content_hash": "7ef6b3d897f6e666f3fd4ae8cbd803ec", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 201, "avg_line_length": 41.733178654292345, "alnum_prop": 0.6473564240840607, "repo_name": "rzr/iotivity", "id": "ca90df516a441a653348d006e110c3753d5c0b4c", "size": "18730...
def get_value(): """current core temperature is %d degrees celsius""" try: f = open("/sys/class/thermal/thermal_zone0/temp") val = int(f.read().strip()) f.close() return val/1000 except: return -1
{ "content_hash": "df8dfdc9f5d2ffe6bf9aa89027363a71", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 57, "avg_line_length": 27.666666666666668, "alnum_prop": 0.5502008032128514, "repo_name": "tjcsl/queri-agent", "id": "aafeb25b1e5ee6f683b6044c33c74c25928df7a6", "size": "249...
""" Contains transport interface (classes). """ class TransportError(Exception): def __init__(self, reason, httpcode, fp=None): Exception.__init__(self, reason) self.httpcode = httpcode self.fp = fp class Request: """ A transport request @ivar url: The url for the request. ...
{ "content_hash": "b06057be4b26b67b2c4a6709a3f42406", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 73, "avg_line_length": 26.47826086956522, "alnum_prop": 0.5589490968801314, "repo_name": "ronreiter/interactive-tutorials", "id": "f3d05aafae1018247422d0f4e424a7c83bae54af",...
import os, sys, errno import unittest from test import test_support threading = test_support.import_module("threading") from platform import machine # Do this first so test will be skipped if module doesn't exist test_support.import_module('_winreg') # Now import everything from _winreg import * try: REMOTE_NAME ...
{ "content_hash": "33e4552e814664ad671aa289d6595aee", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 85, "avg_line_length": 42.89737470167064, "alnum_prop": 0.5825080672081896, "repo_name": "ArneBab/pypyjs", "id": "bdf4e14b76584630b38febe5ff7b536243271ca2", "size": "18090...
import mmap import string, os, re, sys PAGESIZE = mmap.PAGESIZE def test_both(): "Test mmap module on Unix systems and Windows" # Create an mmap'ed file f = open('foo', 'w+') # Write 2 pages worth of data to the file f.write('\0'* PAGESIZE) f.write('foo') f.write('\0'* (PAGESIZE-...
{ "content_hash": "bf8fdbdf831148f1bd981dff1e7da95a", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 80, "avg_line_length": 27.525, "alnum_prop": 0.5613079019073569, "repo_name": "MalloyPower/parsing-python", "id": "449c674119d0fde9ff5c5a9ebdbf1b7de67bdc3a", "size": "3304...
""" This file is part of the everest project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Jul 14, 2011. """ from everest.entities.utils import slug_from_string from everest.testing import Pep8CompliantTestCase __docformat__ = 'reStructuredText en' __all__ = ['SlugTestCase'...
{ "content_hash": "5bc7482235f1973a577d711bb6a374fe", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 28.80952380952381, "alnum_prop": 0.7041322314049587, "repo_name": "helixyte/everest", "id": "8c6db8d345dbafa06b5f731780b4a02e311041fe", "size": "605"...
import json import logging import os import subprocess import time import common import ffx_session import remote_cmd from log_manager import LogManager from symbolizer import BuildIdsPaths, RunSymbolizer _SHUTDOWN_CMD = ['dm', 'poweroff'] _ATTACH_RETRY_INTERVAL = 1 # Amount of time to wait for a complete package ...
{ "content_hash": "138648bfbcae0b13543b0376a9f0d671", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 80, "avg_line_length": 38.666666666666664, "alnum_prop": 0.6334561726770203, "repo_name": "nwjs/chromium.src", "id": "18fa2c21cbf21fe3b68035dafd38052006267723", "size": "1...
""" Send random notes to the output port. """ from __future__ import print_function import sys import time import random import mido from mido import Message if len(sys.argv) > 1: portname = sys.argv[1] else: portname = 'Base2 MIDI 1' # Use default port # A pentatonic scale notes = [36,37,38,39,40,41,42,43...
{ "content_hash": "44d0fbe8c20c103a40949e09fbe06615", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 84, "avg_line_length": 22.487179487179485, "alnum_prop": 0.5917901938426454, "repo_name": "nyboer/chordspeak", "id": "d76583942e060f2659770256c81ded9847c6a2c5", "size": "90...
import mock from cloudferrylib.utils import mysql_connector from tests import test class GetDbTestCase(test.TestCase): def test_returns_mysqldump_host_if_set(self): config = mock.MagicMock() config.mysql.db_host = "db_vip" expected = "mysql_node" config.migrate.mysqldump_host = ex...
{ "content_hash": "f974703dd97314da36836a71cde083c4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 71, "avg_line_length": 31.227272727272727, "alnum_prop": 0.6812227074235808, "repo_name": "japaniel/CloudFerry", "id": "280b8864f799c7a8fb1bdad396f8ae997bb4364b", "size": "...
from OpenGL.GL import * from .. GLGraphicsItem import GLGraphicsItem from .. MeshData import MeshData from ...Qt import QtGui from .. import shaders from ... import functions as fn import numpy as np __all__ = ['GLMeshItem'] class GLMeshItem(GLGraphicsItem): """ **Bases:** :class:`GLGraphicsItem <pyqtgraph....
{ "content_hash": "41ff6bfd2b169124616f1a9bd552e20c", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 107, "avg_line_length": 37.775784753363226, "alnum_prop": 0.4896723646723647, "repo_name": "hiuwo/acq4", "id": "14d178f883339e48fb43d01c3f8a0f9705a57fe0", "size": "8424", ...
"""Elliptical geometrical entities. Contains * Ellipse * Circle """ from sympy.core import S, C, sympify, pi, Dummy from sympy.core.logic import fuzzy_bool from sympy.simplify import simplify, trigsimp from sympy.functions.elementary.miscellaneous import sqrt, Max, Min from sympy.functions.elementary.complexes impor...
{ "content_hash": "e491dff0aee151cd954c99502e2e3278", "timestamp": "", "source": "github", "line_count": 1321, "max_line_length": 111, "avg_line_length": 26.172596517789554, "alnum_prop": 0.497049806212761, "repo_name": "flacjacket/sympy", "id": "a63a825100f1d53ec7bb8ce22694eb5c42caf8cf", "size": "3...
from oslotest import base from oslo_db.tests import fixtures class BaseTestCase(base.BaseTestCase): """Test case base class for all oslo.db unit tests.""" def setUp(self): """Run before each test method to initialize test environment.""" super().setUp() self.warning_fixture = self.u...
{ "content_hash": "cc5a80d7659802f1b1b883d04229332f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 27.53846153846154, "alnum_prop": 0.6955307262569832, "repo_name": "openstack/oslo.db", "id": "a74ef827deb85b41d83b57a91515b1fcd180b6ff", "size": "903...
"""Various generic utility classes and functions. Provided utilities are generally stable, but absolute backwards compatibility between major versions is not guaranteed. """ from .argumentparser import ArgumentParser from .application import Application from .compress import compress_text from .connectioncache import...
{ "content_hash": "a86559ee91f0432af3237297de7fcab2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 82, "avg_line_length": 46.12820512820513, "alnum_prop": 0.7443023902167871, "repo_name": "robotframework/mabot", "id": "1226cb10072c9005f8acabf54d7137ef8d453850", "size": "...
import pytest from tests.setup_transaction_tests import chain as s, tester as t, ethereum_utils as u, check_gas, \ get_contract_with_gas_estimation, get_contract def test_comment_test(): comment_test = """ def foo() -> num: # Returns 3 return 3 """ c = get_contract_with_gas_estimation(commen...
{ "content_hash": "52aa0a5729f50adc642dc4d692114fea", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 100, "avg_line_length": 24.0625, "alnum_prop": 0.6597402597402597, "repo_name": "NedYork/viper", "id": "2b6018b579d7cc731d83d1bf28a8b7ded3158517", "size": "385", "binary"...
"""Support for INSTEON fans via PowerLinc Modem.""" from pyinsteon.constants import FanSpeed from homeassistant.components.fan import ( DOMAIN as FAN_DOMAIN, SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_SET_SPEED, FanEntity, ) from homeassistant.helpers.dispatcher import async_di...
{ "content_hash": "90f80a9ad77f4615c8e8b4f1c0b50443", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 82, "avg_line_length": 30.98780487804878, "alnum_prop": 0.6430539157811885, "repo_name": "soldag/home-assistant", "id": "fb741d7a4b00ab579d62212c4af44cb994e2bb3f", "size": ...
from __future__ import absolute_import, unicode_literals import json import unittest from bs4 import BeautifulSoup from wagtaildraftail.widgets import DraftailTextArea class DraftailTextAreaWidgetTestCase(unittest.TestCase): def test_rendering(self): widget = DraftailTextArea() html = widget.r...
{ "content_hash": "441c52024ec36683662341ee53aeeb3f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 103, "avg_line_length": 30.514285714285716, "alnum_prop": 0.6086142322097379, "repo_name": "gasman/wagtaildraftail", "id": "909949e6b23f1821fe42c349090ab8d0bebd053c", "size...
import sys, os import unittest sys.path.insert(0, '..') from pycparser import parse_file, c_ast # Portable cpp path for Windows and Linux/Unix CPPPATH = 'utils/cpp.exe' if sys.platform == 'win32' else 'cpp' # Test successful parsing # class TestParsing(unittest.TestCase): def _find_file(self, name): """...
{ "content_hash": "0f913086876f4e337fbd695ea93abfca", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 28.3, "alnum_prop": 0.5886925795053004, "repo_name": "pombredanne/pycparser-1", "id": "4b620020c58c5e8615b606582af8094a24380b10", "size": "1415", "...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.TaskIndexView.as_view(), name='index'), url(r'^add/$', views.TaskAddView.as_view(), name='add'), url(r'^view/(?P<pk>[0-9]+)/$', views.TaskDetailView.as_view(), name='view'), url(r'^edit/(?P<pk>[0-9]+)/$', views.TaskEditView.as_v...
{ "content_hash": "5ad03f37d55f8ab9a3353600b5c9b5d3", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 81, "avg_line_length": 41.416666666666664, "alnum_prop": 0.6237424547283702, "repo_name": "hgpestana/chronos", "id": "37c6bbfc7e9f1f9d001337558b4ed19ef35ef130", "size": "49...
""" Filesystem utilities """ import contextlib import os import re import shutil from subprocess import check_call, CalledProcessError, Popen, PIPE RUN_RE = '\d{6}_[a-zA-Z\d\-]+_\d{4}_[AB0][A-Z\d]' PROJECT_RE = '[a-zA-Z]+\.[a-zA-Z]+_\d{2}_\d{2}' @contextlib.contextmanager def chdir(new_dir): """Context manager to...
{ "content_hash": "74d18036a2b35a61cf192710d1a0dc82", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 138, "avg_line_length": 31.646464646464647, "alnum_prop": 0.6096393233322694, "repo_name": "b97pla/TACA", "id": "7367bd9e35ee4b790c49cd6f26327c34f829514c", "size": "3133", ...
import sys sys.path.append("/home/adamvest/lib/python") import time import options, data, helpers, models from numpy import ceil from torch import cuda from torch.utils.data import DataLoader from torch.autograd import Variable from torchvision import transforms args = options.SRGANTrainOptions().parse() transform ...
{ "content_hash": "507ee52d76fbe50cb5fddbb6cbdaa1d2", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 105, "avg_line_length": 29.4375, "alnum_prop": 0.6725053078556263, "repo_name": "adamvest/SRGAN", "id": "8c9ee746f32c8232865214003296b0c78fdf614b", "size": "1912", "binar...
import tacker.vnfm.lcm_user_data.utils as UserDataUtil from tacker.vnfm.lcm_user_data.abstract_user_data import AbstractUserData class SampleUserData(AbstractUserData): @staticmethod def instantiate(base_hot_dict=None, vnfd_dict=None, inst_req_info=None, ...
{ "content_hash": "dea3f75da1f600a56910f6ad363a5573", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 35.57692307692308, "alnum_prop": 0.6583783783783784, "repo_name": "stackforge/tacker", "id": "360230953bd34a66e899be5a11df696513f22c73", "size": "146...
try: from setuptools import setup setup except ImportError: from distutils.core import setup setup setup(name='uvwxyz', version='1.1.1', description='Calculate XYZ and UVW coordinates', url='https://github.com/dr-rodriguez/uvwxyz.git', author='David Rodriguez', author_emai...
{ "content_hash": "b4c14a91b87aa0faa7c48eea2d2120e1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 55, "avg_line_length": 29.041666666666668, "alnum_prop": 0.6054519368723099, "repo_name": "dr-rodriguez/uvwxyz", "id": "8057a6fca5d3be60495c8965e6d5541d4d9e5840", "size": "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('typeclasses', '0004_auto_20151101_1759'), ('comms', '0006_channeldb_db_object_subscriptions'), ] operations = [ migrations.AddField( ...
{ "content_hash": "9ba1d28fce54259b9a02929ce8262bc2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 180, "avg_line_length": 29.94736842105263, "alnum_prop": 0.6379613356766256, "repo_name": "whitehorse-io/encarnia", "id": "899d6f946a89922cbb78390815101a8c917cb5d6", "size"...
from __future__ import print_function from .Trigger import *
{ "content_hash": "acb29e6ebc0e7590a062dea3a20e3f4d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 37, "avg_line_length": 30.5, "alnum_prop": 0.7540983606557377, "repo_name": "pbmanis/acq4", "id": "9ec5565a38788db7893818602bc011f5bd8a3fd2", "size": "61", "binary": false...
def setup_stream_listener(self): """ Setup Twitter API streaming listener """ listener = Listener() listener.set_callback(self.mq.producer.publish) self.stream = tweepy.Stream( self.config.get('twitter', 'userid'), self.config.get('twitter', 'password'), listener, ...
{ "content_hash": "35313ced1aba03ab6aff350820f09ff8", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 28.25, "alnum_prop": 0.616519174041298, "repo_name": "totalgood/pug-data", "id": "fa1216719c75f5415123e0a2ce26b765fc6dfb4a", "size": "339", "binary...
import sys import os import shutil import unittest from unittest import mock from unittest.mock import patch import mvtools_test_fixture import create_and_write_file import path_utils import copy_plugin class CopyPluginTest(unittest.TestCase): def setUp(self): v, r = self.delegate_setUp() if not...
{ "content_hash": "50b241dd7c7204dc29d8059799de6399", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 113, "avg_line_length": 34.36645962732919, "alnum_prop": 0.6287728176396169, "repo_name": "mvendra/mvtools", "id": "f0a1d4e9bdde669f0530c0cd84cac713953bbe39", "size": "555...
""" EventWall Development Server Script """ from os import environ from eventwall import app if __name__ == '__main__': HOST = environ.get('SERVER_HOST', 'localhost') try: PORT = int(environ.get('SERVER_PORT', '5555')) except ValueError: PORT = 5555 app.run(HOST, PORT)
{ "content_hash": "467bb6c0f522f8af942851755076ddf1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 54, "avg_line_length": 20.266666666666666, "alnum_prop": 0.618421052631579, "repo_name": "stevenmirabito/eventwall", "id": "fd4301501d44f769f5e956993a5a195a7cfce6ef", "size...
""" Copyright 2016 Udey Rishi Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
{ "content_hash": "78ac48324b6807b2eab0c0108635d736", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 91, "avg_line_length": 37.666666666666664, "alnum_prop": 0.7327433628318584, "repo_name": "udeyrishi/bo", "id": "70a6426c30febcb21f7101d849777b75cfc5e739", "size": "1130", ...
import json from six.moves.urllib import parse from neutron.tests.tempest.common import service_client class RegionClientJSON(service_client.ServiceClient): api_version = "v3" def create_region(self, description, **kwargs): """Create region.""" req_body = { 'description': descri...
{ "content_hash": "df59a2a5961d80ad31047191043cb0c0", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 74, "avg_line_length": 36.93650793650794, "alnum_prop": 0.594327460249248, "repo_name": "mandeepdhami/neutron", "id": "d2fa53b7561417d4997e415984ba44641cb95f6e", "size": "2...
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.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "804c450dd5a58ae3226420691041ea21", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 80, "avg_line_length": 32.50738916256157, "alnum_prop": 0.7061676011516896, "repo_name": "ceymard/validictory", "id": "f429c8e0c70a937030dd0d14b99b8a418de5e1f8", "size": "...
default_app_config = 'bot.apps.BotConfig'
{ "content_hash": "c96a7fedcccfa66a9c448a008cb67845", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 41, "avg_line_length": 41, "alnum_prop": 0.7804878048780488, "repo_name": "ItsCalebJones/SpaceLaunchNow-Server", "id": "1bee4bbcff3b2f1ef4c66b9d2371a07b70a10930", "size": "4...
from oslo_log import log from oslo_serialization import jsonutils import six from sqlalchemy import orm from keystone.common import sql from keystone import exception from keystone.federation.backends import base from keystone.i18n import _ LOG = log.getLogger(__name__) class FederationProtocolModel(sql.ModelBase,...
{ "content_hash": "e24d897c50c9fe10035b22f5b39f8998", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 78, "avg_line_length": 38.29023746701847, "alnum_prop": 0.6022601984564498, "repo_name": "cernops/keystone", "id": "7e31714c306cb9c9fb47f9dcd06919e702dc043d", "size": "150...
from __future__ import absolute_import, unicode_literals import unittest import gransk.core.pipeline as pipeline class PipelineTest(unittest.TestCase): def test_build_pipeline(self): config = { 'subscribers': ['gransk.core.detect_type'] } pipe = pipeline.build_pipeline(config) self.asse...
{ "content_hash": "5360216687915b90cbcc56031741e6fc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 56, "avg_line_length": 18.217391304347824, "alnum_prop": 0.6754176610978521, "repo_name": "pcbje/gransk", "id": "c36c57bfcc6a4978a32a837fa28854544f004670", "size": "462", ...
""" Dynamically generate the NRT module """ from numba.core.config import MACHINE_BITS from numba.core import types, cgutils from llvmlite import ir, binding # Flag to enable debug print in NRT_incref and NRT_decref _debug_print = False _word_type = ir.IntType(MACHINE_BITS) _pointer_type = ir.PointerType(ir.IntType...
{ "content_hash": "15884fdffb4d08d7098a3e71a11d2548", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 81, "avg_line_length": 35.244131455399064, "alnum_prop": 0.6384707606234181, "repo_name": "gmarkall/numba", "id": "0d12d475d3b8ee43a3f6f464dd4d84f86348a3ea", "size": "7507...
"""An Enigma machine simulator with rich textual display functionality for Python 2.7. Currently support is only provided for those `machine models`_ in most widespread general use during the war years: the `I`_, `M3`_, and `M4`_. No attempt is made here to describe the operation of an Enigma machine. For information...
{ "content_hash": "74da2938e883d977e0895bf472d1c44c", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 107, "avg_line_length": 36.467948717948715, "alnum_prop": 0.6934434874318861, "repo_name": "orome/crypto-enigma-py", "id": "57ca0457d092963071fc89086eda0d4e084f4cc9", "siz...
"""one spout two bolts integration test topology""" __all__ = ['one_spout_two_bolts'] from .one_spout_two_bolts import one_spout_two_bolts_builder
{ "content_hash": "64d0d5a15ac3b48ca3bf01556bb27643", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 60, "avg_line_length": 37, "alnum_prop": 0.722972972972973, "repo_name": "zhangzhonglai/heron", "id": "ff2d233c9d2cef831cdce2418b20658b89ef530b", "size": "148", "binary": ...
import sys from awscli.customizations.commands import BasicCommand from awscli.customizations.codedeploy.utils import \ validate_region, validate_instance_name, INSTANCE_NAME_ARG from awscli.errorhandler import ClientError, ServerError class Deregister(BasicCommand): NAME = 'deregister' DESCRIPTION = ( ...
{ "content_hash": "9d63dc01683a999396e643093155ebd6", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 79, "avg_line_length": 36.9671052631579, "alnum_prop": 0.5549030076526072, "repo_name": "LockScreen/Backend", "id": "15790cb045e607434ecea0eb9c1e88d4bd77df08", "size": "61...
__about__ = """ In addition to what is provided by the "zero" project, this project provides thorough integration with django-user-accounts, adding comprehensive account management functionality. It is a foundation suitable for most sites that have user accounts. """ default_app_config = "esp_2015.proposals.apps.AppCo...
{ "content_hash": "0db03f19f5659ed268799cbebb7098ef", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 40.75, "alnum_prop": 0.7852760736196319, "repo_name": "euroscipy/esp_2015", "id": "0e83b58819be635e9eb8fa70acd44267c088d79f", "size": "351", "binary...
from django.conf.urls import url, include from django.contrib import admin from rest_framework.routers import DefaultRouter from syard_api import views router = DefaultRouter() router.register('users', views.UserViewSet) router.register('games', views.GameViewSet) urlpatterns = [ url(r'^admin/', admin.site.urls),...
{ "content_hash": "e2f249e4a38b04c87887d8cda93683d9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 83, "avg_line_length": 32.25, "alnum_prop": 0.7131782945736435, "repo_name": "BoardFellows/ScotlandYard", "id": "0a579c14207e3c15e16503c4b53e26965d68f97c", "size": "516", ...
import sys from axiom import store from twisted.python import filepath def main(storePath, itemID): assert 'axiom.test.itemtest' not in sys.modules, "Test is invalid." st = store.Store(filepath.FilePath(storePath)) item = st.getItemByID(itemID) print item.plain if __name__ == '__main__': main(s...
{ "content_hash": "497b6c8cf1b60eaf4c5695376e00ab5f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 71, "avg_line_length": 24.466666666666665, "alnum_prop": 0.6948228882833788, "repo_name": "hawkowl/axiom", "id": "da763b057f4763aa7857b6b0fdc60c21a30fd213", "size": "367", ...
import datetime from neutron_lib.db import api as db_api from oslo_config import cfg from oslo_utils import timeutils from oslo_utils import uuidutils from neutron.db.models import ovn as ovn_models CONF = cfg.CONF # NOTE(ralonsoh): this was migrated from networking-ovn to neutron and should # be r...
{ "content_hash": "ab86d53e2f2280f1c14522943c21abb4", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 34.425925925925924, "alnum_prop": 0.692845615922539, "repo_name": "openstack/neutron", "id": "1cea2f6bef26f59a28b7621c9c45c3d0b117156c", "size": "248...
""" Cisco_IOS_XR_ipv4_arp_oper This module contains a collection of YANG definitions for Cisco IOS\-XR ipv4\-arp package operational data. This module contains definitions for the following management objects\: arp\-gmp\: ARP\-GMP global operational data arp\: arp Copyright (c) 2013\-2016 by Cisco Systems, Inc....
{ "content_hash": "0b09722e9cd68b4fd6083e62a84f698e", "timestamp": "", "source": "github", "line_count": 3185, "max_line_length": 301, "avg_line_length": 34.37080062794349, "alnum_prop": 0.41911556485279206, "repo_name": "111pontes/ydk-py", "id": "b52e8792dcf50342ab90877c4d87ce4d73464696", "size": "...
import ddt import mock from rally.common import utils from rally import consts from rally.plugins.openstack.wrappers import network from tests.unit import test from neutronclient.common import exceptions as neutron_exceptions SVC = "rally.plugins.openstack.wrappers.network." class Owner(utils.RandomNameGeneratorMi...
{ "content_hash": "910d2fc002d8202b745fff8744bcf2a8", "timestamp": "", "source": "github", "line_count": 481, "max_line_length": 79, "avg_line_length": 47.80873180873181, "alnum_prop": 0.5604452948338842, "repo_name": "yeming233/rally", "id": "44cf8afb263a936f34a9c181a7f37c02aa65928e", "size": "2362...
from wtforms import Form, StringField, validators, SelectField from .validators import FREQ_PLAN, freq_plan_validate, eui_validator, appkey_validator from utils.errors import KeyDuplicateError, PatchError from userver.object.gateway import FrequencyPlan from binascii import unhexlify from userver.object.asserts import ...
{ "content_hash": "3ed2dcc732c1c742f985c403f988e470", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 143, "avg_line_length": 47.80487804878049, "alnum_prop": 0.6683673469387755, "repo_name": "soybean217/lora-python", "id": "be6cddd7bc6fd53cd5544a0d3deca16a51595c72", "size"...
from midonetclient.api import MidonetApi from midonetclient.router import Router from midonetclient import resource_base from midonetclient import vendor_media_type from midonetclient.bridge import Bridge from midonetclient.chain import Chain from midonetclient.host import Host from midonetclient.host_interface_port im...
{ "content_hash": "4ebec9dbd3d95c374ae39607c91d2c82", "timestamp": "", "source": "github", "line_count": 1294, "max_line_length": 101, "avg_line_length": 45.15455950540958, "alnum_prop": 0.5214615779565291, "repo_name": "sjones4/eutester", "id": "698459b475577078d70f5f5623e800e8c5ff917a", "size": "5...
""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363) imports from itertools are fixed in fix_itertools_import.py If itertools is imported as something else (ie: import itertools as it; it.izip(spam, eggs)) method c...
{ "content_hash": "54b08de2e61208ba33fb8114558f4692", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 37.04651162790697, "alnum_prop": 0.5524168236032643, "repo_name": "nmercier/linux-cross-gcc", "id": "b61343d43fc7d6b68d170b4e2928ad411b8d2355", "size...
"""This module contains ops for generating summaries. ## Summary Ops @@tensor_summary @@scalar """ # pylint: enable=line-too-long from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.framework ...
{ "content_hash": "ce67daefe5ee815309cb4763014e94c3", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 32.605633802816904, "alnum_prop": 0.7101511879049676, "repo_name": "naturali/tensorflow", "id": "46e33aae271ee1e97df90eb296cae6126b1cf8d2", "size": "...
from __future__ import absolute_import import json from flask_restful import reqparse from freight.api.base import ApiView from freight.api.serializer import serialize from freight.checks.utils import parse_checks_config from freight.config import db from freight.environments.utils import parse_environments_config f...
{ "content_hash": "71b9c6297d6a27ae29619b4dad0f4c7d", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 90, "avg_line_length": 32.170731707317074, "alnum_prop": 0.6413949962092494, "repo_name": "klynton/freight", "id": "db9d247d603ea7b6c6a64e74bc36d5476e24b00a", "size": "2638...
from table import * from exception import * # Addresses of the first instruction in a function. _FUNC_HEAD_EAS = set() # Addresses of the first instruction in a block. _BLOCK_HEAD_EAS = set() # Set of initially discovered block entrypoint addresses for each function # as discovered by IDA's initial auto-analysis. _D...
{ "content_hash": "e13bb8fd2614043b14b1704670054735", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 89, "avg_line_length": 33.909937888198755, "alnum_prop": 0.6764355710229875, "repo_name": "chubbymaggie/mcsema", "id": "5613d9f5408df962001ed637d4b3dfd9f8ef1a94", "size": ...
"""Add AggregateTest{Group,Suite} Revision ID: 166d65e5a7e3 Revises: 21b7c3b2ce88 Create Date: 2013-12-04 13:19:26.702555 """ # revision identifiers, used by Alembic. revision = '166d65e5a7e3' down_revision = '21b7c3b2ce88' from alembic import op import sqlalchemy as sa def upgrade(): op.create_table( ...
{ "content_hash": "3cfea03eb8ce68bf103be90fe176f03e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 90, "avg_line_length": 40.067796610169495, "alnum_prop": 0.6315566835871405, "repo_name": "alex/changes", "id": "6b3eab59512b249fbeba110dd972b4380fa88ba4", "size": "2364", ...
"""Gather info for scaffolding.""" import json from homeassistant.util import slugify from .const import COMPONENT_DIR from .model import Info from .error import ExitApp CHECK_EMPTY = ["Cannot be empty", lambda value: value] def gather_info(arguments) -> Info: """Gather info.""" existing = arguments.templ...
{ "content_hash": "a3928a73aece0b0c880ed9f989a729ce", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 122, "avg_line_length": 32.22950819672131, "alnum_prop": 0.4337063411325873, "repo_name": "Cinntax/home-assistant", "id": "a7263daaf41982026a2f1e8df20f3fdb97d9d6ac", "size...
"""Provides QtPdf classes and functions.""" from . import ( PYQT5, PYQT6, PYSIDE2, PYSIDE6, QtBindingMissingModuleError, ) if PYQT5: raise QtBindingMissingModuleError(name='QtPdf') elif PYQT6: # Available with version >=6.4.0 from PyQt6.QtPdf import * elif PYSIDE2: raise QtBindingM...
{ "content_hash": "010f52a0badf9287102167d9c7bc45a6", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 51, "avg_line_length": 21.75, "alnum_prop": 0.6919540229885057, "repo_name": "spyder-ide/qtpy", "id": "3a6796ca2b219ccb71fd84965016777634990fab", "size": "725", "binary":...
import hashlib from typing import List from src.classes.JsonEncoder import JsonEncoder from src.classes.dto.Serializable import Serializable from src.classes.dto.Transaction import Transaction class Block(Serializable): def __init__(self, index: int, proof: int, transactions: List[Transaction], timetamp: str, pr...
{ "content_hash": "bd842ab47bd760ce0355ebb5f843444a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 115, "avg_line_length": 30.48, "alnum_prop": 0.6561679790026247, "repo_name": "JasonQuinn/BlockChain", "id": "a50caae91f78908e7ce593fb8351d3282462b038", "size": "762", "b...
import netaddr from neutron.agent.linux import ip_lib from neutron.agent.linux import ip_link_support from neutron.agent.linux import ovs_lib from neutron.agent.linux import utils as agent_utils from neutron.common import utils from neutron.i18n import _LE from neutron.openstack.common import log as logging from neutr...
{ "content_hash": "5c983234aa168e8546529366cd936acf", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 77, "avg_line_length": 36.717948717948715, "alnum_prop": 0.6222067039106145, "repo_name": "Metaswitch/calico-neutron", "id": "c0c971b25b0bd4f8208b67fd6473d973aaa2a1ba", "s...
import bee from bee.segments import * import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * class mydisplay(bee.worker): def set_displayfunc(self, displayfunc): self.display = displayfunc @modifier def do_display(self): self.display(self.v_string)...
{ "content_hash": "76e7245f99e16000b5952711082d2b17", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 56, "avg_line_length": 22.076923076923077, "alnum_prop": 0.681184668989547, "repo_name": "agoose77/hivesystem", "id": "3328b729ef74d9e2b1c72ed60b1024eb1fc05236", "size": "5...
""" Vanilla Policy Gradient(VPG or REINFORCE) ----------------------------------------- The policy gradient algorithm works by updating policy parameters via stochastic gradient ascent on policy performance. It's an on-policy algorithm can be used for environments with either discrete or continuous action spaces. ...
{ "content_hash": "ef7986f839b81e1b68e0d929b7f36392", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 119, "avg_line_length": 33.952789699570815, "alnum_prop": 0.5599797749968398, "repo_name": "zsdonghao/tensorlayer", "id": "776cd6ac453c74ea60936bb064555e0be10b4187", "size...
from volttron.platform.agent.known_identities import VOLTTRON_CENTRAL, \ VOLTTRON_CENTRAL_PLATFORM def add_volttron_central(wrapper, config=None, **kwargs): config_dict = { # The agentid is used during display on the VOLTTRON central platform # it does not need to be unique. "agentid":...
{ "content_hash": "18a820a43ae9868e6da556d1e2f841f2", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 159, "avg_line_length": 31.229007633587788, "alnum_prop": 0.6260083109264238, "repo_name": "schandrika/volttron", "id": "080b8b659cb866ee07f86f92a098e51319e430f4", "size":...
from kivy_soil.text_editor import TextEditorPopup from ._base import FunctionBase from kivy.clock import Clock class Function(FunctionBase): name = 'ed' doc = 'text editor' methods_subclass = {'empty': ''} def empty(self): a = TextEditorPopup() a.open()
{ "content_hash": "ec07fc53d56aab1b957bc2abc10cda4e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 49, "avg_line_length": 22.23076923076923, "alnum_prop": 0.657439446366782, "repo_name": "Bakterija/mmplayer", "id": "251a477c9633de6afa9a3a6ac5d8cbbb1ddd5607", "size": "289...
import cairo as cr from osgeo import osr import math class UnsupportedFeatureType(Exception): """Attempted to render an unsupported feature type""" class TODOError(Exception): """Attempted to use a feature that hasn't been implemented yet""" class MapRenderingContext(object): def __init__(self, proj, wor...
{ "content_hash": "b41dd06a68ccb6ce3afb2d80b548af73", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 133, "avg_line_length": 38.544474393531, "alnum_prop": 0.5312587412587413, "repo_name": "hydroshare/hydroshare_temp", "id": "9dc5872859dd975c094073d841f5574d8fa9bd6e", "si...
"""program/module to trace Python program or function execution Sample use, command line: trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs trace.py -t --ignore-dir '$prefix' spam.py eggs trace.py --trackcalls spam.py eggs Sample use, programmatically import sys # create a Trace object, telling it ...
{ "content_hash": "86ba328cae10e744baee9d78e7277774", "timestamp": "", "source": "github", "line_count": 827, "max_line_length": 82, "avg_line_length": 36.78597339782346, "alnum_prop": 0.5390178160541713, "repo_name": "munyirik/python", "id": "f108266816e15f1028fc7f70e4a5f97798688734", "size": "3154...
import settings import tempfile import unittest class SettingsTest(unittest.TestCase): def test_basic(self): f = tempfile.NamedTemporaryFile() s = settings.Settings(f.name) self.assertFalse(s.has_setting("foo")) self.assertRaises(settings.SettingDoesntExistException,lambda: s["foo"]) s.register("...
{ "content_hash": "15e7f9058af20926d73a8f941dfa81b1", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 91, "avg_line_length": 29.961038961038962, "alnum_prop": 0.6486779367143476, "repo_name": "natduca/quickopen", "id": "aedfecad23f5dbc4cce85f48f1d2951c0c020ff8", "size": "5...
import contextlib import copy class Proxy(object): def __init__(self, func): self.__dict__['get_proxied'] = func def __repr__(self): return '<Proxy via %r of %r>' % (self.get_proxied, self.get_proxied()) def __str__(self): return self.get_proxied().__str__() def __getattr__(s...
{ "content_hash": "397f3398c518bc4db684266d9552aa61", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 24.814285714285713, "alnum_prop": 0.558434081750144, "repo_name": "westernx/vee", "id": "4c712ee299b32af8708a5e0ff1bbb2471bf010a7", "size": "1737", ...
import math import posixpath from unittest import mock import pytest from dvc.fs.base import FileSystem, RemoteCmdError from dvc.objects.db.base import ObjectDB class _CallableOrNone: """Helper for testing if object is callable() or None.""" def __eq__(self, other): return other is None or callable...
{ "content_hash": "fc35732291608b1ed48ceeeabc38ff6d", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 29.437956204379564, "alnum_prop": 0.6161666253409372, "repo_name": "efiop/dvc", "id": "b61c5532a57bcae5c5429c18b1273c8c123c16d4", "size": "4033", ...
import os import unittest import imath import IECore import Gaffer import GafferTest import GafferScene import GafferSceneTest class SubTreeTest( GafferSceneTest.SceneTestCase ) : def testPassThrough( self ) : a = GafferScene.SceneReader() a["fileName"].setValue( os.path.dirname( __file__ ) + "/alembicFiles/...
{ "content_hash": "782b5ffd7d2d7cf843c2f7bc27652218", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 128, "avg_line_length": 32.13178294573643, "alnum_prop": 0.6453558504221955, "repo_name": "johnhaddon/gaffer", "id": "fc5212c75a8c2cf7c18adff896d6abd47f827db6", "size": "1...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("page", "0005_auto_20190208_0456")] operations = [ migrations.AlterField( model_name="page", name="is_published", field=models.BooleanField(default=True), ) ...
{ "content_hash": "3b65e46b8372d39b60a371c1206cf3b1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 56, "avg_line_length": 23.142857142857142, "alnum_prop": 0.6018518518518519, "repo_name": "mociepka/saleor", "id": "0a64cd18558d36c5075738885d0558d1b7ec4112", "size": "373"...
from .pillar import P
{ "content_hash": "4fe3c3f398dcf7f393a1a9b73bfd3660", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 22, "alnum_prop": 0.7727272727272727, "repo_name": "lcgong/domainics", "id": "2334f5155eb82045ac8a9fc5e5dd930db3ad745e", "size": "47", "binary": fal...
from __future__ import division, print_function, unicode_literals __doc__ = """ Compare sidebearings of two frontmost fonts. """ Font1 = Glyphs.font # frontmost font Font2 = Glyphs.fonts[1] # other font tolerance = 2.0 # brings macro window to front and clears its log: Glyphs.clearLog() Glyphs.showMacroWindow() prin...
{ "content_hash": "6bf98c961e86aaeeb840dbafc7899d6c", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 84, "avg_line_length": 30.225, "alnum_prop": 0.6451612903225806, "repo_name": "mekkablue/Glyphs-Scripts", "id": "c0d957bd5e1b9a3ac709b174ad64e214c30ecae1", "size": "1266", ...
"""Module with names of pre and postfixes of classes used. Note that all the values should be in lower case.""" TEST_MODAL_NEW_PREFIX = "modalnew" INFO_POSTFIX = "info"
{ "content_hash": "486806b094b072a47514aa46c7c70f13", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 58, "avg_line_length": 34, "alnum_prop": 0.7352941176470589, "repo_name": "prasannav7/ggrc-core", "id": "b7d01a032cce6e1285f9d852cad3fc784f9902fb", "size": "414", "binary"...
""" Implements the mumble protocol. https://mumble-protocol.readthedocs.org/en/latest/index.html """ import socket import ssl import threading import time import struct from ....logging import get_logger from ....signals import on_exception from ... import BaseResponder from . import mumble_pb2 # Mapping of ...
{ "content_hash": "96f8237768da3b49316e5525e1fc4521", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 96, "avg_line_length": 31.594155844155843, "alnum_prop": 0.5753776590278491, "repo_name": "fadybinadnan/BOTNet-2017.4-", "id": "2796470f22c2418be4e092fb852175d61a77ba41", ...
import grpc from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2 from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 class ImageAnnotatorStub(object): """Service that performs Google...
{ "content_hash": "a33b257ee57c3e518be5ad7da640821a", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 151, "avg_line_length": 51.291666666666664, "alnum_prop": 0.7611697806661251, "repo_name": "tseaver/gcloud-python", "id": "f2be4408fd1791888bae6b3beb846493d8a8c8e3", "size"...
import contextlib import os import sys import shutil import hashlib import zipfile import subprocess try: from urllib.request import urlretrieve except ImportError: from urllib import urlretrieve URL = 'http://unicode.org/Public/cldr/37/core.zip' FILENAME = 'cldr-core-37.zip' FILESUM = 'ba93f5ba256a61a6f82533...
{ "content_hash": "65e7dc0c6b0644888a9f7f30306d521e", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 105, "avg_line_length": 28.893203883495147, "alnum_prop": 0.6051747311827957, "repo_name": "cloudera/hue", "id": "805772a1648c2c4aca557bbb11ba7d1b30965d1f", "size": "3000"...
""" Python program for deleting a snapshot of a first class disk (fcd) """ import atexit from tools import cli, tasks, disk from pyVim import connect from pyVmomi import vmodl from pyVmomi import vim def get_args(): """ Adds additional args for deleting a snapshot of a fcd -d datastore -v vdisk ...
{ "content_hash": "d0a62cb04842fdf42c8b230be1d6d69d", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 78, "avg_line_length": 31.80188679245283, "alnum_prop": 0.5040047463660635, "repo_name": "jm66/pyvmomi-community-samples", "id": "68a02473485ec047ac22f9db674441a0fe296599", ...
from .relationship_manager import RelationshipManager, ZeroOrMore # noqa class ZeroOrOne(RelationshipManager): description = "zero or one relationship" def single(self): nodes = super(ZeroOrOne, self).all() if len(nodes) == 1: return nodes[0] if len(nodes) > 1: ...
{ "content_hash": "6565862c3a9c63e5b924fd66bc150992", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 97, "avg_line_length": 30.223529411764705, "alnum_prop": 0.6165823277539899, "repo_name": "cristigociu/neomodel_dh", "id": "6ff047ead2132e1485bf2c082fe4672a53e80f8c", "size...
from rapidsms.backends.kannel.outgoing import KannelBackend __all__ = ('KannelBackend',)
{ "content_hash": "6b8738e510e8140c7dc090c31d22f5ab", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 59, "avg_line_length": 30, "alnum_prop": 0.7666666666666667, "repo_name": "peterayeni/rapidsms", "id": "92ff11936717b353e287521fa5cae4b4bb449a37", "size": "90", "binary": ...