text
stringlengths
6.04k
39.5k
import re from fastapi import FastAPI from pydantic import BaseModel from typing import List import pandas as pd from fewsum.config.run import * from fewsum.config.model_hp import * from fewsum.modelling.models import * from fewsum.data_pipelines.assemblers import assemble_unsup_pipeline, \ assemble_vocab_pipeline,...
print(__file__) import bluesky as bs import bluesky.plans as bp import time as ttime from subprocess import call import os import signal #from bluesky import RunEngine ### Added by Chanaka and Julien def slit_scan_plan(detectors, num, slit1, slit2, rel_start, rel_stop): ''' Scan slit 1 and slit 2 together relati...
""" Author: <NAME> (<EMAIL>, http://personales.upv.es/jon) Version: 1.0 Date: September 2021 Universitat Politecnica de Valencia Technical University of Valencia TU.VLC Using E-M algorithm for Unsupervised Maximum Likelihood Estimation """ import os import sys import numpy from sklearn.base ...
#!/usr/bin/env python3 # ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ----------------------------...
import os from copy import deepcopy import numpy as np import pandas as pd import nibabel as nib import pytest from lyman.frontend import LymanInfo @pytest.fixture() def execdir(tmpdir): origdir = tmpdir.chdir() yield tmpdir origdir.chdir() @pytest.fixture() def lyman_info(tmpdir): data_dir = tm...
"""Core pandera schema class definitions.""" import json import copy import warnings from typing import List, Optional, Union, Dict, Any import pandas as pd from . import errors, constants, dtypes, error_formatters from .checks import Check N_INDENT_SPACES = 4 class DataFrameSchema(): """A light-weight panda...
# encoding=utf-8 ################################# # Author: ideawu # Link: http://www.ideawu.net/ ################################# import sys, os, shutil, datetime import antlr3 import antlr3.tree from ExprLexer import ExprLexer from ExprParser import ExprParser class CpyEngine: found_files = set() def find_impo...
# Searching Algorithm Visualizer # from tkinter import * from tkinter import messagebox from PIL import Image,ImageTk import time class Initialization: def __init__(self,root): self.window= root self.store=[10,20,30,40,50,60,70,80,90,100] self.search_positio...
"""RAOP functional tests with fake device. TODO: Things to improve: * Add tests for timing server * Improve sync tests """ import asyncio import io import logging import math from typing import Dict, List import pytest from pyatv import exceptions, raop from pyatv.const import DeviceState, FeatureName, FeatureState...
import speech_recognition as sr import cv2 import ctypes import subprocess import psutil from plyer import notification from PIL import Image import pytesseract import youtube_dl from googlesearch import * import time import tkinter import random import operator import datetime import wikipedia import w...
import logging from datetime import datetime import geojson import pycountry from mongoengine import ( BooleanField, DateTimeField, Document, EmbeddedDocument, EmbeddedDocumentListField, FloatField, IntField, ListField, MultiPolygonField, PolygonField, ReferenceField, St...
# coding=utf-8 import yaml import inflection import re import os import copy from typing import Optional, Dict, MutableMapping, List from collections import defaultdict, OrderedDict from functools import partial from werkzeug.datastructures import ImmutableMultiDict from .errors import ContentNotFoundError, Questio...
# -*- coding: utf-8 -*- from shutil import copyfile import numpy as np # #from aiida import get_file_header from aiida.common.utils import classproperty from aiida.common.datastructures import CalcInfo, CodeInfo from aiida.common.exceptions import InputValidationError # from aiida.orm.calculation.job import JobCalculat...
#################################################################################################### #Intro v = "0.1" f0=(""" ,:++. %#::. .....
from __future__ import absolute_import, division, print_function from collections import OrderedDict import math from pymel.core import duplicate, dt, group, hide, joint, ikHandle, listConnections, makeIdentity, move, orientConstraint, parent, parentConstraint, PyNode, skinCluster, xform from .... import core from ....
''' Several no-fuss methods for creating plots ''' from typing import Dict, Optional, Callable, Tuple, Union, List from numpy import exp import numpy from numpy.core.fromnumeric import repeat, shape import pandas import plotly.express as px import plotly.io as pio import plotly.graph_objects as graph_objects # Set the...
r""" This module implements Multi-Scale Structural Similarity (MS-SSIM) index in PyTorch. Implementation of classes and functions from this module are inspired by <NAME>ang's (@VainF) implementation: https://github.com/VainF/pytorch-msssim and implementation of one of pull requests to the PyTorch by <NAME> (@MKFMIKU)...
import math import os import random import time import cv2 import keras import keras.backend.tensorflow_backend as backend import numpy as np import tensorflow as tf import sc2 from sc2 import run_game, maps, Race, Difficulty, position, Result from sc2.player import Bot, Computer from sc2.constants import * os.envi...
import logging from enum import Enum import unicodedata from typing import Any import pandas as pd import jellyfish import scipy import textdistance from sentence_transformers import SentenceTransformer from tqdm import tqdm from gleipnir.data import * from gleipnir.formats import Document, Sentence, Entity from ...
# Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved. """ Contains classes that represent data-centric transformations. """ import copy from dace import serialize from dace.dtypes import ScheduleType from dace.sdfg import SDFG, SDFGState from dace.sdfg import nodes as nd, graph as gr, utils as sd...
import pickle import urllib.request from datetime import datetime as dt from glob import glob as ls from os import path, remove import numpy as np from astropy.time import Time from bs4 import BeautifulSoup from scipy.interpolate import interp1d from scipy.io import readsav def iris_get_response(date=dt.strftime(dt....
import numpy as np import nibabel as nib import pickle from time import time from src.utils.definitions import * from src.evaluation_metrics.segmentation_metrics import dice_score, haussdorff_distance DATA_DIR = [ Controls_LEUVEN_TESTINGSET, SB_LEUVEN_TESTINGSET, CORRECTED_ZURICH_DATA_DIR, ] SAVE_FOLDER = ...
#------------------------------------------------------------------------------- # Name: GitHubImageMaker # Purpose: GitHubのグリッド風の画像生成プログラムです # # Author: Shaneron # # Created: 15/03/2022 # Copyright: (c) Shaneron 2022 #------------------------------------------------------------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import re import sys import base64 import shutil import random import hashlib import tempfile import itertools import subprocess import contextlib import multiprocessing random.seed(12345) CHARMAP_V = str.maketrans( '()-—‘’“”…〈〉《》「」『』【】〔〕(){}', '︵︶||﹃﹄...
""" Author: <NAME> Description: This program utilizes NLP and machine learning to extract concepts from philosophical texts. The user inputs a the filepath of an xml file containing a text. The program splits that text into paragraphs and then (via NLP and ML) trains a model to search for each of the conce...
# Copyright 2020 . All Rights Reserved. # Author : <NAME> import functools print = functools.partial(print, flush=True) import argparse import os from textdata_SQUAD import TextData import time, sys import torch import torch.autograd as autograd import torch.nn as nn import torch.nn.functional as F import torch.optim ...
from __future__ import absolute_import from collections import OrderedDict from cached_property import cached_property import ctypes import numpy as np import sympy from devito.compiler import jit_compile, load, save from devito.dimension import Dimension from devito.dle import transform from devito.dse import rewri...
"""JSON Web Token""" import six try: from builtins import str from builtins import object except ImportError: pass # Most of the code, ideas herein I have borrowed/stolen from other people # Most notably <NAME>, <NAME> and <NAME> import json import logging import struct from Crypto.Hash import SHA256 fr...
""" Functions that are used in the pipeline to convert explanations into labeling functions """ import copy import pathlib import re import string import sys from nltk.ccg import chart, lexicon PATH_TO_PARENT = str(pathlib.Path(__file__).parent.absolute()) + "/" sys.path.append(PATH_TO_PARENT) from CCG import CCG_c...
import numpy as np from scipy import linalg from scipy.special import logsumexp, gammaln from scipy.stats import multivariate_normal, poisson from sklearn.utils import check_random_state MIN_LIKELIHOOD = 1e-300 MIN_LOGLIKELIHOOD = -700 def log_multivariate_normal_density(X, means, covars, covariance_type='diag'): ...
import os import ntpath import pathlib import posixpath import types import typing from typing import Any, ClassVar, Iterator, Optional, Type, TypeVar, Union from fileio.core import type_utils from fileio.cloud import auth from fileio.core.libs import TF_FUNC from fileio.cloud.gcp_gcs import _auth_gcp_gcs, GCSBlob, GC...
"""Engine to run the turn of a pokemon game.""" from copy import deepcopy from uuid import uuid4 from random import random from config import (PAR_STATUS, FRZ_STATUS, SLP_STATUS, TOX_STATUS) from file_manager.log_writer import LogWriter from pokemon_helpers.pokemon import default_boosts class PokemonEngine(): ...
import numpy as np import pandas as pd from PyEMD import EMD, Visualisation import scipy import math import scipy.io import scipy.linalg import sklearn.metrics import sklearn.neighbors from sklearn import metrics from sklearn import svm import matplotlib.pyplot as plt import torch from torch import nn from torch.uti...
import collections import json import math import os import sys import termcolor from bos_consensus.util import ( ArgumentParserShowDefaults, logger, Printer, ) class FaultyNodeHistory: history = None def __init__(self): self.history = dict() self.created_times = dict() def ...
#!/usr/bin/env python3 import os from collections import OrderedDict, deque from typing import Any, Deque, Dict, List, Optional, Tuple import torch from fairseq import checkpoint_utils from pytorch_translate import constants # TODO(T55884145): Replace with # from fvcore.common.file_io import PathManager from pytorch...
# Copyright 2014 <NAME> # # 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. # This program is distribut...
"""Create a wheel super element 1) Create a 2-d wheel section mesh using abaqus cae 2) Based on this mesh, generate an input file for a full 3d-wheel 3) Run the input file to obtain the substructure stiffness matrix .. codeauthor:: <NAME> """ # Python imports import os import numpy as np # Abaqus imports from abaq...
import copy import itertools try: import plateo except ImportError: _has_plateo = False else: _has_plateo = True class Vessel: """A container for the cloning experiment.""" def __init__(self): self.env = {"temperature": 37, "molecules": [], "plasmids": []} self.strains = [] ...
#!/usr/bin/env python3 import argparse import collections from datetime import timedelta import json import numpy import random from typing import Any, List, Hashable, Tuple, Dict, TypedDict, TypeVar, Generator, Iterable import sys # This file provides functionality to correct noisy data coming from the event-level r...
# wadze.py # # Web Assembly Decoder - Zero Extras # # Copyright (C) 2019 # <NAME> (https://www.dabeaz.com) # All Rights Reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # * Redistributions of source code must...
import torch import torch.nn as nn import torch.nn.functional as F from mo.utils.error import Error # Callback which is executed after nn.Module forward def forward_hook(self, inputs, output): # Skip if we already processed as functional hook if isinstance(output, OpenVINOTensor) and output.node_name: ...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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 law ...
import pandas as pd import numpy as np ### MAST DATA CHECKS AND VALIDATIONS ### def check_mast_data_not_empty(mast_data): assert not mast_data.empty, 'No data in mast_data DataFrame.' def check_sensor_names_in_mast_data_columns(mast_data_columns, sensor_names): if not isinstance(sensor_names, list...
import numpy as np #necessary imports import cv2 import time import math import serial color=(255,0,0) #variable for contour color and thickness thickness=2 cX = cY = 0 #centroid of ball contour cap = cv2.VideoCapture(1) #capture ...
from functools import cached_property, reduce from typing import Tuple, Sequence, Optional, Dict import numpy as np from scipy import linalg from rfidam.protocol.symbols import InventoryFlag from rfidam.inventory import RoundModel, get_inventory_probs, get_id_prob from rfidam.protocol.protocol import Protocol from rf...
from __future__ import print_function import itertools import torch import torch.nn as nn import torch.nn.functional as F import tcmm import random import math import numpy as np TENSOR_CORE=False TENSOR_CORE_THRES=1024 #2048*1024 def try_contiguous(x): if not x.is_contiguous(): x = x.contiguous() ret...
# Copyright 2016 Google 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 applicable law or ...
from telethon import TelegramClient, events from telethon.tl.functions.users import GetFullUserRequest from telethon.client import bots from utils.weather import wtr from requests import get import os import requests import random import calendar from datetime import datetime token = os.environ.get("BOT_TOKEN") bot = ...
import numpy as np import codecs import json from torch.utils.data import DataLoader import os import torch import pandas as pd from modules.utils.utils import ipython_info from tqdm._tqdm_notebook import tqdm_notebook from tqdm import tqdm def read_list(sents, max_chars=None): """ read raw text file. The for...
import numpy as np import pandas as pd import pysam from functools import reduce import ribohmm.utils as utils MIN_MAP_QUAL = 10 class Genome(): def __init__(self, fasta_filename, map_filename, read_lengths): self._seq_handle = pysam.FastaFile(fasta_filename) # Mappability self._map_han...
# Copyright (c) 2017-present, Facebook, 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 law or agreed...
import inspect import datetime from enum import Enum, auto from typing import List, Callable, Optional, Tuple, Union import docstring_parser import stringcase from django.apps import apps from django.conf import settings from django.db import models from django.db.models.base import ModelBase from djmoney.models.field...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ### ### ...
import ast from pathlib import Path import attr import numpy as np import pandas as pd from langdetect import detect from sklearn.preprocessing import MultiLabelBinarizer, StandardScaler try: from rich import print except ModuleNotFoundError: pass @attr.s class TracksMetaDB(object): buckets = attr.ib() ...
import os import sys import pdb import torch import numpy as np import pickle as pkl from PIL import Image from random import shuffle from torchvision import datasets, transforms """ Template Dataset with Labels """ class XYDataset(torch.utils.data.Dataset): def __init__(self, x, y, **kwargs): self.x, se...
"""Extend sklearn's Pipeline and FeatureUnion.""" import itertools from functools import wraps import time import types import warnings import numpy as np import pandas as pd from scipy import sparse from sklearn.pipeline import _transform_one from sklearn.pipeline import _fit_transform_one from sklearn.pipeline impo...
# Copyright (c) 2019 MindAffect B.V. # Author: <NAME> <<EMAIL>> # This file is part of pymindaffectBCI <https://github.com/mindaffect/pymindaffectBCI>. # # pymindaffectBCI 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 Softwar...
import numpy as np import pandas as pd from datetime import datetime from datetime import timedelta import scipy.interpolate from sklearn.linear_model import Lasso from statsmodels.tsa.arima_model import ARMA import warnings from os import listdir def cov(a,b): a_mean = np.mean(a) b_mean = np.mean(b) ...
""" High-level operations for numpy structured arrays. join(): Perform a database join of two numpy ndarrays. hstack(): Horizontally stack a list of numpy ndarrays. vstack(): Vertically stack a list of numpy ndarrays. Some code and inspriration taken from numpy.lib.recfunctions.join_by(). Redistribution license rest...
import telebot, telebot.types as types,json,os, datetime as dt from datetime import datetime bot = telebot.TeleBot('5074269648:AAHeazmppyZrzDcyRuhs4SNuyXkvXrLneZ4') with open('Activitys.json') as json_file: Activitys = json.load(json_file) with open('Users.json') as json_file: Users = json.load(json_file) with ...
from __future__ import print_function as _print_function from __future__ import absolute_import as _absolute_import import os import unittest import tempfile import numpy as np import debacl as dcl from numpy.testing import assert_array_equal class TestLSTConstructors(unittest.TestCase): """ Test that the v...
''' This is a set of functions for dealing with PIV data Most functions are for 2D data. ''' #Import matlab PIV data def loadDataset(path,mats,structs,matlabData = None): ''' Import a matlab data file Inputs: path - Path to the matlab file mats - names of the matlab matrices to be imported. ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import os.path import tempfile...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- # Copyright (c) 2021, Blue Lynx and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import getdate, get_time, flt from datetime import datetime, timedelta, date, time from club_crm.club_c...
import numpy as np import pickle import copy import sys import argparse import logging import os from logger import get_logger from tqdm import tqdm from collections import deque import torch import torch.nn as nn import torch.nn.functional as F import torch.distributed as dist from torch.utils.tensorboard import Summ...
import os, sys, json, re, uuid, time import logging, argparse import requests logging.basicConfig( filename='brownfield_import.log', format='%(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S' ) linux_template_uuid = "50204284-5a62-9f9f-16c1-de6...
#!/usr/bin/python2 # # Copyright 2015 Google INc. All Rights Reserved. """This module controls locking and unlocking of test machines.""" from __future__ import print_function import argparse import getpass import os import sys import traceback from cros_utils import logger from cros_utils import machines class A...
from constants import * import random # -- - general_purpose methods - - --- - - def generate_initial_Q(): """ This builds the initial brain or 'Q'. Returns a dictionary of states associated with an array of actions. All actions are set to an intial value of zero. 'Q' stands for '...
# -*- coding: utf-8 -*- ############################################################################### # This file is part of metalibm (https://github.com/kalray/metalibm) ############################################################################### # MIT License # # Copyright (c) 2020 Kalray # # Permission is here...
from __future__ import absolute_import import os.path as op import shutil import numpy as nm from sfepy.base.base import ordered_iteritems, output, set_defaults, assert_ from sfepy.base.base import Struct from sfepy.homogenization.engine import HomogenizationEngine from sfepy.homogenization.homogen_app import Homogen...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/python # -*- coding: utf-8 -*- import functools import itertools import json import math import time from collections import defaultdict import autonetkit.ank as ank_utils import autonetkit.ank_json import autonetkit.ank_messaging import autonetkit.log as log import netaddr import networkx as nx from autone...
# HTLCProductsSim.py # # A library for simulating financial products based on hash oracles # # Copyright 2019 <NAME> # # MIT License # # Classes contained within: # # class Pair - A currency pair (e.g. "USD:CNY") # class Price - A price of one currency in another # class AssetBag - A quan...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2020, Men&Mice # GNU General Public License v3.0 # see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt # # https://docs.ansible.com/ansible/latest/dev_guide/developing_inventory.html # # python 3 headers, required if submitting to Ansible """Ansible inven...
""" Utilities for working with rating matrices. """ from collections import namedtuple import logging import warnings import pandas as pd import numpy as np import scipy.sparse as sps import numba as n from numba import njit, jitclass, prange from .util.array import swap _logger = logging.getLogger(__name__) Ratin...
from tensorflow.keras.models import Sequential, Model from tensorflow.keras.layers import Dense, Flatten, Input, \ Concatenate, LeakyReLU from tensorflow.keras import initializers, regularizers import tensorflow as tf from tensorflow.keras.optimizers import Adam from rl.agents import DDPGAgent from rl.memory import...
import clang.cindex from clang.cindex import CursorKind, TranslationUnit import os.path import asciitree # must be version 0.2+ from collections import OrderedDict as odict import subprocess import tempfile import ccsyspath from shutil import which import sys import re from . import util from .util import logerr, dbg...
#! /usr/bin/env python3 import unittest import hrr from itertools import chain, islice, combinations from functools import reduce import numpy as np # for comparing hrr output to # output of corresponding numpy functions, using np.testing # later, the main package will use the numpy f'n versions (and test using t...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# coding=utf-8 ''' Created on 2018年1月13日 @author: heguofeng ''' import os from _stat import S_ISDIR, S_ISREG import hashlib import struct import unittest import logging from logtool import set_debug import math import sys NODE_TYPE_FILE = 1 NODE_TYPE_FOLDER = 2 NODE_TYPE_UP = 3 NODE_TYPE_DOWN = 4 NODE_TYPE_IMAGE = ...
from __future__ import annotations import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.transforms as transforms import numpy as np import scipy.spatial.distance as distance from scipy.stats import multivariate_normal # import scipy.linalg as linalg import matplotlib.colors as matcolo...
import logging import time from abc import abstractmethod from collections import OrderedDict, defaultdict from itertools import cycle from typing import List import anndata import numpy as np import torch from sklearn.model_selection._split import _validate_shuffle_split from torch.utils.data.sampler import SubsetRan...
import numpy as np import numpy.linalg as LA from src.common.conics import matrix_adjugate, scale_det, conic_matrix, conic_center from src.matching.utils import np_swap_columns, is_colinear, is_clockwise, enhanced_pattern_shifting, \ shift_nd class PermutationInvariant: """ Namespace for permutation inva...
#%% import os import pickle import time from pathlib import Path import colorcet as cc import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.decomposition import PCA from sklearn.feature_selection import VarianceThreshold from sklearn.model_selection import train_tes...
# This file is part of Scapy # Scapy 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 # any later version. # # Scapy is distributed in the hope that it will be useful, # but ...
#!/usr/bin/env python3 import sys TCP_STAT_DESC = [ [ "wscale", "sep", ",", [ ["snd_wscale", "int"], ["rcv_wscale", "int"], ], ], ["rto", "double"], ["backoff", "int"], [ "rtt", "sep", "/", [ ...
# # Disassemble - Disassemble selected region (the whole file if not selected) # # Copyright (c) 2020, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of sou...
""" produces a human readable, interactive HTML/js depiction of findneighbour4 server status A component of the findNeighbour4 system for bacterial relatedness monitoring Copyright (C) 2021 <NAME> <EMAIL> repo: https://github.com/davidhwyllie/findNeighbour4 This program is free software: you can redistribute it and/o...
# -*- coding: utf-8 -*- """ Get input data from Excel files, and calculate epidemiological parameters """ import os import numpy as np import pandas as pd import datetime as dt from . import param_parser from .get_initial_state import InitialModelState from datetime import datetime def aggregate_params_a...
# Author: <NAME> # Text input: <NAME> # Text display and some variables: <NAME> # / / / / / / / / / / / / / / / / / / / / Imports all pngs for program background = "Screens/background.png" cobble = "Screens/cobblepath713.png" hitscreen = "Screens/splash_hit.png" frontScreen = "Screens/FrontScreen.png" scoreBG = "Scree...
import numpy as np import pandas as pd from scipy import signal, stats from scipy.stats import entropy from .tools import * from abc import ABC, abstractmethod #https://raphaelvallat.com/entropy/build/html/index.html try: from entropy import spectral_entropy except: response = yes_or_no("Missing 'entropy' depe...
# -*- coding: utf-8 -*- import unetsl.data import numpy def upsample(stack, shape): """ upsamples the last three dimensions and keeps the other dimensions unchanged. """ scale = [o//i for o,i in zip(shape[-3:], stack.shape[-3:])] return numpy.kron(stack, numpy.ones(tuple(scale))) def c...
#!/usr/bin/env python3 import re import json import time import requests from utils import Utilities from static import Static import logging # for later use: categories = {1: 'Music', 2: 'Applications', 3: 'E-Books', # 4: 'Audiobooks', 5: 'E-Learning Videos', 6: 'Comedy', 7: 'Comics'} ut = Utilities() st = Static()...
# uncompyle6 version 3.7.4 # Python bytecode 3.6 (3379) # Decompiled from: Python 3.6.13 |Anaconda, Inc.| (default, Feb 23 2021, 21:15:04) # [GCC 7.3.0] # Embedded file name: /home/dordonez/Projects/slip_control/slip_control/utils/plot_utils.py # Compiled at: 2021-09-30 19:22:48 # Size of source mod 2**32: 22201 bytes...
import torch import torch.nn as nn import torch.nn.init as I import torch.nn.utils.rnn as R import torch.nn.functional as F from torch.autograd import Variable from torchsru import SRU def pad_batch(x, n, after=True): pad_shape = x.data.shape[1:] pad = x.data.new(n, *pad_shape).zero_() pad = Variable(pad...
import logging import os import sys import click # noinspection PyUnresolvedReferences import comet_ml # Needs to be imported __before__ torch import torch import torch.utils.data from torch import optim from tqdm import tqdm from data.dataset_implementations import get_vae_dataloader from models import select_vae_m...
# # Storage.py # # (c) 2020 by <NAME> # License: BSD 3-Clause License. See the LICENSE file for further details. # # Store, retrieve and manage resources in the database. It currently relies on # the document database TinyDB. It is possible to store resources either on disc # or just in memory. # from tinydb import Ti...
import tensorflow as tf import label_map import functools import sync_attention_wrapper def combined_static_and_dynamic_shape(tensor): """Returns a list containing static and dynamic values for the dimensions. Returns a list of static and dynamic values for shape dimensions. This is useful to prese...
""" Copyright 2021 <NAME>. Functions for looking up the right classes to handle types and values, and for registering new custom types. To prevent cyclic imports, the functions in this file should not be used by dataframe.py before the file is fully initialized (that is, only use within functions). """ from copy impo...