text
stringlengths
8.04k
46.5k
""" CUDA Python version of subgraphs.py to support parallel computations via an Nvidia GPU. Functions (Pure Python): create_subgraphs_array, find_subgraphs """ from time import time from math import factorial from collections import Counter from numpy import array, zeros, int64 int64_py = int64 zeros_py = zero...
"""Create a Client connection to a Visonic PowerMax or PowerMaster Alarm System.""" #! /usr/bin/python3 # set the parent directory on the import path import os,sys,inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,pa...
import itertools from collections import defaultdict from functools import partial from math import ceil from multiprocessing import Pool from os import cpu_count import numpy as np from numba import njit from pandas import DataFrame def __set_matrix(x, phases=None, subset_genes=None, subset_samples=None, rm_zeros=T...
##################################################### Import system libraries ###################################################### import matplotlib as mpl mpl.rcdefaults() mpl.rcParams.update(mpl.rc_params_from_file('meine-matplotlibrc')) import matplotlib.pyplot as plt import numpy as np import scipy.constants as c...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Aug 22 17:00:38 2020 @author: thales """ """production rules for Colada""" import copy import msg import word_lists import lib import lexer import parser_combinator as c from parser_combinator import (Parse, ParseError, ...
import os from enum import Enum from typing import Any, Dict, Tuple, List, Union from pathlib import Path from glob import glob import numpy as np import SimpleITK as sitk from .augment import DataAugmentation from .preprocess import Preprocess, Registration, RegionOfInterest class FileType(Enum): sa_ed = 'S...
# Lint as: python2, python3 # Copyright 2020 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law ...
import random import re import math import numpy as np from src import constants from src.multi_agent.elements.camera import Camera, CameraRepresentation from src.my_utils import constant_class from src.my_utils.my_math.bound import bound_angle_btw_minus_pi_plus_pi, bound from src.my_utils.my_math.line import distance...
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # 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, merg...
""" With molecular inversion probes, we map reads to the genome that include the ligation and extension arms, along with a molecular tag (AKA UMI). This script takes: 1) ref.fasta 2) mips design file (likely from MIPgen) 3) de-multiplxed, paired-end fastqs and moves the UMI into the read-name, aligns the r...
import bibtexparser as bp import Levenshtein as le import fuzzy as fz import numpy import scipy.misc as ch from sklearn import linear_model from sklearn.cross_validation import train_test_split # from scipy import misc as ch # import gmpy2 as ch import re, csv, os, threading, logging, sys from datetime import * fr...
###modified based on centernet### #MIT License #Copyright (c) 2019 <NAME> #All rights reserved. from __future__ import absolute_import from __future__ import division from __future__ import print_function import time import datetime import pycocotools.coco as coco from pycocotools.cocoeval import COCOeval import nump...
#!/usr/bin/env python3 import hashlib import os import os.path import random import threading import time import wave import pyaudio import lib.STT as STT import lib.TTS as TTS import lib.sr_wrapper as sr import logger import utils from languages import F from lib.audio_utils import StreamRecognition, StreamDetector...
import configparser import numpy import sys import time import random import math import os from copy import deepcopy import json from numpy.linalg import norm from numpy import dot import numpy as np import codecs from scipy.stats import spearmanr import tensorflow as tf import torch import torch.nn as nn from torch....
#!/usr/bin/env python3 import argparse import random import json import logging import pandas as pd from scipy import stats import spacy import time from tqdm import tqdm, trange import torch import torch.nn.functional as F import numpy as np import os from pytorch_pretrained_bert import GPT2LMHeadModel, GPT2Tokeniz...
import sys import os import time import random import keyboard from console.screen import sc from rich.console import Console mythical_creature_list = None male_name_list = None both_sex_name_list = None name_of_queen = None weapon_type_list = None your_weapon_type = None name_of_trainer = None ...
# Copyright (c) 2017–2018 crocoite contributors # # 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 absolute_import from __future__ import unicode_literals import json import os import uuid import re import logging import yaml from collections import OrderedDict, namedtuple from copy import deepcopy from io import open from couchdbkit import ResourceNotFound from couchdbkit.exceptions import...
import random import torch import torch.optim as optim from parlai.agents.dialog_evaluator.auto_evaluator import ( TorchGeneratorWithDialogEvalAgent, CorpusSavedDictionaryAgent ) from parlai.core.metrics import AverageMetric from parlai.core.torch_agent import History from parlai.core.torch_generator_agent im...
# -*- coding: utf-8 -*- # Copyright © 2012-2013 <NAME> and others. # 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, c...
# -*- coding: utf-8 -*- # Copyright 2010 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
""" MS COCO object detection dataset. """ import os import cv2 import logging import mxnet as mx import numpy as np from PIL import Image import torch.utils.data as data from .dataset_metainfo import DatasetMetaInfo __all__ = ['CocoDetMetaInfo'] class CocoDetDataset(data.Dataset): """ MS COCO detection datas...
# # Copyright (c) 2018 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
import cv2 import numpy as np from numpy.linalg import norm import sys import os import json SZ = 20 #训练图片长宽 MAX_WIDTH = 1000 #原始图片最大宽度 Min_Area = 2000 #车牌区域允许最大面积 PROVINCE_START = 1000 #读取图片文件 def imreadex(filename): return cv2.imdecode(np.fromfile(filename, dtype=np.uint8), cv2.IMREAD_COLOR) def point_l...
import logging import numpy as np from ctapipe.calib.camera import CameraCalibrator from ctapipe.io import ( EventSource, read_table, ) from numba import njit from scipy.interpolate import interp1d from traitlets.config import Config from lstchain.io import standard_config from lstchain.io.config import read...
"""Amazon S3 Text Write Module (PRIVATE).""" import csv import logging import uuid from distutils.version import LooseVersion from typing import Any, Dict, List, Optional, Tuple, Union import boto3 import pandas as pd from pandas.io.common import infer_compression from awswrangler import _data_types, _utils, catalog...
# labplus mPython library # MIT license; Copyright (c) 2018 labplus # V1.0 <NAME>(<EMAIL>) # mpython buildin periphers drivers # history: # V1.1 add oled draw function,add buzz.freq(). by tangliufeng # V1.2 add servo/ui class,by tangliufeng from machine import I2C, PWM, Pin, ADC, TouchPad, UART from ssd1106 import...
#!/usr/bin/python # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright 2020 Efabless 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...
#!/usr/bin/env python3 # Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """Definitions of model layers/NN modules""" import ipdb import torch import torch.nn as nn import os from tor...
"""Module for Testing the InVEST Wave Energy module.""" import unittest import tempfile import shutil import os import re import numpy import numpy.testing from osgeo import gdal from osgeo import osr, ogr from shapely.geometry import Polygon from shapely.geometry import Point import pygeoprocessing.tes...
# Copyright 2018 Google 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 in writing, ...
""" opentrons.system.nmcli: Functions and data for interacting with nmcli The functions contained here are for bridging Python calls with nmcli command line invocations. They are in general not safe to call anywhere except an Opentrons robot; on systems that do not have network-manager (like OSX, Windows and some Linu...
#!/usr/bin/python # # Copyright (c) 2016 <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', 'status': ...
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
# -*- coding: utf-8 -*- from __future__ import print_function import pytest import random import numpy as np import pandas as pd from pandas.compat import lrange from pandas.api.types import CategoricalDtype from pandas import (DataFrame, Series, MultiIndex, Timestamp, date_range, NaT, IntervalIn...
#copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable l...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 """ Miscellaneous functions go here """ from __future__ import annotations from meerschaum.utils.typing import ( Union, Mapping, Any, Callable, Optional, List, Dict, SuccessTuple, Iterable, PipesDict ) def add_method_to_class( func : Callable...
#!/usr/bin/env python3 # Copyright (c) 2021 The Ttm Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import time from test_framework.messages import msg_qgetdata, msg_qwatch from test_framework.mininode import ( ...
from __future__ import print_function from unittest import TestCase import numpy as np from nose import SkipTest from numpy.testing import assert_array_equal, assert_array_almost_equal from sklearn.datasets.samples_generator import make_spd_matrix from sklearn.mixture import GMM from sklearn.utils import check_random...
#/* # * Copyright (c) 2019,2020 Xilinx Inc. All rights reserved. # * # * Author: # * <NAME> <<EMAIL>> # * # * SPDX-License-Identifier: BSD-3-Clause # */ import copy import struct import sys import types import unittest import os import getopt import re import subprocess import shutil from pathlib import Path fro...
from functools import reduce, partial from operator import __rshift__ from typing import Mapping, Any, Union, Tuple, List from hbutils.collection import nested_map from hbutils.design import SingletonMark from hbutils.string import truncate from .base import BaseUnit, _to_unit, UnitProcessProxy, raw from .build impor...
# Copyright (c) 2014 Scality # # 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 import os import shutil import unittest import tempfile import platform import getpass import tarfile from gppylib.db import dbconn from gppylib.gparray import GpArray from contextlib import closing from gppylib.commands import gp from gppylib.commands.unix import Scp from gppylib.commands.base...
# -*- coding: utf-8 -*- """ Created on Thu Aug 19 08:55:28 2021 Purpose of the script: The purpose of the script is to load informations from files created by both the Quality Control of Nergica and the lidar installed on Nergica's site. The informations is extracted for heights and the year selected a the top...
import datetime import json from aiohttp import request import random import inspect import os import dbl import aiohttp import io import asyncpraw import discord import DiscordUtils import httpx from discord.ext import commands from dotenv import load_dotenv from prsaw import RandomStuff from dotenv import load_dotenv...
""" Module for managing container and VM images .. versionadded:: 2014.7.0 """ import logging import os import pprint import shlex import uuid import salt.syspaths import salt.utils.kickstart import salt.utils.path import salt.utils.preseed import salt.utils.stringutils import salt.utils.validate.path import salt.ut...
# Copyright (c) 2016 Uber Technologies, 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 ...
#################################################################################################### # # # Script for the analysis of Free energy simulations using MBAR # # ...
"""Classes for representing properties of STIX Objects and Cyber Observables.""" import base64 import binascii import copy import inspect import re import uuid from .base import _STIXBase from .exceptions import ( CustomContentError, DictionaryKeyError, MissingPropertiesError, MutuallyExclusivePropertiesError...
from typing import Dict, List, Tuple, Union import torch import torch.nn as nn import torch.nn.functional as F from kornia.constants import pi from kornia.filters import GaussianBlur2d, SpatialGradient from kornia.geometry.conversions import cart2pol from kornia.utils import create_meshgrid # Precomputed coefficient...
import numpy as np import cv2 import glob import matplotlib.pyplot as plt import matplotlib.image as mpimg from queue import Queue from moviepy.editor import VideoFileClip # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*9,3), np.float32) objp[:,:2] = np.mgrid[0:9,0...
from ..utils import constants, utils import folium from folium.plugins import HeatMap import numpy as np import pandas as pd import matplotlib.pyplot as plt import shapely from geojson import LineString import geopandas as gpd import json import warnings STACKLEVEL = 2 # COLOR = { # 0: '#FF0000', # Red # 1: '...
import binascii import struct import os import gevent import ipaddress import time from gevent.lock import RLock from gevent.event import AsyncResult from gevent import socket import collections import traceback try: import color_logging import logging logger = logging except: import logging logger...
#!/usr/bin/env python import numpy as np import netCDF4 as nc import pandas as pd import multiprocessing import textwrap import matplotlib.pyplot as plt import lhsmdu import glob import json import os import ast import shutil import subprocess from contextlib import contextmanager import param_util as pu import outp...
# Copyright 2014 SAP AG or an SAP affiliate company. # # 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...
""" Contains useful graphic generators. Currently, effect measure plots and functional form assessment plots are implemented. Uses matplotlib to generate graphics. Future inclusions include forest plots Contents: Functional form assessment- func_form_plot() Forest plot/ effect measure plot- EffectMeasurePlot() ...
import collections import json import random import re from datetime import timedelta, datetime from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.cache import cache from django.db.models import Q from django.http import JsonResponse, FileResponse ...
from __future__ import annotations import pyqtgraph as pg from pyqtgraph import colormap as cmap from typing import Generic, Iterator, Sequence, TypeVar, overload, MutableSequence import numpy as np from ._utils import convert_color_code, to_rgba from .components import Legend, Region, ScaleBar, TextItem from .graph_i...
import sys import random import pygame from CardGame import * from Gui import * class Player(): def __init__(self): self.hand = [] self.pointsCards = [] self.permCards = [] self.jacks = {} # Dictionary with card keys that have list of jack cards attached to them self.sc...
#!/usr/bin/env python3 """pybuild -- build python3 from source (currently for macos) usage: pybuild.py [-h] [-v] {all,framework,shared,static} ... pybuild: builds python from src optional arguments: -h, --help show this help message and exit -v, --version show program's ver...
"""Tests for traitlets.config.configurable""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import logging from unittest import TestCase from pytest import mark from traitlets.config.application import Application from traitlets.config.configurable import ( ...
#!/usr/bin/python3 # Simple Python Fixed-Point Module (SPFPM) # (C)Copyright 2006-2018, <NAME> # This file is (C)Copyright 2006-2018, <NAME> # and is released under the Python-2.4.2 license # (see http://www.python.org/psf/license), # it therefore comes with NO WARRANTY, and NO CLAIMS OF FITNESS FOR ANY PURPOSE. # Ho...
#! /usr/bin/env python # -*- mode: python; coding: utf-8 -* # Copyright (c) 2019 <NAME>, <NAME> # Licensed under the 2-clause BSD License """Code for plotting EoR Limits.""" import glob import os import copy import yaml import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cmx import matplotlib.c...
# Copyright (c) 2015-present, Facebook, Inc. # All rights reserved. # Modified from # https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py # Copyright 2020 <NAME>, Apache-2.0 License from timm.models.layers import activations import torch import itertools import ut...
from __future__ import print_function import collections import math import os import pickle import sys import time import numpy import torch from sklearn.utils import compute_class_weight from torch.nn.utils import clip_grad_norm from torch.utils.data import DataLoader from nldrp.dnn.config import DNN_BASE_PATH from ...
import io import os import time import argparse import random import logging import warnings import multiprocessing import numpy as np import mxnet as mx from mxnet import gluon from mxnet.gluon import Block, nn from mxnet.gluon.data.sampler import Sampler, SequentialSampler import gluonnlp as nlp from gluonnlp.model i...
# Modified by Microsoft Corporation. # Licensed under the MIT license. import json import operator import os import pickle import subprocess import sys import time from collections import deque from contextlib import contextmanager from datetime import datetime from importlib import reload from pprint import pformat ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import discord import os from typing import Dict, List, Set, Tuple from cache import PssCache import emojis import pss_assert import pss_entity as entity import pss_core as core import pss_lookups as lookups import settings import utility as util # ---------- Constants ...
"""generator.py Created by <NAME>, <NAME>. Copyright (c) NREL. All rights reserved. Electromagnetic design based on conventional magnetic circuit laws Structural design based on McDonald's thesis """ import numpy as np import openmdao.api as om import wisdem.drivetrainse.generator_models as gm # -------------------...
"""This submodule defines the "vanilla" `MODNetModel`, i.e. a single model with deterministic weights and outputs. """ from typing import List, Tuple, Dict, Optional, Callable, Any from pathlib import Path import multiprocessing import pandas as pd import numpy as np from sklearn.preprocessing import StandardScaler,...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of https://github.com/zsquareplusc/python-msp430-tools # (C) 2002-2010 <NAME> <<EMAIL>> # # SPDX-License-Identifier: BSD-3-Clause # # JTAG programmer for the MSP430 embedded processor. # # Requires Python 2+ and the binary extension _parjtag or ctyp...
# Copyright 2018 Mycroft AI 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 in writin...
# Copyright 2019 NREL # 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, software distribu...
import re from .types import Module, ResultCode, UNKNOWN_MODULE, NO_RESULTS_FOUND """ This file contains all currently known Wii U result and error codes. There may be inaccuracies here; we'll do our best to correct them when we find out more about them. A result code is a 32-bit integer returned when calling variou...
import pylab as plt import matplotlib import numpy as np import pylab as plt import matplotlib from itertools import product import numpy as np import pandas as pd import os from sklearn.metrics.pairwise import pairwise_distances from matplotlib.ticker import ScalarFormatter, FuncFormatter matplotlib.style.use('bmh')...
# SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2021 Scipp contributors (https://github.com/scipp) # @file # @author <NAME> import numpy as np import pytest import scipp as sc def test_shape(): a = sc.Variable(value=1) d = sc.Dataset(data={'a': a}) assert d.shape == [] a = sc.Variable(['x'], ...
''' Sub encoder that is based on the Alphanum Encoder that is part of monay.py and the Optimised Subencoder that is part of Metasploit https://github.com/rapid7/metasploit-framework/blob/master//modules/encoders/x86/opt_sub.rb https://github.com/corelan/mona ''' import argparse import binascii import sys import os ...
from asyncio import ensure_future, Lock, sleep, get_event_loop from bisect import insort, bisect, bisect_left from collections import UserList from contextlib import suppress from multiprocessing import Process from os import rename, remove from os.path import getsize, isfile from pickle import load, UnpicklingError fr...
""" GenBank format (:mod:`skbio.io.format.genbank`) =============================================== .. currentmodule:: skbio.io.format.genbank GenBank format (GenBank Flat File Format) stores sequence and its annotation together. The start of the annotation section is marked by a line beginning with the word "LOCUS"....
# Check the following urls for more info about Pan-STARRS: # # https://outerspace.stsci.edu/display/PANSTARRS/PS1+Image+Cutout+Service#PS1ImageCutoutService-ImportantFITSimageformat,WCS,andflux-scalingnotes # https://outerspace.stsci.edu/display/PANSTARRS/PS1+Stack+images#PS1Stackimages-Photometriccalibration #...
# -*- coding: utf-8 -*- """ This Python module provides various service functions. Updated since version 1.1: 1. Added support for postprocess and visualization. 2. Added file path validation for parameters of all related methods. Updated since version 1.2: Merge Code and Update GUI 1. Integrate ...
#!/usr/bin/env python # # Author: <NAME> (mmckerns @caltech and @uqfoundation) # Copyright (c) 2008-2016 California Institute of Technology. # Copyright (c) 2016-2019 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/dill/blo...
""" Collects information from TekkenGameState over time in hopes of synthesizing it and presenting it in a more useful way. """ import time from enum import Enum import artificial_keyboard from MoveInfoEnums import AttackType from MoveInfoEnums import ComplexMoveStates from MoveInfoEnums import ThrowTechs from Tekke...
"""Utility functions for operating on geometry. See the :class:`Geometry3D` documentation for the core geometry class. .. versionadded:: 0.8.6 [functions moved here from :mod:`klampt.model.sensing`] Working with geometric primitives ================================= :func:`box` and :func:`sphere` are aliases for...
# Copyright 2022 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
#! /usr/bin/env python3 # Copyright(c) 2017-2018 Intel Corporation. # License: MIT See LICENSE file in root directory. GREEN = '\033[1;32m' RED = '\033[1;31m' NOCOLOR = '\033[0m' YELLOW = '\033[1;33m' try: from openvino.inference_engine import IENetwork, ExecutableNetwork, IECore import openvino.inference_en...
# BSD 3-Clause License # Copyright (c) 2019, regain authors # 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 notice, this # lis...
# -*- coding: utf-8 -*- """ This module provides a class :class:`Expr` to subclass from in order to describe expressions. The hope was that this class would allow straightforward interoperability between python packages handling symbolics (SymPy) and units (quantities) as well as working without either of those. The pr...
import torch import torch.nn as nn import torch.nn.functional as F from ...ops.roiaware_pool3d import roiaware_pool3d_utils from ...utils import common_utils, loss_utils # from emd import EMDLoss def guassian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): n_samples = int(source.size()[0])+...
''' Extensions to Numpy, including finding array elements and smoothing data. Highlights: - ``sc.findinds()``: find indices of an array matching a condition - ``sc.findnearest()``: find nearest matching value - ``sc.smooth()``: simple smoothing of 1D or 2D arrays - ``sc.smoothinterp()``: linear interpo...
#!/usr/bin/python # Copyright (c) 2018 Cohesity Inc # Apache License Version 2.0 from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os import shutil import time from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_bytes...
########################################################################## # # Copyright (c) 2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
""" the code is adapted from: https://github.com/ibab/tensorflow-wavenet/blob/master/wavenet/model.py (base model) https://github.com/twidddj/vqvae/blob/master/wavenet/model.py """ import numpy as np import tensorflow as tf from .ops import causal_conv, mu_law_encode from .mixture import discretized_mix_logistic_loss...
# Copyright 2014 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. # standard library modules, , , import os import logging from collections import OrderedDict # access, , get components, internal from yotta.lib import access from yotta.lib import access_common # pool, , s...
r"""undocumented 这个页面的代码很大程度上参考(复制粘贴)了https://github.com/huggingface/pytorch-pretrained-BERT的代码, 如果你发现该代码对你 有用,也请引用一下他们。 """ __all__ = [ "BertModel", ] import copy import json import math import os import torch from torch import nn import numpy as np from ...io.file_utils import _get_file_name_base_on_postf...
import scipy.stats as st from sklearn import metrics from sklearn.metrics import auc import matplotlib.pyplot as plt #import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import tensorflow_addons as tfa import math import sys import os.path as osp import numpy as np import PIL.Image import...
import operator import logging import numpy as np import pandas as pd from .coordinates import Coordinates from .visual import VisualAttributes from .visual import COLORS from .exceptions import IncompatibleAttribute from .component_link import (ComponentLink, CoordinateComponentLink, Bin...
"""The watcher file is a script meant to be run as an ongoing process to watch a given directory and analyzing files that may be moved there for certain keywords. Automatic processing will be started if the file contains the keywords.""" import collections import concurrent.futures import datetime import os from functo...
# get_nhif_price_package from __future__ import unicode_literals from codecs import ignore_errors from time import perf_counter import frappe from frappe import _ from hms_tz.nhif.api.token import get_claimsservice_token import json import requests from frappe.utils.background_jobs import enqueue from hms_tz.nhif.doct...