text
stringlengths
6.04k
39.5k
# ------------------------------------------------------------------------------ # Testing code. # Example command: # python tools/test_net_single_core.py --cfg PATH_TO_CONFIG_FILE # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ import argparse import cv2 ...
# # Copyright 2019 <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, soft...
"""Utilities for running HammerBlade in F1. """ import boto3 import enum import shlex import click import subprocess import socket import time import os import logging import click_log from collections import namedtuple import tomlkit __version__ = '1.0.0' SSH_PORT = 22 # The setup script to run on new images. SETU...
import sys import os import timeit import datetime import shutil import datetime import shutil from tqdm.notebook import tqdm_notebook from pathlib import Path import pandas as pd import numpy as np import csv from sqlalchemy import create_engine import sqlite3 import requests # from selenium import webdriver # from...
# -*- coding: utf-8 -*- """A fix for GraphML write_graphml module Run this code only when you need to generate a metro Meta-KG graph .. moduleauthor:: <NAME> <<EMAIL>> """ import warnings from collections import defaultdict try: from xml.etree.cElementTree import Element, ElementTree from xml.etree.cEleme...
import pygame, sys, pygame.mixer from pygame.locals import * import socket from time import sleep, time import bluetooth as bt print('-----------------------------------------------------------------') print('Controls:\nClick and drag joystick to drive the T-Bot\nUse up, down, left, right arrow keys to drive the T-Bot\...
# -*- coding: utf-8 -*- import io import requests from lxml import etree, objectify from xml.etree import ElementTree as ET from uuid import uuid4 import pprint import logging from odoo.addons.payment.models.payment_acquirer import _partner_split_name from odoo.exceptions import ValidationError, UserError from odoo im...
# -*- encoding: utf-8 -*- # Author: hushukai import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.keras import layers, models, optimizers, regularizers from networks.resnet import ResNet58V2_for_char_recog as ResNet_for_char_recog from networks.resnext import ResNeXt58_for_char_recog as R...
# Copyright (c) 2017, The MITRE Corporation # For license information, see the LICENSE.txt file """ TAXII Clients """ import sys import base64 import socket import ssl import warnings from libtaxii.constants import * import six from six.moves import urllib class HttpClient(object): # Constants for authenticatio...
#!/usr/bin/env python3 import argparse import base64 import configparser import errno from io import BytesIO import json import logging from math import sin, cos from os import getenv, remove from pathlib import Path import platform import sys from typing import Optional, Tuple from PIL import Image import xml.etree.E...
from matplotlib import pyplot as plt import numpy as np import os from random import random from singlecell.analysis_basin_plotting import plot_overlap_grid from singlecell.singlecell_constants import BETA, FIELD_SIGNAL_STRENGTH, MEMS_MEHTA, MEMS_SCMCA, FIELD_APPLIED_PROTOCOL, MEMORIESDIR from utils.file_io import RUN...
from ...fileio.adm.elements import AudioPackFormat, AudioChannelFormat, TypeDefinition, ObjectCartesianPosition from ...fileio.adm.exceptions import AdmError from . import matrix from .utils import (get_single_param, in_by_id, pack_format_channels, pack_format_packs, pack_format_paths_from) def _v...
#!/bin/env python3 # coding=utf-8 from functools import reduce import sys is_py3k = bool(sys.version_info[0] == 3) class IdGenerator: """id 生成器""" def __init__(self): self.id = -1 def next(self): self.id += 1 return self.id class Queue(list): """普通队列""" def pop(self,...
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate import plotly.graph_objects as go import plotly.express as px import pandas as pd from helpers import ( austin_listings, zc_link, ...
import glob import os import shutil import random import numpy as np from PIL import Image # from imagecorruptions import corrupt from torch.utils.data import Dataset from torchvision import transforms from tqdm import tqdm from config import Config class coco_c(Dataset): def __init__(self, root_dir, size=(416,...
######## # Copyright (c) 2016 GigaSpaces Technologies Ltd. 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...
# ============================================================================= # Authors: PAR Government # Organization: DARPA # # Copyright (c) 2016 PAR Government # All rights reserved. #============================================================================== import time import ttk from Tkinter import * impor...
import json from typing import ( Any, Callable, Collection, Iterator, List, MutableMapping, MutableSequence, MutableSet, Optional, Sequence, Set, Union ) from semantic_version import Version from slicedimage import Collection as collec from slicedimage import TileSet fro...
import pickle, glob, sys, csv, warnings from sklearn.preprocessing import PolynomialFeatures, StandardScaler from sklearn.metrics import accuracy_score, confusion_matrix, auc, roc_curve from feature_extraction_utils import _load_file, _save_file, _get_node_info from scipy.stats import multivariate_normal from scipy.n...
# TODO # test with the --output option # test reading from standard input from __future__ import print_function, division, absolute_import import sys, os from nose.tools import raises from contextlib import contextmanager from cutadapt.scripts import cutadapt @contextmanager def redirect_stderr(): "Send stderr to st...
''' ClientSide.py Convenience python functions that return JavaScript code - including complete python bindings for WebElements.js NOTE: documentation for the binding functions is defined in WebElement.js and not as doc strings on the binding methods themselves. Copyright (C) 2013 <NAME> ...
import os import sys import io import logging import re import platform import traceback import multiprocessing from setuptools import setup, Extension as _Extension, find_packages from distutils.command.build_ext import build_ext from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError ...
# -*- coding: utf-8 -*- import numpy as np import osmnx as ox import matplotlib.pyplot as plt import plotly.express as px import plotly.graph_objects as go import pandas as pd import networkx as nx import ast from logproj import stat_time_series as ts from logproj.ml_dataCleaning import cleanUsingIQR from logproj.P8_p...
import numpy as np import ipywidgets as widgets from IPython.display import display import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable import lsst.afw.table from lsst.afw.image import MultibandExposure from scarle...
#dataset generation import random import math import zipfile import os import time from TDO.dataset_generation import utils_generation import sys ##Please contact the authors to obtain "value similarity" zip file ############################################## SOURCE FUNCTIONS ##############################...
#gui/configProfiles.py #A part of NonVisual Desktop Access (NVDA) #Copyright (C) 2013 NV Access Limited #This file is covered by the GNU General Public License. #See the file COPYING for more details. import wx import config import api import gui from logHandler import log import appModuleHandler import gl...
import serial.serialutil import pygame, math, sys, uart, serial, threading, time, numpy from scipy.optimize import curve_fit from statistics import pstdev # Constants BLUE = (25, 25, 200) PURPLE = (150, 25, 200) BLACK = (23, 23, 23) GREY = (56, 56, 56) WHITE = (254, 254, 254) RED = (200, 25, 25) GREEN = (25, 200, 25) ...
import warnings import re import io import ast import contextlib import itertools import tempfile from typing import List from collections import namedtuple from typing import NamedTuple, Union import ir_measures class Qrel(NamedTuple): query_id: str doc_id: str relevance: int iteration: str = '0' cla...
# 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...
import torch from torch.distributions import constraints from pyro.distributions.torch_distribution import TorchDistribution from pyro.distributions.util import broadcast_shape from pyro.ops.gaussian import Gaussian, gaussian_tensordot, matrix_and_mvn_to_gaussian, mvn_to_gaussian def _logmatmulexp(x, y): """ ...
#This file contains various helper routines import numpy as np from scipy.interpolate import interp1d from . import const import glob, os, time import os.path from numpy import array, asarray, roll from numpy.linalg import matrix_rank from scipy.fftpack import fft, ifft, fftn, ifftn from numpy.fft import rfftn, irfftn...
""" This module implements specific pulse retrieval algorithms, e.g., COPRA, GPA, PCGPA, etc. """ import numpy as np from scipy.optimize import minimize_scalar from .retriever import BaseRetriever from .. import lib class StepRetriever(BaseRetriever): def _retrieve(self): # local rename ...
import collections import glob import cv2 import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np from calibration_functions import calibrateCamera_SLOW, undistort from globals import xm_per_pix, ym_per_pix from perspective_function import birdview from threshold_functions import binarize_...
# from datasets.mongo import triage,get_by_id import numpy as np import struct import glob import re import os,shutil import scipy.io as io import pandas as pd from settings import data_dir,segment_length,segment_slide from datasets.signals import resample from settings import Fs import joblib import _pickle as pickle ...
from anthill.framework.utils.decorators import method_decorator, retry from anthill.framework.utils.asynchronous import as_future, thread_pool_exec as future_exec from anthill.framework.utils.module_loading import import_string from anthill.framework.utils import timezone from anthill.framework.utils.geoip import GeoIP...
''' Handling the data io ''' import argparse import models.Constants as Constants import json import numpy as np from tqdm import tqdm import string import wget import os import nltk from collections import defaultdict import pickle import spacy url = "https://github.com/ybCliff/VideoCaptioning/releases/download/v1.0/v...
import os from PIL import Image import pytesseract import cv2 import numpy as np import re import time X = 1280.00 / 3840.00 PIXEL_X = int(X * 3840) print(X, PIXEL_X) MASKS_DIR = os.path.join(os.path.dirname(__file__), "masks") CARD_MASK = os.path.join(MASKS_DIR, "idcard_mask.jpg") NAME_MASK = os.path.join(MASKS_DIR...
""" Author: <NAME> Created: 10/02/2021 9:30 AM """ import os import ksl_env import numpy as np import datetime import subprocess import sys import netCDF4 as nc import glob import yaml import pandas as pd import shutil from Climate_Shocks.Stochastic_Weather_Generator.read_swg_data import read_swg_data from Climate_S...
#!/usr/bin/env python3 import sqlite3 import json import flask import re import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import re import time from plotly.validators.scatter.marker import SymbolValidator import math import dash_table from ...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import spectral_norm from torch.nn.init import xavier_uniform_ def init_weights(m): if type(m) == nn.Linear or type(m) == nn.Conv2d: xavier_uniform_(m.weight) m.bias.data.fill_(0.) def snco...
import cv2 import glob import numpy as np import matplotlib.pyplot as plt import matplotlib.image as mpimg import os from moviepy.editor import VideoFileClip def camera_calibration(): images = glob.glob('./camera_cal/calibration*.jpg') # Arrays to store object points and image points for all the images ob...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.distributions import Categorical import numpy as np import time, os class PPO(nn.Module): def __init__(self, arg_dict, device=None): super(PPO, self).__init__() self.device=None if devi...
# +--------------------------------------------------------------------------+ # | Licensed Materials - Property of IBM & OpenInformix | # | | # | (C) Copyright IBM Corporation 2008, 2019. | # +-...
"""Nested vocab tries.""" import itertools import os from pathlib import Path from typing import Any, Callable, Dict, List, Set, Tuple, Union import marisa_trie import numpy as np import ujson from numba import njit from tqdm import tqdm from bootleg.utils.utils import dump_json_file, load_json_file def flatten(arr...
import re from parsing.models.fine_tuning_based_on_bert_interface import token_classifier_interface from parsing import parsing_args from common_structs.ungrounded_graph import UngroundedNode from parsing import parsing_utils from common import globals_args def generate_nodes(question_normal, qid=None, tokens=N...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import shutil import queue import threading import subprocess import datetime import time import codecs #print(os.path.dirname(__file__)) #print(os.path.basename(__file__)) #print(sys.version_info) qApiCV = 'google' qApiOCR = qApiCV qApiTr...
import matlab.engine from matlab.engine import EngineError as MatlabEngineError import json import sys import os import asyncio import select log_python_adaptor = False def return_vscode(message_type=None, success=None, command=None, message=None, ...
import argparse import stanza import json import numpy as np from os.path import exists import requests import json import re from tqdm import tqdm # clean half nodes from a binary parse def clean_binary_parse(bp): bp = bp.replace('\n', '') bp = re.sub(' +', ' ', bp) bp = re.sub('\((.*?) ', '(0 ', bp) ...
# Import from third library import torch import torch.nn.functional as F from up.tasks.det.models.utils.matcher import build_matcher from up.utils.general.registry_factory import MATCHER_REGISTRY, ROI_SUPERVISOR_REGISTRY from up.tasks.det.models.utils.bbox_helper import bbox_iou_overlaps from up.utils.general.log_helpe...
from collections import namedtuple import numpy as np from matplotlib import pyplot as plt plt.switch_backend('agg') import matplotlib.cm as cm import time from read_starcd import write_tecplot def f_maxwell(vx, vy, vz, T, n, ux, uy, uz, Rg): """Compute maxwell distribution function on cartesian velocity mesh ...
import asyncio import logging import aiohttp import dateutil.parser import struct from datetime import datetime, timezone from urllib.parse import urlparse, urlunparse, ParseResult, parse_qs from typing import Dict, Any, Optional, Tuple, cast, Union, List, TypeVar, Callable import discord from discord import Embed, Col...
## # Copyright 2019 Telefonica Investigacion y Desarrollo, S.A.U. # This file is part of OSM # 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.or...
# coding: utf-8 # In[1]: import matplotlib matplotlib.use("Agg") import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torch.optim as optim torch.manual_seed(1) import numpy as np from tqdm import tqdm import pandas as pd import matplotlib.pyplot as plt im...
import math import torch import torch.nn.functional as F from torch import nn from collections import OrderedDict import sys from torch.nn import init import numpy as np from IPython import embed sys.path.append('./') sys.path.append('../') from .recognizer.tps_spatial_transformer import TPSSpatialTransformer from .re...
""" SimpleMonitor logging to files """ import glob import json import logging import logging.handlers import os import shutil import socket import stat import subprocess # nosec import sys import tempfile from typing import TYPE_CHECKING, Any, Dict, List, Optional, cast import arrow from jinja2 import Environment, F...
#!usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import math import time import sys sys.path.append('../..') from envs.airCombateEnv.customization import init_posture from envs.airCombateEnv.customization import REGISTRY_STATE as registry_state from argument.argManage import args from envs.unit import...
import os import argparse import torch from torch import nn import torch.backends.cudnn as cudnn from torch.utils.data.distributed import DistributedSampler from torch.utils.data import DataLoader import numpy as np from dataset import potsdam, label_to_RGB from seg_metric import SegmentationMetric import cv2 from mut...
"""Common plot functions.""" import logging import os from copy import deepcopy import cartopy.crs as ccrs import iris.quickplot import matplotlib.colors as colors import matplotlib.pyplot as plt import numpy as np import yaml logger = logging.getLogger(__name__) def _process_axes_functions(axes, axes_functions): ...
# 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 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
import json from builtins import object from builtins import str from contextlib import contextmanager from importlib import import_module from bs4 import BeautifulSoup from django.conf import settings from django.contrib.auth.models import Group, Permission from django.core import mail from django.core.serializers.js...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # 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 requi...
#----------------------------- # builelie 共通関数 #----------------------------- import sys import json import jsonschema import numpy as np import os # import pandas as pd import itertools import math # 電気の量 1kWh を熱量 kJ に換算する係数 fprime = 9760 # データベースファイルの保存場所 database_directory = os.path.dirname(os.path.abspath(__file...
#!/usr/bin/python # -*- coding: utf-8 -*- """ PyCOMPSs Testbench Tasks ======================== """ # Imports import unittest import numpy as np from .my_class import MyClass from .psco import PSCO from .psco_with_tasks import PSCOWithTasks from pycompss.api.task import task from pycompss.api.parameter import * f...
import os import json import math def load_timber_properties(folder_path): collected_properties = [] properties = ['timber_properties.json','k_mod.json','safety_factor.json','straightness_factor.json'] for properti in properties: file_path = os.path.join(folder_path, properti) with open...
import itertools import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from .base_model import BaseModel from . import networks from .networks import VGGNet class DoubleHead(nn.Module): def __init__(self, num_classes): super(DoubleHead, self).__init__() self.PredBack...
import datetime, copy, xmlrpclib, thread, time, cgi from django.db import models from django.core.cache import cache from django.contrib.sitemaps import ping_google from django.contrib.sites.models import Site from django.dispatch import dispatcher from django.db.models import signals from django.core.mail import mail_...
''' Diabetes and comorbidities flags ''' from itertools import chain import logging import sys from pyspark.sql import functions as f from pyspark.sql.session import SparkSession from pyspark.sql.window import Window from pyspark.sql.types import ArrayType, StringType from pyspark.sql import Column from typing import ...
# -*- coding: utf-8 -*- #!/usr/bin/env python3 """ Created on Fri Jun 29 20:57:25 2018 @author: yansl Usage: make image mask. """ import cv2 import sys import numpy as np from skimage import morphology #%% """ secondary functions """ def channel_decomposion(image): temp_img = image.copy...
""" Library Features: Name: lib_snowblending_blending_tools Author(s): <NAME> (<EMAIL>), <NAME> (<EMAIL>) Date: '20210525' Version: '1.0.0' """ # ------------------------------------------------------------------------------------- # Library import logging import numpy as np import raste...
# A general training procedure import time import torch.optim as optim from torch.nn import init import torch from torch import FloatTensor, tensor from genre.loggers.loggers import _LogCumulator from genre.util.util_print import str_warning from genre.visualize.visualizer import Visualizer import pickle import os de...
# from x2paddle import torch2paddle from copy import deepcopy import argparse import math import os import pickle import json import logging import time import paddle import numpy as np import random from collections import Counter from paddle.nn import functional as F from model.meta import Meta from utils.metrics imp...
# -*- coding: utf-8 -*- """ Import and extensions of the core Mesh class. """ import numpy as np from math import ceil from .core import (cat, HexahedronShape, Line, RSparseMapMatrix, Mesh, MeshEntity, Node, Boundary, RVector, RVector3, PolygonFace, TetrahedronShape, Tr...
import os import sys import numpy import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from collections import OrderedDict from gru import BayesianGRU, GRU from dropout import EmbeddingDropout, SequentialDropout urls = {} urls['dictionary'] = 'http://www.cs.toronto....
# # Modified (butchered) argparse to provide tree-like # extendable configuration options for bento-linker # # Copyright (c) 2020, Arm Limited. All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # import re import argparse import sys import os import io from argparse import Namespace import itertools as it ...
#imports import pandas as pd import os import ast import sklearn as skl import sklearn.utils, sklearn.preprocessing, sklearn.decomposition, sklearn.svm import matplotlib.pyplot as plt import numpy as np import pylab import librosa import ffmpeg import audioread import sklearn import librosa.display import datetime ...
import sys assert sys.version_info[0] == 3 assert sys.version_info[1] >= 5 from platform import python_version assert int(python_version().split(".")[1]) >= 5, "Please upgrade your Python version following the instructions in \ the README.txt file found in the same directory as this notebook. Your Python version...
from design_bench.datasets.dataset_builder import DatasetBuilder import numpy as np def one_hot(a, num_classes): """A helper function that converts integers into a floating point one-hot representation using pure numpy: https://stackoverflow.com/questions/36960320/ convert-a-2d-matrix-to-a-3d-one-hot-...
""" Factor class and necessary functions """ # from __future__ import annotations import numpy as np from sortedcontainers import SortedSet from collections import namedtuple from typing import List, Tuple, Union, overload, Optional, Callable, Iterable from .helper import reduce_tuples import functools Variable = na...
""" 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) any later version. Written (W) 2095-2010 <NAME> Copyright (C) 2009-2010 by <NAM...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Loop through selected (hardcoded!) RunAnalysis.R output tables and plot chosen parts of the data on Bokeh maps. Created on Wed Apr 15 15:26:30 2020 @author: <NAME> (<EMAIL>) """ # Silence FutureWarnings of Pandas import warnings warnings.simplefilter(action='ignore'...
""" MONITARP - c0mplh4cks a Network Device Detection Tool using ARP """ # === Importing Dependencies === # from socket import socket, AF_PACKET, SOCK_RAW, htons from time import time, sleep, strftime, gmtime from threading import Thread from ipaddress import IPv4Network as ip_range from copy import deepcopy...
from __future__ import absolute_import from __future__ import unicode_literals from corehq.apps.tzmigration.timezonemigration import is_datetime_string, FormJsonDiff, json_diff PARTIAL_DIFFS = { 'XFormInstance*': [ {'path': ('_rev',)}, # couch only {'path': ('migrating_blobs_from_couch',)}, # cou...
# Copyright (c) Microsoft Corporation # # All rights reserved. # # MIT License # # 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...
import torch from torch import nn from torch.nn import functional as F import collections from gym.spaces import MultiDiscrete from nle import nethack from typing import NamedTuple, Union from collections import namedtuple from .minihack_util import id_pairs_table import logging from .common import * from .distribut...
from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization,hashes from cryptography.hazmat.primitives.asymmetric import padding,utils,ec from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes i...
""" Tiny Web - pretty simple and powerful web server for tiny platforms like ESP8266 / ESP32 MIT license (C) <NAME> 2017-2018 """ import logging import uasyncio as asyncio import uasyncio.core import ujson as json import gc import uos as os import sys import uerrno as errno import usocket as socket log = logging.getL...
# Adapted from https://github.com/aam-at/cpgd import math from functools import partial from typing import Optional import torch from torch import Tensor, nn, optim from torch.autograd import grad from torch.nn import functional as F from adv_lib.distances.lp_norms import l0_distances, l1_distances, l2_distances, lin...
from enum import Enum import numpy as np # https://sites.uni.edu/morgans/astro/course/Notes/section2/spectraltemps.html class SpectralType(Enum): # Dwarfs O5V = {'name': 'O5V', 'Teff': 54000, 'M': -4.5, 'L': 200000} O6V = {'name': 'O6V', 'Teff': 45000, 'M': -4.0, 'L': 140000} O7V = {'name': '...
""" The MIT License (MIT) Copyright (c) 2018 Zuse Institute Berlin, www.zib.de Permissions are granted as stated in the license file you have obtained with this software. If you find the library useful for your purpose, please refer to README.md for how to cite IPET. @author: <NAME> """ import xml.etree.ElementTree ...
# -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> and <NAME> # -------------------------------------------------------- import os import yaml import numpy as np import numpy.random as n...
import math import copy import time from tqdm import tqdm import numpy as np from regym.util import save_traj_with_graph def run_episode(env, agent, training, max_episode_length=math.inf): ''' Runs a single episode of a single-agent rl loop until termination. :param env: OpenAI gym environment :param ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils import weight_norm from functools import partial from model.model_utils import concat_elu import numpy as np from model.model_utils import * from scipy import linalg as la logabs = lambda x: torch.log(torch.abs(x)) # dictionary fo...
import numpy import threading def merge_times(time1,time2): """ merge two time vectors and remove duplicates """ times = numpy.append(time1,time2) resortIndices = numpy.argsort(times) times = times[resortIndices] diff = numpy.diff(times) diff = numpy.append([1],diff)# the diff has...
# Copyright 2020 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 agreed to in...
import math import torch from enum import Enum from torch import Tensor from typing import List, Tuple, Optional, Dict from . import functional as F, InterpolationMode __all__ = ["AutoAugmentPolicy", "AutoAugment", "RandAugment", "TrivialAugmentWide"] def _apply_op(img: Tensor, op_name: str, magnitude: float, ...
import sys import tensorflow as tf import numpy as np import time import math import os import getopt from glob import glob from natsort import natsorted import pyBigWig as pbw import subprocess as subp PATH_SEP=os.path.sep def longest_common_prefix(seq1, seq2): start = 0 while start < min(len(seq1), len(s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module provides functionality for tabulating sequence files (FASTA) into an Ananke HDF5 file. """ import sys import warnings import hashlib import pandas as pd import numpy as np from collections import defaultdict from scipy.sparse import csr_matrix from ._datab...
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
""" Implements HIRES-specific functions, including reading in slitmask design files. .. include common links, assuming primary doc root is up one directory .. include:: ../links.rst """ import glob import re import os import numpy as np from scipy import interpolate from astropy.io import fits from pypeit import ms...
# Runlike this exec(open("estimate_phase_delay.py").read()) # that way it will use your pysmurf S object. import pysmurf import numpy as np import time import os # how to get AMC s/n and fw def get_amcc_dump_bsi(S,ip='shm-smrf-sp01',slot=None): if slot is None: # attempt to guess from epics prefix ...