text
stringlengths
8.04k
46.5k
# Copyright 2019 <NAME> # # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # # This source code is licensed under the BSD license found in the # LICENSE file in the root directory of this source tree. from collections import OrderedDict from copy import deepcopy import time import pytest import ...
# Copyright (c) 2021-present The Torchy Authors. # Distributed under the MIT license that can be found in the LICENSE file. PYTORCH = '../pytorch' from typings_data import * import sys sys.path.append(PYTORCH) from tools.codegen.gen import * from tools.codegen.api import types yaml_path = PYTORCH + '/aten/src/ATen/n...
import sys, re, glob, os, tempfile, pdb, time import subprocess import pylab as pl import math import shutil import AtlejgTools.Utils as UT import AtlejgTools.SimulationTools.UnitConversion as U def _acosd(x): return math.degrees(math.acos(x)) def read_exported_file(fname, varnms): ''' reads a file create...
from collections import OrderedDict import copy import hashlib import io import itertools import logging import os, os.path import platform import random import shutil import subprocess import sys import struct import time import zipfile from World import World from Spoiler import Spoiler from Rom import Rom from Patc...
# Copyright (c) MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jan 5 12:42:22 2020 Read NFWF whale and boat observation files and create Julian Date identifies and detect passbys in whale file. Then, find corresponding boat observations and build and save Whale and Boat datastructures for each passbby @...
import os import shutil import sys import textwrap import zipfile from pip._vendor import pkg_resources from pip.backwardcompat import HTTPError from pip.download import (PipSession, url_to_path, unpack_vcs_link, is_vcs_url, is_file_url, unpack_file_url, unpack_http_url) from pip.exceptions i...
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from future.utils import python_2_unicode_compatible import os import logging import textwrap from copy import deepcopy from indra.statements import * from indra.util import read_unicode_csv from indra.databases impo...
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2022/1/26 13:10 Desc: 申万指数-申万一级、二级和三级 http://www.swsindex.com/IdxMain.aspx https://legulegu.com/stockdata/index-composition?industryCode=851921.SI """ import time import json import pandas as pd from akshare.utils import demjson import requests from bs4 import Bea...
import math import os import re from multiprocessing import Pool from collections import defaultdict import tables import numpy as np from astropy.io import fits from astropy.table import Table from beast.observationmodel.noisemodel.generic_noisemodel import get_noisemodelcat from beast.physicsmodel.grid import SEDGr...
import json import os import shutil import tempfile from typing import Dict, Optional import unittest import pytest from bitcoinx import PrivateKey, PublicKey, Script from electrumsv.bitcoin import address_from_string from electrumsv.constants import DATABASE_EXT, StorageKind from electrumsv.keystore import from_seed...
"""Uses PPO to training an attack policy against a fixed, embedded policy.""" import functools import json import logging import os import os.path as osp import pkgutil from typing import Callable, Iterable from gym.spaces import Box from sacred import Experiment from sacred.observers import FileStorageObserver impor...
#!/usr/local/bin/python3 import sys import pickle import argparse import json import numpy as np from pathlib import Path import SimpleITK as sitk from cinemri.definitions import Patient, Study, CineMRISlice from cinemri.utils import get_patients from data_conversion import convert_2d_image_to_pseudo_3d from vs_comput...
# Copyright 2013 10gen Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2015 The TensorFlow 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 applica...
import argparse import sys import os import fabric import random import json import io import yaml import shutil import subprocess from github import Github import validators from invoke import UnexpectedExit from configparser import ConfigParser LOC_INSTALLER = { 'python3.6': { 'installer': 'pip', ...
from __future__ import print_function import json import time import math import sys import os import traceback from hashlib import sha1 from tempfile import NamedTemporaryFile from multiprocessing import Process, Queue from itertools import starmap, chain, islice from boto3.s3.transfer import TransferConfig try: ...
# # 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 us...
"""A collection of native images. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import errno import glob import io import logging import os import shutil import stat from treadmill import appcfg from treadmill ...
__copyright__ = "Copyright (C) 2017 <NAME>" __license__ = """ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, mer...
import io from pathlib import Path from textwrap import dedent import numpy as np import openpyxl import pandas as pd import pytest from pytest import fixture, raises try: from openpyxl.worksheet.worksheet import Worksheet except ImportError: # openpyxl < 2.6 from openpyxl.worksheet import Worksheet from o...
""" Vision Transformer (ViT) in PyTorch A PyTorch implement of Vision Transformers as described in 'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale' - https://arxiv.org/abs/2010.11929 The official jax code is released and available at https://github.com/google-research/vision_transformer ...
#!/usr/bin/env python3 import argparse import numpy as np from pathlib import Path import sys try: import DREAM except ModuleNotFoundError: sys.path.append('../../py') import DREAM from DREAM import DREAMSettings import DREAM.Settings.CollisionHandler as Collisions import DREAM.Settings.Equations.ColdEl...
# -*- coding: UTF-8 -*- """ Copyright (c) 2004-2007, <NAME> Copyright (c) 2016, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright no...
"""Build macros for TF Lite.""" load( "//tensorflow:tensorflow.bzl", "clean_dep", "if_oss", "tf_binary_additional_srcs", "tf_cc_shared_object", ) load("//tensorflow/lite:special_rules.bzl", "tflite_copts_extra") load("//tensorflow/lite/java:aar_with_jni.bzl", "aar_with_jni") load("@build_bazel_rule...
import cv2 import numpy as np from skimage.transform import pyramid_gaussian from skimage.feature import local_binary_pattern from skimage.color import label2rgb import time class SegmentationHelper: def __init__(self, image, num=2, scale=2): self.pyramid = None self.images = None self.ima...
#!/usr/bin/env python """ Utility subroutines for manipulating parmed Structure objects """ #============================================================================================= # GLOBAL IMPORTS #============================================================================================= import os import t...
### -*- coding: utf-8 -*- ############################################# # Developed by <NAME> (<EMAIL>) # All right reserved, 2012-2017 ####################################################################### """Text processing functions """ __author__ = "<NAME> (<EMAIL>)" __license__ = "ZPL" import csv im...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, <NAME> <<EMAIL>> # 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 ANSIBLE_METADATA = { 'metadata_version': '1.1', '...
from rec_utils import * import matplotlib.pyplot as plt from matplotlib.lines import Line2D from itertools import product from matplotlib.animation import FuncAnimation from matplotlib.patches import Wedge from operator import itemgetter import matplotlib.animation as animation # args_version = ['factor=StimulusGating...
""" Aesthetics.py Author: <NAME> Affiliation: University of Colorado at Boulder Created on: Wed Sep 24 16:15:52 MDT 2014 Description: """ import os, imp, re import numpy as np from matplotlib import cm from .ParameterFile import par_info from matplotlib.colors import ListedColormap # Charlotte's color-maps _charl...
""" This module is used to hold the Player class. The Player represents the user- controlled sprite on the screen. """ import pygame import numpy import constants as const import platforms from spritesheet_functions import SpriteSheet class Player(pygame.sprite.Sprite): """ This class represents the bar at t...
# -*- coding: utf-8 -*- import os import win32com.client import pandas as pd from pandas import Series, DataFrame from eunjeon import Mecab # from konlpy.tag import Komoran # For Test(2021-02-21) # from datetime import datetime import datetime import re import argparse import time import multiprocessing i...
import argparse, os, sys, gzip from tqdm import tqdm from pgs_harmonizer.harmonize import * from datetime import datetime # Inputs parser = argparse.ArgumentParser( description='Harmonize a PGS Catalog Scoring file (PGS######.txt.gz) to a specific genome build.') subparsers = parser.add_subparsers(help='Harmonizat...
import numpy as np import pandas as pd import pdb import re from time import time import json import random import os import model import paths from scipy.spatial.distance import pdist, squareform from scipy.stats import multivariate_normal, invgamma, mode from scipy.special import gamma # from scipy.misc import imre...
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. # Copyright (c) Microsoft Corporation. # Original code: https://github.com/vsyrgkanis/adversarial_gmm """ TensorFlow2 implementation of the Adversarial Generalized Method of Moments. ... as described at https://arxiv.org/abs/1803.07164 In its core, we optimize:...
#!/usr/bin/env python """Automation script for making a release. Must be run from the root for the repository""" # Note: Version scheme according to https://www.python.org/dev/peps/pep-0440 import json import os import re import shutil import sys import urllib.error import urllib.parse import urllib.request from os.pat...
## BugUtil ## ## Collection of general-purpose utility functions. ## ## Text Formatting ## ## getPlainText(key, default, replaceFontTags) ## getText(key, values, default, replaceFontTags) ## Retrieves a translated <TEXT> message from CyTranslator. If <key> doesn't ## exist, the default (if given) i...
# (c) 2012, <NAME> <<EMAIL>> # (c) 2012-2014, <NAME> <<EMAIL>> and others # (c) 2017, <NAME> <<EMAIL>> # (c) 2017 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 import ...
#!/usr/bin/env python # -*- python -*- #BEGIN_LEGAL # #Copyright (c) 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-...
#!/usr/bin/env python3 # # Plots the power spectra for the matter and HI, # compared to the Zeldovich/ZEFT models. # import matplotlib matplotlib.use('Agg') import numpy as np import matplotlib.pyplot as plt from matplotlib import rc, rcParams, font_manager rcParams['font.family'] = 'serif' fsize = 11 fontmanage = fo...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
from collections import defaultdict from typing import Any, Dict, Iterator, List, Optional, Set, Tuple, Union, cast from dagster import check from dagster.core.definitions import ( AssetKey, AssetMaterialization, ExpectationResult, Materialization, Output, OutputDefinition, SolidDefinition,...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * """" IMPORTS """ import json import requests from datetime import datetime, timedelta # Disable insecure warnings requests.packages.urllib3.disable_warnings() ''' GLOBAL VARS ''' # PagerDuty API works only with secured...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn # import torch.autograd.Function zero_clip = 1e-6 def _sigmoid(x): y = torch.clamp(x.sigmoid_(), min=1e-4, max=1-1e-4) return y def _tanh(x): y = torch.clamp(x.tanh_...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
""" Code adapted from the Mathis Lab MIT License Copyright (c) 2022 <NAME> DataJoint Schema for DeepLabCut 2.x, Supports 2D and 3D DLC via triangulation. """ import datajoint as dj import os import inspect import importlib import numpy as np from pathlib import Path from datetime import datetime import ya...
from torch.nn.functional import conv1d, conv2d, fold import torch.nn as nn import torch import numpy as np from time import time from ..utils import * from scipy.signal import get_window class STFTBase(nn.Module): """ STFT and iSTFT share the same `inverse_stft` function """ def inverse_stft( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from gluon import * import datetime from gluon import current T=current.T import sys, re class MOD_ATR_TIPO(): formula='F' valores='V' @classmethod def getitems(self): return {self.formula:'Formula',self.valores:'Valores discretos'} class MOD_CMP_T...
import json import logging import re from typing import Iterable, List, Optional, Type, TypeVar from bs4 import BeautifulSoup from sqlalchemy.orm import Session from fallen_london_chronicler.images import get_or_cache_image, ImageType from fallen_london_chronicler.model import Area, AreaType, Storylet, \ Storylet...
# encoding=utf-8 """ Created on 15:05 2019/07/16 @author: <NAME> It implements "Self-ensemble Visual Domain Adapt Master" and refer to the writer's code """ import os import time import math import numpy as np import torch from torch import nn from batchup import data_source, work_pool import Data_transform...
#!/usr/bin/env python3 # Copyright 2019 Google LLC # Copyright 2020 <NAME> # # 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 requ...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from numpy import linalg as LA import pdb import random from skmultiflow.ADCN.ADCN_process.utilsADCN import deleteRowTensor, deleteColTensor # random seed control # np.random.seed(0) # torch.manual_seed(0) # random.seed(0) # =======...
import json import numbers import time import uuid from concurrent import futures from typing import ( Any, Callable, Dict, FrozenSet, Generic, Optional, Set, Tuple, TypeVar, Union, ) import networkx as nx from tiledb.cloud import array from tiledb.cloud import sql from tiledb....
from __future__ import absolute_import, division, print_function, unicode_literals import copy import json import logging import math import os import shutil import tarfile import tempfile import sys from io import open import torch from torch import nn from torch.nn import CrossEntropyLoss from torch.utils import c...
from socket import socket, AF_INET, SOCK_STREAM, getprotobyname from hashlib import sha256, sha512, md5, sha1, sha384, sha224, blake2b, blake2s, shake_128, sha3_512, sha3_384, sha3_256, shake_256, shake_128 from argparse import ArgumentParser from Cryptodome.Cipher.AES import new, MODE_GCM, MODE_CBC from Cryptodome...
# Copyright (c) 2020, Build-A-Cell. All rights reserved. # See LICENSE file in the project root directory for details. import copy import numbers from collections import defaultdict from typing import List, Set, Union import libsbml from .parameter import ModelParameter, Parameter, ParameterEntry from .sbmlutil im...
"""Utility methods for manipulation of Kubernetes objects in Python. """ import datetime from functools import partial import inspect import keyword import operator from pprint import pformat import re from salt.ext import six from salt.utils.dictdiffer import recursive_diff try: import kubernetes.config impo...
import six from astropy import units as u from astropy.io import fits from astropy import constants from astropy import wcs import numpy as np import warnings # Imports for the custom kernels from astropy.modeling.models import Ellipse2D, Gaussian2D from astropy.convolution import Kernel2D from astropy.convolution.ker...
import torch import torch.nn as nn import rdkit.Chem as Chem import torch.nn.functional as F from hgraph.nnutils import * from hgraph.encoder import IncHierMPNEncoder from hgraph.mol_graph import MolGraph from hgraph.inc_graph import IncTree, IncGraph class HTuple(): def __init__(self, node=None, mess=None, vmask=...
# SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC # SPDX-License-Identifier: Apache-2.0 # # Project: # glideinWMS # # File Version: # # Description: # This module implements the functions needed # to monitor the VO frontend # # Author: # <NAME> (Mar 19th 2009) # import copy import fcntl import math ...
from collections import OrderedDict, defaultdict import xlrd from django.conf import settings from django.db import transaction from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from django.core.exceptions import ValidationError from evap.evaluation.models import Course,...
import asyncio import csv import io import logging import re from collections import defaultdict from typing import Dict, List, Optional import aiohttp from redbot.core.utils import AsyncIter from tsutils.enums import Server from tsutils.formatting import contains_ja from .errors import InvalidGraphState from .models...
import aetherling.space_time.type_helpers from aetherling.space_time.space_time_types import * from aetherling.space_time.nested_counters import * from aetherling.space_time.ram_st import DefineRAM_ST from aetherling.space_time.type_helpers import get_shared_and_diff_subtypes, remove_tseqs, replace_tombstone, \ ST_...
import os import argparse import logging import time import numpy as np import numpy.random as npr import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import lib.layers.wrappers.cnf_regularization as re...
from gc import collect from math import dist from sqlite3 import SQLITE_CREATE_TABLE from turtle import back, distance, update from types import CellType from matplotlib import pyplot as plt from matplotlib.patches import ConnectionPatch from numpy.lib.arraysetops import unique from numpy.lib.type_check import _nan_to_...
#! /usr/bin/env python """ Module with frame de-rotation routine for ADI. """ __author__ = '<NAME>, <NAME>' __all__ = ['cube_derotate', 'frame_rotate', 'rotate_fft'] from astropy.stats import sigma_clipped_stats import numpy as np from numpy.fft import fft, ifft, fftshift, fftfreq import warni...
""" DC2 Object Catalog Reader """ import os import re import warnings import itertools import shutil import numpy as np import pandas as pd import yaml from GCR import BaseGenericCatalog from .dc2_dm_catalog import DC2DMTractCatalog from .dc2_dm_catalog import convert_flux_to_mag, convert_flux_to_nanoJansky, convert...
""" Plotly-to-Matplotlib conversion functions. """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government re...
# -*- coding: utf-8 -*- """Subclass of InteractiveShell for terminal based frontends.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import bdb import os import sys from IPython.core.error import TryNext, UsageError from ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import os.path import time import sys import random import math import tensorflow as tf import numpy as np import importlib import argparse import facenet import lfw import tensor...
import os import sys import time import pickle import numpy as np import torch import logging import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from . import gpr from .serie import Serie from .dataset import DataSet from .errors import mean_absolute_error, mean_a...
# Copyright (c) 2016-2017 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2.0, which is in the LICENSE file. """ This module defines hydroelectric system components. It creates a hydraulic system that works in parallel with the electric one. They are linked through the power gene...
""" STARDATE ===================== This package produces posterior PDFs over age, mass, bulk metalicity, distance and V-band extinction for stars from their spectroscopic parameters (T_eff, log g and observed bulk metallicity), their apparent magnitudes in a range of bandpasses, their parallaxes and rotation periods, i...
import datetime import os import tempfile import time import unittest import netCDF4 import numpy import cf def _make_gathered_file(filename): ''' ''' def _jj(shape, list_values): array = numpy.ma.masked_all(shape) for i, (index, x) in enumerate(numpy.ndenumerate(array)): if ...
import os.path import pytest from gwaripper.info import ( FileInfo, FileCollection, RedditInfo, children_iter_dfs, DELETED_USR_FOLDER, sanitize_filename ) # from gwaripper.extractors.base import BaseExtractor # doesn't work since it leads to circ dep from gwaripper.extractors import base def...
# coding=utf-8 # Copyright (C) 2019 ATHENA AUTHORS; <NAME> # # 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...
# Copyright 2021 IBM Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
"""Framework za leksičku, sintaksnu, semantičku analizu, te izvođenje programa. Za više detalja pogledati šalabahter.txt.""" __version__ = '1.4' import enum, types, collections, contextlib, itertools, functools, math def identifikator(znak): """Je li znak dopušten u C-ovskom imenu (slovo, znamenka ili _)?""" ...
import datetime import json from pathlib import Path from django.apps import apps from django.core.exceptions import ValidationError from django.db.models import ( CharField, ForeignKey, ManyToManyField, permalink, PROTECT, URLField, CASCADE, PositiveSmallIntegerField, FileField, BooleanField, DateField, T...
# -*- coding: utf-8 -*- """ @author: meslami """ # Multilayer Perceptron import pandas import numpy # fix random seed for reproducibility seed = 7 numpy.random.seed(seed) import tensorflow.keras import math from tensorflow.keras.utils import plot_model from tensorflow.keras.models import Model from tensorflow.keras...
import os from datetime import datetime import cv2 import numpy as np import undistort from undistort import FisheyeUndistorter, PerspectiveUndistorter from perftimer import PerfTimer from clize import run class VisionProcessor(object): # input image must already have all distortions applied def __init__(self, img,...
from math import * kraji = [ ('Brežice', 68.66, 7.04), ('Lenart', 85.20, 78.75), ('Rateče', -65.04, 70.04), ('Ljutomer', 111.26, 71.82), ('<NAME>', 71.00, 42.00), ('Ribnica', 7.10, -10.50), ('Dutovlje', -56.80, -6.93), ('Lokve', -57.94, 19.32), ('Vinica', 43.81, -38.43), ('Brtonigla'...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation # Copyright 2015-2019 Lenovo # # 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/licens...
import torch.nn.functional as F import torch from torch import Tensor from torch.nn import Linear, Conv2d, BatchNorm1d, BatchNorm2d, PReLU, ReLU, Sigmoid, Dropout2d, Dropout, AvgPool2d, MaxPool2d, AdaptiveAvgPool2d, AdaptiveMaxPool2d, Sequential, Module, Parameter from collections import namedtuple import math import ...
# <Copyright 2022, Argo AI, LLC. Released under the MIT license.> """API for loading and Argoverse 2.0 maps. These include left and right lane boundaries, instead of only lane centerlines, as was the case in Argoverse 1.0 and 1.1. Separate map data (files) is provided for each log/scenario. This local map data repre...
import os import re import tqdm import copy import json import torch import string import random import sqlite3 import preprocess import subprocess import editsql_postprocess import numpy as np import embeddings as E from eval_scripts import evaluation from vocab import Vocab from torch import nn from torch.nn import f...
"""Defines the Periodogram class and associated tools.""" from __future__ import division, print_function import copy import logging import numpy as np from matplotlib import pyplot as plt import astropy from astropy.table import Table from astropy.stats import LombScargle from astropy import __version__ from astrop...
import os import logging import json import argparse import common_utils from collections import defaultdict from typing import List, OrderedDict from datetime import datetime common_utils.setSeed(42) from tqdm import trange import numpy as np import torch from transformers import ( TrainingArguments, AutoTok...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import os import sys import random import pickle import torch import torch.nn.functional as F from PIL import Image from torch.utils.data import Dataset, DataLoader from torchvision import transforms def r_at_k(embs1, embs2):...
import tensorflow as tf import sonnet as snt import numpy as np from graph_nets import blocks from tensorflow_addons.image import gaussian_filter2d from graph_nets.graphs import GraphsTuple from graph_nets.modules import _unsorted_segment_softmax, _received_edges_normalizer, GraphIndependent, SelfAttention, GraphNetwor...
""" CANNR TM analytics container building tool launcher. Launches the tool from the user's desktop. Copyright 2021 <NAME> <EMAIL> All rights reserved Maintainer <NAME> <EMAIL> """ import os import platform import sys import json import time #import subprocess as sp import pathlib import tkinter as tk import tkinter.fo...
#!/usr/bin/env python from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from termcolor import colored import ipdb # from .graspNet import model as grasp_net # from graspNet import model as grasp_net import matplotlib.pyplot as plt import os import ast fr...
""" Differential evolution implementation """ import random from collections import OrderedDict import os from hops import hdfs as hopshdfs from hops import tensorboard from hops import devices from hops import util import pydoop.hdfs import threading import six import datetime import copy objective_function=None ...
#!/usr/bin/env python3 ################################################################################ # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"),...
# pylint: disable=too-many-lines # TODO de-clutter this file! # pylint: disable=unused-import from typing import (Any, Callable, Dict, List, Tuple, Optional, Union, Iterable, Set) # pylint: enable=unused-import import time import collections import re from datetime import timedelta import numpy as...
import tensorflow as tf import numpy as np from tqdm import tqdm from sklearn.neighbors import KDTree from .base_model import BaseModel from ...datasets.augment import SemsegAugmentation from ...utils import MODEL from ...datasets.utils import (DataProcessing, trans_normalize, trans_crop_pc) class RandLANet(BaseMod...
# -*- coding: UTF-8 -*- """ Common functions for interacting with Virtual Machines in VMware """ import ssl import time import random import os.path import textwrap from io import BytesIO import ujson import OpenSSL import requests from pyVmomi import vim from urllib3.exceptions import InsecureRequestWarning from vla...
import numpy as np from PIL import Image, ImageDraw, ImageFont, ImageMath from pyray.shapes.solid.polyhedron import * from pyray.axes import * from pyray.rotation import * import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D ##########################################################################...
from compression_tools.pruning.helper_functions import get_layer_index import tensorflow as tf import numpy as np def delete_conv2d_output(new_model_param, layer_bias, index, filter, soft_prune=False): if not soft_prune: new_model_param[index][0] = np.delete(new_model_param[index][0], filter, axis=3) ...