text
stringlengths
2
999k
from biogeme import * from headers import * from loglikelihood import * from statistics import * from nested import * # rowid H1_HHID H1_Pcode Pax_ID day_pattern_code In_day_pattern_choice_set modified_code begin_in_tour_table End_in_tour_table simple_day_pattern universitystudent person_type_id age_id income_id incmid...
class Verdict: def __init__(self, reconciled: bool=None, verdict: str=None): self.reconciled = reconciled self.verdicts = [] if verdict: self.verdicts.append(verdict) def __str__(self): return f'<Verdict / {"reconciled" if self.reconciled else "non-reconciled"} ({...
#!/usr/bin/env python3 ''' A driver script for CCA container image Copyright 2020 Codinuum Software Lab <https://codinuum.com> 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...
from rest_framework.serializers import ModelSerializer from api.models import Issue class IssueSerializer(ModelSerializer): class Meta: model = Issue fields = "__all__"
"""celeryDj URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-base...
import cv2 as cv from numpy import ndarray class AgentTransformers: @staticmethod async def transformer_color_BGR2GRAY(frame: ndarray) -> ndarray: resulting_frame = cv.cvtColor(frame, cv.COLOR_BGR2GRAY) return resulting_frame @staticmethod async def transformer_color_BGR2LAB(frame: n...
''' Copyright 2011-16 Province of British Columbia 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 ...
from pathlib import Path from yaml import safe_load SPECIAL_TYPES = { "discord_role": "int", "discord_permission": "disnake.Permissions", "discord_channel": "int", "choice": "str", } _DEFINITION_FILE = Path("starbot/configuration/config-definition.yaml") with _DEFINITION_FILE.open() as file: DEF...
# Create your views here. from QQLoginTool.QQtool import OAuthQQ from rest_framework.response import Response from rest_framework.views import APIView from rest_framework_jwt.settings import api_settings from oauth.models import QqYhb from oauth.oa_gg import jopenid, jmopenid from oauth.xuliehua import qqyhxlh from sh...
import json import os import yaml class Package(): """ Class representing a serialized upload package containing one or more batches. """ def __init__(self, destination): self.root = destination self.batches = [] if not os.path.exists(self.root): os.makedirs(se...
import bz2 from io import BytesIO MAGIC = b'BSDIFF40' import bsdiff4.core as core def write_patch(fo, len_dst, tcontrol, bdiff, bextra): """write a BSDIFF4-format patch to stream 'fo' """ fo.write(MAGIC) faux = BytesIO() # write control tuples as series of offts for c in tcontrol: ...
class Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ first = 0 second = 0 while first <len(nums) and second < len(nums): while first < len(nums) and nums[first] != 0: ...
import unittest import jimmies import tempfile import ssl from .util import cert_path from .echo import EchoServer class SocketTest(unittest.TestCase): TESTSTRING = b"""whose woods these are, I think I know' his house is in the village though he will not see me stopping here to watch his woods fill u...
import numpy as np from . import util def localizeCoefficient(patch, aFine): iPatchWorldCoarse = patch.iPatchWorldCoarse NPatchCoarse = patch.NPatchCoarse NCoarseElement = patch.world.NCoarseElement NPatchFine = NPatchCoarse*NCoarseElement iPatchWorldFine = iPatchWorldCoarse*NCoarseElement NWo...
import csv import os from time import sleep from typing import Dict from datetime import datetime from src.twitter_fetching.requests_base import make_request RECENT_SEARCH_URL = "https://api.twitter.com/2/tweets/search/recent" def recent_search( params: dict, headers: dict = None, tweet_fetch_limit: int = 1000 ...
from typing import Generic, Iterable, List, TypeVar from gevent.event import Event from gevent.queue import Queue T = TypeVar("T") class NotifyingQueue(Event, Generic[T]): """This is not the same as a JoinableQueue. Here, instead of waiting for all the work to be processed, the wait is for work to be availa...
import numpy as np class vector: def cross(v): v1, v2, v3 = v.squeeze() return np.array([ [0, -v3, v2], [v3, 0, -v1], [-v2, v1, 0] ]) class quaternion: def from_theta(e, theta): n = 1 if not hasattr(theta, '__len__') else len(theta) ...
"""Some code to deal with geo880 data.""" import glob import os import re import sys from nltk.stem.porter import PorterStemmer IN_DIR = os.path.join( os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))), 'data/geo880/sempre-examples') OUT_DIR = os.path.join( os.path.dirname(os.pat...
import sys import shutil import getpass import time from tqdm import tqdm as pb import py_telegram import os args = sys.argv class module_uninstaller: class FNFE0(OSError): pass def uninstall(): print("Telegram Bot Library Module Uninstaller") print("*********************************...
"""Base TestCase class for testing Exporters""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os from ...tests.base import TestsBase all_raw_mimetypes = { "text/x-python", "text/markdown", "text/html", "text/restructuredtext", "text/l...
# # Copyright (c) 2008 - 2013 10gen, Inc. <http://10gen.com> # # 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 applicab...
""" Package for the tmi application. """ from .__version__ import __version__ from .__main__ import main
from keras.models import load_model import h5py import numpy as np import matplotlib.pyplot as plt import cv2 from keras.optimizers import Adam import os from keras import backend as K import tensorflow as tf def PSNR(y_true, y_pred): max_pixel = 1.0 return 10.0 * tf_log10((max_pixel ** 2) / (K.mean(K.sq...
import pkg_resources __version__ = pkg_resources.get_distribution('django-authtools').version
from tree.app import main if __name__ == '__main__': main().main_loop()
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # # FreeType high-level python API - Copyright 2011-2015 Nicolas P. Rougier # Distributed under the terms of the new BSD license. # # ----------------------------------------------------------------------------- ''...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..utils import Calc def test_Calc_inputs(): input_map = dict( args=dict(argstr='%s', ), environ=dict( nohash=True, usedefault=True, ), expr=dict( argstr='-expr "%s"', mandator...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # @author Copyright (c) 2022 Damir Dzeko Antic # @version 0.1.0 # @lastUpdate 2022-02-02 import sys try: assert (sys.version_info.major == 3 and sys.version_info.minor >= 7), "Python version must be 3.7 or newer" except Exception as e: print (e) sys.exit(1) ...
import json # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["age"])
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
# pyright: reportMissingImports=false # pylint: disable=import-error, wrong-import-position, import-outside-toplevel, consider-using-from-import import os from dataclasses import dataclass from pathlib import Path from typing import List, Tuple, Union import jpype import jpype.imports from appdirs import AppDirs from...
from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException ...
import argparse from os import path from glob import glob from kaldi.asr import GmmLatticeFasterRecognizer from kaldi.decoder import LatticeFasterDecoderOptions from kaldi.util.table import SequentialMatrixReader, SequentialWaveReader ap = argparse.ArgumentParser(prog="kaldi2scribe", usage="%(prog)s --modelroot '/wsj...
import pytest import numpy as np import context from sequentations.augmentations.transforms import RandomGamma, ColorJitter, Normalize def test_random_gamma(): arr = np.full((2, 100, 100, 3), fill_value=127, dtype=np.uint8) aug = RandomGamma() data = aug(image=arr, force_apply=True)['image'] assert ...
import os import shutil from pathlib import Path from test.convert_worker.unit.convert_test import ConvertTest from workers.convert.convert_pdf import convert_pdf_to_tif class PdfToTifTest(ConvertTest): def setUp(self): super().setUp() self.pdf_src = os.path.join(f'{self.resource_dir}', 'files'...
import os if 'PYTHONPATH' not in os.environ: print("Error: Run `source env.sh` to be able to run `/scripts/*.py`") exit(1) from pathlib import Path from time import time from typing import Iterable import ecgdigitize from ecgdigitize.otsu import otsuThreshold import ecgdigitize.visualization as viz from ecgdi...
import numpy as np import pandas as pd from pystorm.hal.run_control import RunControl from pystorm.hal import data_utils class NetBuilder(object): def __init__(self, HAL, net=None): """Initialize NetBuilder: Inputs: ======= HAL (HAL object) : net (hal.neuromorph.graph obj...
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Copyright (c) 2017-2021 Thought Networks, LLC # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import ComparisonTestF...
import socket import webbrowser from builtins import object import httplib2 import oauth2client.clientsecrets as clientsecrets import oauth2client.file from six.moves import input from apiclient.discovery import build from functools import wraps from oauth2client.service_account import ServiceAccountCreden...
import collections from marshmallow import ( Schema, fields, validates, validates_schema, ValidationError, RAISE, ) def validate_dependent_fields(data, dependent_fields, name): error_msg = ( "The fields {} in {} are co-dependent, if you supply one of them, you must " "supp...
import asyncio from typing import Any, AsyncGenerator, Callable, Generic, Optional, Type, Union from unittest.mock import MagicMock import httpx import pytest from asgi_lifespan import LifespanManager from fastapi import FastAPI, Response from fastapi.security import OAuth2PasswordBearer from httpx_oauth.oauth2 import...
# -*- encoding: utf8 -*- # # Automate the installation of pip and IPyIDA. # # Copyright (c) 2016-2018 ESET # Author: Marc-Etienne M.Léveillé <leveille@eset.com> # See LICENSE file for redistribution. import idaapi import os import sys from contextlib import contextmanager import tempfile import subprocess import filei...
# ----------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ----------------------------------------------------------------------------- ""...
import sys if len(sys.argv) != 2: print("syntax: compiler.py bfsource.txt") exit(1) source_map = { "+": 0, "-": 1, ">": 2, "<": 3, "[": 4, "]": 5, ".": 6, ",": 7 } hex_output = "" with open(sys.argv[1]) as f: for c in f.read(): if c in source_map: hex_output += "{:03b}\n".format(source_map[c]) prin...
class HookspecMarker(object): """ Decorator helper class for marking functions as hook specifications. You can instantiate it with a project_name to get a decorator. Calling PluginManager.register_specs later will discover all marked functions if the PluginManager uses the same project_name. """ ...
import time # send three msgs over wrapped and raw socket from socket import * sock = socket() # default=AF_INET, SOCK_STREAM (tcp/ip) sock.connect(('localhost', 60000)) file = sock.makefile('w', buffering=1) # default=full buff, 0=error, 1 not linebuff! print('s...
#!/usr/bin/python ## SourceObject ## ################################################################# # # Copyright 2013, Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a co...
#!/usr/bin/env python3 __author__ = 'atul' from PyQt4 import QtCore, QtGui from Copy.Ui import MainWindow from Copy.Utils import AtUtils import os import shutil class App(QtGui.QMainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = MainWindow.Ui_MainWindow() self.u...
def translate(phrase): translation = "" for letter in phrase: if letter.lower() in "aeiou": if letter.isupper(): translation += "G" else: translation += "g" else: translation += letter return translation print(translate(i...
from django.apps import AppConfig class CidAppConfig(AppConfig): name = 'cid' verbose_name = 'Django Correlation Id'
import urllib3 from aws_autobuild import AWSAutoBuild def main(): # Disable insecure warning output urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # Create object of autobuild class autobuilder = AWSAutoBuild('build_schema.py') # Retrieve all Meraki related information m...
# Copyright 2015 The TensorFlow 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 applica...
# -*- codiEEG_dsddsdsng: utf-8 -*- """ Created on Mon Jun 29 20:08:11 2020 @author: mahjaf """ #%% Import libs #####===================== Importiung libraries =========================##### import mne import numpy as np from scipy.integrate import simps from numpy import loadtxt import h5py import time import os f...
from __future__ import absolute_import, unicode_literals import logging from pykka.messages import ProxyCall from mopidy.audio import PlaybackState from mopidy.compat import urllib from mopidy.core import listener from mopidy.internal import deprecation, models, validation logger = logging.getLogger(__name__) cla...
# Copyright (c) 2016 OpenStack Foundation # 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 ...
import os import unittest import budget.util.fileloader as f class TestFileLoaderYaml(unittest.TestCase): testdir = os.path.dirname(__file__) data = testdir+'/fileloader.yaml' def runTest(self): test = f.load_yaml(self.data) self.assertEqual(test['Foo'], 'Bar') test['blah'] = ['bl...
"""Test that HTML data is decoded into a formatted document. Press ESC to exit the test. """ import unittest import pyglet from pyglet.text import caret, document, layout doctext = """ <html> <head> (metadata including title is not displayed.) <title>Test document</title> </head> <body> <h1>HTML ...
class Solution: def getPermutation(self, n: int, k: int) -> str: numStr = [str(i) for i in range(1, n+1)] fact = [1]*n for i in range(1, n): fact[i] = i*fact[i-1] ans = [] k -= 1 while n: i = int(k / fact[n-1]) k %= fact[n-1] ...
import click from blackbelt.handle_trello import ( migrate_label as ml, schedule_list as sl, next_card as n, next_week as nw, open_current_working_ticket as cc, verify as v, order_tea as ot ) @click.group(help='Handle Trello-related actions and integrations.') def cli(): pass @cli.c...
# # * The source code in this file is based on the soure code of CuPy. # # # NLCPy License # # # Copyright (c) 2020-2021 NEC Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
""" Django settings for controle_gastos project. Generated by 'django-admin startproject' using Django 4.0.2. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ from...
from recommender.item_similarity_recommender_py import *
# You are given coins of different denominations and a total amount of money. # Write a function to compute the number of combinations that make up that amount. # You may assume that you have infinite number of each kind of coin. # Example 1: # Input: amount = 5, coins = [1, 2, 5] # Output: 4 # Explanation: there ar...
import threading # #################### 1. 计算密集型多线程无用 #################### # v1 = [11, 22, 33] # +1 # v2 = [44, 55, 66] # 100 # # # def func(data, plus): # for i in range(len(data)): # data[i] = data[i] + plus # # # t1 = threading.Thread(target=func, args=(v1, 1)) # t1.start() # print(v1) # # t2 = thread...
from __future__ import annotations from typing import ClassVar from PySide6.QtCore import QObject, QSize, Qt, Signal from PySide6.QtGui import ( QAction, QBrush, QColor, QFont, QIcon, QLinearGradient, QPainter, ) from PySide6.QtWidgets import ( QDockWidget, QListWidget, QListWi...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
# Copyright 2019 Uber Technologies, Inc. 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 applica...
from Crypto.Hash import HMAC, SHA256 def szyfruj(): haslo = input("Podaj hasło:") bhaslo = haslo.encode() h = HMAC.new(bhaslo, digestmod=SHA256) return h.hexdigest() def sprawdz(podpis): haslo = input("Podaj hasło:") bhaslo = haslo.encode() h = HMAC.new(bhaslo, digestmod=SHA256) return...
''' New Integration Test for detaching share volume under PS maintain mode. @author: SyZhao ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.operations.primarystorage_operations as ps_ops im...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __...
"""System test of mirage/FGS that creates simulations based on a .yaml file. Authors ------- - Johannes Sahlmann Use --- >>> pytest -s test_fgs_imaging.py """ import os import pytest from mirage import imaging_simulator as im os.environ['TEST_FGS_DATA'] = os.path.join(os.path.dirname(__file__), 'test_dat...
from main import scale a = "abcd\nefgh\nijkl\nmnop" r = "aabbccdd\naabbccdd\naabbccdd\neeffgghh\neeffgghh\neeffgghh\niijjkkll\niijjkkll\niijjkkll\nmmnnoopp\nmmnnoopp\nmmnnoopp" def test_scale(benchmark): assert benchmark(scale, a, 2, 3) == r assert benchmark(scale, "", 5, 5) == "" assert benchmark(scale,...
import types def hide_key(key, hide=lambda s: s // 2): """ Hide part of the key and return e.g. 'abc***123'. """ key_len = len(key) if isinstance(hide, types.FunctionType): hide = hide(key_len) before = (key_len - hide) // 2 + 1 after = before + hide return key[:before] + '*...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Freely adapted from Aymeric Damien's code # This code is attributed to original author with modifications to load Tamil MNIST like data. """ Neural Network. A 2-Hidden Layers Fully Connected Neural Network (a.k.a Multilayer Perceptron) implementation with TensorFlow. This example is using the MNIST database of handwr...
import torch import torch.nn as nn import torch.nn.functional as F class QNetwork(nn.Module): """ QNetwork model""" def __init__(self, state_size, action_size, seed=0): """Constructor for QNetwork model to initialize states, actions and random seed Args: state_size: number of stat...
from django.db import models from django.utils.translation import gettext_lazy as _ from taggit.managers import TaggableManager class Article(models.Model): title = models.CharField( max_length=255 ) author = models.CharField( max_length=255, blank=True, help_text="Suggesti...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt from flask_login import LoginManager app = Flask(__name__) app.config['SECRET_KEY'] = '5791628bb0b13ce0c676dfde280ba245' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db' db = SQLAlchemy(app) bcrypt = Bcrypt(app) ...
""" Copyright (c) 2016-2020 Keith Sterling http://www.keithsterling.com 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 rights to use, copy, m...
class App: def __init__(self, app, file): self._app = app self._services = {} self._s2ss = {} self._file = file def addService(self, service, sw, hw, things): if service not in self._services: self._services[service] = (sw,hw,things) def addS2S(self, se...
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.urls import reverse from django.http import HttpResponseRedirect, JsonResponse, Http404 from django.contrib.auth import logout, get_user_model from django.core.exceptions import PermissionDenied from django.conf im...
import math #replace with sieve for faster check, but expected small answer def is_prime(n): if n == 1: return False if n % 2 == 0 and n > 2: return False return all(n % i for i in range(3, int(math.sqrt(n))+1,2)) primes = [] for i in range(1,1000000): if is_prime(i): primes.append(i) def chec...
import _plotly_utils.basevalidators class ShowValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name='show', parent_name='isosurface.spaceframe', **kwargs ): super(ShowValidator, self).__init__( plotly_name=plotly_name, ...
# -*- coding: utf-8 -*- from ...campos import Campo from ...campos import CampoAlfanumerico from ...campos import CampoCNPJ from ...campos import CampoData from ...campos import CampoFixo from ...campos import CampoNumerico from ...campos import CampoRegex from ...registros import Registro class Registro0000(Registr...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else [] PROJECT_CATKIN_DEPENDS = "".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "mbot_teleop" PROJECT_SPACE_DIR = "/ho...
#!/usr/bin/env python # Copyright (C) 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
import logging log = logging.getLogger(__name__) from atom.api import Value import enaml from enaml.application import deferred_call from enaml.workbench.api import Workbench with enaml.imports(): from enaml.stdlib.message_box import critical from . import error_style from psi import set_config from psi.cor...
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
import re # Limits to Alphanumeric characters, [,.], 5-50 characters in length universal_note_regex = re.compile(r'^[a-zA-Z0-9,.\x20]{0,256}$') universal_phone_regex = re.compile(r'^[0-9]{10,10}$')
"""Extra application configuration options for the build_manager app""" from django.apps import AppConfig class BuildManagerConfig(AppConfig): """Application configuration for the build_manager""" name = 'build_manager' verbose_name = 'Build Manager'
"""Test config flow.""" from collections import namedtuple from unittest.mock import AsyncMock, MagicMock, patch from aioesphomeapi import ( APIConnectionError, InvalidAuthAPIError, InvalidEncryptionKeyAPIError, RequiresEncryptionAPIError, ResolveAPIError, ) import pytest from homeassistant import...
from u2flib_server.u2f import (begin_registration, begin_authentication, complete_registration, complete_authentication) from cryptography import x509 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import Encoding from django.sh...
#!/usr/bin/env vpython # Copyright 2015 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from test_env import future import test_env test_env.setup_test_env() from components.config.proto import service_config_p...
import torch import argparse import hashlib import pandas as pd import numpy as np import itertools as its from tabulate import tabulate from torch.utils.data import DataLoader from functools import partial from tqdm import tqdm from pathlib import Path, PurePath from warnings import warn from rdkit import Chem, DataSt...
""" python ./scripts/run_tune_example.py # To see results from ray.tune import Analysis analysis = Analysis(PATH_TO_EXP_DIR) df = analysis.trial_dataframes """ import sys import os import numpy as np from random import shuffle from collections import deque from dataclasses import dataclass, asdict import torch impor...
# pylint:disable=multiple-imports,wrong-import-position import os, threading, time os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide" import pygame # https://gist.github.com/ohsqueezy/6540433 from array import array from pygame.mixer import Sound, get_init, pre_init pre_init(44100, -16, 1, 1024) pygame.init() audio_c...
# Copyright 2014 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
"""Location plugin for Home Assistant CLI (hass-cli).""" import logging import re as reg import sys from typing import Any, Dict, Pattern, no_type_check # noqa: F401 import click import homeassistant_cli.autocompletion as autocompletion from homeassistant_cli.cli import pass_context from homeassistant_cli.config imp...
import cv2 from plantcv.plantcv import watershed_segmentation, outputs def test_watershed_segmentation(test_data): """Test for PlantCV.""" # Clear previous outputs outputs.clear() # Read in test data img = cv2.imread(test_data.multi_bin_img) mask = cv2.imread(test_data.multi_bin_img, -1) _...