text
stringlengths
6.04k
39.5k
import tkinter as tk import sys from tkinter import filedialog import random import numpy as np import pandas as pd import math import seaborn as sns sys.path.append('Portplanering') sys.path.append('Bilbokning/src') from bilbokning import calculate_carriages HEURISTICS = ['local_search', 'simulated_an...
""" This script loads in a trained policy neural network and uses it for inference. Typically this script will be executed on the Nvidia Jetson TX2 board during an experiment in the Spacecraft Robotics and Control Laboratory at Carleton University. Script created: June 12, 2019 @author: Kirk (<EMAIL>) """ import ten...
# from time import sleep, time # import collections # import numpy as np # import qcodes as qc #from qcodes import Instrument from qcodes.instrument.base import InstrumentBase from qcodes.instrument.parameter import (Parameter,DelegateParameter) from qcodes.instrument.function import Function from qcodes.dataset.measur...
import re import numpy as np import logging import time import io import sys import cv2 import pandas as pd from math import ceil from datetime import timedelta import os from utilities.pandas_loader import load_csv import cv2 def atoi(text): return int(text) if text.isdigit() else text def get_elapsed_time_and...
import tempfile import json import pvl import pyproj import csmapi from knoten import csm from numbers import Number import numpy as np import pandas as pd from pysis import isis from pysis.exceptions import ProcessError import plotly.graph_objects as go import plotly.express as px from plotly.subplots import mak...
from functools import reduce from typing import List, Tuple, Any, Dict, Optional from copy import deepcopy from time import time from tqdm import tqdm from torch.utils.tensorboard import SummaryWriter import numpy as np import gym import regym from regym.rl_algorithms.agents import Agent from regym.environments.tasks...
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
import iris import iris.plot as iplt import iris.quickplot as qplt import numpy as np import matplotlib.pyplot as plt import fnmatch import os import matplotlib.dates as mdates import sys reload(sys) sys.getdefaultencoding() import numpy.ma as ma import cartopy.crs as ccrs import matplotlib from tools import rotate_dat...
"""MAGI planners.""" from abc import abstractmethod from contextlib import contextmanager import logging import random import signal import sys import networkx as nx import numpy as np from magi.actions.Parallel import ParallelAction from magi.actions.Sequence import SequenceAction, SequenceSolution from magi.action...
import os import webapp2 import jinja2 import random import re import hmac import hashlib from google.appengine.ext import db from string import letters from functools import wraps import time template_dir = os.path.join(os.path.dirname(__file__), 'html') jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader(t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Developeurs : VBNIN + CKAR - IPEchanges. Script de relevé des niveaux de réceptions des IRD nodal en DVB-S2 ou IP. Ce script créé un fichier CSV alimentant une page web puis envoi ses relevés en TCP vers une Mosaique Miranda Kaleido Release v2.0 avec librairie EasySNMP...
from __future__ import annotations from collections import OrderedDict import logging from typing import Any, Dict import gym import numpy as np import tensorflow as tf import tensorflow.keras.backend as K import tensorflow_probability as tfp from muzero.mcts import MCTS from muzero.tf_model import MuZeroTFModelV2 f...
import random import pygame from pygame.math import Vector2 as V2 import thorpy import parameters as p import graphics from bullet import Bullet, Rocket from thorpy._utils.colorscomputing import normalize_color ennemies_fn = ["skorpio"+str(i)+".png" for i in range(1,6)] container_fn = "xevin1.png" hero_fn = "xevin2.pn...
'''BlockFS directory The directory keeps track of the blockfiles and the extents of the volume. The format is: Size Description (bytes) Header 8 The text "BlockFS" zero-terminated MDSize 4 The length of the JSON metadata DirOffset 4 Offset to the first direc...
from assess import * from sklearn_extra.cluster import KMedoids import cx_Oracle import json import platform import numpy as np import time # Library functions usings = [difference, ratio, reldifference] # , absdifference # labels = [quartile, # ok for all comparisons # likert3, likert5, # ok for differen...
# -*- coding: utf-8 -*- """ Created on Thu Nov 24 10:32:07 2016 @author: joel """ import datetime import argparse import logging import shutil import re import os from skimage import exposure from itertools import cycle import skimage.io as io from glob import iglob from PIL import Image # Change to pillow? import nu...
# Copyright (c) 2020, RTE (https://www.rte-france.com) # See AUTHORS.txt # This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0. # If a copy of the Mozilla Public License, version 2.0 was not distributed with this file, # you can obtain one at http://mozilla.org/MPL/2.0/. # SPDX-Lice...
import numpy as np import torch as tr import itertools as it from abstract_machine import make_abstract_machine, memorize_env from neural_virtual_machine import NeuralVirtualMachine as NVMNet def hadamard_matrix(N): H = tr.tensor([[1.]]) while H.shape[0] < N: H = tr.cat(( tr.cat((H, H), di...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 11 00:45:08 2018 rnb2(sep)(user_emb): 유저 embedding: cat(audio_sup, log_sup, label_sup)>lin>LN>ReLU>1x1Conv audio relation: Relation-cat(audio_sup, audio_que, 유저embedding) metric relation: cat(audio relation,...
from __future__ import print_function import time import json from elasticsearch import Elasticsearch, NotFoundError from elasticsearch import helpers from biothings.utils.common import iter_n, timesofar, ask #from biothings.dataindex.mapping import get_mapping # setup ES logging import logging formatter = logging.Fo...
from sqlalchemy import or_ import logging import os from datetime import datetime import sys from src.models import Source, So, Dbentity, Locusdbentity, Referencedbentity, Alleledbentity,\ AlleleReference, LocusAllele, LocusalleleReference, AlleleAlias, \ AllelealiasReferen...
import exifread import os import numpy as np import matplotlib.mlab as mlab import matplotlib.pyplot as plt def processFolder(directoryInput,directoryOutput,fileName,directoryInput2= "none"): # count the pictures per hour clearCounts() file_object = open("%s/%s.txt" % (directoryOutput, fileName), 'w') ...
# -*- coding: utf-8 -*- """ Module: pypub.scrapers.taylorfrancis NOTE: THIS IS FOR A DEPRECATED VERSION OF T&F!! THE HTML TAGS NEED TO BE CHANGED. Tasks/Examples: --------------- 1) ****** Get references given a doi value ******* from pypub.scrapers import ________ as __ refs = __.get_references('000689938790372...
""" This module contains functions related to orbit calculations """ # Standard library imports from typing import Any,Dict,List,Tuple,Sequence #https://mypy.readthedocs.io/en/stable/cheat_sheet_py3.html # Third party imports import pandas as pd import numpy as np from numpy import rad2deg, deg2rad from numpy.linalg ...
#!/usr/bin/env python """BasicSocket wrapper that works with the Twisted framework The intention is to work with TCPConnection and all the infrastructure that uses it. History: 2012-07-19 ROwen 2012-11-29 ROwen Misfeature fix: write and writeLine failed on unicode strings that could be converted to ASCII ...
""" This is PISACov, a program designed to infer quaternary structure of proteins from evolutionary covariance. """ from pisacov import __prog__, __description__, __version__ from pisacov import __author__, __date__, __copyright__ from pisacov.iomod import _conf_ops as pco from pisacov.core import _psicov_modes as PS...
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 The HuggingFace Team. 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/LI...
from collections import OrderedDict from .model import Param, RustType, non_keyword_name, prefixed, pascal_to_snake class RustClassBinding: def __init__(self, model): self.__model = model self.overloads = OverloadTree(model) self.overloads.print_tree() self.__methods = [RustMethodB...
#!/usr/bin/env python3 # command line program import argparse # deepcopy import copy # file import os.path # numpy import numpy as np import scipy as sp import scipy.integrate import scipy.linalg import scipy.interpolate # internal modules import libpost # tmp plot import matplotlib.pyplot as plt # nu: 0.000185 # eps...
import asyncio import copy import math from datetime import datetime, timedelta from enum import Enum from typing import List, Optional, Dict, Union import knxdclient from apscheduler.job import Job from apscheduler.schedulers.asyncio import AsyncIOScheduler from astral import LocationInfo from astral.sun import sun, ...
''' 提供一些目标函数 ''' import numpy as np from math import sin, cos, exp, sqrt import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from Common.constants import * class base_unconstrained_objective_func(): ''' 无约束目标函数基类 ''' search_space_tuple = (-1, 1) func_formula_str = 'f(...
# -*- coding: utf-8; -*- """Find and expand dialects, i.e. whole-module source and AST transformers.""" __all__ = ["Dialect", "DialectExpander"] import ast import functools import re import sys from .colorizer import setcolor, colorize, ColorScheme from .coreutils import ismacroimport, get_macros from .unparser impo...
# Copyright (c) 2022, NVIDIA 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 i...
# -*- coding: utf-8 -*- """Classes for Windows Registry access.""" import logging from dfvfs.helpers import file_system_searcher from plaso.dfwinreg import definitions from plaso.dfwinreg import path_expander from plaso.dfwinreg import regf class WinRegistryFileMapping(object): """Class that defines a Windows Re...
"""Code for handling location support. Location is an optional module which will add location information to certain message types. These include: * ``METAR`` * ``TAF`` * ``WINDS_06_HR`` * ``WINDS_12_HR`` * ``WINDS_24_HR`` * ``PIREP`` The most challenging of these are PIREPs, because PIREPs are often encoded by huma...
#!/usr/bin/env python ##### #Description reframe the barcode extraction script to do the following. #1. Improve speed by storing barcodes by position instead of string searching for them. #2. Support sequence error handling by filtering and correcting barcodes on the fly using hamming distance. # Filtering this wa...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
from sympy import Tuple, S, I, Plane from sympy.core.relational import Relational from sympy.logic.boolalg import Boolean from sympy.matrices.dense import DenseMatrix from sympy.vector import Vector from sympy.geometry.entity import GeometryEntity from spb.series import ( LineOver1DRangeSeries, Parametric2DLine...
#!/usr/bin/env python3 # Copyright (c) 2015-2021 Dell Inc. or its subsidiaries. # # 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 ...
from brightics.common.report import ReportBuilder, strip_margin, plt2MD, \ pandasDF2MD, keyValues2MD from brightics.function.utils import _model_dict from brightics.common.utils import check_required_parameters import numpy as np import pandas as pd import math from math import sqrt import seaborn as sns ...
import unittest import aiodns import logging import asynctest import socket import asyncio from unittest import mock from neo3.network import payloads, convenience, node, message, capabilities from neo3 import network_logger, settings from datetime import datetime from neo3.core import msgrouter class NodeManagerTest...
import numpy as np import sympy from ..api import utils def as_dimension(value): if isinstance(value, Dimension): return value elif isinstance(value, (int, np.int64)): return Dimension(int(value)) elif isinstance(value, (str, sympy.Symbol, sympy.Expr)): if isinstance(value, str): ...
""" Module containing all necessary calculations, functions and classes, for ionization calculations from Budapest-Florida code output. It uses the interface given in tcdata.py module. Most important feature is: Ionization.IonizationForRawprofile static method calculates ionization for given rawProfile object. """ ...
"""Helper functions for file I/O and manipulating MNIST dataset""" import os import glob import struct import pickle import copy import math import numpy as np import xarray as xr import matplotlib.pyplot as plt from littlenet import neural_net as nn def normalize_images(np_array): """Resizes MNIST image inputs t...
# Python 3.6 # Beautiful Soup 4.4 # Requests # # schedule_scraper version 2 | Plan zajęć na Uniwersytecie Śląskim # 17.12.2017 <NAME> import requests from bs4 import BeautifulSoup # CONSTANTS # Website's URL, it will return schedule table for current week URL = "http://plan.ii.us.edu.pl/plan.php?type=2&id=23805&winW...
"""Views for the accounts app.""" from collections import OrderedDict import json from django.conf import settings from django.contrib import messages from django.contrib.auth.models import Permission from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.db.model...
import subprocess import os import tarfile import zipfile from re import search, compile from tempfile import mkdtemp from abc import ABCMeta, abstractmethod from io import BytesIO native_support_os = ['posix'] def bytes_to_bio(filebytes): """Creates a file like BytesIO object from given filebytes.""" assert type(f...
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. """ Functions related to working with the simulation box or unit cell of a structure """ __name__ = "biotite.structure" __author__ = "<NAME>" __all__ = ["vectors_...
"""Inspect photos selected in Photos """ import functools import re from fractions import Fraction from multiprocessing import Process, Queue from queue import Empty from time import gmtime, sleep, strftime from typing import List, Optional, Tuple import pathlib import bitmath import click from applescript import Scr...
import pandas as pd import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import FancyBboxPatch, Rectangle def _plot_single_scatter_category(muts, mut_counts, xcol, ycol, marker_size_from_count, base_marker_size, colour, label, alpha, ...
import sys import tempfile from abc import ABCMeta import matplotlib.pyplot as plt from matplotlib.colors import to_hex import numpy as np from bokeh.io import output_notebook, push_notebook, show, output_file from bokeh.plotting import figure from bokeh.models import ( ColumnDataSource, TapTool, ColorBar...
import builtins import dis import importlib import inspect import itertools import types from inspect import iscode from itertools import groupby import dill from stdlib_list import stdlib_list from undecorated import undecorated from .globalslister import retrieve_all_funcs from .utils import get_system_packages, or...
""" This module defines power circuits """ import math from typing import Tuple from functools import reduce from re import A from skidl import * from ..units import linear from ..parts_wrapper import TrackedPart from .power_data import get_lm2596_inductor_value from .resistors import small_resistor as R __all__ = ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # parts of this code are copied from DQN_ZOO https://github.com/deepmind/dqn_zoo # under the Apache License, Version 2.0 (the "License"); import sys import typing import haiku as hk import jax from jax.config import config import jax.numpy as jnp import numpy as np im...
# hyperparameters.py # Imports import gc import os import logging import numpy as np from timeit import default_timer as timer import hyperopt from hyperopt import fmin, tpe, hp import matplotlib matplotlib.use('Agg') # Need this to write images from the GSA servers. Order matters: import matplotlib.pyplot as plt #...
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread fro...
"""XACML Context handler translates to and from SAML Authorisation Decision Query / Response """ __author__ = "<NAME>" __date__ = "14/05/10" __copyright__ = "(C) 2010 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "<EMAIL>" __revision__ = '$Id$' i...
""" Training script for scene graph detection. Integrated with my faster rcnn setup """ import os, sys script_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.append('{}/../'.format(script_dir)) from dataloaders.visual_genome import VGDataLoader, VG import numpy as np import torch from torch import optim f...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: FileFormat.Results.ElectronTrajectoriesResults .. moduleauthor:: <NAME> <<EMAIL>> Read MCXray electron trajectories results file. """ ############################################################################### # Copyright 2017 <NAME> # # Li...
import glob import os import sys import pdb import os.path as osp sys.path.append(os.getcwd()) import torch import os.path as osp import torch.nn as nn import torch.nn.functional as F from psypose.MEVA.meva.utils.video_config import MEVA_DATA_DIR from psypose.MEVA.meva.lib.spin import Regressor, hmr from psypose.MEVA...
""" """ import time, zlib, re from calendar import timegm from .rtlibRepl import minidom import wx from WikiExceptions import * import Consts from .MiscEvent import MiscEventSourceMixin, KeyFunctionSink from . import Exporters, Serialization from . import StringOps # from ..StringOps import a...
import collections import os import numpy as np from PIL import Image def read_obj_with_group(filename, swapyz=False): vertices = [] colors = [] normals = [] texcoords = [] faces = [] normal_idxs = [] texcoord_idxs = [] materials = [] mtl = None group = [[], [], []] material = None for line ...
import os from warnings import warn from getpass import getuser import numpy as np import pandas as pd import cufflinks as cf import plotly.graph_objects as go from plotly.subplots import make_subplots pd.set_option('display.max_rows', 100) cf.set_config_file(offline=True, world_readable=False, theme='ggplot') INCREA...
import rlp from ethereum.utils import normalize_address, hash32, trie_root, \ big_endian_int, address, int256, encode_hex, encode_int, \ big_endian_to_int, int_to_addr, zpad, parse_as_bin, parse_as_int, \ decode_hex, sha3, is_string, is_numeric from rlp.sedes import big_endian_int, Binary, binary, Countable...
#!/usr/bin/env python """ Fit a hypersurface to discrete systematics datasets -- as specified by a fit config file -- and produce a fit file usable by, e.g., the `discr_sys.hypersurfaces` service. For more details, see `pisa/utils/hypersurface.pu` A script for making plots from the fit results produced by this file ...
import os import numpy as np import netCDF4 import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import matplotlib import matplotlib.collections as mcollections import matplotlib.patches as patches from matplotlib.path import Path from matplotlib.offsetbox import AnnotationBbox, OffsetImage from mat...
import logging import os from argparse import ArgumentParser import torch import torch.nn as nn from src.detr.matcher import build_matcher from src.utils.configs import get_default_configuration, load_config from src.utils.confusion import BinaryConfusionMatrix from src.data import data_factory import src.uti...
# Author: <NAME> from typing import Tuple from lark import Lark, Transformer, v_args, exceptions from kernel.type import HOLType, TVar, Type, TFun, boolT from kernel.term import Var, Const, Comb, Abs, Bound, Term from kernel import macro from kernel.thm import Thm from kernel.proof import ProofItem, id_force_tuple fr...
# pylint: disable=C,R,E1101,E1102,W0221 import argparse import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F from se3cnn.blocks import GatedBlock from se3cnn.util.dataset.shapes import ModelNet10, Obj2Voxel, CacheNPY, EqSampler import matplotlib matplotlib.use('A...
#!/usr/bin/sudo python import os import time import json import copy import argparse import collections import shutil import random import logging from datetime import datetime import numpy as np import soundfile as sf import yaml import pretty_midi import pyloudnorm as pyln import utils import midi_inst_rules logg...
__all__ = ['diag_gaussian_log_likelihood', 'gaussian_pos_log_likelihood', 'Gaussian', 'DiagonalGaussianFromExisting', 'LearnableDiagonalGaussian', 'LearnableAutoRegressive1Prior', 'CoordinatedDropout', 'GRUClipCell', 'test_GRUClipCell', 'GRUClip', 'test_GRUClipLayer', 'test_GRUClipLayer...
import pygame from pygame.locals import * import sys import time from random import randrange import random SCREEN_SIZE = (1280, 720) global HORIZ_MOV_INCR HORIZ_MOV_INCR = 5 global FPS global clock global time_spent WHITE = ((255,255,255)) BLACK = ((0,0,0)) BLUE = pygame.Color('dodgerblue4') glo...
#!/usr/bin/env python3 # https://docs.openshift.com/container-platform/4.8/rest_api/index.html import os import re import csv import sys import html import json import logging import datetime import argparse import openpyxl import subprocess url_prefix = 'https://docs.openshift.com/container-platform' ocp_version = ...
# MIT License # Copyright 2020 <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 Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, di...
import pdb import numpy as np import os import tensorflow as tf import math from .data_utils import minibatches, pad_sequences, get_chunks from .general_utils import Progbar from .base_model import BaseModel class NERModel(BaseModel): """Specialized class of Model for NER""" def __init__(self, config): ...
# !/usr/bin/env python # coding: utf-8 ''' @File : boost.py @Time : 2020/04/13 13:46:21 @Author : <NAME> @Version : 1.0 @Contact : <EMAIL> ''' # This is used to build catboost model using extracted features import argparse import gc import time import os import math import catboost import matplotlib...
# *_*coding:utf-8 *_* import os import sys from os import makedirs from os.path import exists, join BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(BASE_DIR) sys.path.append(os.path.join(ROOT_DIR, 'models')) sys.path.append(os.path.join(ROOT_DIR, 'utils')) from...
from matplotlib.cm import ocean from matplotlib.colors import LinearSegmentedColormap import matplotlib.pyplot as plt import numpy as np import os from unittest import main, skip, TestCase from unittest.mock import call, MagicMock, patch from pkwscraper.lib.region import Region from pkwscraper.lib.visualizer import C...
# diff_tree.py -- Utilities for diffing files and trees. # Copyright (C) 2010 Google, Inc. # # 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 # or (at your option) a later versio...
import os import time import copy import random import logging import itertools import ipdb as pdb import numpy as np import torch import torch.optim.lr_scheduler from torch.nn.utils.clip_grad import clip_grad_norm from allennlp.common import Params from allennlp.common.checks import ConfigurationError from allennlp....
from typing import Any, Callable, Dict, List, Tuple import numpy as np __all__ = ["mcts", "MCTSNode"] # TODO: sort this out: State, Action = Any, Any Player, Game = Any, Any def mcts(starting_node: "MCTSNode", game: Game, estimator: Callable, mcts_iters: int, c_puct: float, ...
from __future__ import absolute_import import ast import io import os import threading import types from collections import defaultdict from collections import deque from os import getpid from colorama import AnsiToWin32 from . import config from .util import BUILTIN_SYMBOLS from .util import CODE_COLORS from .util ...
#!/usr/bin/env python # Features to be added later: #proper splice site modeler (perhaps optimizing splice site score vs. difference from expected length), maybe MAYBE taking #into account non-conserved exon phase. # Known issues: #Will return annotations with arbitrary missing exons, but can't handle two ...
from sklearn import tree from sklearn.naive_bayes import GaussianNB, MultinomialNB, BernoulliNB from sklearn import svm from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import confusion_matrix from sklearn.metrics import accuracy_score from sklearn.metrics import classification_report from sklear...
from flask import request, jsonify, abort from flask import current_app as app from flask_jwt_extended import jwt_required, get_jwt_identity from ...models import db, RioUser from ...helper_functions import calculate_era # API Request URL example: /profile/stats/?recent=10&username=demouser1 ''' @ Description: Ret...
import os import torch from torch.nn import functional as F from stft_core.modeling.utils import cat from stft_core.structures.bounding_box import BoxList #infer from stft_core.structures.boxlist_ops import boxlist_iou INF = 100000000 def get_num_gpus(): return int(os.environ["WORLD_SIZE"]) if "WORLD_SIZE" in...
import sys import json import time import torch import pickle import socket import logging import numbers import functools import subprocess import unicodedata from typing import List, Union from pathlib import Path import yaml import numpy as np import hickle import scipy.io as spio import msgpack_numpy as msgpack_np...
# -*- coding: utf-8 -*- """Classes for interacting with models.""" import logging from datetime import datetime from ._api_object import ApiObject from urllib.parse import urlencode from .error import NotFoundError, ResponseError from typing import Union from time import time as t from time import sleep class Models:...
import netket as nk import numpy as np from Forging_helper import * from Forging_helper_Circuits_TFIM import * import pennylane as qml import os from functools import partial from netket import jax as nkjax import jax import jax.numpy as jnp from jax import random import time import matplotlib.pyplot as plt import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Nov 6 15:42:56 2021 @author: mohsenr """ import matplotlib.pyplot as plt import numpy as np from scipy.io import loadmat from scipy.stats import zscore import torch from torch import nn from torch.utils.data import DataLoader, random_split from eelbrai...
""" implement a CNN network as mentioned in VIN paper. Author: <NAME> """ import tensorflow as tf from scipy import io as sio import numpy as np import matplotlib.pyplot as plt import pickle as pkl # NUM_CLASSES = cnn_model_cfg.action_dims # NUM_EXAMPLES_PER_EPOCH_FOR_TRAIN = 50000 # NUM_EXAMPLES_PER_EPOCH_FOR_EVAL =...
""" The game_state entities module contains the classes that represent game entities for suspects, weapons, rooms, hallways, game cards, and the game board """ #constants for suspect names SUSPECT = 'Suspect' MUSTARD = '<NAME>' SCARLET = '<NAME>' PLUM = '<NAME>' GREEN = 'Mr Green' WHITE = '<NAME>' PEACOCK = '<NAME>' ...
import os import sys import argparse import importlib import numpy as np import tensorflow as tf import pdb BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.join(BASE_DIR, '..')) sys.path.append(os.path.join(BASE_DIR, '../utils')) import provider import provider_ri...
import scipy.io from tqdm import tqdm import pickle import numpy as np import sys import math from scipy.linalg import lstsq from sklearn.model_selection import KFold, permutation_test_score import argparse import os import helper from scipy.stats import spearmanr from sklearn.linear_model import Ridge, RidgeCV import ...
"""The main way to define and interact with a Pycollo optimal control problem. This module contains the main class that the user will interact with to define and run their optimal control problem when working with Pycollo. Terminolgy is loosely defined in accordance with "<NAME> (2010). Practical Methods for Optimal...
from drawengine import * from readscreen import * import screens class Catalog: last_tale = 0 search_text = '' def __init__(self, to_overview = False): self.window = Singleton.window self.color = [Color(200, 80, 80), Color(250, 180, 180)] self.toshow = [(self.show, 0.5...
import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.spatial import cKDTree from scipy.sparse.linalg import cg sys.path.append('../qc_dem/') from qc_dem.boundary import Boundary from qc_dem.particles import ( Particles, NList, ) from qc_dem.variational_int im...
import os import csv import re import pandas import argparse import numpy as np import shutil # Predefines regex = re.compile(r'\d+') my_dpi = 96 fixation_vel_threshold = 50 # pixels base_path = './original_data/Dataset_stimuli/' output_path_csv = './csv/' output_path_image = 'images/' header_gaze=("web_group_id", "us...
"""Summarise completed scans of observation models.""" import h5py import importlib import logging import numpy as np import numpy.lib.recfunctions as recfunctions import os import os.path from . import json from . import settings def year_from_fs_date(s, fs_date): """Determine the calendar year associated with...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ __ __ ___ # / | \ | \ | \ / Automatic # \__ |__/ |__/ |___| \__ Annotation # \ | | |...