text
stringlengths
8.04k
46.5k
# -*- coding: utf-8 -*- # Copyright 2016 Resonai Ltd. 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 requir...
import json,copy,datetime,numbers import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.csgraph import connected_components from scipy.spatial.transform import Rotation as R import ase from ase import Atoms from ase.data import atomic_numbers,atomic_masses_iupac2016,chemical_symbols fro...
from pywinauto import Application, keyboard, findwindows from pywinauto.base_wrapper import ElementNotEnabled import pywintypes import pywinauto import warnings import pyautogui from pywinauto import mouse import time import os import shutil import numpy as np computer = "desktop" # Note that if running this script ...
import datetime import os import re from functools import reduce import pandas as pd import requests import xlrd import xlwt from flask import request from sqlalchemy import and_ from xlutils.copy import copy from app import app from app.Controllers.BaseController import BaseController from app.Models import Gzp, WTM...
import os import time import locale import datetime import calendar import pandas as pd import numpy as np from scipy import stats import statsmodels.api as sm import scipy.stats as scs import statsmodels.tsa.api as smt import matplotlib import matplotlib.pyplot as plt import src.math_utils as math_utils # Use dots ...
from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch.optim as optim import numpy as np import matplotlib.pyplot as plt import pickle as pkl from copy import deepcopy class LSTM(nn.Module): """ input_size: Data...
# Copyright Amazon.com, Inc. or its affiliates. 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 app...
# from https://github.com/amdegroot/ssd.pytorch import torch from torchvision import transforms import cv2 import numpy as np import types from numpy import random from Archs_2D.BBox import BBoxes def intersect(box_a, box_b): max_xy = np.minimum(box_a[:, 2:], box_b[2:]) min_xy = np.maximum(box_a[:, :2], box...
import argparse import os import os.path as osp import torch.nn.functional as F import numpy as np import torch import torch.nn as nn import torch.optim as optim import network import loss from torch.utils.data import DataLoader import lr_schedule import data_list from data_list import ImageList, split_train_test from...
import copy import numpy as np from flatland.envs.agent_utils import RailAgentStatus from collections import defaultdict from itertools import groupby def optimize_old_graph(observation_builder, observations): """ :return: List of observations containing resulting graph after each optimization step """ ...
from pathlib import Path from typing import Any import wandb import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchtext from tqdm import tqdm import random import sys sys.path.append('/home/ubuntu/gcm') from seq2seq.dataset import SourceField, TargetField from re...
# Copyright 2017-2019 typed_python Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
import os import math import json import ctypes import renpy import pygame import euclid import skin import geometry import utils LINE_WIDTH = 2 PIVOT_SIZE = 4 PICK_DISTANCE_PIVOT = PIVOT_SIZE * 2 PICK_DISTANCE_CROP = 5 PIVOT_COLOR = (200, 0, 0) MESH_COLOR = (128, 255, 255) ACTIVE_COLOR = (0, 255, 0) HOVER_COLOR = ...
''' Copyright 2017 The Regents of the University of Colorado 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 appl...
# gemato: Verification tests # vim:fileencoding=utf-8 # (c) 2017-2020 <NAME> # Licensed under the terms of 2-clause BSD license import itertools import os import os.path import socket import stat import pytest from gemato.exceptions import ( ManifestInvalidPath, ManifestCrossDevice, ) from gemato.hash im...
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import datetime as dt from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import csv import os.path from download import download import tensorflow as tf import tensorflow_probability as tfp from tensorflow_probability import dist...
import numpy as np from tqdm import tqdm import scipy.io as sio import os import pkg_resources import hickle # cosmology assumption from astropy.cosmology import FlatLambdaCDM cosmo = FlatLambdaCDM(H0=70, Om0=0.3) from .priors import * from .gp_sfh import * try: import fsps mocksp = fsps.StellarPopulation(co...
#!/usr/bin/env python3 """Command line utility for determining what jstests have been added or modified.""" import copy import logging import os.path import shlex import subprocess import sys from abc import ABC, abstractmethod from collections import defaultdict from typing import Optional, Set, Tuple, List, Dict, Nam...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehumancommunity.org/ **Github Code Home Page:** https://github.com/makehumancommunity/ **Authors:** <NAME> **Copyright(c):** MakeHuman Team 2001-2019 **Licensing:** AG...
""" Module implementing an interface with Sentinel Hub Batch service """ import logging import time import datetime as dt from collections import defaultdict from dataclasses import field, dataclass from enum import Enum from typing import Optional from dataclasses_json import config as dataclass_config from dataclass...
"""server_main module. This module contains classes, containing server code. Classes and their functions: * GameServer - main loop, listening socket event handler, synchronization event handlers. * Resources - information about game resource pack. * ResourceServer - HTTP server, used for resources d...
# # -*- coding: utf-8 -*- # Wireshark tests # By <NAME> <<EMAIL>> # # Ported from a set of Bash scripts which were copyright 2005 <NAME> # # SPDX-License-Identifier: GPL-2.0-or-later # '''Capture tests''' import fixtures import glob import hashlib import os import socket import subprocess import subprocesstest import ...
#!/usr/bin/env python # coding: utf-8 # # Supervised sentiment: hand-built feature functions # In[1]: __author__ = "<NAME>" __version__ = "CS224u, Stanford, Spring 2020" # ## Contents # # 1. [Overview](#Overview) # 1. [Set-up](#Set-up) # 1. [Feature functions](#Feature-functions) # 1. [Building datasets for expe...
""" Functions for wrapping native libraries we call from Python (e.g., DL backends like TensorFlow, simulators like pybullet). We transparently intercept Python :math:`\leftrightarrow` C calls/returns so that we can start/end timestamps of when we are in Python, and when we are in a C library. """ from rlscope.profile...
""" .. module:: taxi_world :synopsis: Simulates the taxi world environment based on actions passed in. """ from enum import Enum import math from itertools import count from collections import defaultdict import argparse import numpy as np from domains.gym_craft.utils.representations import env_to_json from domain...
#!/usr/bin/env python # coding: utf-8 # # NewEgg.Com WebCrawler & Scraper Program For Laptops - Beta v1.0 # # ### - April 29th, 2020 # # #### By: <NAME> # # --- # In[1]: # Import dependencies import os import re import glob import time import random import requests import datetime import pandas as pd from re ...
#============================================================================= # Project: SoPHI # File: phi_gen.py # Author: <NAME> (<EMAIL>) # Contributors: #----------------------------------------------------------------------------- # Description: #-------------------------------------------------------------...
#!/usr/bin/env python from __future__ import print_function import math import numpy import random import matplotlib matplotlib.use("PDF") prng = numpy.random.RandomState() fig_size = [11.7,8.3] # din A4 params = {'backend': 'pdf', 'axes.labelsize': 10, 'text.fontsize': 10, 'legend.fontsiz...
# Natural Language Toolkit: Chat-80 KB Reader # See http://www.w3.org/TR/swbp-skos-core-guide/ # # Copyright (C) 2001-2021 NLTK Project # Author: <NAME> <<EMAIL>>, # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT r""" Overview ======== Chat-80 was a natural language system which allowed...
from itertools import product import numpy as np from numpy import ma import pandas as pd import pytest from scipy import sparse as sp from scipy.sparse import csr_matrix, issparse from anndata import AnnData from anndata.tests.helpers import assert_equal, gen_adata # some test objects that we use below adata_dense...
#------------------------------------------------------------------------- # ipgen.py # # IPgen: IP-core package generator for AXI4/Avalon # # Copyright (C) 2013, <NAME>-Yamazaki # License: Apache 2.0 #------------------------------------------------------------------------- from __future__ import absolute_import from...
import math import torch import neural_renderer as nr from .utils import * EPS = 1e-7 def get_rotation_matrix(rxyz): rx, ry, rz = rxyz.unbind(1) m_x, m_y, m_z = torch.zeros(3, len(rxyz), 3, 3).to(rxyz.device).unbind(0) m_x[:, 1, 1], m_x[:, 1, 2] = rx.cos(), -rx.sin() m_x[:, 2, 1], m_x[:, 2, 2] = rx....
# # Class QCOpMat for operator matrices. # """ A class for individual operator matrices from/to a matrix-element file. Module qcmatrixio provides low-level I/O routines for the file. Class ----- OpMat -- one operator matrix from/to a matrix element file. Properties ---------- name -- name string (label used in ...
# You need an image testsuite to run this, for information see: # kivy/tools/image-testsuite/README.md import os import re import sys import unittest from collections import defaultdict from kivy.core.image import ImageLoader DEBUG = False ASSETDIR = 'image-testsuite' LOADERS = {x.__name__: x for x in ImageLoader.loa...
# Parses derivatives.yaml into autograd functions # # Each autograd function is represented by `DifferentiabilityInfo` containing # a list of `Derivative`. See `tools.codegen.api.autograd` for the data models. from collections import defaultdict import re from typing import Counter, Sequence, Any, Tuple, List, Set, Dic...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
# Copyright (c) Facebook, Inc. and its affiliates. import random from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np import torch from mmf.common.registry import registry from mmf.common.sample import Sample, SampleList from mmf.datasets.processors.processors import BaseProcessor from transf...
# # Copyright (c) SAS Institute Inc. # SPDX-License-Identifier: Apache-2.0 # this has been significantly modified from the original# # # Visit https://aboutcode.org and https://github.com/nexB/univers for support and download. import unittest from univers.maven import Version from univers.maven import VersionRange f...
""" python3 classification_meta_learning.py --datasource=omniglot-py --base-model=CNN --batchnorm=True --ds-folder=../datasets --minibatch=50 --num-epochs=1 --num-episodes-per-epoch=100000 --resume-epoch=0 --mode=protonet """ import torch import torchvision from torch.utils.tensorboard import SummaryWriter import highe...
# File is generated by: tox -e codemod # -*- coding: utf-8 -*- """ wandb.init() indicates the beginning of a new run. In an ML training pipeline, you could add wandb.init() to the beginning of your training script as well as your evaluation script, and each piece steps would be tracked as a run in W&B. """ from __futu...
""" Copyright (c) 2020 The Orbit Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. """ import logging import random import time from fnmatch import fnmatch from typing import Tuple, List, Iterable from core.common_controls import Track, Ta...
# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. # 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/LI...
""" .. py:class:: Buffer Low-level untyped memory allocation. Actual class depends on the API: ``pycuda.driver.DeviceAllocation`` for ``CUDA`` and ``pyopencl.Buffer`` for ``OpenCL``. .. py:attribute:: size .. py:class:: Array A superclass of the corresponding API's native array (``pycuda.gpu...
from __future__ import print_function # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import os import os.path as op import warnings from nose.tools import assert_true, assert_raises, assert_equal from copy import deepcopy import numpy as np from numpy.testing import (assert_array_a...
""" Plotting tools for the simulation framework Styling tools: * :py:class:`set_plot_style`: Plot style context manager * :py:class:`colorwheel`: Custom color palettes Plotting Functions: * :py:func:`plot_3d_sphere_cloud`: Plot a sphere cloud in 3D Axis element functions: * :py:func:`add_lineplot`: Add lineplots ...
# ----------------------------------------------------------------------------- """ Cortex-M Registers The SVD files typically don't contain the core system peripherals defined for the Cortex-M CPUs. Some vendors will define system peripherals with SoC variablility (E.g. NVIC), but in general a device structure deriv...
# Copyright 2018 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
"""Custom implementations of builtin types.""" from pytype import abstract from pytype import abstract_utils from pytype import class_mixin from pytype import function from pytype import mixin class TypeNew(abstract.PyTDFunction): """Implements type.__new__.""" def call(self, node, func, args): if len(args....
import numpy as np import matplotlib.pyplot as plt import pickle from pathlib import Path import torch from google.protobuf import text_format from second.utils import simplevis from second.pytorch.train import build_network from second.protos import pipeline_pb2 from second.utils import config_tool import time import ...
#!/usr/bin/env python # # separate module for lifting, two main exports: # gen_flag_il() # gen_instr_il() # Binja includes from binaryninja.log import log_info from binaryninja.architecture import Architecture from binaryninja.enums import LowLevelILOperation, LowLevelILFlagCondition from binaryninja.function import R...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Project: Azimuthal integration # https://github.com/silx-kit/pyFAI # # Copyright (C) 2015-2022 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: <NAME> (<EMAIL>) # # Permission is hereby granted, free of charge, t...
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function __metaclass__ = type # Copyright: (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = """ module: nxos_logging author:...
""" This module implements an inversion of control framework. It allows dependencies among functions and classes to be declared with decorators and the resulting dependency graphs to be executed. A decorator used to declare dependencies is called a :class:`ComponentType`, a decorated function or class is called a comp...
# Copyright (C) 2003-2007 <NAME> <<EMAIL>> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any l...
# -*- coding: utf-8 -*- from __future__ import print_function from twisted.internet.defer import Deferred from twisted.internet.protocol import ClientFactory, ServerFactory from twisted.internet import reactor from twisted.protocols.basic import LineReceiver from Screens.InfoBar import InfoBar from enigma import eEPGC...
# -*- coding: utf-8 -*- from app.const import * from app.base.logger import log from app.base.db import get_db, SQL from app.model import syslog from app.model import policy from app.base.utils import AttrDict, tp_timestamp_sec def get_by_id(pid): s = SQL(get_db()) s.select_from('audit_policy', [...
import os import re from datetime import datetime, date from glob import glob from json.decoder import JSONDecodeError from yaml.parser import ParserError, ScannerError from typing import Dict, List, Set, Any, Optional, Union from door43_tools.td_language import TdLanguage from door43_tools.bible_books import BOOK_NAM...
""" Loaders and downloaders for data files and models required for the examples in NLP in Action >>> df = get_data('cities_us') >>> df.iloc[:3,:2] geonameid city 131484 4295856 Indian Hills Cherokee Section 137549 5322551 Agoura 134468 4641562 ...
u"""Neural Causation Coefficient. Author : <NAME> Ref : <NAME>. and <NAME>. and <NAME>. and <NAME>. and <NAME>., "Discovering Causal Signals in Images", CVPR 2017. .. MIT License .. .. Copyright (c) 2018 <NAME> .. .. Permission is hereby granted, free of charge, to any person obtaining a copy .. of this software...
# Copyright Contributors to the Rez project # # 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 ...
#!/usr/bin/env python3 """readme_exampleServer.py - starts a server (if not already running) for the compilation of readme_example Author: <NAME> <<EMAIL>> Copyright 2019 Bavarian Academy of Sciences and Humanities Licensed under the Apache License, Version 2.0 (the "License"); you may not use t...
# encoding: UTF-8 ''' vn.okcoin的gateway接入 注意: 1. 前仅支持USD和CNY的现货交易,USD的期货合约交易暂不支持 ''' import os import json from datetime import datetime from time import sleep from copy import copy from threading import Condition from Queue import Queue from threading import Thread from time import sleep from vnpy.api.okcoin impo...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np import os import sys import time import shutil import datetime import pytz from tf_libs.tf_logging import LOG from tf_libs.save_result import generate_result_folde...
"""Functions for web operations (e. g. working with URLs and retrieving data from websites).""" from typing import Iterable, Union, Tuple, Callable from urllib.parse import urljoin from urllib.robotparser import RobotFileParser import logging import re import requests import tld import tld.exceptions import aiohttp f...
# -*- coding: utf-8 -*- # file: apc_trainer.py # time: 2021/4/22 0022 # author: yangheng <<EMAIL>> # github: https://github.com/yangheng95 # Copyright (C) 2021. All Rights Reserved. import os import pickle import random import shutil import time import numpy import torch import torch.nn as nn from findfile import fin...
"""Contains functions to parse and preprocess information from the input file""" import sys import os import h5py import logging import multiprocessing as mp import numpy as np import pandas as pd import pickle import signal as sig from .io_ import decodeUTF8 from .namedtuples import CountInfo from .namedtuples import...
from collections import deque from time import perf_counter_ns from typing import * from sys import exit import tkinter from tkinter import filedialog import os from classes import Node import pickle import csv def reduce_nodes(all_nodes): if isinstance(all_nodes, list): print("Converting gr...
import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from .embed_regularize import embedded_dropout from .locked_dropout import LockedDropout from .model_trans import Transformer import sys class MatrixReconstruction(nn.Module): def __init__(self, bat...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jun 22 16:06:27 2020 @author: glatt """ import random import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import networkx as nx #COSTANTS max_E=200 #Max value for interactions matrix l=8 #Average preys...
import binascii from math import ceil, sqrt, floor from skimage.measure import compare_psnr import numpy as np import cv2 import os import math from scipy.optimize import curve_fit IMG_EXTENSIONS = ['.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP', '.bin', '.tiff' ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import re import time import traceback import logging import six import copy import hashlib from checkmate.helpers.issue import group_issues_by_fingerprint from checkmate.management.helpers import (filter_filenames_by_analyzers, ...
# pylint: disable=redefined-builtin from yaaredis.exceptions import RedisError, DataError from yaaredis.utils import b, dict_merge, first_key, int_or_none, string_keys_to_dict, list_or_args, float_or_none # todo need functions and check callbacs VALID_ZADD_OPTIONS = {'NX', 'XX', 'CH', 'INCR'} def zset_score_pairs...
''' The protocol class is responsible for managing an MSIMApi object and converting requests dealing with buddies, conversations, groups, etc into strings, ints, etc for the API object to send. It also binds to the API's events and provides feedback to Digsby when information is delivered from the server. ''' NETW...
# -*- coding: utf-8 -*- import math import numpy as np import tensorflow as tf from vkge.training import constraints, index from vkge.training import util as util import logging import tensorflow_probability as tfp tfd = tfp.distributions logger = logging.getLogger(__name__) class LIM: """ Latent Inf...
import numpy as np import numpy_indexed as npi from itertools import tee, combinations from dcptree.data import remove_intercept from dcptree.rule_naming import * def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..." a, b = tee(iterable) next(b, None) return zip(a, b) DEFAULTS_BOOLEAN = { ...
"""Module containing multiple classes to interact with openmediavault based on StaticCube https://github.com/StaticCube/python-synology""" # -*- coding:utf-8 -*- import requests import urllib3 class FormatHelper(object): """Class containing various formatting functions""" @staticmethod def bytes...
# Taken from https://github.com/CompVis/taming-transformers # pytorch_diffusion + derived encoder decoder import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from fast_pytorch_kmeans import KMeans from torch import einsum import torch.distributed as dist from einops import ...
# -*- coding: utf8 -*- # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge...
from __future__ import annotations from enum import Enum import os import re import pycountry import shlex import sys import webbrowser from typing import Callable, TYPE_CHECKING, List, Union, cast, Optional from PySide2.QtCore import * # type: ignore from PySide2.QtGui import * # type: ignore from PySide2.QtWidge...
import torch import torch.nn as nn import torch.nn.functional as F from torch import distributions as dist from layers import (CResnetBlockConv1d, CBatchNorm1d, CBatchNorm1d_legacy) import resnet import numpy as np class VoxelDecoder64(nn.Module): ''' Voxel64 Decoder with batch normalization (BN) class. Ar...
# -*- coding: utf-8 -*- """Handling of bv_maker configuration (bv_maker.cfg).""" from __future__ import absolute_import, division from __future__ import print_function, unicode_literals import glob from optparse import OptionParser import os import shlex from socket import gethostname # for use in eval()'d expressi...
# import setGPU import torch from model import Graph_GAN import utils, save_outputs, evaluation, augment from jets_dataset import JetsDataset from torch.utils.data import DataLoader from torch.distributions.normal import Normal import torch.optim as optim from tqdm import tqdm from os import listdir, mkdir from os.p...
""" Testing for Multi-layer Perceptron module (sklearn.neural_network) """ # Author: <NAME> # Licence: BSD 3 clause import sys import warnings import numpy as np from numpy.testing import assert_almost_equal, assert_array_equal from sklearn.datasets import load_digits, load_boston from sklearn.datasets import make...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import hashlib from base64 import b64encode from unittest.mock import MagicMock import pytest from authli...
# coding=utf-8 # Copyright (c) Microsoft. All rights reserved. import argparse import json import os import random from datetime import datetime from pprint import pprint import numpy as np import torch from torch.utils.data import Dataset, DataLoader, BatchSampler from pretrained_models import * from tensorboardX impo...
import configparser import logging import os import re from markupsafe import escape from sqlalchemy import false from sqlalchemy.sql import select import tool_shed.dependencies.repository from galaxy import util from galaxy import web from galaxy.tool_shed.util.repository_util import ( check_for_updates, che...
"""dim_reducer.py nodes and widgets for reducing data dimensionality. """ from typing import Dict, Any, Tuple, Type, Optional, List, Union, cast from enum import Enum, unique from typing_extensions import TypedDict import numpy as np from .node import Node, updateOption, NodeWidget from ..data.datadict import Meshgr...
# Copyright 2016 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...
#!/usr/bin/env python """Earth Engine helper functions for working with the Cloud API. Many of the functions defined here are for mapping legacy calls in ee.data into their new Cloud API equivalents. This generally requires remapping call parameters and result values. """ from __future__ import absolute_import from _...
from random import shuffle import numpy as np import torch import torch.nn as nn import math import torch.nn.functional as F from matplotlib.colors import rgb_to_hsv, hsv_to_rgb from PIL import Image from utils.utils import bbox_iou, merge_bboxes def clip_by_tensor(t,t_min,t_max): t=t.float() result = (t ...
# Copyright 2020 The TensorFlow Probability Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
""" FBNet model builder """ from __future__ import absolute_import, division, print_function, unicode_literals import copy import logging import math from collections import OrderedDict import torch import torch.nn as nn from mydl.layers import ( BatchNorm2d, Conv2d, FrozenBatchNorm2d, interpolate, )...
# 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 u...
import numpy as np import pandas as pd import random import sys from sklearn import model_selection import tensorflow as tf from utils import * import tensorflow_constrained_optimization as tfco import pdb import pickle from sklearn.metrics import roc_auc_score from collections import OrderedDict import itertools impor...
#!/usr/bin/env python ####################### import sys, unittest, inspect, tempfile, os import astropy, astropy.io.fits as pyfits import astropy.wcs as pywcs import numpy as np import regionfile as rf ######################### __cvs_id__ = "$Id: wcsregionfile.py,v 1.7 2009-12-15 02:42:58 dapple Exp $" ###########...
# # Copyright (c) 2017-2019 TBD. All rights reserved. # This file is part of TBD (see TBD). # See the LICENSE file for licensing terms (TBD). # import sys import numpy as np import torch from torch import Tensor from torch import autograd, nn from torch.nn import functional as F import warnings from typing import Call...
from io import StringIO import random import re import time import urllib from zlib import compress from discord.ext import commands, menus import discord import lxml.html import orjson from cogs.utils.calculation import safe_eval, hex_float, oct_float, bin_float CODE_REGEX = re.compile( r"(?:(?...
import numpy as np from collections import deque, defaultdict try: # `pip install pillow` # optional: used for textured meshes import PIL.Image as Image except BaseException as E: # if someone tries to use Image re-raise # the import error so they can debug easily from ..exceptions import Excep...
""" Gateway for Binance Crypto Exchange. """ import urllib import hashlib import hmac import time from copy import copy from datetime import datetime, timedelta from enum import Enum from threading import Lock from vnpy.api.rest import RestClient, Request from vnpy.api.websocket import WebsocketClient from vnpy.trade...
# 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 u...