text
stringlengths
4
1.02M
meta
dict
import PlayerClass import ActionMethods import Log import Items import copy import random class Sym: # logName - string def __init__(self,logName): self.listOfTeams = [] # Team - a list of players with some additional stuff. self.dayDuration = 12 # Amount of hours in a day self.hourlyCalorieCost = ...
{ "content_hash": "f91451f6c0f41da04d3e136267a35d20", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 171, "avg_line_length": 38.34153846153846, "alnum_prop": 0.7139073910601076, "repo_name": "Pernowi/Hunger-Games-Sim", "id": "9648ed0d547cfcf3975e9c2e2b8d7388e19f0bf3", "si...
"""Generated message classes for dataflow version v1b3. Develops and executes data processing patterns like ETL, batch computation, and continuous computation. """ # NOTE: This file is autogenerated and should not be edited by hand. from apitools.base.protorpclite import messages as _messages from apitools.base.py im...
{ "content_hash": "1ebc93eb261f7c407b00597ed858dc4c", "timestamp": "", "source": "github", "line_count": 5077, "max_line_length": 102, "avg_line_length": 39.75930667717156, "alnum_prop": 0.7325149362423089, "repo_name": "tgroh/beam", "id": "fdc1681f33e1d7f6281b2433d748cac1e08dedfd", "size": "202643"...
class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = ''' options: hostname: description: - IP Address or hostname of APIC resolvable by Ansible control host. required: yes aliases: [ host ] username: description: - The username to use for authentic...
{ "content_hash": "9ea42de829eb8f89392ee0c908d6d56c", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 113, "avg_line_length": 32.6530612244898, "alnum_prop": 0.700625, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "db951b679420f8993b62bfd976537a13709cc8cd", "s...
""" Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak is a RESTfu...
{ "content_hash": "99f837674b15122e8254f680f69f996b", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 984, "avg_line_length": 32.16339869281046, "alnum_prop": 0.5952042267831742, "repo_name": "Chaffelson/whoville", "id": "76c68448b99426f17e641bce7fe28dbc8ccd5dd8", "size": ...
from __future__ import print_function import argparse import os import sys py3 = sys.version_info.major == 3 def warn(msg): print('[powerline-bash] ', msg) class Powerline: symbols = { 'compatible': { 'lock': 'RO', 'network': 'SSH', 'separator': u'\u25B6', ...
{ "content_hash": "bfd3ef4db35536a1d2bf5e1f62d275fc", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 86, "avg_line_length": 35.29370629370629, "alnum_prop": 0.5742024965325936, "repo_name": "juancruzmdq/dotfiles", "id": "8b95fb3a951ca94472bac7b2b46b88f114b70b52", "size": ...
from __future__ import print_function, unicode_literals from __future__ import division, absolute_import from tdbus import SimpleDBusConnection import tdbus conn = SimpleDBusConnection(tdbus.DBUS_BUS_SYSTEM) print('Listing all well-known services on the system bus:') print() result = conn.call_method(tdbus.DBUS_PAT...
{ "content_hash": "0ac23897fa560b42a4afc89aba3b70ec", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 30.11111111111111, "alnum_prop": 0.6955719557195572, "repo_name": "Jajcus/python-tdbus", "id": "85d8b34fc721018e0191d31695b96a55dd6e0791", "size": "9...
from typing import Dict, List, Optional, TypeVar from django.conf import settings from django.conf.urls import url from django.core.urlresolvers import LocaleRegexProvider from django.utils.module_loading import import_string """This module declares all of the (documented) integrations available in the Zulip server. ...
{ "content_hash": "a81cbac0039ef191fcbdd3f03aa9c692", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 119, "avg_line_length": 41.27536231884058, "alnum_prop": 0.6772003745318352, "repo_name": "TigorC/zulip", "id": "c736c2c5d96684a901b08ec16794b7d15cdde8aa", "size": "8544",...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import logging LOGGER = logging.getLogger(__name__) def expand_path(path, log=False): expanded = os.path.normpath(os.path.abspath(path)) if log and expanded != path: LOGGER.debug('...
{ "content_hash": "03f0d86781796a943edf74005761664a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 25.4, "alnum_prop": 0.6456692913385826, "repo_name": "digitalrounin/py-lambda-packer", "id": "1e272a03e08bafe720e6f7956a282b5199665015", "size": "381...
from __future__ import unicode_literals from rest_framework.decorators import api_view from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse from django.conf import settings from django.shortcuts import render from tesseract import tesseract_exec import os, StringIO def index(requ...
{ "content_hash": "8443fd9c792061faa465e20049102581", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 92, "avg_line_length": 32.78947368421053, "alnum_prop": 0.7279293739967897, "repo_name": "acislab/HuMaIN_Microservices", "id": "ad9e9c2ef2035856135d735631786b56d1fb20e3", "...
from django.contrib.admin import widgets from django import forms class FilteredSelectMultiple(forms.SelectMultiple): """ removing 2 select fields widget """ def __init__(self, verbose_name, is_stacked, attrs=None, choices=[]): super(FilteredSelectMultiple, self).__init__(attrs, choices) w...
{ "content_hash": "6bddc6555f90d0e85c2649c5d7035a96", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 94, "avg_line_length": 27.659574468085108, "alnum_prop": 0.7369230769230769, "repo_name": "quinode/django-admintools-bootstrap", "id": "e7c37e20baad25b4ecde92501e0fae605486ca...
from setuptools import setup setup( name="pytest_snmpserver", version="0.1.9", packages=["pytest_snmpserver"], long_description="SNMP server as a pytest plugin", long_description_content_type="text/markdown", python_requires=">=3.6", install_requires=[], entry_points={"pytest11": ["pyte...
{ "content_hash": "368c976fa29945840ea540267e5e151d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 87, "avg_line_length": 32.35294117647059, "alnum_prop": 0.6345454545454545, "repo_name": "tardate/LittleCodingKata", "id": "a472d9c1617973ea35bc1f7a165a7637c8b18ffa", "size...
""" garage.exceptions * created: 2014-08-23 Kevin Chan <kefin@makedostudio.com> * updated: 2014-11-21 kchan """ from django.core.exceptions import ImproperlyConfigured
{ "content_hash": "9a8b9ef12110ac948128fd5b4f09546b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 57, "avg_line_length": 21.25, "alnum_prop": 0.7647058823529411, "repo_name": "kefin/django-garage", "id": "ac4951013ee7026200cacd67eabbe63692501eda", "size": "194", "binar...
class AddArgs: def __init__(self, args, add_rec=False, add_skip=False): self.args = args self.add_rec = add_rec self.add_skip = add_skip def extend(self, args): if self.args is not None: self.args.extend(args) else: self.args = args
{ "content_hash": "d449583ddb79d03f77364b4d0cfbfec5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 19.53846153846154, "alnum_prop": 0.6535433070866141, "repo_name": "amol9/redcmd", "id": "080c8e566ec2be8d777f2d5a0a73cea2fe283885", "size": "256", ...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models from radpress.readers import get_reader class Migration(DataMigration): no_dry_run = True def forwards(self, orm): reader = get_reader() model_names = ['radpress.Article', 'radpress.Page'] ...
{ "content_hash": "3dc32d1f079bd6087ac7916e3089df19", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 207, "avg_line_length": 63.03731343283582, "alnum_prop": 0.5289451876405824, "repo_name": "gkmngrgn/radpress", "id": "501930e5bb8e0dc6612bcd29bded406c9301dc37", "size": "8...
"""Settings for SAML SSO. Version Added: 5.0 """ from django.urls import reverse from django.utils.translation import gettext_lazy as _ from djblets.siteconfig.models import SiteConfiguration try: from onelogin.saml2.constants import OneLogin_Saml2_Constants as constants except ImportError: constants = No...
{ "content_hash": "79f35a65c4de6b537009dbad7f90a281", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 78, "avg_line_length": 26.72, "alnum_prop": 0.5410607356715141, "repo_name": "reviewboard/reviewboard", "id": "6982227519be0e3cbb2fa57c9b9ec35782167f4c", "size": "4676", ...
import rospy from pibot import srv, msg from std_msgs.msg import String pub = None prior = 24 def handler(req): global pub m = msg.window() m.prior = prior m.timeout = req.timeout m.content = req.message m.id = 'msgbox' pub.publish(m) return True def init(): rospy.init_node('sc...
{ "content_hash": "3b51ae754f61fc59f10937621e31bd79", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 69, "avg_line_length": 16.666666666666668, "alnum_prop": 0.6181818181818182, "repo_name": "psby233/pibot", "id": "a1ccf42fe5d0a2bb1b4743468d9f7b4e74f7c238", "size": "573", ...
"""Tests for google.protobuf.message_factory.""" import os os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION'] = '2' # We must set the implementation version above before the google3 imports. # pylint: disable=g-import-not-at-top from google.apputi...
{ "content_hash": "29bddceea1fd3cca2326824af15a8071", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 33.625, "alnum_prop": 0.7695167286245354, "repo_name": "da2ce7/protobuf", "id": "fb52e1b1c6cb4e08f185e9cbedc3ca34fab12934", "size": "2446", "binary...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import profile import unittest class TestIssue0048 (unittest.TestCase): def testProfile (self): amap = profile.AbstractFeatureBaseType._AttributeMap self.assertEqual(1, len(amap)) if __name__ == ...
{ "content_hash": "1f4acd0bf71a637498dea546789400d1", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 60, "avg_line_length": 25.142857142857142, "alnum_prop": 0.6647727272727273, "repo_name": "pabigot/pyxb", "id": "065d36a34245928044a0d3e7e2d0ecfc1520d03c", "size": "376", ...
"""Store game events in database Usage: munerator [options] store Options: -v --verbose Verbose logging --context-socket url ZMQ socket for conext event [default: tcp://127.0.0.1:9002] --database ip:port Host and port for mongo database [default: 127.0.0.1:27017] --rcon-socket url Z...
{ "content_hash": "f2248a14e98f2328342a45feb0890018", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 120, "avg_line_length": 33.7816091954023, "alnum_prop": 0.60326641714869, "repo_name": "aequitas/munerator", "id": "348863d0c75c5baece8974aa053d5bdc6ec38c00", "size": "587...
from misaka import Markdown, BaseRenderer, HtmlRenderer, \ SmartyPants, \ EXT_FENCED_CODE, EXT_TABLES, EXT_AUTOLINK, EXT_STRIKETHROUGH, \ EXT_SUPERSCRIPT, HTML_USE_XHTML, \ TABLE_ALIGN_L, TABLE_ALIGN_R, TABLE_ALIGN_C, \ TABLE_ALIGNMASK, TABLE_HEADER class BleepRenderer(HtmlRenderer, SmartyPants): ...
{ "content_hash": "3cc96bd5578c538a61a01a84e0e8b2a1", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 25.742574257425744, "alnum_prop": 0.5373076923076923, "repo_name": "hhatto/python-hoedown", "id": "871f9d647a8ce835e1b9294a55164bca63acffe5", "size"...
import pytest from cutadapt.__main__ import ( main, parse_cutoffs, parse_lengths, CommandLineError, setup_logging, ) def test_help(): with pytest.raises(SystemExit) as e: main(["--help"]) assert e.value.args[0] == 0 def test_parse_cutoffs(): assert parse_cutoffs("5") == (0, ...
{ "content_hash": "0b5919e5a79aa7d064cc068526dc2f0d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 87, "avg_line_length": 28.428571428571427, "alnum_prop": 0.6413316582914573, "repo_name": "marcelm/cutadapt", "id": "ee137bfc7cad935abf7ef378916b455cd1bf864e", "size": "159...
from .test_base_doc import AbstractTestDoc class TestLatinDoc(AbstractTestDoc): text = 'Omnia gallia\nin tres part-\nes divisa est.' language = 'latin' def test_normalize(self): self.ready() test = self.doc.normalize() compare = 'Omnia gallia\nin tres part-\nes diuisa est.' ...
{ "content_hash": "d3fd602b83c59063d26f4216ee98ca7a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 63, "avg_line_length": 30.666666666666668, "alnum_prop": 0.6413043478260869, "repo_name": "thePortus/arakhne", "id": "d6761f6fd8318d72add3a718f26cb07e2f926642", "size": "55...
from __future__ import absolute_import, unicode_literals import base64 import errno import hashlib import json import os import shutil from StringIO import StringIO from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.multipartparser import Mult...
{ "content_hash": "b17840b264497008ca224f79e22c2760", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 110, "avg_line_length": 38.178660049627794, "alnum_prop": 0.5614194722474978, "repo_name": "kennethlove/django", "id": "a7424639b4f49aa8e0a90aaf94076aad6198f8f9", "size": ...
"""Hook to run tf.GraphKeys.UPDATE_OPS.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf class UpdateOpsHook(tf.train.SessionRunHook): """Hook to run assign_ops.""" def before_run(self, run_context): del run_context u...
{ "content_hash": "6c2e9dd718d386cf2c1eb3ee428cd759", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 59, "avg_line_length": 28.133333333333333, "alnum_prop": 0.7298578199052133, "repo_name": "mlperf/training_results_v0.5", "id": "c2615c661cead4a997cf9ee9f00ad385700ffec4", ...
import logging import os import sys import numpy as np import tensorflow as tf from ludwig.constants import AUDIO, BACKFILL, TIED, TYPE, COLUMN, PROC_COLUMN, \ PREPROCESSING, NAME from ludwig.encoders.sequence_encoders import StackedCNN, ParallelCNN, \ StackedParallelCNN, StackedRNN, SequencePassthroughEncode...
{ "content_hash": "c350ad8f94d235c628bbd082865eede8", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 109, "avg_line_length": 38.41777777777778, "alnum_prop": 0.5513072651550208, "repo_name": "uber/ludwig", "id": "e9dee871ec40e856a628eead0d048748bf3b744e", "size": "17998",...
import kfp from kfp import dsl def print_op(msg): """Print a message.""" return dsl.ContainerOp( name='Print', image='alpine:3.6', command=['echo', msg], ) @dsl.pipeline( name='Pipeline service account', description='The pipeline shows how to set the max number of parallel pods in a ...
{ "content_hash": "c261ecd508c9180778cf670f2f9bc678", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 94, "avg_line_length": 24.625, "alnum_prop": 0.6480541455160744, "repo_name": "kubeflow/kfp-tekton-backend", "id": "e2def4585683d54d1883670b581d6b11010d923d", "size": "1191...
""" Helper script to dump all information for an architecture """ import argparse import html from ppci import api from ppci.arch import encoding arch = api.get_arch('msp430') arch = api.get_arch('x86_64') def mkstr(s): if isinstance(s, str): return s elif isinstance(s, encoding.Operand): re...
{ "content_hash": "a1fb45d80e4c70a559847253076f16a2", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 79, "avg_line_length": 27.541666666666668, "alnum_prop": 0.5885022692889561, "repo_name": "windelbouwman/ppci-mirror", "id": "0aa487ecb85807e73337431541943c0cfb7f60cf", "si...
from datetime import datetime from threading import Thread import psutil import time old_status = None current_nic_status = None # convert bytes to kilobytes def bytes_to_kb(byts): return byts / 1024 # loop every second to update records def update_nics(): global old_status global current_nic_status ...
{ "content_hash": "60c222e945a77221bbf65c930b3d320f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 119, "avg_line_length": 24.453125, "alnum_prop": 0.6095846645367412, "repo_name": "Atomicbeast101/atomic-monitor", "id": "7b18bc0f0787ff4e0d03a854ec642fcdf49be461", "size":...
"""Tests for text_util.""" from absl.testing import parameterized import tensorflow as tf from tensorflow_model_analysis.experimental.preprocessing_functions import text class TextTest(tf.test.TestCase, parameterized.TestCase): @parameterized.named_parameters( ('EmptyString', [''], [[]]), ('SingleStrin...
{ "content_hash": "86ce188de5eb0459d9dba2d35ba03260", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 35.34615384615385, "alnum_prop": 0.6224156692056583, "repo_name": "tensorflow/model-analysis", "id": "ae10a64aaa5686b6d4f6c778e4c79ab590a8d456", "siz...
from tests import unittest from mock import Mock from ....utils import MockHttpResource, setup_test_homeserver from synapse.types import UserID from twisted.internet import defer PATH_PREFIX = "/_matrix/client/v2_alpha" class V2AlphaRestTestCase(unittest.TestCase): # Consumer must define # USER_ID = <...
{ "content_hash": "11c1205e9fc8f7b66ce64ea9175781e6", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 65, "avg_line_length": 27.75, "alnum_prop": 0.6006006006006006, "repo_name": "illicitonion/synapse", "id": "de5a917e6aabbb6065245af6f42ec6b037bf8f8a", "size": "1935", "bi...
"""Setup.py module for the workflow's worker utilities. All the workflow related code is gathered in a package that will be built as a source distribution, staged in the staging area for the workflow being run and then installed in the workers when they start running. This behavior is triggered by specifying the --se...
{ "content_hash": "43f98956feeaccfc38d3dfc8fbc5af8b", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 84, "avg_line_length": 36.33, "alnum_prop": 0.7162124965593174, "repo_name": "GoogleCloudPlatform/data-science-on-gcp", "id": "55b61239e8b4681245f87e4f0e993a95646426a1", "...
import MySQLdb as mdb import argparse import os import csv import sys def createDoc(doc): file = open(doc, "w") file.close() def makeID(): #This is important when running this program from the command line because it generates a keywordID file = open("ID.txt", "w") first = str(0) ...
{ "content_hash": "36719f8fb2b28e2818480b621b683ccf", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 641, "avg_line_length": 41.57276995305164, "alnum_prop": 0.6145680406549971, "repo_name": "RDCEP/BWLT", "id": "8fe44baa2e3eedb830c29da7cb1b36b6b03f2eaa", "size": "8855", ...
from app.constants import S_OK, S_ERR import random import math import base64 import time import ujson as json from app import cfg from app import util def p_img_info_handler(data): cfg.logger.debug('data: %s', data) if not data.get('the_id', ''): return {"success": False} result = util.db_update...
{ "content_hash": "a05d8a3d70f32134e9140b081c57b322", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 94, "avg_line_length": 23.55, "alnum_prop": 0.6475583864118896, "repo_name": "g0v/LittleBeeGeo", "id": "661932f47e2c17d21679626ad4d3e47be47e569a", "size": "496", "binary"...
from mpfmc.tests.MpfMcTestCase import MpfMcTestCase class TestText(MpfMcTestCase): def get_machine_path(self): return 'tests/machine_files/text' def get_config_file(self): return 'test_text.yaml' def get_widget(self, index=0): return self.mc.targets['default'].current_slide.widge...
{ "content_hash": "a34fcf86cf01de032f718cebbe415246", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 83, "avg_line_length": 34.33256351039261, "alnum_prop": 0.6138840306740213, "repo_name": "missionpinball/mpf_mc", "id": "0d9e47a6bce3b5f14a7154b6ef90edaf6bdbab70", "size":...
import sys import datetime from time import strptime, strftime def _getWeekDetails(_weekNo, _Year, _weekStart): rslt = [] janOne = strptime('%s-01-01' % _Year, '%Y-%m-%d') dayOfFirstWeek = ((7-int((strftime("%u",janOne)))+ int(_weekStart)) % 7) if dayOfFirstWeek == 0: dayOfFirstWeek = 7 dat...
{ "content_hash": "3003138afc012bad79f2b8b88298ba8a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 106, "avg_line_length": 41.55555555555556, "alnum_prop": 0.6096256684491979, "repo_name": "jonlatorre/gestioneide", "id": "40fc9e98dabe30f3bf162b7312c1a3253aec32e3", "size"...
import oslo_i18n _translators = oslo_i18n.TranslatorFactory(domain='networking_nec') # The primary translation function using the well-known name "_" _ = _translators.primary # Translators for log levels. # # The abbreviated names are meant to reflect the usual use of a short # name like '_'. The "L" is for "log" an...
{ "content_hash": "a01135bcda23801b766879596e25398e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 69, "avg_line_length": 30.1875, "alnum_prop": 0.7391304347826086, "repo_name": "openstack/networking-nec", "id": "7047ce1d9e2a5f2de194c7fabbda648da09920f2", "size": "1081",...
import boto3 from botocore.client import ClientError import pytest import sure # noqa # pylint: disable=unused-import from moto import mock_s3 @mock_s3 def test_create_bucket_with_ownership(): bucket = "bucket-with-owner" ownership = "BucketOwnerPreferred" client = boto3.client("s3") client.create_b...
{ "content_hash": "d5370e456d822e3c5c49aeb3afb7fa59", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 88, "avg_line_length": 32.1, "alnum_prop": 0.7258566978193146, "repo_name": "spulec/moto", "id": "bc68eb892bbdbe2e4498b463575aefda638d5e3a", "size": "1605", "binary": fal...
import sublime import sublime_plugin import os import json from datetime import datetime from .baseutil import SysIo from .setting import SfBasicConfig from .uiutil import SublConsole ########################################################################################## #Project Config ##########################...
{ "content_hash": "6c0b679703f2b6231ccaec8d85826503", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 105, "avg_line_length": 41.15929203539823, "alnum_prop": 0.5452590840679423, "repo_name": "exiahuang/SalesforceXyTools", "id": "b217861724f3ec5b62278292f89be423a2398807", ...
from unittest import TestCase from warnings import catch_warnings, simplefilter as simple_filter from iota import Address, AddressChecksum, AsciiTrytesCodec, Hash, Tag, \ TryteString, TrytesDecodeError class TryteStringTestCase(TestCase): def test_ascii_bytes(self): """ Getting an ASCII representation of...
{ "content_hash": "e9f2818a5a64e706ed671c9c1cf12cf8", "timestamp": "", "source": "github", "line_count": 1193, "max_line_length": 78, "avg_line_length": 27.893545683151718, "alnum_prop": 0.618595426270397, "repo_name": "iotaledger/iota.lib.py", "id": "6230024244b5aae558bd34e0be7556975cf5b46a", "size...
from .Base import * from .helper import hasHackChars from ckstyle.browsers.BinaryRule import ALL, STD from ckstyle.browsers.Detector import doRuleSetDetect class FEDCombineSameRuleSets(StyleSheetChecker): '''{ "summary":"合并两个完全相同的规则集", "desc":"如果两个规则集完全一样,则可以进行合并。<br> 需要指出的是:合并可能会带来功能上的...
{ "content_hash": "2c9b26dbe85c31b47869adb1f5692f79", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 106, "avg_line_length": 40.261538461538464, "alnum_prop": 0.5147115017195262, "repo_name": "wangjeaf/CSSCheckStyle", "id": "0a8e0549f5052b107e65f4eb73af649bd2b9de65", "siz...
__all__ = ['WebHandler', 'cases', 'request_filter'] import logging import functools from copy import copy from webob import Response logger = logging.getLogger(__name__) def is_chainable(handler): while isinstance(handler, WebHandler): if not hasattr(handler, '_next_handler'): return True ...
{ "content_hash": "c8e213609d36205494e3fb6cc67d5a80", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 80, "avg_line_length": 31.29787234042553, "alnum_prop": 0.5659415363698165, "repo_name": "SmartTeleMax/iktomi", "id": "ba282a05acd5a0ebf85ad3977be619ef9dd2950b", "size": "...
""" Python-like loader which is able to customize default global namespace. """ from __future__ import absolute_import, division, print_function from mybuild._compat import * from mybuild.util.importlib.machinery import SourceFileLoader class PyFileLoader(SourceFileLoader): """Loads Pybuild files and executes th...
{ "content_hash": "54394251063f474f943db0ad1efcca2e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 32.6, "alnum_prop": 0.6958808063102542, "repo_name": "embox/mybuild", "id": "7aff87c98c88a001525d4f2c362ef98b0cf49187", "size": "1141", "binary": f...
from tempest.api.compute import base from tempest import exceptions from tempest import test class AbsoluteLimitsNegativeTestJSON(base.BaseV2ComputeTest): @classmethod def resource_setup(cls): super(AbsoluteLimitsNegativeTestJSON, cls).resource_setup() cls.client = cls.limits_client c...
{ "content_hash": "8081e13fa908dc95fa4b1dfe17ad1b73", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 38.432432432432435, "alnum_prop": 0.6272855133614628, "repo_name": "afaheem88/tempest_neutron", "id": "a9c72fb71a315ac436316634fffd83eb07879758", "si...
from rest_framework.test import APITestCase from rest_framework import status from django.core.urlresolvers import reverse import json from helpers import * class Miscs1Test(APITestCase): fixtures = ['users.json', 'nonprofits.json'] def test_api_root(self): """ """ url = reverse('api-root') with self.ass...
{ "content_hash": "2343098e1f8cacde21e5a79e38fc792f", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 87, "avg_line_length": 32.2442748091603, "alnum_prop": 0.6841856060606061, "repo_name": "atados/api", "id": "1e2045959865ecd909781e5299d6f7b011772354", "size": "4249", "...
"""Tests for distutils.cmd.""" import unittest import os from test.support import captured_stdout, run_unittest from distutils.cmd import Command from distutils.dist import Distribution from distutils.errors import DistutilsOptionError from distutils import debug class MyCmd(Command): def initialize_op...
{ "content_hash": "3e644d8958b0ea4025dad204df6a0010", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 31.436507936507937, "alnum_prop": 0.5647563746528654, "repo_name": "Suwmlee/XX-Net", "id": "398ed672721e5aea93332e293475ed09818f3552", "size": "3961...
import os import warnings import pytest from pex import pex_warnings from pex.common import temporary_dir from pex.compatibility import PY2 from pex.pex_warnings import PEXWarning from pex.testing import environment_as from pex.typing import TYPE_CHECKING from pex.util import named_temporary_file from pex.variables i...
{ "content_hash": "c94acaf5ff4a4ce5723b60c8d68ce09d", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 99, "avg_line_length": 31.184905660377357, "alnum_prop": 0.6251210067763795, "repo_name": "pantsbuild/pex", "id": "59789c9157ff57fac1c9f8f351d058f03a929f45", "size": "8396...
__all__ = ['imread'] import numpy as np try: from PIL import Image except ImportError: raise ImportError("The Python Image Library could not be found. " "Please refer to http://pypi.python.org/pypi/PIL/ " "for further instructions.") from skimage.util import img_as...
{ "content_hash": "e1a2fd4a45b88d94f8e50b7ebc6d462f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 76, "avg_line_length": 27.330882352941178, "alnum_prop": 0.5835351089588378, "repo_name": "chintak/scikit-image", "id": "6dd78035ead58b15caf9312abbe8ea541dbafbd3", "size":...
import re def instantiate_request_uri_templates(json_content): """Instantiate the parameters for all the requests URI templates Arguments: json_content -- JSON object containing the API parsed spec """ for resource_group in json_content["resourceGroups"]: for resource in resource_group["re...
{ "content_hash": "33ab3dfdf4a4bb03265c10e4f7cc91af", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 136, "avg_line_length": 47.96296296296296, "alnum_prop": 0.587953667953668, "repo_name": "Lenijas/test-travisci", "id": "1e801ca6e8e4dbb827e691ea9bfa747b3cd8654a", "size":...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('feedbacks', '0002_auto_20181007_1922'), ] operations = [ migrations.AlterField( model_name='answer', name='author_name', field=models.CharField(max_lengt...
{ "content_hash": "7c4b92a6550e0b871d6aea4856bf98df", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 23.25, "alnum_prop": 0.5887096774193549, "repo_name": "flavoi/diventi", "id": "b56eefdf24e589f171f6abd01c559f91b5601d32", "size": "421", "binary": ...
from __future__ import division, print_function import argparse import os import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import multiprocessing as mp import comptools as comp import comptools.analysis.plotting as plotting color_dict = comp.analysis.get_color_dict() def get...
{ "content_hash": "e6c4ec824f73d40fcbbbbd75f027bf27", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 92, "avg_line_length": 36.94318181818182, "alnum_prop": 0.6348815749000307, "repo_name": "jrbourbeau/cr-composition", "id": "41092ae21e09f2d62f0171e97cc0ae224c168a77", "siz...
__author__ = 'digao' from flask import Flask from flask.ext.mongoengine import MongoEngine app = Flask(__name__) app.config["MONGODB_SETTINGS"] = {'DB': "my_tumble_log"} app.config["SECRET_KEY"] = "KeepThisS3cr3t" db = MongoEngine() db.init_app(app) def register_blueprints(app): # Prevents circular imports fr...
{ "content_hash": "9f97652099768d56dbb308a380ddafd2", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 56, "avg_line_length": 20.791666666666668, "alnum_prop": 0.6833667334669339, "repo_name": "digaobarbosa/tumblog", "id": "8bf4c670b489034d99d0956e3838a39fc5aa0798", "size": ...
subreddit = 'BollyBlindsNGossip' t_channel = '@bollybng' def send_post(submission, r2t): return r2t.send_simple(submission)
{ "content_hash": "259cd1476e11eb6930487cc1c141c7d4", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 38, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7384615384615385, "repo_name": "Fillll/reddit2telegram", "id": "41781bcac3c657d08ddafadd83a76038f82222b5", "size":...
import unittest import fibonacci as fm class FibonacciTests(unittest.TestCase): """Test all Fibonacci functions against a list of known Fibonacci numbers Values indexed 0 - 38 are from OEIS https://oeis.org/search?q=fibonacci 39 - 50 manually calculated and verified by Brig Young ...
{ "content_hash": "f5322c740a73b21ad4fa403be6cc6c6b", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 103, "avg_line_length": 46.71084337349398, "alnum_prop": 0.6639153985039979, "repo_name": "Sonophoto/PythonNotes", "id": "9165f58850f82329caabc596a48378578e09fabb", "size":...
from fastapi import Body, FastAPI from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str description: str | None = None price: float tax: float | None = None class User(BaseModel): username: str full_name: str | None = None @app.put("/items/{item_id}") async def u...
{ "content_hash": "d7a03153ab8c6000fa11f5d41b6c65e8", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 88, "avg_line_length": 22.90909090909091, "alnum_prop": 0.6567460317460317, "repo_name": "tiangolo/fastapi", "id": "a1a75fe8e40e9067147ac0735b70ad380ea292e5", "size": "504"...
TARGETS = [ 'KitchenSink.py', ] PACKAGE = { 'title': 'kitchensink', 'desc': 'KitchenSink example', } def setup(targets): '''Setup example for translation, MUST call util.setup(targets).''' util.setup(targets) def translate(): '''Translate example, MUST call util.translate().''' util.tr...
{ "content_hash": "343b56c4215a2e9f149dd2d14dbbf5ac", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 77, "avg_line_length": 20.591836734693878, "alnum_prop": 0.599603567888999, "repo_name": "gpitel/pyjs", "id": "ca52e4312e82561b8ddd15009ff1833c8b0b4524", "size": "1057", ...
import json from tempest.common.rest_client import RestClient class ExtensionsClientJSON(RestClient): def __init__(self, config, username, password, auth_url, tenant_name=None): super(ExtensionsClientJSON, self).__init__(config, username, password, auth...
{ "content_hash": "20b46d47073a7e571cab933822fe2778", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 79, "avg_line_length": 32.94117647058823, "alnum_prop": 0.6160714285714286, "repo_name": "BeenzSyed/tempest", "id": "bdd5f1e76ca0533da1318b3376a27535b682ef2d", "size": "119...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2013-2017 Alex Forencich Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
{ "content_hash": "719053daf6d83f61f4ade4540106b1cb", "timestamp": "", "source": "github", "line_count": 669, "max_line_length": 119, "avg_line_length": 38.04633781763827, "alnum_prop": 0.5929359996856952, "repo_name": "python-ivi/python-ivi", "id": "1782463313a153cc24ceda2964daab09102a7996", "size"...
from django.conf import settings from django.contrib.auth.decorators import user_passes_test from django.contrib.auth.models import Group, Permission from rest_framework import permissions SURVEY_ADMINS = "Survey Admins" # Name of the group containing survey admins. def get_or_create_survey_admins_group(apps=None,...
{ "content_hash": "21a17974d5603455b98de59024592460", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 79, "avg_line_length": 34.910714285714285, "alnum_prop": 0.6997442455242967, "repo_name": "tndatacommons/tndata_backend", "id": "07da117c20f22f26475cb997fbd9b9c4bcbdd242", ...
class IScalable: def __init__(self): pass def scale(self, scale): # type: (float) -> None pass
{ "content_hash": "d632332fb1d4a540e6c8f3bc2c323f70", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 31, "avg_line_length": 16.125, "alnum_prop": 0.4883720930232558, "repo_name": "Diralf/evolution", "id": "a18e650a74a349f5449fe552bfe191129ef4d22f", "size": "131", "binary"...
from setuptools import setup setup(name='boostaroota', version='1.2.0.b', description='A Fast XGBoost Feature Selection Algorithm', url='http://github.com/chasedehan/BoostARoota', author='Chase DeHan', author_email='chasedehan@yahoo.com', license='MIT', packages=['boostaroota'...
{ "content_hash": "f3ea215fd43222a59665956af3341944", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 69, "avg_line_length": 35.63636363636363, "alnum_prop": 0.6632653061224489, "repo_name": "chasedehan/BoostARoota", "id": "3a92bc68a63742a6e4accdf8c2271f680d60d4b3", "size":...
"""Contains a factory for building various models.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import tensorflow as tf from nets import resnet_v1 from nets import resnet_v2 slim = tf.contrib.slim networks_map = {'resnet_v1_50': r...
{ "content_hash": "4c24ab230bdf964cff4342db641f5ec7", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 41.8875, "alnum_prop": 0.6454789615040286, "repo_name": "google-research/morph-net", "id": "cd5d135dff699f47600eaa762daf5b3c188bbaa1", "size": "4036"...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('benchmark', '0021_benchmarkdefinitionentry_max_benchmark_date'), ] operations = [ migrations.AlterField( model_name='ben...
{ "content_hash": "2b3cf7876d8b83df72de9ea9987319d0", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 120, "avg_line_length": 27.42105263157895, "alnum_prop": 0.6564299424184261, "repo_name": "imvu/bluesteel", "id": "a6326e6b70c8ba6321904cad7d37afdd3c09e63f", "size": "594",...
from djangoproject.settings import * DEBUG=True TEMPLATE_DEBUG=DEBUG
{ "content_hash": "12c786ecd31f7574b8addbded9883325", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 36, "avg_line_length": 17.5, "alnum_prop": 0.8285714285714286, "repo_name": "lemonad/my-django-skeleton", "id": "87a7e2c3a358e3b5bfc6bfba15822c30b265422e", "size": "71", "...
"""Runs the Web Search benchmark of Cloudsuite. More info: http://cloudsuite.ch/websearch/ """ import re from perfkitbenchmarker import configs from perfkitbenchmarker import flags from perfkitbenchmarker import sample from perfkitbenchmarker import vm_util from perfkitbenchmarker.linux_packages import docker FLAGS...
{ "content_hash": "5cdd910cb8303a8bfdcbb40419683d05", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 79, "avg_line_length": 33.82208588957055, "alnum_prop": 0.6428441864683475, "repo_name": "xiaolihope/PerfKitBenchmarker-1.7.0", "id": "5690a888e1fef01e7ff44b44a481be07ba6405...
""" Django settings for backend project. Generated by 'django-admin startproject' using Django 1.8.9. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
{ "content_hash": "16d77215488e0102b9115a55a4ecc7f8", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 71, "avg_line_length": 25.617886178861788, "alnum_prop": 0.6601079022532529, "repo_name": "Glucksistemi/EGS-DSM", "id": "5341587a7017af7ffd69965d1244258196176a6b", "size":...
""" crypto.keyedHash.pbkdf2 Password Based Key Derivation Function 2 References: RFC2898, B. Kaliski, September 2000, PKCS #5 This function is used for IEEE 802.11/WPA passphrase to key hashing Copyright (c) 2002 by Paul A. Lambert Read LICENSE.txt for license information. """ from crypto.keyedHash.hmacHash im...
{ "content_hash": "f91eca3a20a4f1ffd8ff4eced97c1e11", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 95, "avg_line_length": 35.906976744186046, "alnum_prop": 0.7266839378238342, "repo_name": "bubbalinear/smartmeshsdk", "id": "87c9fd71b9a56a34e37cb28d46a486fc13bfcea4", "siz...
from Kamaelia.File.Writing import SimpleFileWriter from Kamaelia.Chassis.Graphline import Graphline from Kamaelia.Chassis.Carousel import Carousel from Axon.Component import component import IRCClient import formatters from IRCClient import SimpleIRCClientPrefab import time, os class SimpleReloader(component): Out...
{ "content_hash": "e03356891db6908f1658c2212799b908", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 88, "avg_line_length": 40.983870967741936, "alnum_prop": 0.5600157418339237, "repo_name": "sparkslabs/kamaelia_", "id": "4ad2aaf5c2b4796bcd1de17ec084753b03184f83", "size": ...
"""The tests for local file sensor platform.""" import pytest from homeassistant.const import STATE_UNKNOWN from homeassistant.setup import async_setup_component from tests.async_mock import Mock, mock_open, patch from tests.common import mock_registry @pytest.fixture def entity_reg(hass): """Return an empty, l...
{ "content_hash": "eb35dbe054aad9c1f055e088bf662f46", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 88, "avg_line_length": 34.35526315789474, "alnum_prop": 0.6464955955572578, "repo_name": "soldag/home-assistant", "id": "31370334f92118102ecae53734d5ea24aa293e5a", "size": ...
from django.conf import settings import codelabs.config as config def configurations(request): return { 'DISCOURSE_FLAG': config.DISCOURSE_FLAG, 'DISCOURSE_URL' : config.DISCOURSE_URL }
{ "content_hash": "c9b98b94612e71b75c4402d498cfdb80", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 52, "avg_line_length": 28.375, "alnum_prop": 0.6519823788546255, "repo_name": "rachitnaruzu/codearena", "id": "22c22d527b81e499a5e8b7a7fe96ce2cb64961ab", "size": "227", "b...
"""A matplotlib backend for publishing figures via display_data""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import matplotlib from matplotlib.backends.backend_agg import new_figure_manager, FigureCanvasAgg # analysis: i...
{ "content_hash": "b186cfdd8ceeec72efced9ac0a07b87a", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 98, "avg_line_length": 35.274647887323944, "alnum_prop": 0.6506288680375324, "repo_name": "initNirvana/Easyphotos", "id": "b45af5f2e5087cacfcd19dc139bdaf9091a7b095", "size...
from conans import ConanFile from llvmpackage import * from llvmcomponentpackage import * from llvmmodulepackage import * class LLVMCommon(ConanFile): name = 'llvm-common' version = '0.0.0' url = 'http://gitlab.com/henning/clang-conan-packages' license = 'MIT' description = 'Common package recipes...
{ "content_hash": "bf0b0b1280abae441589d9cf7937128c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 27.76923076923077, "alnum_prop": 0.7119113573407202, "repo_name": "pierricgimmig/orbitprofiler", "id": "a949446405a706175931e9aaaf886c333d74cda5", "s...
"Tests for preview/save views." from __future__ import unicode_literals import json from datetime import date from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from . import DaysLog from .base import Scribbl...
{ "content_hash": "1435bdcf131a10fb0e888390f91e8bc4", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 91, "avg_line_length": 38.868020304568525, "alnum_prop": 0.6330808410604676, "repo_name": "imposeren/django-scribbler", "id": "91466c5128a68124cbd4acf077cb34ae9ad2305d", "...
from datetime import datetime, timedelta, timezone import graphene from django.urls import reverse from freezegun import freeze_time from .....account.error_codes import AccountErrorCode from .....core.jwt import ( JWT_ACCESS_TYPE, JWT_REFRESH_TYPE, create_refresh_token, jwt_decode, ) from .....core.u...
{ "content_hash": "daeeec432bc9f6764acf02b45b3b6c41", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 86, "avg_line_length": 40.30493273542601, "alnum_prop": 0.6838006230529595, "repo_name": "mociepka/saleor", "id": "784a560aa7c60242253a49bf218792ac90319561", "size": "8988...
''' Move words around @author Justin Hileman <http://justinhileman.com> ''' import cp_actions as cp def act(controller, bundle, options): context = cp.get_context(controller) line_ending = cp.get_line_ending(context) direction = cp.get_option(options, 'direction', 'right') line_text, line_ra...
{ "content_hash": "168220caf4f99e2ea8827438d3d49f26", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 142, "avg_line_length": 40.054545454545455, "alnum_prop": 0.6300499319110304, "repo_name": "bobthecow/ManipulateCoda", "id": "7727996c1b81f3d269c59b50bcbc8a097d0d8c55", "si...
import os import shutil import glob for e in glob.glob(r'delivery/include/*.h'): os.remove(e) if os.path.exists(r'delivery/crypt.lib'): os.remove(r'delivery/crypt.lib') for h in glob.glob(r'crypt/*.h'): shutil.copy(h, r'delivery/include') shutil.copy(r'x64/Release/crypt.lib', r'delivery')
{ "content_hash": "da623eb96e0fd56efa3719af857c9a69", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 50, "avg_line_length": 21.428571428571427, "alnum_prop": 0.7066666666666667, "repo_name": "KaiSta/scrates", "id": "cf87c5a6bc17ad37f52d0be297f4bca7e78b2cfd", "size": "300",...
"""Support for interacting with Linode nodes.""" import logging import voluptuous as vol from homeassistant.components.linode import ( ATTR_CREATED, ATTR_IPV4_ADDRESS, ATTR_IPV6_ADDRESS, ATTR_MEMORY, ATTR_NODE_ID, ATTR_NODE_NAME, ATTR_REGION, ATTR_VCPUS, CONF_NODES, DATA_LINODE) from homeassistant.compone...
{ "content_hash": "56533ab74e8bd429513d4b3edcc32357", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 73, "avg_line_length": 30.333333333333332, "alnum_prop": 0.5885989010989011, "repo_name": "nugget/home-assistant", "id": "0cab2f4d0f25fa26b1108ec768960cd05c7e79f9", "size":...
from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from product_spiders.items import Product, ProductLoaderWithNameStrip as ProductLoader class Huntingl...
{ "content_hash": "9b1eb44217cc2971593df0064fcb0481", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 101, "avg_line_length": 44.666666666666664, "alnum_prop": 0.662046908315565, "repo_name": "0--key/lib", "id": "b85808b5ed7dda1546104870b00ff52f31167aa9", "size": "1876", ...
from rdkit import Geometry from rdkit.Chem.FeatMaps import FeatMaps, FeatMapPoint import re """ ScoreMode=All DirScoreMode=Ignore BeginParams family=Aromatic radius=2.5 width=1.0 profile=Gaussian family=Acceptor radius=1.5 EndParams # optional BeginPoints family=Acceptor pos=(1.0, 0.0, 5.0) weight=1.25 dir=(1,...
{ "content_hash": "3a6e55a7ce50a2bcacc762f30ad95d0a", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 100, "avg_line_length": 27.85635359116022, "alnum_prop": 0.5509718365727886, "repo_name": "rvianello/rdkit", "id": "12db430bbc7acdeb96231ea65d5ada02cec0c2dc", "size": "530...
"""Tests for soft round.""" from absl.testing import parameterized import tensorflow as tf from tensorflow_compression.python.ops import round_ops class SoftRoundTest(tf.test.TestCase, parameterized.TestCase): def test_soft_round_small_alpha_is_identity(self): x = tf.linspace(-2., 2., 50) y = round_ops.s...
{ "content_hash": "0db0d49fdbd5b60b2865385dcbb7adde", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 76, "avg_line_length": 40.44155844155844, "alnum_prop": 0.6657032755298651, "repo_name": "tensorflow/compression", "id": "6e9ad7ae3c8393047da725a7d9e23868e3053372", "size":...
from __future__ import absolute_import, print_function import os import glob import numpy as np import six from ..utils.ioutils import download, extract class TColor128(object): """`TColor128 <http://www.dabi.temple.edu/~hbling/data/TColor-128/TColor-128.html>`_ Dataset. Publication: ``Encoding col...
{ "content_hash": "784fbf897dba721149c7f3a5f386ad48", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 97, "avg_line_length": 35.40816326530612, "alnum_prop": 0.5636887608069164, "repo_name": "got-10k/toolkit", "id": "452b59bd34ddf00e8195ed7e1b8ff77c90efcd2d", "size": "3470"...
from __future__ import print_function import shutil import sys import os import errno import string import re import traceback import time import datetime import copy import glob from math import ceil, trunc import collections import subprocess from testglobals import * from testutil import * if config.use_threads: ...
{ "content_hash": "b886eedaaba8c7431a0f81996c7714c2", "timestamp": "", "source": "github", "line_count": 2276, "max_line_length": 187, "avg_line_length": 33.54701230228471, "alnum_prop": 0.5714248294107631, "repo_name": "fmthoma/ghc", "id": "98a75e011e566eaa6a31ac6ac145ed286308910a", "size": "76382"...
__author__ = 'lothilius' import sys import time from Wordlist import * from Permutations import * def main(): while True: try: inputFileName = input("Enter full path of scrambled word list:") f = open(inputFileName) break except FileNotFoundError: p...
{ "content_hash": "bdbbef7a8c146d8b099adec58f2e29f1", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 90, "avg_line_length": 33.20454545454545, "alnum_prop": 0.6197809719370294, "repo_name": "Lothilius/python-jumble", "id": "305815020b40b8d242bd45d6782f097dee28046e", "size"...
from datetime import datetime from airflow.decorators import task from airflow.models import DAG from airflow.providers.microsoft.azure.hooks.fileshare import AzureFileShareHook NAME = 'myfileshare' DIRECTORY = "mydirectory" @task def create_fileshare(): """Create a fileshare with directory""" hook = AzureF...
{ "content_hash": "aec3c49dd01de1707ee8cd38af74ac11", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 80, "avg_line_length": 24.457142857142856, "alnum_prop": 0.7184579439252337, "repo_name": "lyft/incubator-airflow", "id": "d50db3cb040273936e7766f588d783ac4a61b2f4", "size"...
from django.contrib.admin import ModelAdmin, TabularInline from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.tests import AdminSeleniumTestCase from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.test import Requ...
{ "content_hash": "9cbe9e675b9752a9e88b5208e12a05ce", "timestamp": "", "source": "github", "line_count": 979, "max_line_length": 117, "avg_line_length": 48.36465781409601, "alnum_prop": 0.641238463325519, "repo_name": "timgraham/django", "id": "0a1ab5acbbb4f0a29fc4e9d28c362373d2806240", "size": "473...
default_path = "../src/" import sys sys.path.insert(0, default_path) import unittest from helpers.helper_evaluation_tuning_tester import GetActual_FromIndex import logging logging.basicConfig(format='%(message)s',level=logging.WARN) class _Config: DEBUG = True SKIP_SLOW_TESTS = True SKIP_CONTROL_TESTS = F...
{ "content_hash": "a11354b924319c658641079300d99190", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 142, "avg_line_length": 46.80672268907563, "alnum_prop": 0.670197486535009, "repo_name": "LightStage-Aber/LightStage-Repo", "id": "98bbea94d8942600d58a59d8df4d156096373e34",...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, NetworkThread from test_framework.bricktools import create_coinbase, create_brick, add_witness_commitment from test_framework.script import CScript from io import BytesIO im...
{ "content_hash": "3677f3f3c884eabe1f41f86935a2c0d3", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 137, "avg_line_length": 44.291666666666664, "alnum_prop": 0.6578864847914707, "repo_name": "magacoin/magacoin", "id": "2603fbf15cc6e1c34e3785ac4866543713185ca2", "size": "...
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * walltypes = UnwrapElement(IN[0]) booleans = list() for item in walltypes: try: wallfunction = item.get_Parameter(BuiltInParameter.FUNCTION_PARAM).AsInteger() if wallfunction == 1: booleans.append(True) else: booleans.append(False) e...
{ "content_hash": "5ba6e350fd1b4051f02cc0676a691ee6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 80, "avg_line_length": 21.529411764705884, "alnum_prop": 0.7459016393442623, "repo_name": "andydandy74/ClockworkForDynamo", "id": "85c8edec937458d1f7de48895a687b4a92ef86bc", ...
import sqlalchemy import config, constants, util def textclause_repr(self): return 'text(%r)' % self.text def table_repr(self): data = { 'name': self.name, 'columns': constants.NLTAB.join([repr(cl) for cl in self.columns]), 'constraints': constants.NLTAB.join( [repr(cn) for...
{ "content_hash": "653b2aaf27057e2f8fd1f6e6ff002b90", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 80, "avg_line_length": 34.944954128440365, "alnum_prop": 0.5893935416119717, "repo_name": "DarioGT/SqlAutoCode-", "id": "54a27d129f360b782c668de6fbde1b14957d6b58", "size":...
import sys from difflib import SequenceMatcher from functools import partial if sys.version_info[0] == 2: # from six.py range = xrange text_type = unicode binary_type = str else: binary_type = bytes text_type = str # CORE __version__ = '1' def ratio(a, b): """ similarity ratio b...
{ "content_hash": "daa40d1129a8a5fc116119ae01b54113", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 75, "avg_line_length": 22.982608695652175, "alnum_prop": 0.6027241770715096, "repo_name": "medecau/fuzzywuzzy", "id": "29d9a081cc6070ea6e2098e409311d3ea345984a", "size": "...
from matplotlib import use, cm use('TkAgg') import numpy as np import scipy.io import scipy.misc import matplotlib.pyplot as plt from findClosestCentroids import findClosestCentroids from computeCentroids import computeCentroids from runkMeans import runkMeans from kMeansInitCentroids import kMeansInitCentroids from s...
{ "content_hash": "8b94be39527c6548adff7b39d85e79bc", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 75, "avg_line_length": 31.670886075949365, "alnum_prop": 0.7142286171063149, "repo_name": "jrbadiabo/Coursera-Stanford-ML-Class", "id": "803f45ec24b67e8b96bd46a03591a307b7a0...
from __future__ import unicode_literals import json from abc import ABCMeta from collections import OrderedDict from functools import wraps import sys from os.path import dirname, abspath # just until ransom becomes its own package sys.path.append(dirname(dirname(abspath(__file__)))) import ransom from params impor...
{ "content_hash": "0ac17bb1637625615dd7229d538a08bc", "timestamp": "", "source": "github", "line_count": 791, "max_line_length": 81, "avg_line_length": 31.852085967130215, "alnum_prop": 0.580115102202818, "repo_name": "mahmoud/wapiti", "id": "9915939597a35331e613b5540234bb19d9c0a6b6", "size": "25219...
def activity_post_save_doc_template_values(url_root): """ Show documentation about activityPostSave """ required_query_parameter_list = [ { 'name': 'voter_device_id', 'value': 'string', # boolean, integer, long, string 'description': 'An 88 ch...
{ "content_hash": "7ef26c5d29f0fb634f7ac3689a621268", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 115, "avg_line_length": 42.11904761904762, "alnum_prop": 0.4937817976257773, "repo_name": "wevote/WeVoteServer", "id": "5d9504a433e6c9856397920b81219be894f21ee5", "size": "...
import os import re import sys from setuptools import find_packages, setup from cx_Freeze import setup, Executable # noqa re-import setup from wsgidav import __version__ # Check for Windows MSI Setup if "bdist_msi" not in sys.argv: # or len(sys.argv) != 2: raise RuntimeError( "This setup.py variant is ...
{ "content_hash": "f5e0471aa460b332899cbdb2acf79481", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 88, "avg_line_length": 33.30769230769231, "alnum_prop": 0.6310623556581986, "repo_name": "mar10/wsgidav", "id": "1e0baeb198fe2b968e973aed5d0e9de2b45dd2e9", "size": "5287",...
from __future__ import unicode_literals import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone import user.models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0008_alter_user_u...
{ "content_hash": "d3e17aac01ba83112bcba5a6f8bc1645", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 329, "avg_line_length": 68.05454545454545, "alnum_prop": 0.6369222548757681, "repo_name": "lsdlab/awesome_coffice", "id": "a567fa1fc80e0c6fea5a798b3ddb673d87258d22", "size"...
""" Payload Voice ARI """ import functools from ari import client from ari import event from fysom import Fysom from oslo.config import cfg from payloadvoice.openstack.common import log from payloadvoice.openstack.common import uuidutils ASTERISK_OPTS = [ cfg.StrOpt( 'uri', default='http://127.0.0.1:808...
{ "content_hash": "be29e848a4aabbf50b06bf8201447885", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 76, "avg_line_length": 32.275510204081634, "alnum_prop": 0.6380018969332911, "repo_name": "kickstandproject/payload-voice", "id": "c02b45b67b7629d7d62a0731792d168da595a0a0", ...
"""Support for RESTful binary sensors.""" import voluptuous as vol from homeassistant.components.binary_sensor import ( DOMAIN as BINARY_SENSOR_DOMAIN, PLATFORM_SCHEMA, BinarySensorEntity, ) from homeassistant.const import ( CONF_DEVICE_CLASS, CONF_FORCE_UPDATE, CONF_NAME, CONF_RESOURCE, ...
{ "content_hash": "8003e7102e4296d41791674d93947da5", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 86, "avg_line_length": 29.550847457627118, "alnum_prop": 0.6154287353025524, "repo_name": "sander76/home-assistant", "id": "a90c5bd7c770600cf6cee5787c2a4b2d6b12029c", "siz...
import pycompiler import unittest import re # Copied from deps. TODO: Refactor to avoid copy+paste def striptags(x, v): tags = v.split(",") subbed = x for tag in tags: subbed = re.sub(r'<%s.*?>.*?</%s>' % (tag, tag), '', subbed) subbed = re.sub(r'<%s.*?/>' % tag, '', subbed) return subb...
{ "content_hash": "dc2b0ddf8715b08186657b58ef64b178", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 87, "avg_line_length": 43.53333333333333, "alnum_prop": 0.6045176110260337, "repo_name": "buffis/fetch", "id": "84c1ee650fe16c81a6c07e7f1d59b07562207f23", "size": "5224", ...
"""Provides device automations for control of device.""" from __future__ import annotations from typing import Any import voluptuous as vol from homeassistant.components.automation import ( AutomationActionType, AutomationTriggerInfo, ) from homeassistant.components.device_automation import DEVICE_TRIGGER_BA...
{ "content_hash": "fab0d36b0c5375dd8b66c84da97402b3", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 30.342105263157894, "alnum_prop": 0.6556808326105811, "repo_name": "Danielhiversen/home-assistant", "id": "09784dae63fed03383e785f32fe755977a234e15", ...
from __future__ import print_function from twisted.spread import pb from twisted.internet import reactor class Two(pb.Referenceable): def remote_print(self, arg): print("Two.print() called with", arg) def main(): two = Two() factory = pb.PBClientFactory() reactor.connectTCP("localhost", 8800,...
{ "content_hash": "7dece4682ce03636a50769c6bf2a6878", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 25.08695652173913, "alnum_prop": 0.6707105719237435, "repo_name": "EricMuller/mywebmarks-backend", "id": "f4104268989f93581520a739f604f2d659cb2124", ...
import unittest import multiprocessing import time import server, client class MainTest (unittest.TestCase): """ This test runs the server in a shell subprocess and after a second it runs the client in another shell subprocess. Afterwards, it kills both processes and run assertions on the output. T...
{ "content_hash": "c054884ad84d72f5732d24f69a271a1a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 161, "avg_line_length": 35.15384615384615, "alnum_prop": 0.6334792122538293, "repo_name": "ducin/twisted-echo-server", "id": "22b8f3d56051cc671c0e9d69604e81591a15c9ba", "si...