text
stringlengths
6.04k
39.5k
import sys import argparse import time import copy import itertools import logging import multiprocessing as mproc from abc import ABC from pprint import pformat import numpy as np import pandas as pd import matplotlib.pyplot as plt from skopt.callbacks import EarlyStopper from skopt.plots import plot_convergence fro...
#!/usr/bin/env python3 # # vsdev.py: https://github.com/kiyolee/vs-tools.git # # MIT License # # Copyright (c) 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 restrictio...
# -*- coding: utf-8 -*- # Copyright (C) 2004-2013 Mag. <NAME>. All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # **************************************************************************** # # This module is licensed under the terms of the BSD 3-Clause License # <http://www.c-tanzer.at/license/b...
from __future__ import print_function, division import argparse import os, sys, shutil import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data from torch.autograd import Variable import torchvision.utils as vutils import torch....
import time import math import cmath import itertools from typing import Generator, Tuple, Set, List import heapq def generate_2d_ordered_grid_points(limit: int) -> Generator[Tuple[int, int, int], None, None]: """ Imagine having a 2 dimensional grid of points, e.g. [(0, 0), (1, 0), (2, 0), (0, 1), (1, 1),...
# coding=utf-8 """ Common methods for this project. """ import re import os import collections import numpy as np from common_wrangler.common import (InvalidDataError, SEC_HEAD, SEC_ATOMS, SEC_TAIL, BASE_NAME, ATOM_TYPE, ATOM_COORDS, DIHES, ATOM_NUM_DICT, warning, get_fname_root, ...
from scipy.stats import t from .caltrack.usage_per_day import CalTRACKUsagePerDayModelResults __all__ = ("metered_savings", "modeled_savings") def _compute_ols_error( t_stat, rmse_base_residuals, post_obs, base_obs, base_avg, post_avg, base_var, nprime, ): ols_model_agg_error = ...
# To train the environment model. See paper appendix for implementation # details. import os os.environ["CUDA_VISIBLE_DEVICES"]="" import tensorflow as tf import gym import gym_minigrid from a2c import get_actor_critic, CnnPolicy from common.multiprocessing_env import SubprocVecEnv import numpy as np from tqdm impor...
# coding=utf-8 # 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 ...
# external libraries and modules import os # import module for directory management from dotenv import load_dotenv # load module for usage of a .env file import subprocess # import module used to do linux code execution from discord.ext import commands # import the commands module from discord.py import concurrent....
import glob import os import random import time import sys import logging import trimesh import meshcat import meshcat.geometry as g import meshcat.transformations as tf import cv2 import matplotlib.pyplot as plt import numpy as np import scipy from scipy.ndimage.filters import gaussian_filter import pyglet import py...
# ------------------------------------------------------------------------------ # BSD 2-Clause License # # Copyright (c) 2019, <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions...
import math from collections import OrderedDict import numpy as np import torch from torch import nn as nn from torch.nn import functional as F from utils.misc import param_ndim_setup import matplotlib.pyplot as plt class LossFn(nn.Module): def __init__(self, sim_loss_fn, reg_l...
import json import time import warnings from datetime import datetime import joblib import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from nltk.corpus import stopwords from nltk.stem.wordnet import WordNetLemmatizer # Tweet tokenizer does not split at apostrophes which is wha...
import yaml import numpy as np import re import os import time import json from collections import Counter import torch import torch.nn as nn import torch.nn.functional as F from .bag_of_words import BagOfWords from .util import ( to_gpu, split_chunk, slice_tensors, accu_loss, consolidate_loss, ...
from threading import Thread import socket from time import sleep from sys import byteorder from Config import Config import configparser from Row import Row import os import sys from random import randrange def bell_indicators(MAX_BELLS, INDICATE_BELL_NUMBER_SHIFT, INDICATE_BEL...
#!/usr/bin/env python # -- coding: utf-8 -- #-------------------------------------------------------------------------- #Mit diesem Script können die Feiertage in Deutschland berechnet und #ausgegeben werden. Wird dem Script ein Bundesland übergeben, werden alle #Feiertage dieses Bundeslandes ausgegeben. Wird kein Bund...
import numpy as np from numba import jit from math import factorial, log from sklearn.neighbors import KDTree from scipy.signal import periodogram, welch from .utils import _embed all = ['perm_entropy', 'spectral_entropy', 'svd_entropy', 'app_entropy', 'sample_entropy'] def perm_entropy(x, order=3, delay=1, ...
# # This file is part of LiteDRAM. # # Copyright (c) 2021 Antmicro <www.antmicro.com> # SPDX-License-Identifier: BSD-2-Clause from operator import or_ from functools import reduce from migen import * from litex.soc.interconnect.csr import * from litedram.common import * from litedram.phy.dfi import * from litedram...
import copy import math import os import time from functools import partial import memcnn import numpy as np import torch import torchvision from torchvision import transforms, utils try: from .PerfTorch import dilatedconv except ImportError: from PerfTorch import dilatedconv SAMPLE_INTERVALL = 2 ** 12 SAVE_...
""" Models for bulk email """ import logging import markupsafe from config_models.models import ConfigurationModel from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db import models from opaque_keys.edx.django.models import CourseKeyField from common.django...
# encoding: utf-8 """ @author: liaoxingyu @contact: <EMAIL> """ import numpy as np import torch from ignite.metrics import Metric from torchreid.eval_metrics import eval_func from .re_ranking import re_ranking max_rank = 50 # class R1_mAP(Metric): # def __init__(self, num_query, max_rank=50, feat_norm='yes'):...
import copy import glob import gzip import os import pickle import random from typing import Optional import numpy as np import math import torch.nn as nn from gym.spaces import Box import inspect import re import gym import torch from termcolor import colored from codes.b_environments.or_gym.envs.classic_or.knapsac...
import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib.image as mpimg import pickle import glob def get_camera_param(): # read in and make a list of calibration images cameraParam = np.load("../param/camera_param.npy", allow_pickle=True)[()] mtxParam = cameraParam["mtx"] distP...
import os import numpy as np import json import random from PIL import Image # using pillow-simd for increased speed import PIL.Image as pil import cv2 as cv import torch import torch.nn.functional as F from torchvision import transforms from _Dataset.cityscapes_utils import * class Dataset_Options(...
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # 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 source code mus...
import json import struct from io import BytesIO from typing import BinaryIO import pprint import ctypes def int_overflow(val): maxint = 2147483647 if not -maxint - 1 <= val <= maxint: val = (val + (maxint + 1)) % (2 * (maxint + 1)) - maxint - 1 return val def unsigned_right_shitf(n, i): if ...
''' Form Manager ============ .. warning:: This is a *VERY* experimental attempt to make Kivy work in a mode with multiple windows independent on each other which can communicate together. .. note:: This attempt was written mainly in Python 3, therefore it can happen some calls will crash the app f...
#!/usr/bin/python3 import argparse import collections import difflib import io import logging import multiprocessing import os import queue import random import re import subprocess import sys import threading import time # import objgraph # logging.basicConfig(level=logging.INFO, # format='%(asct...
""" Copyright 2017 Inmanta 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 ...
# Copyright (c) 2016 <NAME> - http://www.pierky.com # Licensed under The MIT License (MIT) - http://opensource.org/licenses/MIT # # The MIT License (MIT) # ===================== # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "S...
""" Python tools and algorithms gathered through out the development projects and tutorials. Sections: 1. File Read/Write/Convert/Save Operations 2. Pandas Utils 3. Path Operations for File/Folder/System 4. Algorithms for Hierarchical Structures 5. Utility functions for xlrd library and read_spir function """ import ...
import numpy as np import os import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from .basics import * from .DPRNN import * from .TCN import * from .DPTNet import * from .sudo_rm_rf import * # GroupComm-RNN class GC_RNN(nn.Module): def __init__(self, input_size, h...
import numpy as np import scipy as sp import sys import pandas as pd import multiprocessing as mp import csv # utils # def isIn(group,elem): for el in group: if el == elem: return True return False def max_value(inputlist): return max([max(sublist) for sublist in inputlist]) def num_s...
import sendgrid from decouple import config from django.contrib.sites.shortcuts import get_current_site from authors.apps.authentication.backends import JWTAuthentication from sendgrid.helpers.mail import( Email, Mail, Content ) from rest_framework import ( exceptions, generics, status, seri...
''' @author : Abdelrauf <EMAIL> ''' import re import sys import os import subprocess import fnmatch import json import gzip try: from bigGzipJson import json_gzip_extract_objects except ImportError: pass from pathlib import Path from multiprocessing import Pool, Manager ,cpu_count import traceback import html ...
import bisect import torch import torch.multiprocessing as mp import copy import traceback from math import ceil class CandidateDomain: ''' Object representing a domain as produced by the BranchAndBound algorithm. Comparison between its elements is based on the values of the lower bounds that are esti...
#-- author: @avialxee ---#--# import requests from astropy import coordinates, units as ut from astropy.wcs import WCS from astroquery.skyview import SkyView as skv import numpy as np from time import perf_counter from warnings import simplefilter from astroquery.nvas import Nvas from astroquery.vizier import Vizier ...
#!/usr/bin/env python3 """This script demonstrates use of the SIE-Batch API from Python3""" # Lint with $ pylint sie_get_py.py (assumes .pylintrc file in dir) import calendar import datetime from datetime import datetime from io import BytesIO import json from os import path from pathlib import Path import re im...
# -*- coding: utf-8 - import re import copy import urllib import urllib3 import string import requests import json import dateutil.parser from iso8601 import parse_date from robot.libraries.BuiltIn import BuiltIn from datetime import datetime, timedelta import pytz TZ = pytz.timezone('Europe/Kiev') def get_library(...
# Leo colorizer control file for redcode mode. # This file is in the public domain. # Properties for redcode mode. properties = { "lineComment": ";", } # Attributes dict for redcode_main ruleset. redcode_main_attributes_dict = { "default": "MARKUP", "digit_re": "", "escape": "", "high...
"""A re-implementation of ANNIS's htmlvis (http://corpus-tools.org/annis/resources/ANNIS_HTML_Vis_Guide.pdf). `generate_visualization` consumes TreeTagger SGML text and renders it into HTML according to an ANNIS htmlvis config file.""" import re from enum import Enum from collections import defaultdict class HtmlGen...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ Detection Training Script. This scripts reads a given config file and runs the training or evaluation. It is an entry point that is made to train standard models in detectron2. In order to let one script support training of many models, this s...
# -*- coding: utf-8 -*- from __future__ import annotations from collections import OrderedDict from dataclasses import dataclass from itertools import chain from math import isclose, sqrt from typing import TYPE_CHECKING import numba as nb import numpy as np from sklearn.neighbors import BallTree if TYPE_CHECKING: ...
import abc import copy import enum import inspect import operator from magma.bits import Bits, BitsMeta, SInt, reduce from magma.conversions import uint, bits, sint from magma.conversions import concat as bits_concat from magma.debug import debug_wire from magma.protocol_type import MagmaProtocolMeta, MagmaProtocol fr...
import datetime as dt import pytz import os import itertools from operator import add from decimal import * from django.contrib.auth.models import User from django.db import models from django.db.models import Sum, F, Value import pandas import numpy as np from .utils import * def getFlightAt(flights, time): f ...
# -*- coding: utf-8 -*- """ Análisis sintáctico utilizando PLY. """ import os import itertools from pytiger2c.contrib.ply import yacc from pytiger2c.grammar.common import compute_column from pytiger2c.grammar.lexer import lexer, tokens from pytiger2c.errors import SyntacticError from pytiger2c.ast import * # Prece...
# -*- coding: utf-8 -*- import unittest import numpy from sagar.crystal.structure import Cell, MutableCell class TestUtils(unittest.TestCase): def test_car_to_frac(self): pass def test_frac_to_car(self): pass class TestCell(unittest.TestCase): def setUp(self): lattice = [3.0,...
import os import cv2 import scipy.io import subprocess import numpy as np from tqdm import tqdm # rewrite cython in anchors.pyx def anchors_cython(height, width, stride, base_anchors): nofanchors = base_anchors.shape[0] all_anchors = np.zeros((height, width, nofanchors, 4), dtype=np.float32) h, w = np.mes...
""" =========== quantify.py =========== This module contains functionality for quantifying nanopore captures. """ import re from pathlib import PurePosixPath from typing import List, Optional import h5py import numpy as np from src.poretitioner.fast5s import CaptureFile from src.poretitioner.logger import Logger, ...
import json import logging import math import random import time import traceback from datetime import datetime, timezone from threading import Thread from typing import List, Tuple import cuwais import numpy import requests from cuwais.common import Outcome from cuwais.config import config_file from cuwais.database i...
import numpy as np import torch from torch import nn from torch.autograd import Variable import torch.nn.functional as F import torchvision.datasets as dsets import torchvision.transforms as transforms import matplotlib.pyplot as plt OccGrids_1 = [] for i in range(488*31): if i%1000 == 0: pri...
from conans import ConanFile, CMake, tools, RunEnvironment from conans.errors import ConanInvalidConfiguration import os, re, platform # Users locally they get the 1.0.0 version, # without defining any env-var at all, # and CI servers will append the build number. # USAGE # version = get_version("1.0.0") # BUILD_NUMBE...
from decimal import Decimal from datetime import timedelta import json import logging from django.conf import settings from django.shortcuts import redirect from django.http import HttpResponse, HttpResponseForbidden from django.utils.text import slugify from django.utils import timezone from django.utils.translation ...
# Crash Catcher: DashCam Accident Detector </br> ### Determining whether dashboard camera video contains an accident</br></br> # I use a hierchical recurrent neural network implementation, trained on a set of videos with and without accidents, to determine whether a new video contains an accident or not.</br></br></br...
# coding=utf-8 # Copyright (c) 2017,2018, F5 Networks, 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 applicabl...
from __future__ import annotations from collections import OrderedDict from dataclasses import dataclass from functools import lru_cache, cached_property from itertools import accumulate from math import floor import re from typing import Dict, Final, FrozenSet, Optional, Pattern, Tuple, TYPE_CHECKING from random impor...
import os # Workaround for PyTorch spawning too many threads os.environ['OMP_NUM_THREADS'] = '4' import sys import argparse import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim torch.manual_seed(1) import cv2 cv2.setNumThreads(0) from tqdm import tqdm fr...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from lmfit.models import ConstantModel, GaussianModel import time from scipy.signal import kaiserord, lfilter, firwin, freqz class AlazarTech(): def __init__(self,param): self.name = param.get('name') self.fs = param.get('sampl...
from generate_character import transformImg, drawChar from collections import Iterator import matplotlib.pyplot as plt import pickle import numpy as np import random import cv2 as cv import tensorflow as tf from absl import logging import os FONTS_PATH_DEFAULT = './fonts/' MAX_DRAW_ATTEMPTS = 25 # TODO: check for rep...
import gensim import torch import numpy as np import os import copy from nltk.corpus import stopwords from utils.model_utils import device def subsequent_mask(size): "Mask out subsequent positions." attn_shape = (1, size, size) subseq_mask = np.triu(np.ones(attn_shape), k=1).astype('uint8') # upper triang...
# -*-coding=utf-8-*- # 适用 tushare 0.7.5 __author__ = 'Rocky' ''' http://30daydo.com Contact: <EMAIL> ''' import tushare as ts import pandas as pd import os, datetime, time, Queue from toolkit import Toolkit from threading import Thread q = Queue.Queue() # 用来选股用的 pd.set_option('max_rows', None) from configure.setting...
import gc import numpy as np import pandas as pd from itertools import chain from sklearn.decomposition import IncrementalPCA import sklearn.linear_model import sklearn.naive_bayes import sklearn.ensemble import sklearn.gaussian_process from sklearn import metrics from ..utils import map_fn from ..config import cfg fro...
# This file is part of the Blockchain Data Trading Simulator # https://gitlab.com/MatthiasLohr/bdtsim # # Copyright 2020 <NAME> <<EMAIL>> # # 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 # ...
import numpy as np import pytest import copy from mrpypulse import pulse import sys sys.path.append('..') def test_pulse_init(): p1 = pulse.Random() # assert np/tres/tp produce same output tp = p1.ns * p1.tres p2 = pulse.Pulse(x=p1.x, y=p1.y, tp=tp, tres=p1.tres) p3 = pulse.Pulse(x=p1.x, y=p1.y, ...
import numpy as np from pygacal.common.cgatools import * from pygacal.rotation import minimizeError from pygacal.rotation.benchmark import * from pygacal.rotation.costfunction import * from pygacal.rotation.mapping import ( RotorLineMapping, BivectorLineMapping, LinePropertyBivectorMapping, ...
#!/usr/bin/env python3 # 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...
from collections import defaultdict from datetime import datetime import math import os from transformers import BertConfig, BertTokenizer, \ TFBertForSequenceClassification from sklearn.base import BaseEstimator, TransformerMixin from sklearn.model_selection import train_test_split from sklearn.utils.validation ...
#!/usr/bin/python # encoding: utf-8 # # Copyright 2020 <NAME>. # # based on Greg Neagle's 'installinstallmacos.py' # https://github.com/munki/macadmin-scripts/blob/main/installinstallmacos.py # # with many thanks to <NAME> for the original script and lots of advice # and <NAME> for helping me figure out the software up...
#!/usr/bin/env python3 """ Mostly automated installation for a new CMS + gitolite server. """ import getpass import os import subprocess import sys import requests class Log(): """ An object for interacting with the user, including colored printing and prompts. """ modifiers = { "normal...
#!/usr/bin/python3.8 # Copyright 2020 Aragubas # # 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 numpy as np import xmltodict import os import cv2 import matplotlib.pyplot as plt import tensorflow as tf anchor_scale = 16 # IOU_NEGATIVE =0.3 IOU_POSITIVE = 0.7 IOU_SELECT =0.7 RPN_POSITIVE_NUM=150 RPN_TOTAL_NUM=300 #bgr can find from here https://github.com/fchollet/deep-learning-models/blob/master...
from typing import Tuple import torch T = torch.Tensor def general_off_policy_returns_from_q_and_v( q_t: T, v_t: T, r_t: T, discount_t: T, c_t: T, ) -> T: """Calculates targets for various off-policy evaluation algorithms. Given a window of experience of length `K+1`,...
import asyncio, datetime, logging, random, re import hangups bot = None logger = logging.getLogger(__name__) def name_from_hangups_conversation(conv): """get the name for supplied hangups conversation based on hangups.ui.utils.get_conv_name, except without the warnings """ if conv.name is not None...
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozi...
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 argparse import os import time import torch import torch.nn as nn from torch.utils.data import DataLoader import numpy as np from lib.data.datasets import get_datasets from prun import * def load_model(path, model): tmp = torch.load(path, map_location='cpu') if 'state_dict' in tmp: tmp = tmp...
# # ⚠ Warning # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT # LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA...
# Author of Aqsa: <NAME> from django.utils.translation import ugettext_lazy as _ # is_nnt - Is not NoneType? def is_nnt(val): if isinstance(val, type(None)): return False return True def is_num(val): try: float(val) return True except (ValueError, TypeError): return F...
import os import sys from abc import ABC, abstractmethod import copy import logging from pathlib import Path from conversion_settings import ConversionSettings from pyfiglet import Figlet from PyInquirer.prompt import prompt import PyInquirer from prompt_toolkit.styles import Style import config import helper_functio...
"""Setup script to compile tlsssl to run against py2.7 on macOS.""" # standard libs from distutils.dir_util import mkpath import os import urllib2 import shutil import sys import stat import re import inspect import argparse # our libs. kind of hacky since this isn't a valid python package. CURRENT_DIR = os.path.dirn...
import logging import importlib import torch import time import os import pickle import asr_error_simulator as asr from datetime import timedelta from torch.utils.data import Dataset, DataLoader from torch.autograd import Variable from pathlib import Path # Set up logger training_log = logging.getLogger(__name__) # S...
import graphutil import pyximport; pyximport.install() import cythontest import numpy as np class TimeoutError(Exception): pass def is_res_subisomorphic(gmain, gsub, check_observed=True, check_value = True, check_splitting=True, ...
""" This package contains the XML handlers to read the NineML files and related functions/classes, the NineML base meta-class (a meta-class is a factory that generates classes) to generate a class for each NineML cell description (eg. a 'Purkinje' class for an NineML containing a declaration of a Purkinje ce...
import os, time, sys import numpy as np import matplotlib.pyplot as plt from hs_digitizer import * from iminuit import Minuit, describe from datetime import datetime from obspy.signal.detrend import polynomial import bead_util as bu import peakdetect as pdet import dill as pickle import scipy.optimize as opti import...
import numpy as np from scipy.stats import truncnorm import chainer from chainer import functions as F from chainer import links as L from chainer import Variable, optimizers, cuda, initializers import chainermn from PIL import Image from gen_models.biggan import BIGGAN from gen_models.sngan import SNGAN def backwar...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 Kyoto University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) """Train LM.""" from distutils.version import LooseVersion import logging import os from setproctitle import setproctitle import shutil import sys import time import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import math from typing import Iterable, Iterator, Sequence, Tuple __author__ = "<NAME>" __doc__ = """ Created on 27/04/2019 @author: cnheider """ from matplotlib.figure import Figure from matplotlib.pyplot import matshow, imshow from itertools import cycle from numpy ...
import collections import math import re from functools import partial from typing import Optional, Sequence from mmcv.runner import BaseModule import torch from torch import nn from torch.nn import functional as F from torch.nn.modules.batchnorm import _BatchNorm from ..builder import BACKBONES # Parameters for an ...
from __future__ import annotations import inspect import re from dataclasses import asdict, dataclass, field from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union from commonmodel.base import Schema, SchemaLike, SchemaTranslation, is_any from dcp.storage.base import Storage from loguru import logger from...
import torch import torch.nn.functional as F from transformers import * from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler, TensorDataset) import random from torch import nn import json import copy class Example(object): def __init__(self, text, label=None, t_s...
"""Methods for downsampling tensorstore so you can zoom out.""" import copy import itertools import math import os import re from typing import Any, Dict, Generator, List, Tuple, Union import apache_beam as beam from cell_img.image_grid import io_lib from cell_img.image_grid import ts_write_lib import numpy as np imp...
""" Classes that offer abstractions for brushes, etc. that aren't modeled in the VMF format itself. """ from vmflib2 import brush, types, utility import math class Block: """A class representing a 3D block in terms of world geometry. This class allows for the simple creation and manipulation of 3D blo...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # ============================================================================= # title : magicbluelib.py # description : Python library to control Magic Blue bulbs over Bluetooth # author : <NAME> # date : 23/11/2015 # python_version : 3....
### classes for storing bundle as a collection of helix axis and points on helix axis ### import itertools import heapq import numpy as np from scipy.spatial import distance from .chainClass import chainClass class NotEqualAxisLen(Exception): pass class helixAxisBundleClass(): ### class for storing all helices axi...
#! /usr/bin/python3 ''' A lightweight MIPS assembler [Author: <NAME>] ''' import argparse import os.path import io import re import collections import tempfile text_start_addr = 0x00400000 # starting address for the .text segment data_start_addr = 0x00001001 # starting address for the .data segment data_seg = [] da...
# """ # Copyright 2019 <NAME>. See LICENSE file for details. # """ #Desktop debug: #import asyncio as uasyncio import uasyncio class Signal(object): # """An asynchronous stimulus that triggers reactions. # A unique identifier that, along with a value, specifies an Event. # p. 154 # """ _registr...
""" .. module:: utilities :platform: Unix, Windows :synopsis: Contains common utility functions and some helper functions for data conversion, integration, etc. .. moduleauthor:: <NAME> <<EMAIL>> """ import math import random # Changes linearly ordered list of points into a zig-zag shape def make_zigzag(po...
""" BFD protocol implementation """ from random import randint from socket import AF_INET, AF_INET6, inet_pton from scapy.all import bind_layers from scapy.layers.inet import UDP from scapy.packet import Packet from scapy.fields import BitField, BitEnumField, XByteField, FlagsField,\ ConditionalField, StrField fro...
""" Rebar Extension ~~~~~~~~~~~~~~~ The main entry point for Flask-Rebar, including a Flask extension and a registry for request handlers. :copyright: Copyright 2018 PlanGrid, Inc., see AUTHORS. :license: MIT, see LICENSE for details. """ from __future__ import unicode_literals import sys fro...