text
stringlengths
6.04k
39.5k
import logging from typing import Dict, List import numpy import copy logging.getLogger("kivy").disabled = True from kivy.config import Config Config.set('graphics', 'width', '1200') Config.set('graphics', 'height', '800') from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.floatlayout import Fl...
def str2meaning(s): """Helper function to eval a string in the Meanings namespace.""" return eval(s) KB = {} ObjectTypes = ('Path','Pathdir','Obj','Struct','Region','Segment') class Meaning: gAbbrevs={} gNames={} gMeanings={} gFuzzy={} def __init__(self,n,a,m,cAbbrevs,cNames,cMeanings): ...
# -*- coding: utf-8 -*- """Common utilities between client and server""" import os import sys import numpy import multiprocessing enc_options = {} try: import cPickle as pickle import xmlrpclib from exceptions import Exception, KeyboardInterrupt except: import pickle import xmlrpc as xmlrpclib u...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Compute the Lyman-alpha S/N for the mean QSO at different g-mag, z, as a function of wavelength. It is the python version of the IDL code desi_quicklya.pro by <NAME> (LBL), and it is heavily based on quicksim.py by <NAME> (UC Irvine) Use desi_quicklya.py --help for ins...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # ''' An example to run externally corrected (ec)-CCSD calculation using HCI wave function. ''' bohr2ang = 0.529177210903 import os, sys, time import struct import tempfile from subprocess import check_call, CalledProcessError import numpy from pyscf import gto, scf...
def as_partitioning(power_plant_inputs): from apcd_partitioning_dictionaries import as_dict import numpy as np arsenic_input = power_plant_inputs.Share_Arsenic pm_control = power_plant_inputs.PM_Control so2_control = power_plant_inputs.SO2_Control nox_control = power_plant_inputs.NOx_Control ...
from __future__ import annotations, division, print_function import math import time from dataclasses import dataclass, field from typing import Dict, List, Set, Tuple GOAL_CONFIG = list(range(3 * 3)) class _Empty(Exception): pass @dataclass class Solution: initial_state: PuzzleState goal_state: Puzzl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME>, PhD, MSB, BCBA-D https://www.researchgate.net/profile/David_Cox26 twitter: @davidjcox_ LinkedIn: https://www.linkedin.com/in/coxdavidj/ Website: https://davidjcox.xyz """ #Set current working directory to the folder that contains y...
import csv from logging import error import os import pandas as pd import subprocess import glob from pathlib import Path import os.path as osp import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np from common.utils import set_seed, read_json_file, compute_std_of_mean from simulat...
import numpy as np from . import coordinates, rotations, expansions class CoaxialTranslation(coordinates.OwnerMixin): _default_output_type = expansions.Expansion def __init__(self, input_order, output_order, position=None, radius=None, wavenumber=None, defer_evaluation=False): self._input_order = inp...
import logging import bpy import numpy as np import kubric as kb from kubric.core import materials from kubric.renderer import Blender from kubric.renderer.blender import Blender as KubricBlender def get_proper_time(nums: int, times: np.ndarray) -> np.ndarray: return np.concatenate([times] * nums) logging.bas...
"""MediaFireUploader - API encapsulating Upload magic""" from __future__ import unicode_literals import hashlib import logging import math import os import time from collections import namedtuple from mediafire.subsetio import SubsetIO from mediafire.api import MediaFireConnectionError MEBIBYTE = 2 ** 20 # Use re...
# Copyright (c) 2019 SUSE LINUX GmbH # # 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 w...
import torch import torch.nn as nn import torch.nn.functional as F from vocoder.distribution import sample_from_discretized_mix_logistic from vocoder.display import * from vocoder.audio import * class ResBlock(nn.Module): def __init__(self, dims): super().__init__() self.conv1 = nn.Conv1d(dims, di...
"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessary. This ...
#!/usr/bin/env python import atexit import json import logging import os import shutil import sys import signal from pathlib import Path import configargparse signal.signal(signal.SIGINT, lambda x, y: sys.exit('')) from checkov.arm.runner import Runner as arm_runner from checkov.cloudformation.runner import Runner a...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
import hashlib import hmac from decimal import Decimal as D from django.conf import settings from django.db import models, transaction from django.db.models import Sum from django.urls import reverse from django.utils import timezone from django.utils.translation import gettext_lazy as _ from oscar.core.compat import ...
'Model training for NLP' from ..torch_core import * from ..basic_train import * from ..callbacks import * from ..data_block import CategoryList from ..basic_data import * from ..datasets import * from ..metrics import accuracy from ..train import GradientClipping from ..layers import * from .models import * from .trans...
import asyncio from discord.ext import commands import discord from .utils.paginator import Pages from lxml import etree import random import logging from urllib.parse import quote as uriquote from lru import LRU import yarl import io import re log = logging.getLogger(__name__) def can_use_spoiler(): def predicat...
from Bio import SeqIO from argparse import (ArgumentParser, FileType) import os, sys, re, collections, operator, math, time,base64 import pandas as pd import hashlib, copy from subprocess import Popen, PIPE from Bio import GenBank from parsityper.helpers import read_fasta from parsityper.version import __version__ def...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id: ogrupdate.py 27044 2014-03-16 23:41:27Z rouault $ # # Project: GDAL/OGR samples # Purpose: Update an existing datasource with features from another one # Author: <NAME> <even dot roua...
#################################################################################################### # IMPORTS ################################################################################ IMPORTS # #################################################################################################### # Standard Libra...
# Copyright 2017 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...
# pylama:ignore=E501 # TODO: Modify all calls to get a Well to use the `wells` method from numpy import isclose from unittest import mock import pytest from opentrons.legacy_api.containers import load as containers_load from opentrons.config import pipette_config from opentrons.trackers import pose_tracker @pytest.m...
#!/usr/bin/env python # -*- coding: ascii -*- # # Copyright 2011 # Andr\xe<NAME> or his licensors, as applicable # # 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/...
# filter.py # <NAME> (<EMAIL>) __all__ = ['Filter', 'ACS_WFC_F435W', 'ACS_WFC_F475W', 'ACS_WFC_F555W', 'ACS_WFC_F606W', 'ACS_WFC_F814W', 'ACS_WFC_F850LP', 'm31_filter_sets', 'm49_filter_sets', 'm51_filter_sets', 'default_m31_filters', 'default_m49_filters', 'default_m51_filt...
#!/usr/bin/env python import os import json from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from scipy.stats import norm from itertools import product import anndata import numpy as np import pandas as pd import scanpy as sc from scipy.sparse import issparse from sklearn.metrics import calinski_har...
# -*- coding: utf-8 -*- """The config functions.""" # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) import atexit from functools import partial import json import os import os.path as op import platform import shutil import sys import tempfile import re import numpy as np from .check import _validate_type, _...
# Copyright 2018, The TensorFlow Federated Authors. # # 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 o...
#!/usr/bin/env python # encoding: utf-8 import os import inspect import logging from functools import wraps import six import yaml import ckan.plugins as p try: from paste.reloader import watch_file except ImportError: watch_file = None import ckan.model as model from ckan.common import c, json from ckan.lib...
# coding=utf-8 # Copyright 2020 The Trax Authors. # # 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 a...
from __future__ import print_function, unicode_literals, absolute_import, division import os import sys import re import numpy as np import numexpr as ne from .base import BaseValidationTest, TestResult from .plotting import plt from astropy.table import Table from scipy.spatial import distance_matrix import ot from nu...
import warnings from abc import ABC, abstractmethod from typing import Dict, Generator, Optional, Union import numpy as np import torch as th from gym import spaces try: # Check memory used by replay buffer when possible import psutil except ImportError: psutil = None from stable_baselines3.common.prepro...
""" A registry of the handlers, attached to the resources or events. The global registry is populated by the `kopf.on` decorators, and is used to register the resources being watched and handled, and to attach the handlers to the specific causes (create/update/delete/field-change). The simple registry is part of the ...
from datetime import datetime from enum import Enum, auto from typing import NamedTuple, List, Any, Union from uuid import UUID from graphql.language.ast import ( EnumTypeDefinition, InputObjectTypeDefinition, ListType, NamedType, NonNullType, ObjectTypeDefinition, IntValue, StringValue, BooleanValue, Node, Ty...
""" Sprites: -Man - moves, object -Boulders - moves, object -Wall - doesn't move, not an object -Goals - doesn't move, not an object """ import pygame import time pygame.init() class moveableObs(object): def clearCurrPos(self): ''' clears the screen in GUI where the calling object is present. If the curren...
# Copyright (c) 2011 matt # Copyright (c) 2011 <NAME> # Copyright (c) 2011-2014 <NAME> # Copyright (c) 2012 dmpayton # Copyright (c) 2012 hbc # Copyright (c) 2012 <NAME> # Copyright (c) 2012 uberj # Copyright (c) 2012-2013 <NAME> # Copyright (c) 2013 <NAME> # Copyright (c) 2014 <NAME> # Copyright (c) 2014 dequis # Copy...
"""Support for Dyson Pure Cool link fan.""" import logging from libpurecool.const import FanMode, FanSpeed, NightMode, Oscillation from libpurecool.dyson_pure_cool import DysonPureCool from libpurecool.dyson_pure_cool_link import DysonPureCoolLink from libpurecool.dyson_pure_state import DysonPureCoolState from libpur...
import copy from typing import Optional from vyper import ast as vy_ast from vyper.ast.validation import validate_call_args from vyper.exceptions import ( ExceptionList, FunctionDeclarationException, ImmutableViolation, InvalidLiteral, InvalidOperation, InvalidType, IteratorException, N...
'Represent existents with Item classes, instantiated by games/stories.' __author__ = '<NAME>' __copyright__ = 'Copyright 2011 <NAME>' __license__ = 'ISC' __version__ = '0.5.0.0' __status__ = 'Development' import random import re import types import can import discourse_model def check_attributes(identifier, require...
# -*- coding: utf-8 -*- """ sphinx.directives.code ~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import codecs import sys from difflib import unified_diff from docutils import nodes from docutils.parsers.rst import ...
from abc import ABC, abstractmethod from tfhe import * RAM_WIDTH = 16 GATE_PARAMS = create_gate_params(MINIMUM_LAMBDA) def encode(value): modulo = value % 2 ** (ARCHITECTURE - 1) binary = bin(modulo)[2:].zfill(ARCHITECTURE - 1) string = "1" + binary if value < 0 else "0" + binary return [bool(int(cha...
# ! # * Copyright (c) Microsoft Corporation. All rights reserved. # * Licensed under the MIT License. See LICENSE file in the # * project root for license information. import time import numpy as np import pandas as pd from sklearn.metrics import ( mean_squared_error, r2_score, roc_auc_score, ...
""" This file is part of famafrench. Copyright (c) 2020, <NAME> <<EMAIL>> See file LICENSE.txt for license information. Filename _________ `famafrench/utils.py` Descriptions ____________ lru_cached_method Wrapper for methodtools.lru_cache(maxsize) that allows for sphinx documentation recognition of decorated ...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # 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 ...
""" A commandline tool for semi-automatically converting CSV to RDF try: ``csv2rdf --help`` """ from __future__ import print_function import sys import re import csv import getopt import fileinput import codecs import time import datetime import warnings import configparser from urllib.parse import quote import r...
''' ------------------------------------------------------------------------ Last updated 7/13/2015 Functions for generating omega, the T x S array which describes the demographics of the population This py-file calls the following other file(s): utils.py data\demographic\demographic_data.csv ...
# Copyright 2018 The Cirq Developers # # 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 copy import json import os import pickle from pathlib import Path import more_itertools as mi import pandas as pd from hp_transfer_optimizers.core.base_iteration import Datum class Run: """ Not a proper class, more a 'struct' to bundle important information about a particular run """...
# 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 # d...
# flake8: noqa import multiprocessing as mp mp.set_start_method("spawn", force=True) import argparse import json import os import pprint import socket import time import torch import torch.distributed as dist import torch.optim as optim import yaml from easydict import EasyDict from tensorboardX import SummaryWriter ...
# Copyright (c) 2018 NVIDIA Corporation """ Tacotron2 decoder """ from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import tensorflow as tf from tensorflow.python.framework import ops from open_seq2seq.parts.rnns.utils import single_cell from open_seq2seq.parts.r...
# Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import numpy as np from .base import DTYPE2BITPIX, DELAYED from .image import PrimaryHDU from .table import _TableLikeHDU from astropy.io.fits.column import Column, ColDefs, FITS2NUMPY from astropy.io.fits.fitsrec import FITS_rec, FITS_record f...
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016-2020 - Sequana Development Team # # File author(s): # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Distributed under the terms of the 3-clause BSD license. # The full license is in the LICENSE file, distributed with this ...
#!/usr/bin/env python # coding: utf-8 # In this notebook, I delete a triple from the neighbourhood of the target triple based on the **IJCAI deletion scores** # # - neighbourhood refers to the triples that share the entities with target's entities # - I get the deletion from both neighbourhood of s and o, then choos...
import os import numpy as np def ensureDir(file_path): directory = os.path.dirname(file_path) if not os.path.exists(directory): os.makedirs(directory) def FillJson(obj, group): usersTime = obj.GetUserTime() usersInt = obj.GetUsersInterv() time = obj.GetTime() userStartInt = obj.GetUserStartInt() usersVol = o...
#==============================================================================# # # # Author: <NAME> # # Email: <EMAIL> # # Date: 4/3...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import math import time from absl import flags import absl.logging as _logging # pylint: disable=unused-import import tensorflow as tf import model import data_utils from data_utils import Corpus f...
# -*- coding: utf-8 -*- """ Created on Thu Jun 21 16:48:40 2018 @author: bwhe """ import ast import numpy as np import pandas as pd import gc import lightgbm as lgb import pickle import w2v import time import metric from multiprocessing import Pool from sklearn.model_selection import train_test_spl...
#!/usr/bin/python3 # coding=utf-8 # ------------------------------------------------------------------------------- # This file is part of Phobos, a Blender Add-On to edit robot models. # Copyright (C) 2020 University of Bremen & DFKI GmbH Robotics Innovation Center # # You should have received a copy of the 3-Clause ...
import glob import os.path import shutil import sys import tempfile import re from types import ModuleType from typing import List, Tuple from mypy.test.helpers import Suite, assert_equal, assert_string_arrays_equal from mypy.test.data import DataSuite, DataDrivenTestCase from mypy.errors import CompileError from myp...
import sys import os import re import pickle import itertools import numpy as np import json import argparse import importlib.resources from collections import namedtuple from apycula import codegen from apycula import chipdb from apycula import bslib from apycula.wirenames import wirenames, wirenumbers _verilog_name ...
import torch import torchvision from torch.utils.data import Dataset, DataLoader from torchvision import datasets, models, transforms import torch.optim as optim import numpy as np import random import sys import json import os import csv import collections import argparse from PIL import Image import math import dat...
#!/usr/bin/env python # Copyright 2016 The Dart project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import shutil import subprocess import sys import time import utils HOST_OS = utils.GuessOS() HOST_ARCH ...
# Copyright 2019 DeepMind Technologies Limited and 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
import logging from typing import Optional, Dict, Any from django.conf import settings from django.contrib.auth import get_user_model from django.db import transaction, IntegrityError from django.db.models import QuerySet from django.utils import timezone from baserow.core.exceptions import ( ApplicationNotInGrou...
"""This module is a command line script which handles comparing the best reference recommendations for a particular context and dataset files. For more details on the several modes of operations and command line parameters browse the source or run: % crds bestrefs --help """ import json import gc # =================...
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.interval.ProjectileInterval import * from direct.distributed.ClockDelta import * from direct.gui.DirectGui import * from direct.showutil import Rope from direct.actor import Actor from otp.otpbase import OTPGlobals from pirates.u...
# File: awslambda_connector.py # # Copyright (c) 2019-2022 Splunk 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 b...
import logging import tempfile from collections import OrderedDict from functools import total_ordering from six.moves import shlex_quote from galaxy import exceptions from galaxy.model.none_like import NoneDataset from galaxy.util.object_wrapper import wrap_with_safe_string log = logging.getLogger(__name__) # Fiel...
""" SWF (Macromedia/Adobe Flash) file parser. Documentation: - Alexis' SWF Reference: http://www.m2osw.com/swf_alexref.html - http://www.half-serious.com/swf/format/ - http://www.anotherbigidea.com/javaswf/ - http://www.gnu.org/software/gnash/ Author: <NAME> Creation date: 29 october 2006 """ from lib.hachoi...
# -*- coding: utf-8 -*- import os import sys import re import argparse import datetime import logging import numpy.core.multiarray # Bug: https://github.com/opencv/opencv/issues/8139 import cv2 from butterflow.settings import default as settings from butterflow import ocl, avinfo, motion from butterflow.render import...
#!/usr/bin/env python """Script that parses CATME peer evaluation data and plots summary plots and statistics. The CATME Peer evaluation results are provided in a CSV file which contains more than one table and mixed in metadata. The data are separated by double line returns and are as follows: 1. Extraneous metadat...
import binascii import datetime import decimal import os from decimal import Decimal import pytz from tracker.models import ( Bid, Donation, Milestone, DonationBid, Donor, Event, Prize, PrizeCategory, PrizeKey, PrizeWinner, SpeedRun, Runner, ) from tracker.models.donatio...
#!/usr/bin/env python """ CUDA Library Installer Installs the latest CUDA library supported by CuPy. """ # This script will also be used as a standalone script when building wheels. # Keep the script runnable without CuPy dependency. import argparse import json import os import platform import shutil import subproc...
import os import pickle import tensorflow as tf import numpy as np import tf_util import gym import load_policy import datetime import csv import seaborn as sns import pandas as pd import matplotlib.pyplot as plt """ Code to load an expert policy and generate a behavioral cloning model. Example usage: python beha...
import json import logging import random import string from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List, NewType, Optional, Union from uuid import UUID, uuid5 import boto3 from dataclasses_jsonschema import FieldEncoder, JsonSchemaMixin from taskcat._cfn.template im...
# SPDX-FileCopyrightText: 2017 ladyada for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_bme280.basic` ========================================================================================= CircuitPython driver from BME280 Temperature, Humidity and Barometric Pressure sensor * Author(s): lady...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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...
''' Created on 24 Feb 2012 @author: Qasim Note: The from_string methods actually require a list, ["string", "string2"], with no newline characters. The to_string methods will actually return a string like "bu7\nbu8u8" A typical DNA string is 'bu7bw9bv1u7u7bu2'. ''' import random from collections import namedtuple ...
"""Implementation of distributed training using Local Updates with Periodic Averaging (LUPA) SGD <NAME>., <NAME>., <NAME>., & <NAME>. "Local SGD with Periodic Averaging: Tighter Analysis and Adaptive Synchronization" Advances in Neural Information Processing. 2019. Support single-host training with one or multiple d...
# Copyright 2019 <NAME> Society. All rights reserved. import logging import os import shutil import numpy as np import pandas as pd import seaborn as sb from matplotlib import pyplot as plt # from gym import wrappers # from matplotlib import animation as anim sb.set_style('whitegrid') plt.rcParams.update({'font.size...
"""ASDF-validators for weldx types.""" import re from typing import Any, Callable, Dict, Iterator, List, Mapping, OrderedDict, Union from asdf import ValidationError from asdf.schema import _type_to_tag from weldx.asdf.types import WxSyntaxError from weldx.asdf.util import _get_instance_shape, uri_match from weldx.co...
import sys import discord import utils import requests import aiohttp import asyncio import async_timeout import sys import pickle import codecs import messages as msg import config_loader as config from discord.ext import commands from utils import * import perm_check import pool_communication as pcom # Initialize Bo...
#!/usr/bin/env python # encode_macs2 0.0.1 # Generated by dx-app-wizard. # # Basic execution pattern: Your app will run on a single machine from # beginning to end. # # See https://wiki.dnanexus.com/Developer-Portal for documentation and # tutorials on how to modify this file. # # DNAnexus Python Bindings (dxpy) docume...
""" The data preparation recipe for the ICSI Meeting Corpus. It follows the Kaldi recipe by <NAME>: https://git.informatik.fh-nuernberg.de/poppto72658/kaldi/-/commit/d5815d3255bb62eacf2fba6314f194fe09966453 ICSI data comprises around 72 hours of natural, meeting-style overlapped English speech recorded at Internatio...
import argparse import cv2 as cv import numpy as np import os """ Link to original paper : https://arxiv.org/abs/1812.11703 Link to original repo : https://github.com/STVIR/pysot You can download the pre-trained weights of the Tracker Model from https://drive.google.com/file/d/11bwgPFVkps9AH2NOD1zBDdpF_tQgh...
import time, random, os, sys, re, copy import numpy as np import traceback from base import Network, NetworkItem from utils import TaskScheduler, EvaScheduleItem, PredScheduleItem from utils import DataSize, _epoch_ctrl, NAS_LOG, Logger, TimeCnt from utils import _dump_stage, _check_log from info_str import NAS_...
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- from __future__ import print_function, division import sys if( sys.version_info[0] == 2 ): range = range import re import math import collections if( len( sys.argv ) != 3 ): print( "%s Topology(RTF) Parameters(PRM)"%( sys.argv[0] ) ) sys.exit( 1 ) opls_type = ...
""" This script handles the training process. """ import argparse import math import os import random import time import dill as pickle import numpy as np import torch import torch.nn.functional as F import torch.optim as optim from torchtext.data import BucketIterator, Dataset, Field from torchtext.datasets import T...
"""FOOOFGroup object and associated code for using the FOOOF model on 2D groups of power spectra. Notes ----- FOOOFGroup object docs are imported from FOOOF object at runtime. Methods without defined docstrings import docs at runtime, from aliased external functions. """ from functools import partial from multiproces...
# Copyright 2021 Google Research. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
''' @author: <NAME> ''' import sys, logging import numpy as np import ibcc from scipy.linalg import block_diag from scipy.special import gammaln def state_to_alpha(logodds, var): alpha1 = 1/var * (1+np.exp(logodds)) alpha2 = alpha1 * (1+np.exp(-logodds)) return alpha1.reshape(logodds.shape), alpha2.reshape...
##### # # visualization_utils.py # # Core rendering functions shared across visualization scripts # ##### #%% Constants and imports import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np from PIL import Image, ImageFile, ImageFont, ImageDraw from data_management.annotations import annotation_c...
import datetime import workon.utils import workon.conf from django import forms from django.db import models from django.views import generic from django.shortcuts import render from django.utils.html import mark_safe from django.utils import six from django.utils.text import slugify from django.forms.fields import Cal...
import dataclasses import logging import os from typing import Callable, Dict, Iterable, Mapping, Optional, Type, Union import gym import numpy as np import torch as th import torch.utils.data as th_data import torch.utils.tensorboard as thboard import tqdm from stable_baselines3.common import on_policy_algorithm, pre...
# Copyright 2019 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...
import sys, time, math, random, argparse from copy import deepcopy import torch from data import get_datasets, get_nas_search_loaders from utils import prepare_seed, prepare_logger, save_checkpoint, copy_checkpoint, obtain_accuracy, AverageMeter, time_string, convert_secs2time, load_config, dict2config, get_optim_sched...
""" plasma functions """ from __future__ import annotations import typing as T import logging import numpy as np import xarray from scipy.integrate import cumtrapz from scipy.interpolate import interp1d, interp2d, interpn from . import read from . import LSP, SPECIES from . import write from .web import url_retrieve...