content
stringlengths
5
1.05M
import logging from pathlib import Path import requests logger = logging.getLogger(__name__) def get_config_from_pad(pad_url, current_time): logger.info(f"Downloading config from {pad_url}") r = requests.get(pad_url) configs_folder = Path("configs") configs_folder.mkdir(exist_ok=True, parents=True) ...
import netCDF4 as nc def nc_dumps(file, unique_id): with nc.Dataset(file) as ds: o = { "uri": unique_id } dims = {} for dim in ds.dimensions.values(): dims[dim.name] = dim.name o["dimensions"] = dims o["properties"] = {} fo...
"""Remove reference to subdir Revision ID: 53e2ac668296 Revises: ed01e313d3cb Create Date: 2017-03-28 15:01:31.073382 """ # revision identifiers, used by Alembic. import json import logging from alembic.script.revision import RevisionError from alembic.util import CommandError from alembic import op as original_op ...
import logging import random import sys import time import uasyncio from utime import ticks_ms from .utils import ButtonEventHandler, EyeAnimation, Buzzer from . import plot # uPy doesn't seem to support enums, this is probably better than passing constants around class WiFiState: UNCONFIGURED = 1 CONNECTING...
import unittest from oslash import State from oslash.util import identity, compose # pure = State.pure unit = State.unit put = State.put get = State.get class TestState(unittest.TestCase): def test_state_greeter(self) -> None: def greeter() -> State: state = get().bind(lambda name: ...
#!/usr/bin/env python # encoding: utf-8 """ @Author: yangwenhao @Contact: 874681044@qq.com @Software: PyCharm @File: enroll_eval.py @Time: 2020/10/31 13:47 @Overview: """ from __future__ import print_function import argparse import os import numpy as np import torch import torch._utils import torch.backends.cudnn a...
import json from itertools import chain # from .assignmentmap import encode_item, decode_item class AssignmentSet: def __init__(self, items=()): self._encoded_keys = {} #note: this isn't doing garbage collection self._items = set([]) for i in items: self._items.add(self.encode_i...
import math def achaTamanho(numero): numero = abs(int(numero)) if numero < 2: return 1 count = 0 valor = 1 while valor <= numero: valor *= 10 count += 1 return count def achaTamanho2(numero): numero = abs(int(numero)) return (1 if numero == 0 else math.floor(ma...
""" Manages the character 3 -- Author : DrLarck Last update : 24/11/19 (DrLarck) """ # dependancies import asyncio # util from utility.cog.character.character import Character # test from utility.cog.character.ability.list.acid import Acid from utility.cog.character.ability.list.spreading_acid import Spreading_ac...
# -*- coding: utf-8 -*- import os __version__ = "0.4.1" __author__ = "ShixiangWang" __copyright__ = "ShixiangWang" __license__ = "mit" # User can modify the following line # to change the default path for host file __host_file__ = "~/.config/loon/host.json" # Get the absolute path for host file # NEVER CHANGE IT! __ho...
""" Scoring algorithm to return probability of correct decryption. Output range depends on the score functions used. """ import statistics def score(text, *score_functions): """Score ``text`` using ``score_functions``. Examples: >>> score("abc", function_a) >>> score("abc", function_a, funct...
import os import pickle import shutil import subprocess import pyqtgraph as pg from PyQt5.QtWidgets import QDesktopWidget from datatypes.joints import JointsList from datatypes.utils.helpers import magnitude def _get_base_dir(): BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) retu...
# Snippet 3. # Fetching SMILES identifiers for compounds tested for activity against a given target. from chembl_webresource_client.new_client import new_client # UniProt ID for erbB-2, a target of Lapatinib uniprot_id = "P04626" # Getting a target for the given accession: targets = new_client.target.filter(target_c...
# coding: utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('teryt', '0003_update_aktywny'), ] operations = [ migrations.Alt...
class Solution: def XXX(self, x): """ :xtype: int :rtype: int """ if x >= 0: over_zero_result = int(str(x)[::-1]) output = 0 if over_zero_result > (2**31 -1) else over_zero_result return output else: low_zero_result = in...
import os import json import urllib2 from urlparse import urlparse from flask import jsonify from flask_restful import Resource, reqparse import ckanapi from tasks import harvesting HOST = os.getenv('CKAN_HOST') TOKEN = os.getenv('CKAN_API_TOKEN') CATALOG = os.getenv('CATALOG_HOST') remote = ckanapi.RemoteCKAN(HOST,...
import filer.fields.file from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("cms", "0003_auto_20140926_2347"), ("filer", "0001_initial"), ] o...
import math def newton(number): """ Newton's method for square root, according to Copilot """ global test_num test_num = 0 x = number / 2 while True: y = (x + number / x) / 2 if y == x: return y x = y def math_sqrt(number): """ Math.sqrt, accor...
import time def create_and_validate( cloud_provider, rke_client, kubectl, rke_template, nodes, base_namespace="ns", network_validation=None, dns_validation=None, teardown=False, remove_nodes=False): create_rke_cluster(rke_client, kubectl, nodes, rke_template) network_validation, dns_validatio...
"""Setuptools packaging script""" from setuptools import setup __version__ = '0.0.9' setup( name="testforeman", version=__version__, description="Orchestrate parallel test runs", long_description=open("README.md", "r").read(), long_description_content_type="text/markdown", keywords="test", ...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
import os import sys import zlib import pytz import time import redis import cPickle from random import randint from datetime import datetime from dateutil.parser import parse from django.core.management.base import BaseCommand, CommandError from core.models import * from api.v1.serializers import ArticleSerializer fr...
""" Persistence module. """ import os.path import pickle from dockie.core import ensure, errors from dockie.core.database import Database def persist_to_file(database: Database, filename: str, overwrite=False): """ Persists the database to a pickle file. :param database: The database. :param filename...
import logging import os from pathlib import Path from typing import Iterable, Tuple from urllib import parse import dask.bag as db from google.cloud.storage import Blob, Bucket, Client logger = logging.getLogger(__name__) def init_blob(bucket_name: str, blob_name: str) -> Blob: logger.debug(f"Initializing GCS ...
import matplotlib.pyplot as plt import numpy as np import pandas as pd from sko.pso.APSO import APSO """ time:2020-10 author:gaomin 测试文件demo_simple_gpso 是一个最基本的全局版的pso,惯量权重选择LDW方法 测试几个30维基准函数的求解结果。 为了方便对比,我们将FEs=300000,particle_num = 20,c1=c2=2 w=0.9(和石琳师姐的Co-evolutionary pso的比对设置相同) 将FEs=200000,particle_n...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app_manager', '0001_initial'), ] operations = [ migrations.CreateModel( name='AppType', fields=[ ...
# Generated by Django 2.2.1 on 2019-05-24 08:15 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0010_userprofile_avatar'), ] operations = [ migrations.AlterField( model_name='userprofile', name='avata...
from torchvision import datasets from torch.utils.data import DataLoader from sitorchtools.imbalanced import ImbalancedDatasetSampler class FolderLoader(object): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def loader(self, path, transform, imbalance=False, batch_size=32): ...
"""Some utilities for testing Krake components""" import asyncio import re import json from itertools import cycle, count from functools import wraps from time import time from aiohttp import web from krake.api.helpers import json_error from krake.controller.kubernetes import listen from kubernetes_asyncio.client imp...
import shutil import zipfile import pytest from git import Repo from mutester.mutant import Mutant from mutester.semantic_mutant_analysis import SemanticMutantAnalysis @pytest.fixture() def mutant_fixture(): with zipfile.ZipFile("tests/data/example_repo.zip", "r") as zip_ref: zip_ref.extractall("tests/d...
import re from datetime import datetime from pathlib import Path from typing import List, Optional, Tuple import typer from controller import RED, log, print_and_exit from controller.app import Application, Configuration from controller.commands.install import BUILDX_VERSION, COMPOSE_VERSION from controller.deploy.bu...
ls = input(">>") ls=ls.split(',') print(ls) ls1=sorted(ls,reverse=True) print(ls1)
#!/usr/bin/env python3 import os import re import subprocess from acquisition.step import AcquisitionStep from mfutil import mkdir_p_or_die from netCDF4 import Dataset from xattrfile import XattrFile class Convert_grib2MainStep(AcquisitionStep): plugin_name = "convert_grib2" step_name = "main" def __ini...
import math class GenericStanleyController: def __init__(self): self.k = 0.15 self.k2 = 0.3 self.k3 = 1.1 self.MAX_OUTPUT_VALUE = 0.5 self.MIN_OUTPUT_VALUE = -0.5 def set_parameters(self, param_k, param_k2, param_k3): self.k = param_k self.k2...
#-*-coding: utf-8 -*- """ /dms/mail.py .. enthaelt Hilfefunktionen fuer E-Mails Django content Management System Hans Rauch hans.rauch@gmx.net Die Programme des dms-Systems koennen frei genutzt und den spezifischen Beduerfnissen entsprechend angepasst werden. 0.01 07.05.2007 Beginn der Arbeit """ import...
#!/usr/bin/env python """ Startup Runner for Simx Act/React. @author Paul Stickney - Oct 2008 """ from optparse import OptionParser import os import sys import time import traceback from TOSSIM import * # Enable compiled Simx modules to be found -- this assumes that this # program was invoked from the directory fro...
#!/usr/bin/env python3 import random import matplotlib.pyplot as plt CHANGES = [-1, 0, 1] deals = [] price = 10 for i in range(10000): #price += random.choice(CHANGES) #price = price if price > 0 else 0 price *= 1 + 0.05 * random.choice(CHANGES) deals.append(price) plt.plot(deals) plt.show()
# coding: utf-8 ######################################################################### # 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> # # author yeeku.H.lee kongyeeku@163.com # # # # version 1.0 ...
''' script to test the function `forwardmodel.BOSS_randoms` ''' import os, time import numpy as np from boss_sbi import util as UT from boss_sbi.halos import Quijote_LHC_HR from boss_sbi import galaxies as Galaxies from boss_sbi import forwardmodel as FM # --- plotting --- import matplotlib as mpl mpl.use('pdf') i...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import numpy as np import os import rospy import sys # Robot motion commands: # http://docs.ros.org/api/geometry_msgs/html/msg/Twist.html from geometry_msgs.msg import Tw...
import requests from mwd.settings import RECAPTCHA_V2_SECRET_KEY, RECAPTCHA_V3_SECRET_KEY def _get_client_ip(request): x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR') if x_forwarded_for: ip = x_forwarded_for.split(',')[0] else: ip = request.META.get('REMOTE_ADDR') return i...
#!usr/bin/env python3 # -*- coding: utf-8 -*- """ Test module to implement synchronous blocking to address race condition among threads, using threading.Lock and threading.Semaphore/threading.BoundedSemaphore. """ __author__ = 'Ziang Lu' import time from threading import BoundedSemaphore, Lock, Semaphore, Thread, cu...
#!/usr/bin/env python # -*- coding: utf-8 -*- def mapFeature(X1, X2): degree = 6 out = [] from math import pow for r in range(len(X1)): row = [] for i in range(degree + 1): for j in range(i + 1): xx = pow(X1[r], i - j) * pow(X2[r], j) row.app...
""" Testing rasterization pipeline """ import os import geopandas as gpd import pytest from eolearn.core import EONode, EOPatch, FeatureType, MapFeatureTask from eogrow.core.config import interpret_config_from_path from eogrow.pipelines.rasterize import RasterizePipeline from eogrow.utils.testing import ContentTeste...
from unittest import mock import pytest from tsplib95 import transformers as T from tsplib95 import exceptions @pytest.fixture def map_transformer(): def make(**kwargs): return T.MapT(**kwargs) return make def test_that_it_works(map_transformer): text = 'foo:1 bar:2 baz:3' map_ = {'foo': '...
# coding=utf-8 # Copyright 2019 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 ...
""" Autotuning System output_common.py A collection of functions which are common to several of the different output methods. This script doesn't directly produce output. So far, this consists of the functions required to read in the CSV file. """ # File opening in Python 2.5 from __future__ import with_statement...
# coding: utf-8 """implementing Brandon's ML detection method""" import numpy as np import pandas as pd import matplotlib.pyplot as plt from radcomp.vertical import case, filtering, ml, classification, NAN_REPLACEMENT def filter_ml_top(top, size=3): """Apply median filter to ml top height.""" topf = filterin...
import os class Config: # secret key SECRET_KEY = os.environ.get('SECRET_KEY', "2OSwOA+nb/GcT5B+O9e297MftGgOR4zLRufPtFWmQkA=") # sql alchemy db configuration SQLALCHEMY_DATABASE_URI = os.environ.get( 'SQLALCHEMY_DATABASE_URI', "sqlite:///{}".format(os.path.join(os.getcwd(), "app/site....
import numpy as np import torch import torch.nn.functional as F def iou_score(output, target): """ calculates the iou score for a given prediction. :param output: :param target: """ smooth = 1e-5 if torch.is_tensor(output): output = torch.sigmoid(output).data.cpu()....
from src.database import engine, db_session from src.models import Base, Student, Classe Base.metadata.drop_all(bind=engine) Base.metadata.create_all(bind=engine) # Create the fixtures # Students ron = Student(name='Ron') harry = Student(name='Harry') herm = Student(name='Hermiona') db_session.add_all([ron, harry, h...
""" SNMPv2_MIB The MIB module for SNMP entities. Copyright (C) The Internet Society (2002). This version of this MIB module is part of RFC 3418; see the RFC itself for full legal notices. """ from collections import OrderedDict from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YLis...
""" Evaluation metrics .. automodule:: ote_sdk.usecases.evaluation.accuracy :members: :undoc-members: .. automodule:: ote_sdk.usecases.evaluation.basic_operations :members: :undoc-members: .. automodule:: ote_sdk.usecases.evaluation.dice :members: :undoc-members: .. automodule:: ote_sdk.usecases.e...
characters = {"S": [[0, 1, 1, 1, 1], [1, 0, 0, 0, 0], [1, 1, 1, 1, 1], [0, 0, 0, 0, 1], [1, 1, 1, 1, 0]], "O": [[0, 1, 1, 1, 0], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1], [0, 1, 1, 1, 0]], "L": [[1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 1, 1, 1, 1]], ...
import cv2 import time from PIL import Image import numpy as np import csv import logistic import mouthoriginal as m WIDTH, HEIGHT = 28, 10 # all mouth images will be resized to the same size dim = WIDTH * HEIGHT # dimension of feature vector #pop up an image showing the mouth with a blue rectangle def show(area): ...
""" Userbot module for other small commands. """ from userbot import CMD_HANDLER as cmd from userbot import CMD_HELP, owner from userbot.utils import edit_or_reply, trans_cmd @trans_cmd(pattern="ihelp$") async def usit(event): await edit_or_reply( event, f"**Hai {owner} Kalo Anda Tidak Tau Perinta...
from config import config as config import json import os csv_annotations = [] separator = ',' def convert_json_to_list(): json_file = os.path.join('../' + config.JSON_PATH, 'all_labelled_20205013.json') with open(json_file) as json_file: images = json.load(json_file) for i, key in enumerate(...
from logistic_regression import LogisticRegression
from geographies import Geography from db_connection import get_connection, close_connection class PointGeography(Geography): """A class for point geographies""" def __init__(self, name,address,city,zip,point): Geography.__init__(self,name,point) self.address = address self.city = city self.zip = zip def ...
# Unix SMB/CIFS implementation. # Copyright (C) Matthieu Patou <mat@matws.net> 2009-2010 # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option...
# encoding: utf-8 # module Rhino.Input.Custom calls itself Custom # from RhinoCommon, Version=5.1.30000.16, Culture=neutral, PublicKeyToken=552281e97c755530 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no functions # classes class CommandLineOption(object): # ...
Experiment(description='More kernels but no RQ', data_dir='../data/tsdl/', max_depth=8, random_order=False, k=1, debug=False, local_computation=False, n_rand=9, sd=4, max_jobs=400, verbose=False, ...
"""Extension of Debian class with wifi functions """ import re import pexpect import pycountry from boardfarm.lib.wifi import wifi_client_stub from . import debian class DebianWifi(debian.DebianBox, wifi_client_stub): """Extension of Debian class with wifi functions wifi_client_stub is inherited from lib/wi...
from __future__ import print_function # from builtins import str # from builtins import object import pandas as pd from openpyxl import load_workbook import numpy as np import os from .data_utils import make_dir class XlsxRecorder(object): """ xlsx recorder for results including two recorder: one for curre...
from repository.database_inventory_repository import \ DatabaseInventoryRepository from . import behavior class InvalidQuery(behavior.Behavior): def __init__(self, database_inventory_repository: DatabaseInventoryRepository, value=None): super().__init__("INVALID-QUERY", value) self.__database...
from django.urls import path from . import views app_name = 'search' urlpatterns = [ path("", views.index, name="search"), path("credits", views.credits, name="credits"), ]
import angr ###################################### # close ###################################### class close(angr.SimProcedure): def run(self, fd): # pylint:disable=arguments-differ if self.state.posix.close(fd): return 0 else: return -1
"""Preset configurations for autogluon.timeseries Predictors""" # TODO: change default HPO settings when other HPO strategies (e.g., Ray tune) are available # TODO: add refit_full arguments once refitting is available TIMESERIES_PRESETS_CONFIGS = dict( best_quality={ "hyperparameters": "default_hpo", ...
import hashlib import json from django.conf import settings import os import smtplib import urllib2 from celery.task import task import time from django.contrib.auth.models import User from ntlm.smtp import ntlm_authenticate from django_sensible import SECURE_CONFIG from django_sensible.identity import getAttributes fr...
# -*- coding:utf-8 -*- SERVER_IP = ['127.0.0.1:9092', ] # kafka集群地址,用逗号分隔 TOPIC = 'test2' # kafka要消费的topic AUTO_OFFSET_RESET = 'latest' # latest:最新数据开始, earliest:重头开始 CONSUMER_GROUP = 'test_group33' # 消费组 API_VERSION = (2, 3, 0) # kafka版本 # SSL配置 SSL_SERVER_IP ...
import tkinter as tk from tkinter import ttk class stdFrame(ttk.Frame): def __init__(self, container): super().__init__(container) self.grid(row=0, column=0) width = self.winfo_screenwidth() heigth = self.winfo_screenheight() sizex = 300 sizey = 300 self.ne...
# import unittest # # from meliora.worker import Worker # from meliora.worker import Meliora # from meliora.backtest import Backtest # from meliora.enums import RunMode # from meliora.main import get_worker # from meliora.config.config import Configuration # # # class TestGetWorker(unittest.TestCase): # def test_ba...
# coding: utf-8 # Copyright 2021 The Oppia 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 requir...
#!/usr/bin/env python3 # Copyright (c) 2019 Bitcoin Association # Distributed under the Open BSV software license, see the accompanying file LICENSE. """ First test (__test_getdata): 1. Send block via p2p connection (block validation completion is delayed) 2. Request get data before it is validated 3. Complete validat...
import ble_uart_peripheral def run(): ble_uart_peripheral.runBleCommandProcessor( 'HelloWifi ESP32', b'\x7E\xE7\x55\xCA', '19B10010-E8F2-537E-4F6C-D104768A1214' )
#!/usr/bin/env python import logging import os import traceback from autopyfactory.apfexceptions import ConfigFailure from autopyfactory.configloader import Config, ConfigManager from autopyfactory.interfaces import ConfigInterface class File(ConfigInterface): def __init__(self, factory, config, section): ...
import csv from directory_constants import user_roles from rest_framework.serializers import ValidationError from django.db.models import BooleanField, Case, Count, When, Value from django.utils.functional import cached_property from company.models import Company from supplier.models import Supplier MESSAGE_ADMIN_...
def dummy_job(package_version): pass
"""Implementation of different Temporal-Difference methods""" import argparse import numpy as np import plot as plt import random from abc import ABC, abstractmethod from env import Easy21 from policy import EpsilonGreedyPolicy from tqdm import tqdm # For reproducibility random.seed(0) class TemporalDifferenceContr...
l_30 = 10000.00; l_31 = 9965.22; l_32 = 9927.12; l_33 = 9885.35; l_34 = 9839.55; d_30 = 34.78; d_31 = 38.10; d_32 = 41.76; d_33 = 45.81; d_34 = 50.26; v = 1/1.1; A_33 = 0.6; A_32 = v*d_32/l_32 + v*l_33*0.6/l_32; A_31 = v*d_31/l_31 + v*l_32*A_32/l_31; A_30 = v*d_30/l_30 + v*l_31*A_31/l_30; import math i4 = 4*(math.p...
from typing import List class Solution: def sortColors(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ self.quick3Way(nums, 0, len(nums)-1) def quick3Way(self, nums, lo, hi): if lo >= hi: return ...
import ptc from ptc.packet import SYNFlag, ACKFlag from base import PTCTestCase class SYNTest(PTCTestCase): def test_server_connection(self): # 1. Create a server instance server = self.launch_server() self.assertEquals(ptc.constants.LISTEN, server.protocol.state) # 2. Send S...
def clean_filename(filename): if filename.startswith(('a/', 'b/')): filename = filename[2:] return filename def parse(buffer, tags): curtag = None diff_start = False for n, line in enumerate(buffer, 1): if line.startswith('diff'): # diff [--git] file1 file2 ...
#!/usr/bin/env python3 import asyncore, socket import sys import threading import logging logger = logging.getLogger('lsp-daemon') hdlr = logging.FileHandler('/Users/ppinheiro/git_tree/pinelang/lsp/server/lsp-daemon.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatte...
from ixnetwork_restpy.base import Base from ixnetwork_restpy.files import Files class SDI_Video_Format(Base): __slots__ = () _SDM_NAME = 'sdiVideoFormat' _SDM_ATT_MAP = { 'Map': 'sdiVideoFormat.sdiHeader.Map', 'Sample': 'sdiVideoFormat.sdiHeader.sample', 'Frame': 'sdiVideoFormat.sd...
import os import numpy as np from matplotlib import pyplot as plt class SafeUtils: @staticmethod def remove_files(files): for file in files: try: os.remove(file) except Exception: pass
from PyQt5.QtWidgets import QWidget from PyQt5.QtGui import QPainter, QBrush, QPen, QColor from PyQt5.QtCore import Qt import math class QBarPlot(QWidget): def __init__(self): super().__init__() self.horizontal_margin = 10 self.vertical_margin = 10 self.data = None self....
# Copyright 2016-2022 The FEAGI 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 applic...
import argparse import logging import pathlib import functools import cv2 import torch from torchvision.transforms import functional as F from object_detection import MaskRCNN from object_detection import filter_by_threshold from object_detection import draw_results def parse_args(): parser = argparse.ArgumentP...
import torch from unittest import TestCase from vdb import Gan_networks as gns device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class TestResnetBlock(TestCase): def setUp(self): # in this block shortcut is learnable self.resBlock_1 = gns.ResnetBlock(fin=21, fout=79).to(devi...
# -*- coding: utf-8 -*- # Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause import sys from .cli import main sys.exit(main())
import cv2 import concurrent.futures from config.app_conf import AppConf from utils.logger import Logger from video.v3io_image import V3ioImage import logging import socket import requests def get_conf_log_level(level): if level == "debug": return logging.DEBUG if level == "info": return loggi...
from converter import CamelCaseModel, DataProductDefinition from pydantic import Field class BasicCompanyInfoRequest(CamelCaseModel): company_id: str = Field( ..., title="Company ID", description="The ID of the company", example="2464491-9", ) class BasicCompanyInfoResponse(C...
from pydrive.onedrive import driver as od r_token = None a_token = None od.upload(rtoken=r_token, atoken = a_token)
# -*- coding: utf-8 -*- # Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is # holder of all proprietary rights on this computer program. # You can only use this computer program if you have closed # a license agreement with MPG or you get the right to use the computer # program from someone who i...
# Link for the problem : https://leetcode.com/problems/merge-intervals/ # Input: intervals = [[1,3],[2,6],[8,10],[15,18]] # Output: [[1,6],[8,10],[15,18]] # Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]. # Create a list merged to store the merged intervals # Condition for merging : If...
# -*- coding: utf-8 -*- """Models for API requests & responses.""" import dataclasses from typing import List, Optional, Type import marshmallow_jsonapi from .base import BaseModel, BaseSchema, BaseSchemaJson class LifecycleSchema(BaseSchemaJson): """Pass.""" last_finished_time = marshmallow_jsonapi.fields...
# Proszę napisać program wypisujący elementy ciągu Fibonacciego mniejsze od miliona. i, j, nxt = 1, 1, 2 # default sep is " " (a space) # but now args passed to print will be separated by # a newline, this allows us to write single line # insted of three print(i, j, nxt, sep="\n") while nxt<1000000-j: # i = j ...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2020 CoML # 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 ...
import string from hypothesis.strategies import text, sampled_from def namespace_names(): return text(min_size=1, max_size=10, alphabet=string.ascii_letters) def apps(): return sampled_from([ ('bare-tasks', 'tests.examples.bare_tasks'), ('ns-tasks', 'tests.examples.ns_tasks'), ])