text
stringlengths
8.04k
46.5k
''' Collection of utility functions used in data collection and data manipulation ''' import pandas as pd import numpy as np def doubleheaders(df, home = "home_team"): df["date"] = pd.to_datetime(df.date, format = "%Y-%m-%d") df['year'] = pd.DatetimeIndex(df.date).year df = df.assign(is_double...
from ZEO.Exceptions import ClientDisconnected, ServerException import concurrent.futures import functools import logging import random import threading import ZODB.event import ZODB.POSException import ZEO.Exceptions import ZEO.interfaces from . import base from .compat import asyncio, new_event_loop from .marshal i...
import json import os import re from typing import Dict, List, Literal, Set, Tuple from uuid import uuid1 from characteristics_damages import * # from damages import compute_damage from damages import compute_damages from damage_parameters import DamageParameters from stats import Stats class SpellOutput: def __...
#!/usr/bin/env python # Copyright (c) 2017, Massachusetts Institute of Technology 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 retain the above copyright n...
""" ================ 99. Make reports ================ Builds an HTML report for each subject containing all the relevant analysis plots. """ import os.path as op import itertools import logging from typing import Dict, Any, Tuple, Union import numpy as np from scipy.io import loadmat import matplotlib import mne f...
### Introspective Adversarial Network Training Function # <NAME>, 2016 import argparse import imp import time import logging import itertools import os import string import numpy as np import os.path import theano import theano.tensor as T from theano.tensor.opt import register_canonicalize from theano.sandbox.rng_mr...
#!/usr/bin/python # Copyright (c) 2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' module: podman_image author: - <NAME> (@samdoran) ...
""" EVE's connected flash and EVE's RAM_G data transfer library This library support to read/write and update blob binary to EVE Progress bar can show up while reading/writing flash Usage: - Reading flash with progress bar: read_flash_with_progressbar - Writing flash with progr...
from __future__ import division, print_function, absolute_import # noinspection PyUnresolvedReferences from six.moves import range import sys from datetime import datetime import numpy as np from ...tools.log import LoggingMgr from ...mdp.stateaction import State, RewardFunction from . import IOfflineLearner __all_...
from Game.Corak.mapread4 import * from Game.Corak.dicio import * from Game.Corak.Worldgen3 import hall print() 'classes' class Corak(pygame.sprite.Sprite): def __init__(S): S.image = pygame.Surface([size, size]) S.image.fill(BLACK) S.rect = S.image.get_rect() S.at = [0, 11] S...
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Imports ######################################## import sys, os SciAnalysis_PATH='/home/kyager/current/code/SciAnalysis/main/' SciAnalysis_PATH in sys.path or sys.path.append(SciAnalysis_PATH) import glob from SciAnalysis import tools from SciAnalysis.Data import * #from ...
import os import random import sys from argparse import ArgumentParser, Namespace from collections import deque from datetime import datetime from pathlib import Path from pprint import pprint import numpy as np import psutil from flatland.envs.malfunction_generators import (MalfunctionParameters, ...
import os import logging import sys import time import json import redis import attr import io try: import torch.multiprocessing as mp try: mp.set_start_method('spawn') except RuntimeError: pass except ImportError: import multiprocessing as mp import importlib import importlib.util impor...
"""Matrix operation utility functions.""" import warnings import numpy as np from numpy.lib.stride_tricks import as_strided def sliding_window(data, window, step=1, padded=False, axis=-1, copy=True): """Calculate a sliding window over a signal. Parameters ---------- data : array The array to...
from os import listdir import cv2 as cv import numpy as np from os import path, makedirs import math import matplotlib.pyplot as plt import argparse import tqdm import tensorflow as tf import time import threading from guided_filter import guided_filter_cv as guided_filter class bbox: def __init__(self, lt, rb): ...
"""Sprite, texture and pixel surface routines.""" import abc from ctypes import byref, cast, POINTER, c_int, c_float from .common import SDLError from .compat import * from .color import convert_to_color from .ebs import System from .surface import subsurface from .window import Window from .image import load_image fro...
""" Functions for fitting and simulating arbitrary dimensional lineshapes commonly found in NMR experiments """ from __future__ import print_function import numpy as np from .leastsqbound import leastsqbound from .analysisbase import squish from .lineshapes1d import ls_str2class from ..fileio import table pi = np.p...
from abc import ABC, abstractmethod from typing import Any, Dict, Optional, Tuple, Union import gym import gym.spaces import gym.utils.seeding import numpy as np import torch from sqlalchemy import case import pickle from panda_gym.pybullet import PyBullet import panda_gym import imageio from pathlib import Path clas...
import copy import json import time import sys,os,shutil import warnings import tempfile from . import debug,log from . import utils from .rclone import Rclone from .dicttable import DictTable _TEST_AVOID_RELIST = False class LockedRemoteError(ValueError): pass class SyncRClone: def __init__(self,config,bre...
# The idea for this module (but no code) was borrowed from the # quantities (http://pythonhosted.org/quantities/) package. from fractions import Fraction import numpy as np from .core import (UnitsError, UnitConversionError, UnitTypeError, dimensionless_unscaled, get_current_unit_registry) def _d...
import os import torch import torch.nn as nn import random import logging import copy import time from time import strftime, localtime import numpy as np import pandas as pd from sklearn import metrics from sklearn.model_selection import StratifiedKFold, KFold, GroupKFold from transformers import BertModel, AdamW, get_...
# Name of results surfaces --done-- # Single surface for loads and deflections --done-- # Does getNodes work on vertices and nodes # Nodes are the discrete mesh points, while vertices are geometric objects # This depends on what we might be using the set for # If we are extracting results we likely want to...
import functools import itertools from typing import List, Iterable import finite_field aes_block_length = 128 _aes_cbc_iv = bytes.fromhex('0123456789abcdef0123456789abcdef') class AESState(object): _nb_dict = {128: 4} _aes_column_length = 4 _nb_round_count_dict = { 4: 10 ...
import numpy as np import os import glob import itertools import pandas as pd import re from typing import List from utils.gym_wrappers import JustMove """ import sys from liftoff import parse_opts sys.argv = ['evaluate_model.py', '/media/andrei/CE04D7C504D7AF292/rl/minigrid_rl/results/2020Mar22-195959_aaaE_cstR_ppo...
''' Model definitions for content posts. The main content type is a BasicPost. Posts with images, slideshows and embedded objects inherit from BasicPost and are implemented in PostWithImage, PostWithSlideShow and PostWithEmbeddedObject respectively. The 3rd party library model_utils handles getting inherited models f...
#!/usr/bin/env python # coding: utf-8 # In[3]: import pprint,copy, json import os, sys HTC_package_path = "C:/Users/tyang/Documents/Jupyter_workspace/HTC/python_3" if os.path.isdir(HTC_package_path) and HTC_package_path not in sys.path: sys.path.append(HTC_package_path) from pymatgen.io.vasp.sets import MPRel...
""" Minimal library for interacting with REDCap's web API. """ import json import logging import os import re import requests from enum import Enum from functools import lru_cache from operator import itemgetter from typing import Any, Dict, Iterator, List, Optional, Tuple, Union from .utils import running_command_name...
#!/usr/bin/env python ## @package crabFunctions # This module provides common functions for tasks with crab3 # # This module provides common functions for tasks with crab3. # You need no create a CrabController object in order to use the functions from __future__ import print_function import os,sys,glob import tarfile ...
"""General utility functions.""" import osmnx as ox import numpy as np import pandas as pd import geopandas as gpd import networkx as nx import math import requests import random from shapely.geometry import Point, LineString, Polygon, MultiPolygon from shapely.ops import polygonize def download(overpass_query): ...
from __future__ import absolute_import, division, print_function, unicode_literals from decimal import Decimal as D import os import balanced import braintree import mock import pytest from gratipay.billing.exchanges import create_card_hold from gratipay.billing.payday import NoPayday, Payday from gratipay.exception...
from itertools import combinations from math import exp, expm1, log1p, log10, log2, sqrt, ceil, floor, radians, sin, cos from random import choice, sample, uniform import time #pyData stack import numpy as np import pandas as pd from scipy import sparse #sklearn preprocessing, model selection from sklearn.mode...
# -*- coding: utf-8 -*- """ Created on Wed Sep 4 08:47:20 2019 @author: Reuben """ import os import unittest import ruamel.yaml as yml from vartrix.container import Container from vartrix.view import View from vartrix.namespace import Name_Space from vartrix import automate base = {'alias.one': 5, 'alias....
""" API for Uniswap v2 distributed exchange (uniswap.exchange) Price info is pulled from the smart contract """ import logging from web3 import Web3 import time import requests from .base_exchange import Daily24hChangeTrackedAPI, NoLiquidityException from .uniswap_v2_abi import exchange_abi from .uniswap_v2_router_abi...
# Copyright 2020-2021, <NAME> # Developed for the Center for Phage Technology, Texas A&M University # # Distributed under the BSD 3-Clause License, see included LICENSE file from Bio import SeqIO, SeqFeature from Bio.SeqFeature import FeatureLocation, CompoundLocation from Bio.Seq import Seq, UnknownSeq from collectio...
# -*- coding: utf-8 -*- import sys import re import struct try: import hashlib as md5 except ImportError: import md5 from io import StringIO from pypdf.psparser import PSStackParser from pypdf.psparser import PSSyntaxError, PSEOF from pypdf.psparser import literal_name from pypdf.psparser import LIT, KWD, STR...
# Copyright 2016 VMware, 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 a...
"""Align reads with STAR aligner.""" import gzip import shutil from pathlib import Path from plumbum import TEE from resolwe.process import ( BooleanField, Cmd, DataField, FileField, FloatField, GroupField, IntegerField, Process, SchedulingClass, StringField, ) SPECIES = [ ...
# Copyright 2018 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. import base64 import contextlib import copy from collections import namedtuple from state import TaskState from recipe_engine import recipe_api...
import xml.dom.minidom import os import numpy as np #from config import get_config #config, _ = get_config() MAX_SERVICE=100 MAX_NODE=200 NODE_SET=233 TOTAL_NODE=2507 NODE_TRANS_INVALID=9999 class Service(object): def __init__(self): self.index=0 self.id=0 self.RT=0 self.maxRT=0 ...
# Copyright (c) 2016-2019 Intel 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...
import ast from ast import * import astor.code_gen import random import os import sys import copy def random_string(minlength, maxlength): """ Horrifying variable names consisting entirely of lookalikes: Digit ones, lowercase els, digit zeroes, uppercase ohs """ return random.choice('lO') + ''.joi...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2018 qizai <<EMAIL>> # # Distributed under terms of the MIT license. """ This is an implementation of the paper online NMF. """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import pickle import time import ipdb i...
# -*- coding:utf-8 -*- """ #====#====#====#==== # Project Name: U-net # File Name: data_Keras # Date: 2/9/18 4:44 PM # Using IDE: PyCharm Community Edition # From HomePage: https://github.com/DuFanXin/U-net # Author: DuFanXin # BlogPage: http://blog.csdn.net/qq_30...
""" Implementation of operations on Array objects. """ from __future__ import print_function, absolute_import, division from functools import reduce import llvmlite.llvmpy.core as lc import numba.ctypes_support as ctypes import numpy from llvmlite.llvmpy.core import Constant from numba import errcode from numba imp...
#!/usr/bin/env python # we're using python 3.x style print but want it to work in python 2.x, from __future__ import print_function import re import os import argparse import sys import threading # make sure scripts/internal is on the pythonpath. sys.path = [os.path.abspath(os.path.dirname(sys.argv[0])) + "/internal"...
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from atmPy.aerosols.instruments import POPS import icarus import pathlib import numpy as np import xarray as xr import pandas as pd from ipywidgets import widgets from IPython.display import display import matplotlib.pylab as plt colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] from nsasci import database...
"""Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the license found in the LICENSE file in the root directory of this source tree. Portions of the source code are from the OLTR project which notice below and in LICENSE in the root directory of this source tree...
#!/usr/bin/env python3 # # Author: <NAME> <<EMAIL>> # # 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 retain the above copyright # notice, this list of conditions and th...
import math import numpy as np from empirical.util.classdef import interpolate_to_closest from empirical.util.classdef import TectType # fmt: off imt = [0.01, 0.02, 0.03, 0.05, 0.075, 0.1, 0.15, 0.2, 0.25, 0.3, 0.4, 0.5, 0.6, 0.75, 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7.5, 10, 0] # constants n = 1.18 c = 1.88 C4 = 10.0 a3 =...
#------------------------------------------------------------------------- # # Implementation of an HTTP Handler for a WSGI-based GGP player. The # class adheres to the WSGI specification so is a functor that can be # called with the parameters: environ, start_response. # # This handler can deal with both the original...
#==============================================================================# # paratime.py # #==============================================================================# """Module for paratessares time conversions. This module provides several f...
import numpy as np from libmatch.chemical_kernel import Atoms2ChemicalKernelmat from libmatch.soap import get_Soaps from libmatch.utils import chunk_list, chunks1d_2_chuncks2d,is_notebook,dummy_queue from soap import get_Soaps import multiprocessing as mp import signal, psutil, os import threading import quippy as qp...
# -*- coding:utf8 -*- from tkinter import * from pandas import read_excel import random import xlrd # 打包用 import pyexpat # 打包用 root = Tk() root.title("2020马原选择题刷题系统v1.2") root.geometry("450x375") # 读取文件数据 sq = read_excel('single_question.xlsx',sheet_name='Sheet1',header=0) sa = read_excel('single_answer....
# This file is Copyright (c) 2015-2020 <NAME> <<EMAIL>> # This file is Copyright (c) 2015 <NAME> <<EMAIL>> # License: BSD # 1:4, 1:2 frequency-ratio DDR2/DDR3 PHY for Xilinx's Series7 # DDR2: 400, 533, 667, 800 and 1066 MT/s # DDR3: 800, 1066, 1333 and 1600 MT/s import math from migen import * from litex.soc.interc...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
# A Q learning Pong AI agent built using Python. import math import random import time import os import pickle from collections import defaultdict from typing import DefaultDict # Global variables DIRECTION = {"IDLE": 0, "UP": 1, "DOWN": 2, "LEFT": 3, "RIGHT": 4} class Ball(): """The ball object (The cube that ...
import tensorflow as tf import numpy as np # import cv2 class Object_Detector(): def __init__(self, graph_path, session=None): self.graph_path = graph_path detection_graph = tf.Graph() with detection_graph.as_default(): od_graph_def = tf.GraphDef() with tf.gfile.GFil...
import time import numpy as np import pandas as pd import quadprog import statsmodels.formula.api as smf from numpy.linalg import LinAlgError from scipy.stats import skewnorm def jackknife_averaging(data, subset): """ calulates the averaged coefficients across several linear regression models according t...
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
import os from datetime import datetime import asyncio import time from PIL import Image, ImageDraw, ImageFont from pySmartDL import SmartDL import shutil import pytz from telethon.tl import functions from telethon.errors import FloodWaitError from userbot.events import javes05 from userbot import CMD_HELP, bot, BIO_M...
''' 02-Dec-2020 Author: <NAME> Script to scrape football match result and odds data Maintains register for daily efficient scraping of data Source Website: https://www.football-data.co.uk/ ''' from bs4 import BeautifulSoup import datetime as dt import io import json import numpy as np import os import pandas as pd imp...
import logging import time import sys from copy import copy from panoramix.core import arithmetic import panoramix.utils.opcode_dict as opcode_dict from panoramix.core.algebra import ( add_op, bits, lt_op, mask_op, minus_op, mul_op, or_op, sub_op, to_bytes, CannotCompare, ) from...
from direct.directnotify import DirectNotifyGlobal from direct.gui.DirectGui import * from direct.task.Task import Task from panda3d.core import * from toontown.distributed import ToontownDistrictStats from toontown.hood import ZoneUtil from toontown.shtiker import ShtikerPage from toontown.coghq import CogDisguiseGlob...
import xml.etree.cElementTree as et import glob import pandas as pd import xml.etree.ElementTree as ET import networkx as nx import matplotlib.pyplot as plt from matplotlib import animation import pathlib from collections import Counter import numpy as np import os import ntpath path_ = None f_count_ = None file_arr_ ...
#! /usr/bin/env python3 from matplotlib import pylab as plt from astropy.table import Table import numpy as np import scipy as sp import scipy.stats from matplotlib import pylab as pl import matplotlib as mpl import re import sys from afdtable import read as read_table, compute as compute_table def marginal_earning(...
""" Copyright (c) 2018 iCyP Released under the MIT license https://opensource.org/licenses/mit-license.php """ import contextlib import json import math import os import re import sys import tempfile from collections import OrderedDict from itertools import repeat from typing import Any, Dict, List, Optional, Tuple f...
import traceback from collections import Mapping, OrderedDict from io import StringIO, TextIOBase from logging import Logger, DEBUG from typing import Type, Dict, Any, List, Iterable, Union, Tuple from parsyfiles.global_config import GLOBAL_CONFIG from parsyfiles.converting_core import Converter, T, S, ConversionChain...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # A shared LSTM + MAN for learning language-invariant features (F_s) # Another shared LSTM with MoE on top for learning language-specific features (F_p) # MoE MLP tagger (C) from collections import defaultdict import io impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import rospy, cv2, time from rospy import Subscriber, ServiceProxy from gs_flight import CallbackEvent from std_msgs.msg import UInt8, Int8MultiArray from threading import Thread from kiberdrom_interfaces.srv import GoToLand from kiberdrom_interfaces.srv import P...
import os import sys import subprocess import argparse import time import math import numpy as np import mrcfile import matplotlib.pyplot as plt from cv2 import * from scipy import ndimage import scipy.signal from scipy.spatial.distance import directed_hausdorff from skimage import feature from skimage.feature import ...
from __future__ import absolute_import, division, print_function import pkg_resources from dxtbx.model import Experiment, ExperimentList from dxtbx.datablock import AutoEncoder class InvalidExperimentListError(RuntimeError): """ Indicates an error whilst validating the experiment list. This means that there i...
# Copyright 2020; <NAME> # See license for more details # # The main function `url2path` is optimised to be fast using caching. # Here is a timeit result for the same. # # [IPython] timeit url2path("http://httpbin.org/bytes/1") # 94.7 ns +- 26.5 ns per loop (mean +- std. dev. of 7 runs, 10000000 loops each) import os ...
#! /usr/bin/env python3 """ usage: staphopia-sccmec [-h] [--assembly ASSEMBLY|ASSEMBLY_DIR|STAPHOPIA_DIR] [--staphopia STAPHOPIA_DIR] [--sccmec SCCMEC_DATA] [--ext STR] [--hamming] [--json] [--debug] [--depends] [--test] [--citation] [--version] D...
import itertools import os import numpy as np import pandas as pd import scipy.sparse as sp import torch from torch.utils.data import Dataset from catalyst.contrib.datasets.misc import download_and_extract_archive class MovieLens(Dataset): """ MovieLens data sets were collected by the GroupLens Research Pr...
import math import random import cv2 import mmcv import numpy as np from mmhuman3d.core.conventions.keypoints_mapping import get_flip_pairs from ..builder import PIPELINES from .compose import Compose def get_affine_transform(center, scale, rot, ...
import pygame from pygame.locals import * import math import sys import os import threading import random import time import collections # One boundary point known def make_circle(points, p): c = (p[0], p[1], 0.0) for (i, q) in enumerate(points): if not _is_in_circle(c, q): if c[2] == 0.0: ...
import itertools import os import random from collections import deque import numpy as np import matplotlib.pyplot as plt import pdb from tspy import TSP from tspy.solvers import TwoOpt_solver from HER_mod.rl_modules.velocity_env import * from HER_mod.rl_modules.hyperparams import NUM_GOALS env = MultiGoalEnvironmen...
# Copyright 2016-2020 Blue Marble Analytics 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 ag...
#!/usr/bin/env python """ Audio Feature Extractors A set of algorithms for analyzing audio files. Most of the features are built using building blocks from the Essentia audio and music analysis toolkit: https://essentia.upf.edu/index.html <NAME> - <EMAIL> University of Victoria """ from abc import ABC, abstractmeth...
#!/usr/bin/python DOCUMENTATION = ''' --- module: cr_apigw_set short_description: create/update api gateway as needed. description: - This module allows the user to create API GW entity type. Includes support for validating user exists and policy matches . This module has a dependency on python-boto. version_add...
#!/usr/bin/env python3 # Copyright 2018-2019 SURFsara B.V. # # 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...
# get_orfs.py import numpy as np import re as re import pandas as pd import skbio as skbio from Bio import SeqIO import os def get_orfs(all_sequences, both_strands=False, min_orf_length=100, all_orfs=False, min_upstream_length=50,genetic_code=1): """ Produce a pandas DataFrame of predicted ORFs ...
#!/usr/bin/python # # Copyright 2016 Canonical Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
# ------------------------------------------------------------------------------ # Purpose: m21utils is a set of music21 utilities for use by musicdiff. # musicdiff is a package for comparing music scores using music21. # # Authors: <NAME> <<EMAIL>> # musicdiff is derived from:...
# This file is part of rinohtype, the Python document preparation system. # # Copyright (c) <NAME>. # # Use of this source code is subject to the terms of the GNU Affero General # Public License v3. See the LICENSE file or http://www.gnu.org/licenses/. import codecs import hashlib, time from binascii import hexlify ...
"""General utility functions used throughout PyRhO.""" from __future__ import print_function, division import os import copy import warnings import logging import pickle from string import Template import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from pyrho import config __all__ = ['Time...
import asyncio import concurrent import copy import importlib import json import random import socket import sys import time from collections import defaultdict from http.server import BaseHTTPRequestHandler, HTTPServer from itertools import cycle from multiprocessing import Event as ProcessEvent from multiprocessing i...
# SWAGAT'S CODE # IMPORTING LIBRARIES # import all classes / functions from the tkinter, easygui and os import tkinter as tk from tkinter import * from tkinter import filedialog from tkinter import ttk from tkinter import messagebox import os # from functools import partial # FUNCTIONS USED # Function to...
import subprocess import glob import os import numpy as np import argparse import re import time import codecs import json from os import listdir, makedirs from os.path import isfile, join, sep, getsize, exists from tqdm import tqdm # PROCESS ARGUMENTS def read_args(): parser = argparse.ArgumentParser( ...
""" Optimal Image Subtraction (OIS) module -------------------------------------- A collection of tools to perform optimal image differencing for the Transient Optical Robotic Observatory of the South (TOROS). ### Usage example (from python): >>> import ois >>> difference, optimal...
from __future__ import unicode_literals import os, json, gzip, sys, shutil, zipfile, uuid sys.path.append(os.path.join(os.path.dirname(__file__), "../../client/")) # This ensures that the constants are same between client and server from django.db import models from django.contrib.auth.mo...
import os import time import numpy as np import torch from torch.utils.data import TensorDataset import torchvision from tqdm import tqdm import yaml import enum from enum import Enum import argparse from tensorboardX import SummaryWriter from collections import OrderedDict from termcolor import colored import tabulat...
import types import numpy as np import theano import theano.tensor as tt from copy import copy from functools import wraps from unittest.mock import patch from collections import namedtuple, OrderedDict from theano.gof.opt import LocalOptimizer, local_optimizer from theano.gof.graph import inputs as tt_inputs from ...
""" @author: <NAME> @contact: <EMAIL> """ import matplotlib # type: ignore import matplotlib.pyplot as plt # type: ignore import matplotlib.patches as patches # type: ignore import configparser from ifpd import bioext, stats from joblib import Parallel, delayed # type: ignore import numpy as np # type: ignore imp...
import torch import datetime from torch import nn from torch.nn.functional import normalize import time class Extractor(nn.Module): ''' This module extracts voxel rays or blocks around voxels that are given by the reconstructed 2D depth map as well as the given groundtruth volume and the current state...
"""Generic feature utils for various purposes. There are a few main things in this module: - `read_and_join_features()`: a function to read various feature files and concatenate them - `FastClassifier`: a class to do fast interactive classification of items based on exemplar SVMs - If you run this module, it starts a ...
import asyncio import os import re import httpx import ujson from loguru import logger from nonebot import on_command, CommandSession, get_bot, scheduler from src.Services import Service, Service_Master, GROUP_ADMIN, SUPERUSER from src.plugins.pixiv import pixiv, pixivison from src.ui_exception import Pixiv_api_Conne...
import sys import os import logging import numpy as np import pandas as pd from web.embeddings import fetch_GloVe, Embedding from web.perceptual import process_CSLB, generate_figure, _learn_logit_reg def test_cleaning_cslb(): logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) words = ['accordion', 'a...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from math import ceil import numpy as np import torch from collections import defaultdict from typing import List, Tuple, Dict ...