id
stringlengths
3
8
content
stringlengths
100
981k
11562591
import unittest from pyvalidator.is_ethereum_address import is_ethereum_address from . import print_test_ok class TestIsEthereumAddress(unittest.TestCase): def test_valid_ethereum_address(self): for i in [ '0x0000000000000000000000000000000000000001', '0x683E07492fBDfDA84457C1654...
11562635
import io import numpy as np from PIL import Image from ppadb.client import Client from src.data.constants import SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT class Screen: def __init__(self): self.client = Client(host='127.0.0.1', port=5037) self.device = self.client.device('emulator-5554') def tak...
11562651
from datetime import date, datetime from typing import Union def convert_to_datetime(d: Union[datetime, date]) -> datetime: if isinstance(d, datetime): return d return datetime.combine(d, datetime.min.time())
11562663
import glob import importlib import os import Utils __all__ = ['cases'] cases = {} for __file in glob.glob(os.path.join(os.path.dirname(__file__), '*.py')): __name = os.path.basename(__file) if not __name.startswith('_'): __module = importlib.import_module(__name__ + '.' + __name[:-3]) __mod...
11562720
import numpy as np import sophus as sp import matplotlib.pyplot as plt DEFAULT_AXIS_LENGTH = 0.1 class SceneViz: def __init__(self): self.fig = plt.figure() self.ax = plt.axes(projection="3d") self.max = np.zeros(3) self.min = np.zeros(3) def _update_limits(self, x): ...
11562723
import json from django.conf import settings from django.contrib.auth.models import Permission from django.core.exceptions import PermissionDenied from django.http import JsonResponse from django.shortcuts import redirect from django.urls import path, include, reverse from django.utils.html import format_html, escapej...
11562757
import sys sys.path.append('../') from ImageProcessing.hog import face_center as hog_face_center def face_center(filename, model): return hog_face_center(filename, model)
11562782
from toee import * import char_class_utils ################################################### def GetConditionName(): return "Shadowdancer" def GetCategory(): return "Core 3.5 Ed Prestige Classes" def GetClassDefinitionFlags(): return CDF_CoreClass def GetClassHelpTopic(): return "TAG_SHADOWDANCERS" classEnu...
11562789
import tensorflow as tf import numpy as np import random from tensorflow.contrib import rnn from tensorflow.python.ops import rnn_cell_impl from ops.ops import * def highway(input_, dim, num_layer=2): size = dim for i in range(num_layer): with tf.variable_scope("highway-%d" % i): W_p = tf...
11562841
from .bases import BaseJsonPage, BaseJsonBlock from .mixins import AIslandGetThreadId import re __all__ = ['AdnmbBlock', 'AdnmbPage'] _request_info = { 'cdn_host': 'http://h-adnmb-com.n1.yun.tf:8999/Public/Upload', 'headers': { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/we...
11562848
class RebarBendData(object,IDisposable): """ The values in this class provide a summary of information taken from the RebarBarType,RebarHookType,and RebarStyle. RebarBendData(barType: RebarBarType,hookType0: RebarHookType,hookType1: RebarHookType,style: RebarStyle,hookOrient0: RebarHookOrientation,hookOrie...
11562856
import renderdoc as rd import rdtest class D3D12_Empty_Capture(rdtest.TestCase): demos_test_name = 'D3D12_Empty_Capture' demos_frame_cap = 100 def check_capture(self): draws = self.controller.GetDrawcalls() self.check(len(draws) == 1) self.check('End' in draws[0].name) se...
11562874
from summary.models import Summary def build_summary_data(summary, paper_id, previous_summary_id): return { 'summary': summary, 'summary_plain_text': summary, 'paper': paper_id, 'previousSummaryId': previous_summary_id, } def create_summary(summary, proposed_by, paper_id): ...
11562885
def onCook(dat): mod.opDefinition.buildTypeTable( dat, supportedTypes=dat.inputs[0], inputDefs=dat.inputs[1])
11562894
from django.http import JsonResponse import json from movies.utils import get_token_data from ..models import Rating, Movie def rate(request): # if POST, save or update rating if request.method == 'POST': body = json.loads(request.body) movie_id = body['id'] rating = int(body['rating...
11562902
from fabric.api import run from fabric.api import task from fabric.contrib import files from fabric.operations import get, put @task def backup(): get(remote_path="/etc/dnsmasq.conf", local_path="backup/dns/dnsmasq.conf") get(remote_path="/etc/hosts", local_path="backup/dns/hosts")
11562913
from core.base_model import AcousticModel from keras.layers import Dense,Activation,Dropout,Input,Add from core.ctc_function import CTC_Batch_Cost from keras import Model import os from util.mapmap import PinyinMapper from util.reader import VoiceDatasetList,VoiceLoader from feature.mel_feature import MelFeature5 clas...
11562978
import argparse import logging import os logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)-8s %(message)s') def run(cmd: str): ret = os.system(cmd) if ret != 0: raise RuntimeError("running '{}' returned non-zero status: {}".format(cmd, ret)) def clean(host: str, directory: ...
11563012
import os.path as osp from glob import glob import torch from torch_geometric.data import InMemoryDataset, extract_zip from torch_geometric.read import read_ply class CoMA(InMemoryDataset): url = 'https://coma.is.tue.mpg.de/' categories = [ 'bareteeth', 'cheeks_in', 'eyebrow', ...
11563027
from htmlgen.attribute import html_attribute from htmlgen.element import Element class Link(Element): """An HTML inline link (<a>) element. >>> link = Link("http://www.example.com/", "caption") >>> link.append(", more") >>> link.url 'http://www.example.com/' >>> str(link) ...
11563052
import logging from io import BytesIO import numpy as np from PIL import Image, ImageCms from PIL.ImageCms import ( applyTransform, getProfileDescription, getProfileName, ImageCmsProfile, ImageCmsTransform, isIntentSupported, ) logger = logging.getLogger(__name__) class ColorManager(object)...
11563069
import argparse import cv2 import numpy as np import requests from v2_plugin.runner.utils import type_serializer def http_request_test(port: int): image: np.ndarray = cv2.imread('../../tests/test1.jpg') data = {'raw_input': image.tolist(), 'dtype': type_serializer(image.dtype)} response = requests.pos...
11563070
import numpy as np import unittest from spyne import Tensor, Constant from spyne.operations import (TensorAddition, TensorSubtraction, TensorMultiply, TensorElemMultiply, TensorReLU, TensorTanh, TensorSigmoid, TensorSoftmax, TensorSum, TensorSquared, TensorNegLog, ...
11563110
from nevada.Common.Connector import * from typing import List import jsonpickle import json class CreateAdExtensionObject: def __init__(self, pcChannelId, mobileChannelId, ownerId, type, userLock, schedule=None): self.pcChannelId = pcChannelId self.mobileChannelId = mobileChannelId self.own...
11563117
from web3 import Web3 sample_eth_address = 562046206989085878832492993516240920558397288279 def str_eth(numeric_eth_address): return Web3.toChecksumAddress(hex(int(numeric_eth_address)))
11563141
import os import numpy as np import pandas as pd import hydra from src.classifier.data_processing.annotate.metrics import ( fleiss_kappa, get_all_pairwise_kappas, ) def create_combined_df(data_dir): data_dir = hydra.utils.to_absolute_path(data_dir) annotations = pd.DataFrame() annotator_names = ...
11563143
import sys import torch from torch import cuda from transformers import * from torch import nn from torch.autograd import Variable from util.holder import * from util.util import * class BertEncoder(torch.nn.Module): def __init__(self, opt, shared): super(BertEncoder, self).__init__() self.opt = opt self.shared...
11563160
import pytest from vectorhub.encoders.text.tfhub import USE2Vec, USEMulti2Vec, USELite2Vec from ....test_utils import assert_encoder_works def test_use_encode(): """ Testing for labse encode """ encoder = USE2Vec() assert_encoder_works(encoder, vector_length=512, data_type='text') def test_use_mul...
11563161
import pytest import numpy as np import tensorflow as tf import jax import torch from tensornetwork.backends import backend_factory #pylint: disable=line-too-long from tensornetwork.matrixproductstates.mpo import (FiniteMPO, BaseMPO, ...
11563185
from typing import List, Tuple, Dict from promise import Promise from promise.dataloader import DataLoader from gtmcore.environment.utils import get_package_manager from gtmcore.environment.packagemanager import PackageMetadata from gtmcore.labbook import LabBook from gtmcore.logging import LMLogger logger = LMLogger...
11563198
class Solution: def minTransfers(self, transactions: List[List[int]]) -> int: def remove_one_zero_clique(non_zero): n = len(non_zero) q = collections.deque() # q store ([index set], sum of set) q.append(([0], non_zero[0])) min_zero_set ...
11563313
import json import logging import pycurl import re import requests import socket import sys import unittest from StringIO import StringIO class EtcdError(BaseException): #Generic etcd error pass class Etcd(object): def __init__(self, logger, server=None): if server: self.server = server else: ...
11563326
import unicodecsv import matplotlib.pyplot as plt import numpy from collections import defaultdict from scipy.stats import chisquare, ttest_ind def n_utterances_counts(f_name, eou='__eou__'): n_utterances = [] reader = unicodecsv.reader(open(f_name)) next(reader) # skip header for line in reader: ...
11563347
import pytest from rest_framework import status from usaspending_api.search.tests.data.utilities import setup_elasticsearch_test url = "/api/v2/agency/{toptier_code}/sub_agency/count/{filter}" @pytest.mark.django_db def test_all_categories(client, monkeypatch, sub_agency_data_1, elasticsearch_transaction_index): ...
11563355
from builtins import property as _property, tuple as _tuple from operator import itemgetter as _itemgetter from collections import OrderedDict class TIPO(tuple): 'TIPO(VALOR,)' __slots__ = () _fields = ('VALOR',) def __new__(_cls, VALOR,): 'Create new instance of TIPO(VALOR,)' retu...
11563367
import json import os import shutil from multiprocessing import Pool import pandas as pd import covid_data_api import covid_data_bed import covid_data_briefing import covid_data_dash import covid_data_situation import covid_data_testing import covid_data_tweets import covid_data_vac from utils_pandas import add_data ...
11563373
from django.conf.urls import url from . import index,yb urlpatterns = [ url(r'^$', index.index), url(r'^login$', yb.login), url(r'^is_login$', yb.is_login), url(r'^rush_yb$', yb.rush_yb), url(r'^captcha$', yb.captcha), url(r'^wangxin_jingyan$', yb.wangxin_jingyan), ]
11563382
routes = [ ('Binance Futures', 'SKL-USDT', '5m', 'Ott2butKAMA', 'WL1T,O'), ('Binance Futures', 'RUNE-USDT', '5m', 'Ott2butKAMA', 'WL1T,O'), ('Binance Futures', 'AVAX-USDT', '5m', 'Ott2butKAMA', 'WL1T,O'), ('Binance Futures', 'ZEN-USDT', '5m', 'Ott2butKAMA', 'WL1T,O'), # cd ('Binance Futures', 'ONE-...
11563411
from setuptools import setup, find_packages with open('README.rst') as f: readme = f.read() setup( name='arlpy', version='1.7.0', description='ARL Python Tools', long_description=readme, author='<NAME>', author_email='<EMAIL>', url='https://github.com/org-arl/arlpy', license='BSD (...
11563442
import ftplib import gzip import os.path import requests import responses import shutil import unittest import urllib3 from contextlib import closing from urllib.request import urlopen from pkt_kg.utils import * class TestDataUtilsDownloading(unittest.TestCase): """Class to test the downloading methods from the...
11563470
from sqlalchemy import Column, Integer, String, Boolean from Agent import Base, Session class APIVersion(Base): """description of class""" __tablename__ = 'vw_apiversions' Id = Column(Integer, primary_key = True) LunaAPIId = Column(Integer) VersionName = Column(String) AMLWorkspaceId = Co...
11563491
from UQpy.Surrogates.PCE.ErrorEstimation import ErrorEstimation from UQpy.Surrogates.PCE.MomentEstimation import MomentEstimation from UQpy.Surrogates.PCE.PCE import PCE from UQpy.Surrogates.PCE.Polynomials import Polynomials from UQpy.Surrogates.PCE.PolyChaosLasso import PolyChaosLasso from UQpy.Surrogates.PCE.PolyCha...
11563497
from openprocurement.tender.core.procedure.utils import is_item_owner from openprocurement.api.utils import raise_operation_error from openprocurement.api.validation import OPERATIONS def validate_download_bid_document(request, **_): if request.params.get("download"): document = request.validated["documen...
11563501
import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag import protocols import ztag.test class FtpZxfs(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER port = None version_re = re.compile("^220-ZXFS Ftp Server v(\d+\.\d+)", re.IG...
11563506
import pytest from aiohttp_admin2.mappers import Mapper from aiohttp_admin2.mappers import fields class StringMapper(Mapper): field = fields.StringField() class LongStringFieldMapper(Mapper): field = fields.LongStringField() @pytest.mark.parametrize('mapper_cls', [StringMapper, LongStringFieldMapper]) de...
11563511
import os import sys sys.path.insert(0, os.path.abspath("../src/djask")) project = "Djask" copyright = "2021, <NAME>" author = "<NAME>" release = "0.5.0" extensions = [ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "sphinx_tabs.tabs", "pallets_sphinx_themes", ] templates_...
11563546
from sympy.abc import s from sympy.physics.control.lti import TransferFunction from sympy.physics.control.control_plots import step_response_plot tf1 = TransferFunction(8*s**2 + 18*s + 32, s**3 + 6*s**2 + 14*s + 24, s) step_response_plot(tf1) # doctest: +SKIP
11563551
from _pagetests import _PageTestsKeywords from _draganddrop import _DragAndDropKeywords from _actionchains import _ActionChainsKeywords __all__ = [ "_PageTestsKeywords", "_DragAndDropKeywords", "_ActionChainsKeywords" ]
11563575
from __future__ import annotations import json import re from subprocess import DEVNULL, PIPE import sys import tempfile from dataclasses import dataclass from datetime import date from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union from anitracker import logger, ffprobe_cmd, ffmpeg_cmd from ani...
11563592
import requests import re import sys import json #目的:web初步配置 + admin用户注册 + admin用户登录并新建dxy用户 #url="http://192.168.56.100" url="http://anchor_cms" requests.adapters.DEFAULT_RETRIES = 5 s = requests.Session() s.keep_alive = False def register_admin(): data0 = { "language": "en_GB", "timezone": "UTC" ...
11563632
from ..moc import MOC, World2ScreenMPL from astropy import units as u from astropy.coordinates import SkyCoord import numpy as np def test_create_from_polygon(): lon = [83.71315909, 83.71378887, 83.71297292, 83.71233919] * u.deg lat = [-5.44217436,-5.44298864, -5.44361751, -5.4428033] * u.deg moc = MOC....
11563646
import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( '/conjurinc/ansible-role-conjur/tests/inventory.tmp').get_hosts('testapp') def test_hosts_file(host): f = host.file('/etc/hosts') assert f.exists assert f.user == 'root' assert f.group == 'root' ...
11563699
import cv2 as cv # Identificar a câmera # Condição de captura # Loop para realizar a captura das nossas imagens em sequência # Capturar um frame # Mostrar o frame capturado
11563747
import argparse import configparser import os from typing import Any, Dict, List, Optional str_settings = ( "pub_key", "secret", "api_version", "api_base", "upload_base", ) bool_settings = ( "verify_api_ssl", "verify_upload_ssl", ) client_setting_mapping = { "pub_key": "public_key", ...
11563761
import pandas as pd import numpy as np from pathlib import Path from shutil import copyfile from src.datasets.tools.transforms import GlobalShift import code class HarmonizationMapping: def __init__(self, config): scans_path = config['dataset']['scans_path'] target_scan_num = config['dataset']['ta...
11563778
import logging import math import os import pickle import cv2 from kawalc1 import settings import pathlib import numpy as np from mengenali.registration import unpickle_keypoints, filter_matches_with_amount, feature_similarity def read_descriptors(reference_form_path): with open(reference_form_path, "rb") as pic...
11563788
import numpy as np import os class WarmingUpCount(object): def __init__(self, size): self.DType = 'i8' self.WUC = np.zeros(size, dtype=self.DType) def decrease(self, indexes): self.WUC[indexes] -= 1 self.WUC[self.WUC < 0] = 0 def extend(self, size, value): start = self.WUC.shape[0] end = size sel...
11563805
from vibora import Vibora, Response from vibora.blueprints import Blueprint from vibora.tests import TestSuite class BlueprintsTestCase(TestSuite): def setUp(self): self.app = Vibora() async def test_simple_sub_domain_expects_match(self): b1 = Blueprint(hosts=['.*']) @b1.route('/') ...
11563826
from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import numpy as np from random import randint import pytest from mmgroup.mm import mm_sub_test_prep_xy from mmgroup import mat24 as m24 from mmgroup.tests.spaces.sparse_mm_space import SparseMmV from mmgroup.t...
11563863
import numpy as np from scipy.spatial.distance import pdist, squareform from scipy.fft import fftn def compute_diversity(pred, *args): if pred.shape[0] == 1: return 0.0 dist = pdist(pred.reshape(pred.shape[0], -1)) diversity = dist.mean().item() return diversity def compute_ade(pred, gt, *ar...
11563897
command = "/usr/bin/sudo /sbin/reboot now" import subprocess process = subprocess.Popen(command.split(), stdout=subprocess.PIPE) output = process.communicate()[0] print output
11563960
import os import re from collections import defaultdict from io import StringIO from unittest import mock import dateutil.tz import pytest from lxml import etree from nikola.nikola import Nikola, Post from nikola.utils import LocaleBorg, TranslatableSetting def test_feed_is_valid(rss_feed_content, rss_schema): ...
11563968
import os, sys inFilePath = sys.argv[1] colIndex = int(sys.argv[2]) hasHeader = sys.argv[3] == "True" inFile = open(inFilePath) if hasHeader: inFile.readline() values = set() for line in inFile: lineItems = line.rstrip("\n").split("\t") values.add(lineItems[colIndex]) print(len(values))
11563972
import re from typing import Optional from typing.re import Match from ..model.configuration import Configuration class Validator: def __init__(self, config: Configuration): self.config = config def check(self, string) -> Optional[Match[str]]: """Check the validation""" return re.matc...
11563978
from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np import paddle.fluid as fluid from paddle.fluid.param_attr import ParamAttr from src.utils.config import cfg __all__ = [ "ResNet", "ResNet18", "ResNet34", "ResNet50", "ResNet1...
11563987
class line2word : def __init__(self, f, gf, ggf, nl , ori): self.f = f self.gf = gf self.ggf = ggf self.nl = nl self.ori = ori self.used = False numberstack = [] list2wordlist = [] def readbacklist (Nl_num...
11563989
from django.db import models as django_models from .. import models class BaseTestModel(django_models.Model): """ An abstract base test model class for test objects that could be related to Images. Contains just one text field """ name = django_models.CharField(max_length=100) def __str__(sel...
11563992
from pathlib import Path from urllib.parse import urlparse from tmclass_solutions.scraping import SimpleWebScraper from tmclass_solutions.scraping import WikipediaArticle EN_BASE_URL = "https://en.wikipedia.org/wiki/" english_articles = [ "Agriculture", "Architecture", "Art", "Biology", "Business", "Cinemato...
11563995
import hashlib import sys def convert_to_utf8(obj): """Encodes object into utf-8 bytes (or 'str' in Py2)""" obj = str(obj) if sys.version_info[0] == 3: obj = bytes(obj, "utf-8") else: obj = u''.join(map(unichr, map(ord, obj))).encode("utf-8") # noqa: F821 in Py3 context return obj...
11564004
from __future__ import print_function, division from PyAstronomy import funcFit as fuf import numpy as np class AtanProfile(fuf.OneDFit): """ A profile based on the arc tangent function. This class implements the following profile: .. math:: f(x) = \\frac{A}{2\\arctan(\\sigma)} \\times \\...
11564079
import argparse import os import shutil import time import math import sys sys.path.append('./') sys.path.append('./src') import copy import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim i...
11564088
from functools import wraps from ..mapping import EpistasisMap from numpy import random class DistributionException(Exception): """""" class SimulatedEpistasisMap(EpistasisMap): """Just like an epistasis map, but with extra methods for setting epistatic coefficients """ def __init__(self, gpm, df=...
11564092
from __future__ import print_function from six.moves import cPickle as pickle import numpy as np import os from scipy.misc import imread import platform import random # 读取文件 def load_pickle(f): version = platform.python_version_tuple() # 取python版本号 if version[0] == "2": return pickle.load(f) # pickl...
11564095
import numpy as np from os.path import join def plot_weight_scatter(harn): """ Draw a scatter plot of the initial weights versus the final weights of a network. Example: >>> import netharn as nh >>> harn = nh.FitHarn.demo() >>> harn.run() Ignore: >>> from netharn....
11564143
import tensorflow as tf from awesome_gans.data import TFDatasets from awesome_gans.utils import initialize, set_seed from awesome_gans.wgan.config import get_config from awesome_gans.wgan.model import WGAN def main(): config = get_config() # initial tf settings initialize() # reproducibility se...
11564151
import sys __version__ = '0.1.2' try: __NLG_SETUP__ except NameError: __NLG_SETUP__ = False if __NLG_SETUP__: sys.stderr.write('Partial import of nlg during the build process.\n') else: from .search import templatize # NOQA: F401 from .grammar import get_gramopts grammar_options = get_gramo...
11564165
from . import base_api_core class LogCenter(base_api_core.Core): def __init__(self, ip_address, port, username, password, secure=False, cert_verify=False, dsm_version=7, debug=True, otp_code=None): super(LogCenter, self).__init__(ip_address, port, username, password, secure, cert_verify, ...
11564168
from django.template import Library from restthumbnails.helpers import get_thumbnail_proxy register = Library() @register.assignment_tag(takes_context=True) def thumbnail(context, source, size, method, extension): if source: return get_thumbnail_proxy(source, size, method, extension) return None
11564169
from typing import List, Union from pysbr.queries.query import Query import pysbr.utils as utils class EventsByEventIds(Query): """Get events from a list of event ids. All event queries return information about matching events including date and time, location, participants, and associated ids. Arg...
11564172
import json import enum import base64 from dataclasses import dataclass, field as dataclass_field, replace from collections import defaultdict from typing import Any, Union, Optional from unittest.mock import MagicMock from aws_lambda_api_event_utils.aws_lambda_api_event_utils import ( FormatVersion, EVENT_FOR...
11564174
argo.temperature.plot.pcolormesh(yincrease=False, cbar_kwargs={'label': 'Temperature (°C)'}, cmap='Reds', levels=[5, 15] );
11564197
import tensorflow as tf import os import sys import pickle import numpy as np import tensorflow as tf import cv2 as cv2 class YOLO2_TINY_TF(object): def __init__(self, in_shape, weight_pickle, proc="cpu"): self.g = tf.Graph() self.sess = tf.Session(graph=self.g) self.proc = proc se...
11564226
import re import os.path import urllib.request import sublime from ..emmet.html_matcher import AttributeToken from ..emmet.action_utils import CSSProperty pairs = { '{': '}', '[': ']', '(': ')' } known_tags = [ 'a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base'...
11564250
import unittest from pyformlang.finite_automaton.symbol import Symbol from pyformlang.regular_expression import Regex from pyformlang.cfg import CFG from pyformlang.rsa.recursive_automaton import RecursiveAutomaton from pyformlang.rsa.box import Box class TestRSA(unittest.TestCase): def test_creation(self): ...
11564272
import torch import torch.nn as nn import torchvision def Conv1x1BnRelu(in_channels,out_channels): return nn.Sequential( nn.Conv2d(in_channels=in_channels, out_channels=out_channels, kernel_size=1, stride=1, padding=0, bias=False), nn.BatchNorm2d(out_channels), nn.ReLU6(inplace=True), )...
11564277
from kivy.uix.floatlayout import FloatLayout from kivymd.uix.tab import MDTabsBase import utils utils.load_kv("tab_two.kv") class TabTwo(FloatLayout, MDTabsBase): """ Tab Item Two. """
11564364
import numpy as np import pytest from steppy.adapter import Adapter, E @pytest.fixture def data(): return { 'input_1': { 'features': np.array([ [1, 6], [2, 5], [3, 4] ]), 'labels': np.array([2, 5, 3]) }, '...
11564429
from __future__ import annotations import pytest from testing.runner import and_exit from testing.runner import trigger_command_mode @pytest.mark.parametrize('setting', ('tabsize', 'tabstop')) def test_set_tabstop(run, setting): with run() as h, and_exit(h): h.press('a') h.press('Left') ...
11564434
import numpy as np import torch import torch.nn as nn import torch.nn.init as init # Local imports from utils.utils import count_parameters def create_model(params): feat_ext = str(params['feat_ext']) if feat_ext == 'b0_lite': print('Using effnet-lite b0 as feature extractor.') return effnet...
11564441
import os import argparse import pandas as pd import datetime import random from string import ascii_lowercase def combine_qc_matrices(library_list): """ Combines the QC matrices from multiple ChIA-PET libraries. Args: library_list (str): The name of the file containing the list o...
11564550
import pomagma.examples.solve from pomagma.examples.testing import ADDRESS, SKJA, WORLD, serve from pomagma.util.testing import for_each WORLD_EXAMPLES = [ (name, WORLD) for name in pomagma.examples.solve.theories if name.endswith('_test') ] SKJA_EXAMPLES = [ (name, SKJA) for name in pomagma.examp...
11564552
import itertools import os import unittest from unittest.mock import patch, MagicMock from iota_notebook_containers.kernel_image_creator import KernelImageCreator class TestKernelImageCreator(unittest.TestCase): def test_GIVEN_emtpy_list_WHEN_get_message_if_space_insufficientv_THEN_none(self): self.asser...
11564595
import unittest import logging from lumbermill.utils.Decorators import ModuleDocstringParser @ModuleDocstringParser class DocStringExample: """ - module: DocStringExample string: # <default: "TestString"; type: string; is: optional> int: # <...
11564629
from pathlib import Path from unittest.mock import Mock from lightkube.config import kubeconfig, client_adapter from lightkube.config import models from lightkube import ConfigError import pytest import httpx import asyncio BASEDIR = Path("tests") def single_conf(cluster=None, user=None, fname=None): return kube...
11564639
import numpy as np from .. import igm def test_igm(): """ Test IGM module (Inoue14) """ igm_obj = igm.Inoue14() # Test against result from a particular version # (db97f839cf8afe4a22c31c5d6195fd707ba4de32) z = 3.0 rest_wave = np.arange(850, 1251, 50) igm_val = np.array([0....
11564646
import boto3 import json import unittest from aws_ir_plugins import revokests_key from moto import mock_iam from unittest.mock import patch class RevokeSTSTest(unittest.TestCase): @mock_iam def test_jinja_rendering(self): self.iam = boto3.client('iam', region_name='us-west-2') self.user = sel...
11564651
from uniplot.axis_labels.extended_talbot_labels import extended_talbot_labels x_min = 6.5 x_max = 7.5 for i in range(150): x_max = x_max * 1.05 space = 60 ls = extended_talbot_labels(x_min=x_min, x_max=x_max, available_space=space, vertical_direction=False) print(ls.render()[0])
11564671
from django.apps import AppConfig from baserow.core.registries import plugin_registry from .plugins import PluginNamePlugin class PluginNameConfig(AppConfig): name = '{{ cookiecutter.project_module }}' def ready(self): plugin_registry.register(PluginNamePlugin())
11564702
import time import dweepy from gpiozero import LED KEY = 'tweet_about_me' led = LED(18) while True: try: for dweet in dweepy.listen_for_dweets_from(KEY): print('Tweet: ' + dweet['content']['text']) led.on() time.sleep(10) led.off() except Exception: ...
11564706
from .clustering import (agglomerative_clustering, cluster_segmentation, cluster_segmentation_mala, mala_clustering) from .features import (compute_affinity_features, compute_boundary_features, compute_boundary_mean_and_length, compute_grid_graph,...