text
stringlengths
8.04k
46.5k
# -*- coding: utf-8 -*- r""" Free Pre-Lie Algebras AUTHORS: - <NAME>, <NAME> (2011) """ #***************************************************************************** # Copyright (C) 2010-2015 <NAME> <<EMAIL>>, # # Distributed under the terms of the GNU General Public License (GPL) # as published by the Free...
import argparse import json import logging import os import threading import time from copy import copy # from concurrent.futures import ThreadPoolExecutor # from queue import Queue import numpy as np import rospy from matplotlib import pyplot as plt from sensor_msgs.msg import JointState from std_msgs.msg import Floa...
#!/usr/bin/env python3 # TODO: switch to asynchronous launch (Popen) for sbatch from enum import Enum import logging import time import datetime import click import socket import zmq import json from subprocess import call, Popen from sortedcontainers import SortedDict # for fake_events (test only) from ClusterShell....
# python3 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import collections from collections import OrderedDict from absl import app from absl import flags import io import numpy as np import tensorflow.compat.v1 as tf tf.disable_e...
# -*- coding: future_fstrings -*- import numpy as np import torch from torch.distributions import Normal, kl_divergence, Bernoulli, RelaxedBernoulli from torch import nn import torch.nn.functional as F from .utils import spatial_transform, calc_kl_z_pres_bernoulli from .common import * from .modules import NumericalRe...
'''Interpreter for LISP like programming language''' import sys import copy # mandatory import time class Parser: '''''' _end_of_program = "" _i = None _peek_token = None _token = None _tokens = None def _tokenize(line): line = line.lower() for deap_stuff in [",", '"', "'"...
#! /usr/bin/env python # Copyright 2018 <NAME>, <NAME> (<EMAIL>, <EMAIL>) # # 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 must retain the above copyright notice, this list of conditi...
__author__ = '<NAME>' import requests,json,re from collections import OrderedDict # (1) Get Library Name and schema from LibraryID def get_name_and_schema_of_datasource(auth_token,paxata_url,libraryId,library_version): url_request = (paxata_url + "/rest/library/data/"+str(libraryId)+"/"+str(library_version)) ...
import collections import os import struct import sys import threading from time import time import pefile from capstone import Cs, CS_ARCH_X86, CS_MODE_32 from colorama import Fore from unicorn import * from unicorn.x86_const import * import unipacker_ucl from unipacker_ucl.apicalls import WinApiCalls from unipacker...
#from netCDF4 import Dataset # http://code.google.com/p/netcdf4-python/ import os import time import datetime as dt import xarray as xr from datetime import datetime import pandas import matplotlib.pyplot as plt import numpy as np import math ####################you will need to change some paths here!################...
import glob import os import datetime from collections import OrderedDict import pandas as pd import numpy as np from sklearn.manifold import TSNE import scipy.stats as stats import scipy.sparse as sparse from sparse_dataframe import SparseDataFrame def combine_sdf_files(run_folder, folders, verbose=False, **kwa...
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. import argparse import logging import logging.handlers import os import re import shutil import sys from collections import namedtuple from time...
#!/usr/bin/env python # coding: utf-8 # # Project 3 | Phase 2 | ENPM 661 | Planning for Autonomous Robots | #SUBMISSION : March 20, 2020 #GITHUB: https://github.com/govindak-umd/ENPM661/tree/master/Project%203/Project%203%20Phase%202 #YOUTUBE: https://www.youtube.com/watch?v=VBzvzb2vaYg&feature=emb_logo # A* Algori...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from builtins import dict, object, range, zip from future.utils import as_native_str, integer_types, string_types import datetime import itertools import math import re from concurrent.futures import ThreadPoolExecutor from itert...
# -*- coding: utf-8 -*- """ Core module defining elementary class and methods for SizingLab """ # -------[Import necessary packages]-------------------------------------------- import sys import pint import warnings import logging import sympy import numpy from collections import OrderedDict from IPython.display impor...
# Import libraries import numpy as np import tensorflow as tf import os from PIL import Image import matplotlib.pyplot as plt import math # Set global values ROWS = 224 COLS = 224 lr = 0.001 # pkeep = 0.5 window = 5 tf.set_random_seed(0) # Functions go here def read_from_folder(filename): a = so...
import sys import os import ctypes import ctypes.util import numpy as np _API = { 'FreeImage_AllocateT': ( ctypes.c_void_p, [ctypes.c_int, # type ctypes.c_int, # width ctypes.c_int, # height ctypes.c_int, # bpp ctypes.c_uint, # red_mask ctypes.c_u...
import numbers import random import cv2 import numpy as np import skimage.transform from torchvision.transforms import functional as F class CenterCrop(object): """Like tf.CenterCrop, but works works on numpy arrays instead of PIL images.""" def __init__(self, size): if isinstance(size, numbers.Numb...
import math import sys import os import time import numpy as np import scipy from skimage.measure import compare_ssim as ssim from skimage.measure import compare_nrmse as nrmse import cv2 import warnings from skimage.measure import compare_ssim from skimage.transform import resize from scipy.stats import wasserstein_di...
import h5py import numpy import scipy.sparse import scipy.linalg import sys from afqmctools.utils.io import ( to_qmcpack_complex, from_qmcpack_complex ) from afqmctools.hamiltonian.io import ( write_sparse_basic, write_sparse_chol_chunk ) def get_dset_simple(fh5, name):...
from __future__ import annotations import numpy as np import pytest import xarray as xr from scipy.stats import genpareto, norm, uniform from xclim.core.options import set_options from xclim.core.units import convert_units_to from xclim.sdba.adjustment import ( LOCI, DetrendedQuantileMapping, EmpiricalQua...
from LTH import * from nilearn.input_data import NiftiLabelsMasker import bct ################################ ## Calculate thalamocortical FC and thalamic vox by vox PC ################################ def generate_correlation_mat(x, y): """Correlate each n with each m. Parameters ---------- x : np.array Shap...
#!/usr/bin/env python # # run_qc.py: run QC pipeline on arbitrary fastq files # Copyright (C) University of Manchester 2017-2021 <NAME> # ######################################################################### # # run_qc.py # ######################################################################### """ Runs ...
import numpy as np from scipy import constants from layer import Layer ''' TransferMatrix for conductive sheets x ^ | eps1,mu1 | eps2, mu2 | _____________|__________________>z | | | sigma_e, sigma_m ''' ''' Convension (hin) = (M)(hout) ...
import torch import torch.nn as nn from torch.cuda.amp import autocast from trainer.loss import GANLoss import random import functools import torch.nn.functional as F from utils.util import opt_get def create_loss(opt_loss, env): type = opt_loss['type'] if 'teco_' in type: from trainer.custom_traini...
# ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ # Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved. # =============================================================...
import json from logging import warning from typing import Iterable, Union import numpy as np import tensorflow as tf from tensorflow.keras import activations, regularizers, initializers from tensorflow.keras.layers import Layer from tensorflow.keras.models import model_from_json from tensorflow.keras.utils import get...
import numpy as np import copy import os import json from .tree_selector import TreeSelector # For `OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.` os.environ["KMP_DUPLICATE_LIB_OK"] = "True" def hard_sigmoid(x): y = 0.2 * x + 0.5 return np.clip(y, 0.0, 1.0) def...
''' Skeleton code for VPG. Partly based on https://github.com/openai/spinningup/tree/master/spinup/algos/ppo ''' import time import sys import subprocess import json import random import training_helpers import numpy as np import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F...
# coding: utf-8 # In[1]: import torch import torch.nn as nn import torch.nn.functional as F from torchvision import models import numpy as np import sys, time, os, warnings from skimage.segmentation import mark_boundaries import matplotlib.pylab as plt get_ipython().run_line_magic('matplotlib', 'inline') # In[2]...
""" The following code is partially based on these two works: https://github.com/google/BIG-bench/blob/main/bigbench/benchmark_tasks/twenty_questions/task.py https://github.com/google/BIG-bench/blob/main/bigbench/benchmark_tasks/taboo/task.py both were released under a compatible free license ([Apache License v.2](http...
#!/usr/bin/env python3 """Redis failover script. You will be prompted for confirmation to do a failover or disable frontends. """ import argparse import datetime import json import os import pprint import socket import ssl import sys import time import redis import requests import common_redis as common TASK_NAME ...
import os import sys import time from . import __path__ import json from .lexer import Lexer, Token, TokenError from .parser import Parser from .transform import TransformExtractStyleSheet, TransformMinifyScope, \ TransformConstEval, getModuleImportExport from .formatter import Formatter from ast import...
#!/usr/bin/env python #=============================================================================== # Copyright 2017 Geoscience Australia # # 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 ...
#!/usr/bin/env python3 # 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 import random from typing import Dict, List, Optional, Tuple from enum import Enum, unique # pyre-fixme...
import copy import time import pandas as pd from paper_trading.event import Event from paper_trading.utility.event import * from paper_trading.utility.setting import SETTINGS from paper_trading.trade.db_model import ( query_position, query_orders, query_orders_today, query_account_record, query_po...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab from __future__ import unicode_literals, division, absolute_import, print_function import struct # note: struct pack, unpack, unpack_from all require bytestring format # data all the way up to at least python 2.7.5, python...
import os import json import numpy as np import tensorflow as tf import tensorflow_hub as hub from collections import Counter import bert_tokenization class LearningRateLogCallback(tf.keras.callbacks.Callback): def __init__(self, log_dir): super(LearningRateLogCallback, self).__init__() file_wri...
from uuid import uuid4 from pycql.query import Query def _insert(): # Insert Test uuid = uuid4().hex data = dict({'user__uuid': uuid, 'fan': 'johndoe'}) query = Query('NerdMovies', 'Hollywood').insert(data) assert query.execute(renderOnly=True).strip() == "INSERT INTO Hollywood....
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import re import logging logging.basicConfig() LOGGER = logging.getLogger(__name__) try: import roman except ImportError as e: LOGGER.warning('package "roman" not found') raise e try: import ply.lex as lex import ply.yacc as yacc exce...
# --------------------------------------------------------------- # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the NVIDIA Source Code License # for OSCAR. To view a copy of this license, see the LICENSE file. # -----------------------------------------------------------...
# -*- coding: utf-8 -*- # Utools for setup.py files from __future__ import absolute_import, division, print_function import sys import textwrap from os.path import exists, join, dirname, split, splitext import os from utool import util_cplat from utool import util_path from utool import util_io from utool import util_s...
import asyncio import socket import struct import os import random import time FLAGS_FIN = 1<<0 FLAGS_SYN = 1<<1 FLAGS_RST = 1<<2 FLAGS_ACK = 1<<4 ETH_P_ALL = 0x0003 ETH_P_IP = 0x0800 #TCP MSS = 1460 K = 4.0 G = 1.0 SRTT = 0.0 RTTVAR = 0.0 alpha = 1.0/8.0 beta = 1.0/4.0 enviados = [] ICMP = 0x01 # https://en.wik...
# Import necessary modules #from __future__ import division # Added by <NAME> from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from os import path import logging import pywcs # Header __author__ = "<NAME> & <NAME>" __version__ = "2.0" # HISTORY...
#!/usr/bin/env python """Element.py contains network entities which build up the network topology, like devices, routers and external machines.""" import logging import sys import re import gevent import netifaces import ipaddress from impacket import ImpactPacket, ImpactDecoder from honeyd.protocols.tcp import TCPHan...
#!/usr/bin/python3 #- Note python 3.6 or later now required! import os from importlib import reload import settings import traceback import datetime import devices import threading import threadpool import configparser import sys import getopt import time import netaddr import signal import socket import errno import j...
# rstblog/views.py import os import pdb import pytz #import re import xml.etree.ElementTree as ET from copy import copy from datetime import datetime from pathlib import Path from docutils.core import publish_parts from docutils.core import publish_doctree from markdown import markdown from django.conf ...
## This file alters the game described in new_simpy_fire_smdp.py # Here, agents receive a local observation (location,strength,status,interest) for 5 closest fires # Also, each fire gets random number of UAV-minutes needed to extinguish it, where the mean is a # function of fire level # Rewards are equal to the fire l...
#!/usr/bin/env python3 __author__ = "<NAME>" __copyright__ = "Copyright 2021, ROPD Project" __license__ = "BSD 2-clause" __email__ = "<EMAIL>" from binascii import unhexlify, hexlify import random from struct import pack, unpack from itertools import permutations, combinations, chain from multiprocessing import Pool ...
"""Provide event management. """ import time import json import abc import collections import logging import copy from datetime import datetime log = logging.getLogger('msiempy') from . import NitroObject, NitroDict, NitroError, FilteredQueryList from .__utils__ import timerange_gettimes, parse_query_result, format_f...
#!/usr/bin/env python '''Compilation of observed and derived astrophysical trends for galaxies. @author: <NAME> @contact: <EMAIL> @status: Development ''' import math import numpy as np import os import pandas as pd import scipy.interpolate as interp from scipy.optimize import newton import scipy.special import sys i...
#StockCard import ticker_data as td import numpy as np class StockCard: ### ## All Cards will be (5x4) market days long (fuck weeks n months) ## ## at starting with dn(tick) then some stock specifics ## each dn(tick) will be ## ohlv ## [ [d0tick[0], d0tick[1], d0tick[2], d0t...
# BSD 2-CLAUSE LICENSE # 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 the following disclaimer. # Redistributions i...
import mmcv import numpy as np import random from collections import OrderedDict from os import path as osp from pyquaternion import Quaternion from shapely.geometry import MultiPoint, box from typing import List, Tuple, Union import pathlib import math import json from dataset_3d.data_loaders.dataset_loader import ...
#!/usr/bin/env python3 import copy import itertools import re import time import uuid import yaml import traceback import os import json import importlib import sys import pathlib from types import SimpleNamespace from datetime import datetime from dataclasses import dataclass import concurrent.futures from itertool...
#!/usr/bin/python # -*- coding: utf-8 -*- import time import datetime as dt import pytz import logging from calendar import timegm from django.db import transaction from django.db.models import F, Q, Count from django.contrib.auth.models import User from users.models import * from views.models.orderitem import OrderI...
import numpy as np import plotly.graph_objects as go import plotly.express as px from interflow.analyze import * def plot_sankey(data, unit_type1, output_level=1, unit_type2=None, region_name=None, strip=None, remove_sectors=None): """Plots interactive sankey diagram(s) for a given region at a given level of gran...
""" Functions and classes for plotting simulation data .. autosummary:: :nosignatures: ScalarFieldPlot plot_magnitudes plot_kymograph plot_kymographs plot_interactive .. codeauthor:: <NAME> <<EMAIL>> """ import logging import time import warnings from typing import Any, Callable, Dict, List, Op...
#!/usr/bin/env python3 # <NAME> - Apr 2016 # This script provisions a vdb or dSource # Updated by <NAME> Aug 2016 # --- Create vFiles VDB # requirements # pip install docopt delphixpy # The below doc follows the POSIX compliant standards and allows us to use # this doc to also define our ARGUMENTS for the script. """...
import copy import numpy as np import torch import torch.nn as nn import torch.nn.functional as F # Implementation of Soft Actor-Critic (SAC) # Paper: https://arxiv.org/abs/1801.01290 # Soft Actor-Critic Algorithms and Applications # https://arxiv.org/abs/1812.05905 # Implemetation of Attentive Update of Multi-Critic ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The Academy / ASC Common LUT Format Sample Implementations are provided by the Academy under the following terms and conditions: Copyright © 2015 Academy of Motion Picture Arts and Sciences ("A.M.P.A.S."). Portions contributed by others as indicated. All rights reserv...
from kivy.uix.modalview import ModalView from kivy.core.window import Window from kivy.uix.button import Button from kivy.lang import Builder from kivy.graphics import Color from kivy.utils import get_hex_from_color, get_color_from_hex, get_random_color #import pyscreenshot as ImageGrab import math from biskivy.avars...
import os import sys import stat import shutil import click import datetime from d2s.generate_metadata import create_dataset_prompt, generate_hcls_from_sparql from d2s.utils import new_dataset, get_config, init_folder, get_base_dir, init_d2s_java from d2s.sparql_operations import sparql_insert_files, java_upload_files...
from __future__ import division, print_function import numpy as np import os from scipy.stats import multivariate_normal import sys import struct try: import sounddevice as sd have_sounddevice = True except: have_sounddevice = False from .stft import stft from .acoustics import mfcc class CircularGauss...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.3.3 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # %% [markdown] # # Plot temp...
# coding: utf-8 # Distributed under the terms of the MIT License. """ This submodule defines some useful chemical functions and constants, with a focus on battery materials. """ import copy import warnings from typing import Dict, Tuple, Any, List import numpy as np from matador.data.constants import * # noqa EP...
from __future__ import division import logging; _L = logging.getLogger('openaddr.render') from glob import glob from unicodedata import normalize from collections import defaultdict from argparse import ArgumentParser from itertools import combinations, chain from os.path import join, dirname, splitext, relpath from u...
#!/usr/bin/env python from __future__ import print_function from datetime import datetime, timedelta import json import logging from logging.config import dictConfig import os import re import shutil import subprocess import tempfile import time import click from croniter import croniter import pytz import requests i...
""" This module defines pdoc's documentation objects. A documentation object corresponds to *something* in your Python code that has a docstring or type annotation. Typically, this only includes modules, classes, functions and methods. However, `pdoc` adds support for extracting documentation from the abstract syntax t...
# -*- coding: utf-8 -*- """ 自动化最优分箱工具 Create Date 2020.11.27 """ import pandas as pd import numpy as np from sklearn.utils.multiclass import type_of_target def _check_target_binary(y): """ check if the target variable is binary ------------------------------ Param y:exog variable,pandas Series co...
# Python Standard Library Imports import datetime import random import uuid from hashlib import sha1 # Third Party (PyPI) Imports import pytz import rollbar # Django Imports from django.conf import settings from django.db import models from django.urls import reverse from django.utils import timezone from django.util...
#! /usr/bin/env python from builtins import str from builtins import zip from builtins import range from builtins import object from argparse import ArgumentParser import glob import json import logging import os import re import sys TYPES = ["Experiment", "Screen"] class Key(object): def __init__(self, patte...
from .mhmesh import MHMesh from .material import MHMaterial import json import math import re import os import uuid import shutil import mathutils from mathutils import Vector from .utils import checkMakeSkinIntegrity _EVALUATED_MAKESKIN = False _MAKESKIN_AVAILABLE = False _knownMeshes = {} # pl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Program za vodenje robota EV3 po seznamu tock na poligonu. [Robo liga FRI 2019: Sadovnjak] """ __author__ = "Laboratory for adaptive systems and parallel processing" __copyright__ = "Copyright 2019, UL FRI - LASPP" __credits__ = ["Laboratory for adaptive systems and...
"""Format data from the FastMRI Knee Initiative. Multicoil Knee Dataset:: ```bash # 1. Format train/validation datasets. Can be run simultaneously. python format_fastmri format --challenge knee_multicoil \ --split train --device <GPU DEVICE ID> --num_workers <NUM WORKERS> python format_fastmr...
"""This module contains operations to manipulate the database Warning: since it involves manipulating source code, some operations may not be very reliable. Additionaly, we currently do not have tests for this file. Thus, my suggestion is to use only the :meth:`~insert` and :meth:`~set_attribute` functions. These fun...
import yfinance as yf import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from typing import Tuple import os import glob import time import json import sys import torch import torch.nn as nn import torch.optim as opt import math from sklearn.metrics im...
"""A high-level Python interface for allocating SpiNNaker boards.""" import threading import time from collections import namedtuple from spalloc.protocol_client import ProtocolClient, ProtocolTimeoutError from spalloc.config import read_config, SEARCH_PATH from spalloc.states import JobState import logging logger...
#####################################################. # This file stores all the functions # # used in CSEARCH # #####################################################. import os import sys import subprocess from pathlib import Path from pkg_resources import resource_fil...
import pyb import struct import sys MODE_RTU = 'rtu' MODE_ASCII = 'ascii' _NUMBER_OF_BYTES_PER_REGISTER = 2 _ASCII_HEADER = ':' _ASCII_FOOTER = '\r\n' class Instrument(): def __init__(self, uartObj, slaveaddress, mode=MODE_RTU): self.serial = uartObj self.address = slaveaddress self.m...
############################################################################ # Copyright (c) 2015-2017 Saint Petersburg State University # Copyright (c) 2011-2015 Saint Petersburg Academic University # All Rights Reserved # See file LICENSE for details. ##################################################################...
# # # 0=================================0 # | Kernel Point Convolutions | # 0=================================0 # # # ---------------------------------------------------------------------------------------------------------------------- # # Class handling ModelNet40 dataset # # ---------------...
#!/usr/bin/env python3 # Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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-...
import numpy as np from pyomo.environ import * # 导入该模块所有函数 from pyomo.dae import * import math class Walk: def __init__(self, state, reference): # state be a 1 * 8 array # reference be a 4 * predict_step array, which concludes theta fy and x reference m = ConcreteModel() length4re...
import functools import numpy as np import random from typing import List from federatedml.util import consts from federatedml.secureprotol import PaillierEncrypt from federatedml.ensemble.basic_algorithms import HeteroDecisionTreeGuest, HeteroDecisionTreeHost, \ HeteroFastDecisionTreeGuest, HeteroFastDecisionTreeH...
import os from concurrent.futures.thread import ThreadPoolExecutor import requests from PySide6.QtCore import QFileSystemWatcher from PySide6.QtCore import Qt, Signal from PySide6.QtWidgets import QDialog, QFormLayout, QHBoxLayout, QLabel, QListWidgetItem, QSizePolicy, QSpacerItem, \ QVBoxLayout, \ QWi...
""" Calculation of Earth layers and electron densities. """ from __future__ import division import numpy as np try: import numba except ImportError: numba = None from pisa import FTYPE from pisa.utils.fileio import from_file from pisa.utils.log import logging, set_verbosity __all__ = ['extCalcLayers', 'Lay...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import dm_env from dm_env import specs from dm_control import mujoco from dm_control.rl import control from dm_control.suite import base from dm_control.suite import common from dm_control....
from __future__ import absolute_import, division, print_function, unicode_literals import sys import platform import subprocess import os from os.path import expanduser import re import glob import numpy as np from argparse import ArgumentParser, REMAINDER from argparse import RawTextHelpFormatter import logging import...
# -*- coding:utf-8 -*- # -*- author:cto_b -*- import requests from bs4 import BeautifulSoup import re from pyquery import PyQuery as pq filename = ''' <html> <head></head> <body> <div class="a-column a-span3 fsdColumn fsdColumn_3"> <div class="fsdDeptBox"> <img alt="" aria-hidden="true" cla...
import os import sys # Add all the python paths needed to execute when using Python 3.6 sys.path.append(os.path.join(os.path.dirname(__file__), "models")) sys.path.append(os.path.join(os.path.dirname(__file__), "models/wrn")) import time import numpy as np from datetime import datetime, timedelta from logger import L...
import math import ransacWrapper as rw from findEmptySpot import * from envClient import EnvClient import png import numpy as np import sys import time import os import tensorflow as tf import readCSV import normSTMImg import scipy.ndimage.filters as spf from scipy import ndimage import glob import datetime def print...
""" this script containts the clean-label attack results with defense. """ import argparse import copy import os import pickle import sys import time from typing import Dict, List, Tuple, Union sys.path.append("/home/ganleilei/workspace/clean_label_textual_backdoor_attack/") import nltk import numpy as np import OpenA...
import math from pathlib import Path import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import itertools as it from collections import defaultdict, deque from tqdm import trange, tqdm if torch.cuda.is_available(): torch.backends.cudnn.benchmark = True class Board(obj...
######## Webcam Object Detection Using Tensorflow-trained Classifier ######### # # Author: <NAME> # Date: 10/27/19 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam # feed. It draws boxes and scores around the objects of interest in each frame from the # webcam. To ...
import random, torch, os import collections from operator import itemgetter import argparse, datetime import numpy as np from torch.autograd import Variable import torch.optim as optim import torch.nn.functional as F from model.dda import * from utils.dataload import data_generator from utils.write_csv import * from u...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ NDK file support for ObsPy The format is an ASCII format but will internally handled by unicode routines. :copyright: The ObsPy Development Team (<EMAIL>) :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) """...
"""Contains base classes for UI elements that deal with lists of entries, that can be scrolled through using arrow keys. Best example of such an element is a Menu element - it has menu entries you can scroll through, which execute a callback when you click on them. """ from copy import copy from threading import Even...
import math import numpy as np import torch from torch import nn from torch.autograd import Variable import torch.optim as optim import torch.nn.functional as F class biDafAttn(nn.Module): def __init__(self, channel_size): super(biDafAttn, self).__init__() """ This method do biDaf from s2...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import tensorflow as tf import numpy import pickle import string import os import copy import LM import dataset as Dataset from util import write_log from util import reverse_seq from util import target_seq from util import original_seq_prob from util import find_k_larg...