text
stringlengths
3.07k
22.1k
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # 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 agre...
# # 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 not us...
from datetime import datetime from dataloader.outdoor_data_mfcc import ActionsDataLoader as SoundDataLoader from dataloader.actions_data_old import ActionsDataLoader from models.unet_acresnet import UNetAc from models.vision import ResNet50Model import numpy as np import tensorflow as tf import os from scipy import sig...
import tkinter as tk from tkinter import * from tkinter import ttk import tkinter.messagebox as mb from main import threader def changeValueSRow(): value = maximumRow.get() if value != "Please select value": maximumR = int(maximumRow.get()) num = list(range(2, maximumR - 1)) ...
import logging from pathlib import Path from ploomber.exceptions import RenderError from numpydoc.docscrape import NumpyDocString import jinja2 from jinja2 import (Environment, meta, Template, UndefinedError, FileSystemLoader, PackageLoader) class Placeholder: """ A jinja2 Template-like ...
#!/usr/bin/env python3 """script to parse output from sslscan and find common issues, then dump into a docx""" try: import argparse import docx import os import re import sys import time from docx.shared import Pt from docx.shared import Inches from docx.shared import RGBColor ...
# Copyright 2017 <NAME>, <NAME> # # 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...
"""Utility functions for parsing inputs.""" import warnings import numpy as np import pandas as pd import xarray def _fig_dimensions(kwargs): if ( "width" not in kwargs and "plot_width" not in kwargs and "frame_width" not in kwargs ): kwargs["frame_width"] = 375 if ( ...
from __future__ import absolute_import from collections import deque, namedtuple import warnings import random import numpy as np # This is to be understood as a transition: Given `state0`, performing `action` # yields `reward` and results in `state1`, which might be `terminal`. Experience = namedtuple('Experience',...
import numpy as np import random import math class evolution_benchmark(): def __init__(self, F, bounds, num_pop, num_gen): self.F = F #Fit function NB. Best fit = Higher fitnes value, so to find minimum put the - before! self.bounds = np.array(bounds) #Function bounds self.num_pop...
import os import signal import threading import docker import dockerpty from subprocess import Popen, STDOUT, PIPE, SubprocessError, CalledProcessError import spython from spython.main.parse.parsers import DockerParser from spython.main.parse.writers import SingularityWriter from popper import utils as pu from popp...
from fastNLP.models.biaffine_parser import BiaffineParser from fastNLP.models.biaffine_parser import ArcBiaffine, LabelBilinear import numpy as np import torch from torch import nn from torch.nn import functional as F from fastNLP.modules.dropout import TimestepDropout from fastNLP.modules.encoder.variational_rnn ...
import torch import torch.nn.functional as F import torch.nn as nn from torch_scatter import scatter class BatchNormNode(nn.Module): """Batch normalization for node features. """ def __init__(self, hidden_dim): super(BatchNormNode, self).__init__() self.batch_norm = nn.BatchNorm1d(hidden_...
import torch import pickle import torch.utils.data import time import os import pandas as pd import csv import dgl from scipy import sparse as sp from torch.nn.utils.rnn import pad_sequence import numpy as np import networkx as nx import hashlib from train.config import Config class MoleculeDGL(torch.utils.data.Datas...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # Copyright Kitware 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 t...
#!/usr/bin/env python # -*- coding:utf-8 -*- import pandas as pd import sys from collections import Iterable import numpy as np import pkg_resources import bz2 import pickle from signature_code.evaluate_phylo500 import format_clonesig, format_sciclone, format_pyclone, format_ccube, format_dpclust, format_deconstructsi...
#!/usr/bin/python3 """ Ackermann Steering Simulator with Tkinter and Pyplot <NAME> 18.02.2019 """ from time import time import tkinter as tk import numpy as np from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg from matplotlib.patches import Ellipse, Circle, Polygon, Rectangle from matplotl...
''' EXTD Copyright (c) 2019-present NAVER Corp. MIT License ''' #-*- coding:utf-8 -*- from __future__ import division from __future__ import absolute_import from __future__ import print_function import os import time import torch import argparse import torch.nn as nn import torch.optim as optim impor...
import argparse from typing import Any, Dict, List, Sequence import torch import torch.nn as nn import torch.nn.functional as F from solo.losses.simsiam import simsiam_loss_func from solo.methods.base import BaseModel from solo.losses.vicreg import covariance_loss class BiasLayer(nn.Module): def __init__(self): ...
from django.http import HttpRequest from rest_framework.request import Request from rest_framework import status from backend.models.event.cloudwatchevent import CloudWatchEvent from backend.models.eventmodel import ScheduleModel, EventModel from backend.externals.events import Events from backend.models.resource...
# # LG AC SmartThinq Plugin # Author: olinek2, 2018 # """ <plugin key="LG-SmartThinq-AC" name="LG AC SmartThinq" author="olinek2" version="0.1.0" wikilink="https://github.com/olinek2/LGAC_SmartT"> <description> LG AC SmartThinq Plugin </description> <params> <param ...
import os import time import shutil import numpy as np import torch from torch.autograd import Variable import torchvision.transforms as transforms class AverageMeter(object): def __init__(self): self.reset() def reset(self): self.avg = 0 self.sum = 0 self.cnt = 0 def u...
""" Definitions for different labels present in Vicar files. This is a collection for their values and types collected into enums. The reader will try to convert all the SystemLabels into other label types where applicable. """ from enum import Enum from typing import Type, Dict, List, Tuple, Optional, Set import num...
import os from model.blueprint import * from model.project import * from model.disk import * from model.discover import * from utils.log_reader import * from utils.dbconn import * from utils.logger import * from pkg.common import nodes as n import time from pkg.azure import network from pkg.aws import disk as awsdisk ...
""" Script entry point """ from src.calrissian.particle4_network import Particle4Network from src.calrissian.layers.particle4 import Particle4 from src.calrissian.layers.particle4 import Particle4Input from src.calrissian.optimizers.particle4_sgd import Particle4SGD import numpy as np def main(): train_X = np....
import math import torch import sys import torch.nn as nn import torch.nn.functional as F from .py_utils.loss_utils import _regr_loss, _neg_loss from torch.autograd import Variable from .resnet_features import resnet50_features, resnet18_features, resnet101_features, resnext101_32x8d, wide_resnet101_2 from .py_utils.ut...
#!/usr/bin/python import json import os import pprint import re import discord import getpass import argparse import logging import requests EMOJI_RE = re.compile("<:([^>]+):([0-9]{18})>") logging.basicConfig( level="WARNING", style="{", format="[{asctime}] [{process}] [{levelname}] {fil...
import os import argparse import torch import numpy as np import torch.nn.functional as F from yacs.config import CfgNode as CN import tqdm import datetime from terminaltables import AsciiTable from data import NYUv2_Dataloader, KITTI_Dataloader from model import MFF_Model, BTS_Model from utils import AverageMeter, lo...
# -*- coding: utf-8 -*- """ Provides support for decoding a bencoded string into a python OrderedDict, bencoding a decoded OrderedDict, and pretty printing said OrderedDict. """ __all__ = ['Encode', 'Decode'] import logging from collections import OrderedDict from io import BytesIO from typing import Union, Dict, An...
import os,re,time,asyncio import sys sys.path.append(os.path.abspath('../../tmp')) sys.path.append(os.path.abspath('.')) try: import aiohttp except Exception as e: print(e, "\n请更新pip版本:pip3 install --upgrade pip \n缺少aiohttp 模块,请执行命令安装: pip3 install aiohttp\n") exit(3) # 调试 # 京喜财富岛兑换111红包 # 59 59 * * * * ...
import logging import re import traceback from opentrons import __version__ from fastapi import FastAPI, APIRouter, Depends from fastapi.exceptions import RequestValidationError from starlette.responses import Response, JSONResponse from starlette.requests import Request from starlette.exceptions import HTTPException ...
import os import argparse import torch import cv2 import logging import numpy as np from net import * from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.utils.data as data from torch.utils.data import DataLoader import sys import math impo...
""" Usage: Step 1: python summary_graphs.py --logdir=../results/classic_control --opr extract_summary Step 2: python summary_graphs.py --logdir=../results/classic_control --opr plot Why 2-step process? : Sometimes , you may want to re-do the plotting with some changes for more beautification. In those cases, we can av...
import asyncio import discord from discord.ext import commands from Cogs import DisplayName from Cogs import Message def setup(bot): # Add the bot settings = bot.get_cog("Settings") bot.add_cog(Quote(bot, settings)) class Quote: # Init with the bot reference, and a reference to the settings var def __init...
""" Transition Disc Example ======================= This example uses the gas and dust density profiles inferred for the transitional disc HD135344B. """ #****************** #sf3dmodels modules #****************** from sf3dmodels import Model, Plot_model import sf3dmodels.utils.units as u import sf3dmodels.rt as rt fr...
#!/usr/bin/env python """This file contains all the functions needed to compute the shimmers of a waveform.""" import numpy as np from .jitters import validate_frequencies from .utils import ( shifted_sequence, peak_amplitude_slidingwindow, ) def validate_amplitudes(amplitudes, frequencies, max_a_factor, p...
import numpy as np def read_raw(path, chan_num): dt = np.dtype([('row', np.int32), ('feature1', np.float32), ('feature2', np.float32), ('feature3', np.float32), ('feature4', np.float32), ('feature5', np.float32), ('feature6', np.float32), ('feature7', np.float32), ...
#!/usr/bin/env python """ Created on Mon Aug 29 2016 Modified from the similar program by Nick @author: <NAME> Modified from authors above to have python work seamlessly in Windows and Linux. @author: <NAME> Optical Powermeter (tkinter) Version 1.03 (last modified on Aug 29 2019) v1.01: There was a bug as worker thr...
# ---------------------------------------------------------------------------- # Copyright (c) 2020, <NAME>. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------------------------...
import contextlib import functools import logging import sys import warnings from typing import List, Sequence import pytorch_lightning as pl import rich.syntax import rich.tree from omegaconf import DictConfig, OmegaConf from pytorch_lightning.utilities import rank_zero_only try: from jammy import link_hyd_run e...
# -*- coding: utf-8 -*- from __future__ import print_function import logging import argparse import random import dnslib from pkg_resources import resource_filename from greendns import session from greendns import connection from greendns import localnet from greendns import handler_base from greendns import cache EX...
#!/usr/bin/env python # encoding: utf-8 # This file is part of CycloneDX Python # # 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 ...
# Copyright (C) 2011-2020 Airbus, <EMAIL> try: from plasmasm.python.compatibility import set, sorted except ImportError: pass import logging log = logging.getLogger("plasmasm") from plasmasm.constants import Constant, P2Align def stack_tracking(label, value): # Analyzes the use of the red zone. # Cf. ...
""" Implementations of standard library functions, because it's not possible to understand them with Jedi. To add a new implementation, create a function and add it to the ``_implemented`` dict at the bottom of this module. Note that this module exists only to implement very specific functionality in the standard lib...
import pygame # to create game functionalities import csv # to load csv's from pygame import mixer # to load music and sound effects from code.world import World from code.config import * from code.player_attributes import HealthBar from code.button import Button from pygame.locals import * mixer.init() pygame.ini...
import re import subprocess import collections import errno from os import makedirs from os.path import join, isfile, split import xml.etree.ElementTree as ET import sublime import sublime_plugin # initialize globals, necessary to communicate between # SublimeCommand class and SublimeEventListener class activating_co...
from lxml.etree import Element, SubElement, tostring from utils import log import shutil import json import os import cv2 import numpy as np def get_pic_dir(out_put_dir): img_dir = os.path.join(out_put_dir, "img") pic_dir = os.path.join(img_dir, "pic") return pic_dir def get_fragment_dir(out_put_dir): ...
from __future__ import print_function import pickle import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from apiclient import errors import base64 from io import StringIO from html.parser import HTMLParser i...
# /usr/bin/env python3.5 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2019, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
import datetime from typing import Union, Sequence from dateutil import parser from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.remote.webelement import WebElement from pages.helpers import wait_for, elem_has_class class InvalidDate(Exception): pa...
import pandas as pd import json import os import sys import datetime from datetime import time from src.util import logger def loadIntradayData(filepath): data = pd.read_csv(filepath, parse_dates=[0], names=['datetime', 'value']) return data #TODO implement and test loading more than one intraday interval de...
#!/usr/bin/env python """ Maintain a directory at ~/remotefs/ for mounting remote filesystems over SSH. """ from __future__ import print_function import argparse import os import pickle import subprocess import sys from eapy.shell import ( ensure_commands_exist, PPTable, colorize, COLOR_GREEN, COLOR_RED, COLO...
import numpy as np import shutil import subprocess from mtuq.graphics._gmt import exists_gmt, gmt_not_found_warning, gmt_version,\ gmt_formats from mtuq.util import fullpath, warn from mtuq.util.math import wrap_180, to_delta, to_gamma, to_mij from os.path import basename, exists, splitext from six import string_...
"""Contains generic filter class, :class:`Filter`, to apply any FFmpeg filter.""" __author__ = '<NAME>' __version__ = '1.0' __all__ = ['generate_filter', 'filter_parameters', 'register_filter_complex', 'filter_complex', 'process_argument_string', 'process_layer_st...
#!/usr/bin/python """ Interface for viewer """ import wx import re import os, sys import logging from reader import Reader from wx.lib.mixins.listctrl import ListCtrlAutoWidthMixin from wx.lib.mixins.listctrl import ColumnSorterMixin class NewListCtrl(wx.ListCtrl, ColumnSorterMixin, ListCtrlAutoWidthMixin): ...
# NOTE: use +1 convention for box # w=x2-x1+1 # h=y2-y1+1 import os.path as osp import sys from itertools import groupby import numpy as np import numpy.random as npr import pycocotools.mask as cocomask from PIL import Image, ImageFile from skimage.morphology import binary_dilation as _binary_dilation from skimage.mor...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. r""" Source: `pytorch imagenet example <https://github.com/pytorch/examples/blob/master/i...
# Submitted April 2, 2020 # Team 28: # <NAME> 101098993 # <NAME> 101138391 # <NAME> 101146639 # <NAME> 101169280 # MILESTONE 3 # IMPORTS from Cimpl import copy, get_color, set_color, Image, choose_file, load_image, create_color, show, get_height, get_width from simple_Cimpl_filters import grayscale # CONSTANTS COLO...
from tkinter import * import tkinter.filedialog import tkinter.font as tkFont from tkinter.messagebox import * from PIL import Image, ImageTk # pillow 模块 import os import json from aip import AipFace import camare config = json.load(open('./config/config.json')) """ 你的 APPID AK SK """ APP_ID = config['APP']['APP_ID'...
def plotly(df): import pandas as pd import numpy as np import re import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import plotly.express as px from plotly.subplots import make_subplots import ...
"""Records shared by all osid objects""" from .base_records import ObjectInitRecord, QueryInitRecord, ProvenanceFormRecord from dlkit.json_.osid import record_templates as osid_records from dlkit.json_.osid.metadata import Metadata from dlkit.abstract_osid.osid.errors import NoAccess from dlkit.primordium.id.primitiv...
import numpy as np from numba import jit, prange from .usefuls import * from . import cosmology as cm from . import conv import itertools print("Using numba module") KB_SI = 1.38e-23 c_light = 2.99792458e+10 #in cm/s janskytowatt = 1e-26 @jit def superpixel_map_numba(data, labels, mns=None): from superpixels imp...
# Program to create a neural network with input layer, # output layer, and one hidden layer. # * UPDATE * # Added support for multiple hidden layers! Yay! # Import statements from __future__ import print_function from random import random, randint from math import exp from tqdm import tqdm from pickle import dump ''...
import json import numpy import pandas as pd import re import spacy from nltk.util import ngrams from collections import Counter import matplotlib.pyplot as plt import seaborn as sns nlp = spacy.load("en_core_web_sm") # python -m spacy download en_core_web_sm sns.set(style="whitegrid") ## Constants # source = "Redd...
import time import DetectPlatform import RemoteArduino class ArduinoPin: def __init__(self, name, number, net = None, suppressHigh = False, suppressLow = False): self.name = name self.number = number if(net == None): self.net = name else: self.net = net self.suppressHigh = suppre...
import scVI import tensorflow as tf from benchmarking import * from helper import * import numpy as np import time import pandas as pd from sklearn.model_selection import train_test_split from sklearn.manifold import TSNE from sklearn import cluster,manifold import matplotlib.pyplot as plt # %matplotlib inline import ...
# # Author : <NAME> # July - 2019 # This script will generate the data for the graphs displayed on dashboard # import calendar, re from django.contrib.auth import get_user_model from django.utils import timezone from django.db.models import Q from helpdesk.models import Ticket """ Output =========================...
import pyttsx3 import datetime import speech_recognition as sr import wikipedia import smtplib import webbrowser as wb import psutil from wikipedia.wikipedia import search import pyjokes import os import pyautogui import random import string import numpy as np from urllib.request import urlopen import ...
import sys import joblib import json import dask.bag as db import pandas as pd import nltk import re import time from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer from nltk.tokenize import word_tokenize from dask.bag import random from sklearn.feature_extraction.text import TfidfVectori...
from __future__ import print_function import sys from matplotlib import pyplot as plt plt.switch_backend('agg') import numpy as np import torch # Library code sys.path.insert(0, '..') from struct2seq import * from argparse import ArgumentParser def get_args(): parser = ArgumentParser(description='Structure ...
""" MIT License Copyright (c) 2021 Andy 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, distribu...
#!/usr/bin/python # -*- coding: utf-8 -*- ################################################################################ # Copyright (c) 2019 <NAME> # # 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...
"""Preprocess ImageNet 1K in advance, in order to avoid transform overhead one would have amortized at each batch collection using dataloader. Recommend you to install Pillow-SIMD first. $ pip uninstall pillow $ CC="cc -mavx2" pip install -U --force-reinstall pillow-simd """ import multiprocessing as mp import os i...
#from adt import ADT #from adt import memo as ADTmemo from .prelude import * from . import atl_types as T from .frontend import AST from fractions import Fraction import numpy as np import math # --------------------------------------------------------------------------- # # -------------------------------------...
import os import numpy as np import json import torch import glob from torch.utils.tensorboard import SummaryWriter from models.universal_model import ( UniversalModel, LSTMModel, TransformerModel) from models.metrics import ( ClassificationMetric, LMMetric, PDAMetric, FullMetric) from datas...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Gears for bots. "Gears for Bots" # Programmed by CoolCat467 __title__ = 'Gears' __author__ = 'CoolCat467' __version__ = '0.1.5' __ver_major__ = 0 __ver_minor__ = 1 __ver_patch__ = 5 import math from typing import Union import asyncio import concurrent.futures import...
import cv2 import queue import numpy as np import math from scipy.spatial import ConvexHull from scipy.ndimage.interpolation import rotate THRESHOLD = 25 def RGB_distance_threshold(first_rgb, second_rgb): return math.sqrt(np.sum((np.absolute(first_rgb - second_rgb))**2)) < THRESHOLD def check_pixels_in_one_direc...
import torch import torch.nn as nn from efficientnet_pytorch.model import efficientnet from habitat_baselines.rl.ddppo.policy.running_mean_and_var import ( RunningMeanAndVar, ) from habitat_baselines.rl.models.rnn_state_encoder import RNNStateEncoder from habitat_baselines.rl.ppo import Net #, Policy from habitat_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ **BETTERSIS.SISCOMPLETER**: Defines an object that helps for autocompletion of commands. """ __author__ = "<NAME>" import os import logging from prompt_toolkit.completion import NestedCompleter import siswrapper try: from ._version import __version__ # noqa: F...
## ========================================================================= ## ## ## ## Filename: jsGenerator.py ## ## ...
# New BSD License # # Copyright (c) 2007–2019 The scikit-learn developers. # Copyright (c) 2019 <NAME> # All rights reserved. # # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # a. Redistributions of source code mus...
from collections import deque from enum import Enum from functools import lru_cache from itertools import chain from math import inf from random import randint, shuffle, choice, sample from typing import List, Tuple, Dict, Union, Optional, Iterator, Generator import networkx as nx from models.position import Position...
""" Helper functions for SoaringSpot competitions. The files from SoaringSpot always contain task information, which can be used for competition analysis. """ import datetime import re from typing import List, Tuple, Union from urllib.error import URLError from urllib.parse import urljoin from aerofiles.igc import Rea...
import os from pathlib import Path from random import shuffle import datetime import click import dotenv import tensorflow as tf import h5py import pandas as pd # from tensorflow.python.keras.losses import SparseCategoricalCrossentropy from src.models.losses_2d import CustomLoss, gtvl_loss from src.models.fetch_data_...
## AUTHOR: <NAME> # ============================================================================ # Filename: main.py # Example usage: python main.py --data ../natural_images [--checkpoint .pth] # ============================================================================ import argparse from IE643_160050064_assignm...
import logging import os import fnmatch import re from subprocess import call from collections import Counter import pandas as pd import numpy as np from sklearn.preprocessing import label_binarize from sklearn.metrics import roc_curve, auc, precision_recall_curve from sklearn.metrics import roc_auc_score, average_prec...
#!/usr/bin/env python3 # # - SolidityEndToEndTest.trace was created with soltest with the following command on # ./soltest --color_output=false --log_level=test_suite -t SolidityEndToEndTest/ -- --no-smt # --evmonepath /Users/alex/evmone/lib/libevmone.dylib --show-messages > SolidityEndToEndTest.trace # - a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """General functions to compute borders and insulation score. Functions: - get_relative_insulation - get_ri_score - get_local_score - detect_final_borders - get_insulation_score """ import bacchus.hic as bch import copy import numpy as np import os ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function from ansible.module_utils.basic import AnsibleModule, env_fallback from ansib...
import pytest # from compas.geometry import homogenize # from compas.geometry import dehomogenize from compas.geometry import Rotation from compas.geometry import Translation from compas.geometry import allclose from compas.geometry import intersection_segment_segment_xy from compas.geometry import mirror_points_line ...
from dataclasses import dataclass from datetime import datetime from typing import List, Tuple, Optional import logging import pytz import requests from requests import HTTPError from marshmallow import Schema, fields, post_load # Because this is a library, we don't want to force logs on people if they # don't confi...
# Copyright (C) 2021 Intel Corporation # # 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 wri...
import os import random import math import argparse import Levenshtein import numpy as np from tqdm import tqdm from scipy.misc import imread, imresize from rdkit import Chem, DataStructs from rdkit.Chem import MACCSkeys, AllChem, rdmolops, Draw from nltk.translate.bleu_score import sentence_bleu from tokenizers import...
import tensorflow as tf from tensorflow import keras as keras from tensorflow.keras.models import Sequential, load_model from tensorflow.keras.layers import Dense, Dropout, Lambda, LayerNormalization from tensorflow.keras.callbacks import ModelCheckpoint, LearningRateScheduler, History, EarlyStopping import numpy as np...
import argparse import const import cv2 as cv import numpy as np import random import sys from matplotlib import pyplot as plt def calculate_distance_window(win_size, win_center): center_y = win_center[1] center_x = win_center[0] dist_window = np.zeros(win_size) for y in range(win_size[1]): ...
from __future__ import division from .misc_functions import uncert_round import numpy as np import pandas as pd import math import multiprocessing as mp import statsmodels.api as sm import seaborn as sns sns.set_style("whitegrid") def calc_ams(s, b, br=0, delta_b=0): """ Approximate Median Significance defined...
import socket import struct import os import sys import re import traceback import threading import numpy as np import subprocess as sp from datetime import datetime from config import (DEFAULT_ADDRESS, SAVE_PATH, CONST_BUFFER_SIZE, SAVE_FPS) from camera import VideoFrame, MyThread, write_error_logs,...
from collections import namedtuple import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd.function import InplaceFunction from image_classification.preconditioner import ScalarPreconditioner, ForwardPreconditioner, DiagonalPreconditioner, BlockwiseHouseholderPreconditioner, ScalarPrecond...
import json from dug.utils import biolink_snake_case class MissingNodeReferenceError(BaseException): pass class MissingEdgeReferenceError(BaseException): pass class QueryKG: def __init__(self, kg_json): self.kg = kg_json["message"] self.answers = self.kg.get("results", []) self...
import numpy as np from scipy.spatial.distance import pdist, squareform from sklearn.cluster import DBSCAN from sklearn.utils import check_array from ML import calculate_rand_score, stock_labels from utils import get_dataset_steps_positions_velocities_headings def get_mean_score(name_file): try: with ope...