content
stringlengths
5
1.05M
from cumulusci.tasks.metadata_etl.base import ( BaseMetadataETLTask, BaseMetadataSynthesisTask, BaseMetadataTransformTask, MetadataSingleEntityTransformTask, MetadataOperation, ) from cumulusci.tasks.metadata_etl.duplicate_rules import SetDuplicateRuleStatus from cumulusci.tasks.metadata_etl.layouts...
# Copyright The PyTorch Lightning team. # # 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 i...
features = [1,2,3] prices = [1,2,3] theta = [0,0] LEARNING_RATE=0.01 NO_TRAINING_EXAMPLES=len(features) EPSILON=0.000000001 #Cost function to calculate half the average of the squared errors for the given theta def cost(features, prices, theta): sum = 0 for i in range(NO_TRAINING_EXAMPLES): ...
__all__ = ('WeakMap',) from .docs import has_docs from .removed_descriptor import RemovedDescriptor from .weak_core import WeakReferer, add_to_pending_removals @has_docs class _WeakMapCallback: """ Callback used by ``WeakMap``-s. Attributes ---------- _parent : ``WeakReferer`` to ``WeakMap``...
import dash import dash_table import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import numpy as np import pandas as pd import plotly.graph_objects as go from database import get_data_cache, get_all_food_data external_stylesheets = ['https://codep...
# Generated by Django 3.1.7 on 2021-04-07 15:46 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0001_initial'), ] operations = [ migrations.CreateModel( name='Rubric', fie...
# based on django-markdownify # https://github.com/erwinmatijsen/django-markdownify # https://django-markdownify.readthedocs.io/en/latest/settings.html from functools import partial from django import template from django.conf import settings import bleach from markdownx.utils import markdownify as markdownx_markdow...
""" Artificial Images Simulator ============================ The Artificial Images Simulator (AIS) class was developed to generate artificial star images, similar to those images that would be acquired by using the acquisition system of the instrument. To accomplish this, the AIS models as star flux as a 2D gaussian d...
from rest_framework import viewsets from .models import RESP, REGONError, REGON, JSTConnection, Institution, ESP from .serializers import RESPSerializer, REGONSerializer, REGONErrorSerializer, JSTConnectionSerializer, \ InstitutionSerializer, ESPSerializer class InstitutionViewSet(viewsets.ReadOnlyModelViewSet):...
# coding=utf-8 from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde # Generated with OTLEnumerationCreator. To modify: extend, do not edit class KlEleAansluitvermogen(KeuzelijstField): """Keuzelijst met gangbare waarden voor ...
# Generated by Django 2.0.2 on 2018-04-26 17:00 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0002_auto_20180406_1917'), ] operations = [ migrations.AlterField( model_name='profile', name...
# -*- coding: utf-8 -*- ''' :file: score.py :author: -Farmer :url: https://blog.farmer233.top :date: 2021/09/20 20:06:29 ''' # cjcx/cjcx_cxDgXscj.html?doType=query&gnmkdm=N305005&su=2018133209 from school_sdk.client.api import BaseCrawler class Score(BaseCrawler): def __init__(self, user_client)...
# -------------------------------------------------------- # Copyright (c) 2021 Microsoft # Licensed under The MIT License # -------------------------------------------------------- import os import random from PIL import Image from PIL import ImageFile from torch.utils.data import Dataset from .transforms import tr...
# """""" from os import getpid import logging.handlers from .snippet import T2I def mapped_level(name): levels = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'error': logging.ERROR, 'fatal': logging.FATAL} return levels[name] if name in levels else logging.WARNING; def mapped_wh...
""" October 2018 Simulations of a Ramsey experiment in the presence of flux 1/f noise """ import time import numpy as np import qutip as qtp from pycqed.measurement import detector_functions as det from scipy.interpolate import interp1d import scipy import matplotlib.pyplot as plt import logging from pycqed.simulation...
from .cloudchain import checkconfig from .cloudchain import CloudChainConfigError from .cloudchain import CloudChainError from .cloudchain import CloudChain from .cloudchain import decryptcreds from .cloudchain import encryptcreds from .cloudchain import endpoint_url from .cloudchain import getconn from .cloudchain imp...
import logging from typing import List, Dict from bs4 import BeautifulSoup, element from .row_utils import ( movies_utils, series_utils, books_utils, comics_utils, music_utils, videogames_utils, ) logger = logging.getLogger(__name__) def get_rows_from_topchart(soup: BeautifulSoup) -> List[e...
#!/usr/bin/env python3 """ For each family and device, obtain a tilegrid and save it in the database """ import os from os import path import subprocess import extract_tilegrid import database def main(): devices = database.get_devices() for family in sorted(devices["families"].keys()): for device i...
import os import random import string import pytest from check_mk_web_api import WebApi, CheckMkWebApiException api = WebApi( os.environ['CHECK_MK_URL'], os.environ['CHECK_MK_USER'], os.environ['CHECK_MK_SECRET'] ) def setup(): api.delete_all_hosts() api.delete_all_hostgroups() api.delete_a...
from functools import reduce hashes = [None] + [i for i in range(1, 11)] index = 0 hash_list = [(lambda _h=h: _h, i == index, []) for i, h in enumerate(hashes)] print(hashes) print("zip = {0}".format(zip(hash_list[::2], hash_list[1::2] + [hash_list[::2][-1]]))) while len(hash_list) > 1: hash_list = [ ( ...
import numpy as np import pandas as pd from dataset import MultiDataset, RegressionDataset def scatter_path_array(path_data, size, rank): all_lst = [] for row, item in path_data.iterrows(): path, num = item['path'], int(item['num']) all_lst.extend([[path, i] for i in range(num)]) all_lst ...
from . import controller from . import model
#------------------------------------------------------------------------------ # Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ # Shar...
''' Comp_slice is a terminal fork of intra_blob. - It traces blob axis by cross-comparing vertically adjacent Ps: horizontal slices across an edge blob. These low-M high-Ma blobs are vectorized into outlines of adjacent flat or high-M blobs. (high match: M / Ma, roughly corresponds to low gradient: G / Ga) - Vectorizat...
__version__ = "0.2" from PyQNX6.core import *
import numpy import six from chainer.backends import cuda from chainer import function_node from chainer import utils from chainer.utils import collections_abc from chainer.utils import type_check def _tensordot(a, b, a_axes, b_axes, c_axes=None): a_col_ndim = len(a_axes[1]) b_row_ndim = len(b_axes[0]) i...
import pytest from di.core.element import Element from di.core.module import ( Module, ModuleElementConsistencyCheck, ModuleElementConsistencyError, ModuleImportSolver, ModuleImportSolverError, ) def test_module_cycle(): modules = [Module(name=f"{index}") for index in range(3)] modules[0]...
import acipdt import xlrd import xlwt import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from xlutils.copy import copy from orderedset import OrderedSet import sys import time import ipaddress import getpass import os # Log levels 0 = None, 1 = Class only, 2 = Line log_level = 2 #...
from distutils.version import StrictVersion from unittest.mock import patch from keepassxc_pwned.keepass_wrapper import KeepassWrapper from .common import * # use keepassxc.cli wrapper script to test changing location of keepassxc-cli keepass_different_binary = os.path.abspath( os.path.join(this_dir, "keepassxc....
# -*- coding: utf-8 -*- ''' Support for the softwareupdate command on MacOS. ''' from __future__ import absolute_import # Import python libs import re import os # import salt libs import salt.utils import salt.utils.mac_utils from salt.exceptions import CommandExecutionError, SaltInvocationError __virtualname__ = '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 23 13:01:46 2020 @author: dnb3k """ #use the unique Full Tokens code to get teh dataframe import ossPyFuncs import pandas as pd import wordcloud import re import matplotlib.pyplot as plt import os import numpy as np #perform sql query to get comp...
# Write the benchmarking functions here. # See "Writing benchmarks" in the asv docs for more information. from math import radians import numpy as np from passpredict import _rotations class Rotations: """ Example from Vallado, Eg 11-6, p. 912 """ def setup(self, *args): self.lat = radians(4...
""" Main file! """ import argparse import logging import pickle import string import sys from typing import Optional, TextIO, BinaryIO import ujson from vk_dumper import utils, vk log = logging.getLogger('vk-dumper') def main() -> None: log.info('Starting vk-dumper!') args = parse_args() # Output vari...
from .iostream import cprint, cin, cout, cerr, endl from .cmath import * from . import cmath, iostream
from __future__ import unicode_literals from django.core.urlresolvers import reverse from tracpro.test import factories from tracpro.test.cases import TracProTest from .. import charts from .. import models class PollChartTest(TracProTest): def setUp(self): super(PollChartTest, self).setUp() ...
# Copyright 2021 The Distla Authors. All Rights Reserved. # # 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 ...
""" Train a DeeProtein-model. """ import argparse import json from DeeProtein import DeeProtein import helpers import os def main(): with open(FLAGS.config_json) as config_fobj: config_dict = json.load(config_fobj) # set the gpu context if not FLAGS.gpu: if config_dict["gpu"] == 'True': ...
# -*- coding: utf-8 -*- __author__ = 'Lara Olmos Camarena' import re import json import re """ utils """ def preprocess_text(text_str): regular_expr = re.compile('\n|\r|\t|\(|\)|\[|\]|:|\,|\;|"|\?|\-|\%') text_str = re.sub(regular_expr, ' ', text_str) token_list = text_str.split(' ') token_list = [e...
import importlib from time import clock for i in range(2): module = input("Enter module to import") importlib.import_module(module) start = clock() print(iterativefact(27)) end = clock() elapsed = end - start print(elapsed) start = clock() print(recursivefactorial(27)) end = clock() elapsed = end - start prin...
# -*- encoding: utf-8 -*- """ Boolean type comparator used to match Boolean Comparators are used by Audit module to compare module output with the expected result In FDG-connector, comparators might also be used with FDG Boolean comparator exposes various commands: - "match" Use Cases: - To check a boolea...
'''MobileNet in PyTorch. See the paper "MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications" for more details. ''' import math import torch import torch.nn as nn import torch.nn.functional as F import os, sys project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sy...
import numpy as np import tensorflow as tf import scipy.signal def add_histogram(writer, tag, values, step, bins=1000): """ Logs the histogram of a list/vector of values. From: https://gist.github.com/gyglim/1f8dfb1b5c82627ae3efcfbbadb9f514 """ # Create histogram using numpy counts, bin_edges...
# See documentation in: # http://doc.scrapy.org/topics/items.html from scrapy.item import Item, Field class Author(Item): name = Field() profile_url = Field() avatar_url = Field() class BlogAuthor(Author): pass class CommentAuthor(Author): pass class Post(Item): author = Field() title =...
import xml.etree.ElementTree as ET import fnmatch import matplotlib.pyplot as plt #rootDir = '/Users/yanzhexu/Desktop/Research/GBM/aCGH_whole_tumor_maps_for_Neuro-Onc_dataset/CEFSL_slices_only/slice22/ROI for +C_3D_AXIAL_IRSPGR_Fast_IM-0005-0022.xml' # draw ROI from coordinates in XML file def ParseXMLDrawROI(rootDir...
word = 'Bye' phrase = word * 3 + '!' print(phrase) name = input() print('I love', name)
# <<BEGIN-copyright>> # Copyright 2021, Lawrence Livermore National Security, LLC. # See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: BSD-3-Clause # <<END-copyright>> from PoPs import IDs as IDsPoPsModule from PoPs.groups import misc as chemicalElementMiscPoPsModule from fudge.channelData i...
import numpy as np from scipy.linalg import expm from tqdm import tqdm import time from utils import visualize_trajectory_2d,load_data ############## All Utility Functions ############### def round_dot(vec): ''' :param vec: A point in homogeneous co-ordinate :return: 0 representation for the vector ...
from rule import * from operator import methodcaller def chi_toi_checker(cards): return 0 def ko_ku_shi_checker(cards): return 0 def ron_dfs(handcards): if (len(handcards) == 0): return True return False #no matter whether have yaku def can_ron(cards): if (ron_dfs(cards.handcards)): return True ...
import pytest import torch import time from ynot.datasets import FPADataset from ynot.echelle import Echellogram from torch.utils.data import DataLoader import torch.optim as optim import torch.nn as nn @pytest.mark.parametrize( "device", ["cuda", "cpu"], ) def test_forward_backward(device): """Do the scene m...
import json import discord from discord.ext import commands from utils import get_color import datetime class Modlogs(commands.Cog): def __init__(self, bot): self.bot = bot with open("./bot_config/logging/modlogs_channels.json", "r") as modlogsFile: self.modlogsFile = json.load(modlog...
import pytest from django.contrib.auth import get_user_model from django.urls import reverse from tahoe_idp.tests.magiclink_fixtures import user # NOQA: F401 User = get_user_model() @pytest.mark.django_db def test_studio_login_must_be_authenticated(client, settings): # NOQA: F811 url = reverse('studio_login')...
UI_INTERACTIONS = { 'learn-more': { 'interaction_type': 'click', 'element_location': 'ct_menu_tree', 'element_name': 'ct_learn_more_btn', 'icon_name': 'document', 'color': 'yellow', 'cta_text': 'Learn More' }, 'advanced-metrics': { 'interaction_type': ...
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. All Rights Reserved. # # 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 requir...
from django.views.generic import ( ListView, CreateView, UpdateView, DeleteView, DetailView, ) from django.urls import reverse_lazy from .models import Todo class ListTodosView(ListView): model = Todo class DetailTodoView(DetailView): model = Todo class CreateTodoView(CreateView): ...
import sys import bpy import threading from .signal import Signal from .utils import find_first_view3d class AnimationController: '''Provides an interface to Blender's animation system with fine-grained callbacks. To play nice with Blender, blendtorch provides a callback based class for interacting wi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 17 11:01:58 2021 @author: root """ import sklearn from sklearn import datasets import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seaborn as sns import torch.nn.functional as F import torch.nn as n...
from django.apps import AppConfig class MetricConfig(AppConfig): label = "metric" name = "edd.metric" verbose_name = "Metric" def ready(self): # make sure to load/register all the signal handlers from . import signals # noqa: F401
from scipy.misc.common import logsumexp from kameleon_rks.densities.gaussian import sample_gaussian, \ log_gaussian_pdf_multiple from kameleon_rks.proposals.ProposalBase import ProposalBase import kameleon_rks.samplers.tools from kameleon_rks.tools.covariance_updates import log_weights_to_lmbdas, \ update_mean...
__copyright__ = 'Copyright(c) Gordon Elliott 2017' """ """ from enum import IntEnum from a_tuin.metadata import ( ObjectFieldGroupBase, StringField, ObjectReferenceField, Collection, DescriptionField, IntField, IntEnumField, ) class PPSStatus(IntEnum): Requested = 1 Provided = ...
""" Tools for segmenting positional AIS messages into continuous tracks. Includes a CLI plugin for `gpsdio` to run the algorithm. """ from gpsdio_segment.segment import BadSegment from gpsdio_segment.segment import Segment from gpsdio_segment.core import Segmentizer __version__ = '0.20.2' __author__ = 'Paul Woods'...
# -*- coding: utf-8 -*- """ A utility library for interfacing with the SRF-08 and SRF-10 ultrasonic rangefinders. http://www.robot-electronics.co.uk/htm/srf08tech.shtml http://www.robot-electronics.co.uk/htm/srf10tech.htm Utilizes I2C library for reads and writes. The MIT License (MIT) Copyright (c) 2015 Martin Clemo...
import sys import time from datetime import timedelta, datetime as dt from monthdelta import monthdelta import holidays import re import threading import inspect from contextlib import contextmanager import traceback import logging # default logging configuration # logging.captureWarnings(True) LOG_FORMATTER = loggin...
token = '1271828065:AAFCFSuz_vX71bxzZSdhLSLhUnUgwWc0t-k'
########################### # # #764 Asymmetric Diophantine Equation - Project Euler # https://projecteuler.net/problem=764 # # Code by Kevin Marciniak # ###########################
## What is Lambda : anonymous function or function without name ## Usecase is you can pass a function as an argument, quick function # def double(num): # x = num + num # return x # print(double(6)) # lambda num: num + num # x = lambda a : a + 10 # print(x(5)) #Example 2 # my_list = [1, 5, 4, 6, 8, 11, 3...
""" Utility functions for dealing with NER tagging. """ import logging logger = logging.getLogger('stanza') def is_basic_scheme(all_tags): """ Check if a basic tagging scheme is used. Return True if so. Args: all_tags: a list of NER tags Returns: True if the tagging scheme does not ...
from dataclasses import dataclass from typing import Callable import torch Logits = torch.FloatTensor @dataclass class Sample: logits: Logits tokens: torch.LongTensor Sampler = Callable[[Logits], Sample] def standard(temperature: float = 1.0) -> Sampler: def sample(logits: Logits) -> Sample: ...
from numpy import NaN import pandas as pd import requests import math import re from bs4 import BeautifulSoup class Propertypro: """ web-scraper tool for scraping data on propertypro.ng Parameters: num_samples (int): The number of samples of data to be scraped. location (list): list...
from oslo_log import log as logging from oslo_messaging import RemoteError from nca47.api.controllers.v1 import base from nca47.api.controllers.v1 import tools from nca47.common.exception import NonExistParam from nca47.common.exception import ParamFormatError from nca47.common.exception import ParamNull from nca47.com...
import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from layers import * from layers.modules.l2norm import L2Norm from data import * import os import math #from vis_features import plot_features class ResNet(nn.Module): def __init__(self, block, layers, num_class...
""" This module defines views used in CRUD operations on articles. """ from rest_framework import generics, status from rest_framework.response import Response from rest_framework.permissions import ( AllowAny, IsAuthenticatedOrReadOnly, IsAuthenticated ) from rest_framework.serializers import ValidationError from ...
from .dynamo import DynamoClient from .s3 import S3Client
#! python3 # -*- encoding: utf-8 -*- ''' Current module: rman.app.rm_task.models Rough version history: v1.0 Original version to use ******************************************************************** @AUTHOR: Administrator-Bruce Luo(罗科峰) MAIL: luokefeng@163.com RCS: rman.app.rm_task.models,...
#!/usr/bin/python3.3 # -*- coding: utf-8 -*- # core.py # Functions: # [X] loading servers details # [X] loading servers config (in which is found username, etc.) # [ ] logging to disk commands and status # [ ] loading and providing configuration e.g. is_enabled() # [ ] provides ini reading interface import ...
############################################################## # Customer Issue Prediction Model #------------------------------------------------------------- # Author : Alisa Ai # ############################################################## import dash import dash_core_components as dcc import dash_html_components ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
import pytest import pandas @pytest.fixture(scope="session") def events(): return pandas.read_pickle("tests/data/events_pickle.pkl")
## https://weinbe58.github.io/QuSpin/examples/example7.html ## https://weinbe58.github.io/QuSpin/examples/example15.html ## https://weinbe58.github.io/QuSpin/examples/user-basis_example0.html ## https://weinbe58.github.io/QuSpin/user_basis.html ## https://weinbe58.github.io/QuSpin/generated/quspin.basis.spin_basis_1d.h...
from django.test import TestCase from django.contrib.auth import get_user_model class ModelTest(TestCase): def test_creat_user_email_succesful(self): email='hello.com' password='123123' user =get_user_model().objects.create_user( email=email, password=password ) ...
""" Itertools examples """ import itertools import collections import operator import os # itertools.count can provide an infinite counter. for i in itertools.count(step=1): print i if i == 20: break # itertools.cycle cycles through an iterator # Will keep printing 'python' for i,j in enumerate(itertool...
# Generated by Django 3.1.7 on 2021-09-06 20:53 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('upload', '0004_auto_20210623_2006'), ] operations = [ migrations.AlterField( model_name='thumbnails', name='large', ...
# ------------------------------------------------------------------ # Step 1: import scipy and pyamg packages # ------------------------------------------------------------------ import numpy as np import pyamg import matplotlib.pyplot as plt # ------------------------------------------------------------------ # Step...
import os import shutil import wget import json import logging import tempfile import traceback import xml.etree.ElementTree as ET import networkx as nx from pml import * #logging.basicConfig(level=logging.INFO) def get_file(file, delete_on_exit = []): # due to current limitations of DMC, allow shortened URLs...
a= int(input("input an interger:")) n1=int("%s" % a) n2=int("%s%s" % (a,a)) n3=int("%s%s%s" % (a,a,a)) print(n1+n2+n3)
#PROGRAMA PARA CALCULAR AS DIMENSÕES DE UMA SAPATA DE DIVISA import math print("=-=-=-=-=-=-=-=-=-=-=-=-=-=-= OTIMIZAÇÃO DE SAPATA DE DIVISA =-=-=-=-=-=-=-=-=-=-=-=-=-=-=") print("Utilize sempre PONTO (.) NÃO VÍRGULA (,)") lado_A = float(input("Qual o Tamanho do Lado A? ")) lado_B = float(input("Qual o Taman...
from math import e import pandas as pd from core.mallows import Mallows from core.patterns import ItemPref, Pattern, PATTERN_SEP def get_itempref_of_2_succ_3_succ_m(m=10) -> ItemPref: return ItemPref({i: {i + 1} for i in range(1, m - 1)}) def get_test_case_of_itempref(pid=0): row = pd.read_csv('data/test_...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, ...
currency = [10000, 5000, 2000, 1000, 500, 200, 100, 25, 10, 5, 1] for _ in range(int(input())): money = input() money = int(money[:-3] + money[-2:]) out = "" for c in currency: out += str(money // c) money %= c print(out)
import tkinter as tk from tkinter import Frame, Button, PanedWindow, Text from tkinter import X, Y, BOTH import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib import pyplot as plt class MatplotlibWindow(object): def __init__(self,root): ...
import csv with open(str(input('Arquivo .csv Airodump-ng: '))) as arquivoCsv: print('\n Rede Senha') try: reader = csv.reader(arquivoCsv) for linha in reader: if not linha: # Verifica se a lista está vazia pass else: if linha[...
from .node_base import NodeBase from .exceptions import NodeRegistrationError, NodeNotFoundError class NodeFactory(object): def __init__(self) -> None: super().__init__() self._nodes = {} self._names = {} def registerNode(self, node: NodeBase): if node is None: raise ValueError('node param i...
import asyncio import hikari import tanjun from hikari.interactions.base_interactions import ResponseType from hikari.messages import ButtonStyle from hikari_testing.bot.client import Client component = tanjun.Component() @component.with_slash_command @tanjun.as_slash_command("paginate", "Paginate through a list o...
# Holly Zhang sp20-516-233 E.Multipass.2 # testing code p = Provider() # TestMultipass.test_provider_run_os r1 = p.run(command="uname -a", executor="os") print(r1) #Linux cloudmesh 4.15.0-74-generic #84-Ubuntu SMP Thu Dec 19 08:06:28 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux # TestMultipass.test_provider_run_live r2 ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014 Cloudwatt # All Rights Reserved. # # 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/l...
# Date : 03/31/2020 # Author : mcalyer # Module : scanse_control.py # Description : Code to explore Scanse LIDAR capabilites # Python : 2.7 # Version : 0.2 # References : # # 1. Scanse User Manual V1.0 , 04/20/2017 # 2. Scanse sweep-ardunio source # 3. sweep-sdk-1.30_...
from re import findall,IGNORECASE for _ in range(int(input())): s=input() f=sorted(findall(r'[bcdfghjklmnpqrstvwxyz]+',s,IGNORECASE),key=lambda x: len(x),reverse=True) print(f'{s} nao eh facil') if len(f[0])>=3 else print(f'{s} eh facil')
__author__ = 'Wenju Sun' import """ This script tries to download given file via http and given the final status summary """ MAX_VALUE=10 MIN_VALUE=0 WARN_VALUE=0 CRITICAL_VALUE=0 STATE_OK=0 STATE_WARNING=1 STATE_CRITICAL=2 STATE_UNKNOWN=3 STATUS_TEXT='OK' STATUS_CODE=STATE_OK murl="http://dl-...
from pathlib import Path import pytest from seq2rel.training.callbacks.concatenation_augmentation import ConcatenationAugmentationCallback class TestConcatenationAugmentationCallback: def test_aug_frac_value_error(self) -> None: with pytest.raises(ValueError): _ = ConcatenationAugmentationCal...
from fastai import * from fastai.vision import * path = Path('../data/') tfms = get_transforms(flip_vert=True) np.random.seed(352) data = ImageDataBunch.from_folder(path, valid_pct=0.2, ds_tfms=tfms, size=224).normalize(imagenet_stats) data.show_batch(3, figsize=(15, 11)) # create a learner based on a pretrained den...