text
stringlengths
3.07k
22.1k
import os try: import pymake except: msg = "Error. Pymake package is not available.\n" msg += "Try installing using the following command:\n" msg += " pip install https://github.com/modflowpy/pymake/zipball/master" raise Exception(msg) try: import flopy except: msg = "Error. FloPy package ...
#!/usr/bin/env python3 # Copyright 2018 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 o...
from discord.ext import commands from discord.utils import get from utils.new_discord import new_guild, new_member from utils.get_member import get_member from utils.check import can_convert_to_int from random import randint from utils.files import FileJson import discord import asyncio import time class Salary(comman...
# Copyright (c) 2020, Xilinx # 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 # list of conditions and the follow...
import beluga import numpy as np from scipy.integrate import solve_ivp, simps import copy from liepack.flow import RKMK, Flow from liepack.domain.hspaces import HManifold from liepack.domain.liegroups import RN from liepack.domain.liealgebras import rn from liepack import exp from liepack.field import VectorField fro...
"""A simple data replication system. Note: an implementation backed by a database needs to ensure strict serialisability, or use some kind of consistent counter for the time stamps. If an object with a time_created before the last replication is added, then it won't be replicated in the next replication and will thus ...
import numpy as np import plotly.graph_objs as go import param from ...core.util import basestring from .plot import PlotlyPlot from ..plot import GenericElementPlot, GenericOverlayPlot from .. import util class ElementPlot(PlotlyPlot, GenericElementPlot): aspect = param.Parameter(default='cube', doc=""" ...
import sys FROZEN = getattr(sys, 'frozen', False) class Op: """ Namespace for instruction opcodes. """ # Misc NOP = 0x00 END = 0xFF # Data Manipulation MOV = 0xD0 LDC = 0xD1 LDM = 0xD2 STM = 0xD3 # Arithmetic INC = 0xA0 DEC = 0xA1 NEG = 0xA2 BCM ...
from AccessControl import ClassSecurityInfo from bika.lims import bikaMessageFactory as _ from bika.lims.utils import t from bika.lims.config import PROJECTNAME from bika.lims.content.bikaschema import BikaFolderSchema from bika.lims.interfaces import IBatch, IClient from bika.lims.workflow import skip, BatchState, Sta...
#!/usr/bin/env python # -*- coding:utf-8 -*- # Created Date: 2020-04-16 15:45:59 # Author: <NAME> # Contact: <EMAIL> # ----- # MIT License # Copyright (c) 2020 <NAME> import requests import inspect import types import ast import importlib import os.path import logging import hashlib import signal import traceback fro...
# 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 agreed to in writing, softw...
# deepatt.py # author: Playinf # email: <EMAIL> import ops import copy import tensorflow as tf from ops.layers import layer_norm, linear from ops.attention import multihead_attention def deepatt_default_params(): params = tf.contrib.training.HParams( feature_size=128, hidden_size=256, fi...
#!/usr/bin/env python # Filename: sar_grd_files_gee.py """ introduction: download SAR GRD files from Google Earth Engine authors: <NAME> email:<EMAIL> add time: 29 May, 2021 """ import sys,os from optparse import OptionParser import time from datetime import datetime from datetime import timedelta # path for Deepla...
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import importlib.resources from typing import ClassVar, Iterable, Sequence from pants.backend.python.target_types import ConsoleScript, EntryPoint, Mai...
# ORM objects import datetime import enum from sqlalchemy import Column, Integer, String, Boolean, Float, ForeignKey, DateTime, Enum, UniqueConstraint, \ ForeignKeyConstraint, JSON from sqlalchemy.dialects import postgresql from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation...
import sys import os import numpy as np import SimpleITK as sitk try: import exercise.helper as helper except ImportError: # Append the MIALab root directory to Python path sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), '..')) import exercise.helper as helper def load_image(img_path, ...
#coding=utf-8 import cv2 import sys import MRange from decimal import Decimal import numpy as np import os import time # 将480*360转为1280*720尺寸 def trans(corX, corY) : return corX * 8 / 3, corY * 2 def realdistance(ta, tb) : vector1 = np.array(ta) vector2 = np.array(tb) op = np.sqrt(np.sum(np.square(v...
# Copyright (c) 2021 PaddlePaddle 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 app...
# -*- coding: utf-8 -*- """ flask.json ~~~~~~~~~~ :copyright: 2010 Pallets :license: BSD-3-Clause """ import codecs import io import uuid from datetime import date from datetime import datetime from itsdangerous import json as _json from jinja2 import Markup from werkzeug.http import http_date from .._compat import ...
from __future__ import print_function #%matplotlib inline import argparse import os import random import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim as optim import torch.utils.data import torchvision.datasets as dset import torchvision.transforms as tran...
import socket import sys import json from config import Config import time from threading import Lock from typing import List import logging import re class LightningClient: def __init__(self, socket_file): self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: self.sock.co...
from collections import defaultdict from theano.gof.graph import list_of_nodes from theano.utils import cmp # {{{ http://code.activestate.com/recipes/578231/ (r1) # Copyright (c) <NAME> 2012 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentati...
from typing import Generator, NamedTuple, Optional, Union import gym import numpy as np import torch from genrl.environments.vec_env import VecEnv class RolloutBufferSamples(NamedTuple): observations: torch.Tensor actions: torch.Tensor old_values: torch.Tensor old_log_prob: torch.Tensor advantag...
# Host class # Copyright (c) 2016, Qualcomm Atheros, Inc. # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging import subprocess import threading import tempfile import os import traceback import select logger = logging.getLogger() def remote_compatib...
import pathlib import pytest from pyglottolog.languoids import (Languoid, Glottocodes, Glottocode, Country, Reference, ClassificationComment, EthnologueComment, Link) def test_legacy_imports(): from pyglottolog import objects assert objects.Glottocode is Glottocode assert objects.Reference is R...
import torch from torch import nn class Discriminator(nn.Module): def __init__(self, n_conv, n_feature_maps, equal_lr): super().__init__() self.conv_rgb = Conv(3, n_feature_maps[0], 1, equal_lr=equal_lr) self.blocks = nn.Sequential(*[DiscriminatorBlock(n_feature_maps[i], n, n_conv, equal_lr...
import os.path import numpy as np import itertools import Tools # Those patterns are used for tests and benchmarks. # For tests, there is the need to add tests for saturation def writeTests(config,format): NBSAMPLES=256 data1=np.random.randn(NBSAMPLES) data2=np.random.randn(NBSAMPLES) data3=np.rand...
import unittest from contextlib import contextmanager from typing import List from selenium.common.exceptions import WebDriverException from selenium.webdriver.remote.webdriver import WebDriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver.support.ui import WebDriverWait, Select ...
# coding=utf-8 """ Drawing a Snowman using scene_graph. """ import glfw from OpenGL.GL import * import numpy as np import sys import os.path sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import grafica.transformations as tr import grafica.basic_shapes as bs import grafica.scene_graph as...
import gzip import json import os import tempfile from enum import Enum from typing import Any, Callable, Iterable, Optional from warnings import warn import torch import torch.autograd.profiler as prof from torch.autograd import kineto_available, ProfilerActivity class ProfilerAction(Enum): """ Profiler act...
# coding: utf8 import os import sys sys.path.insert(0, './solopython') import threading from Controller import Controller import numpy as np import argparse from LoggerSensors import LoggerSensors from LoggerControl import LoggerControl SIMULATION = False LOGGING = False PLOTTING = False if SIMULATION: from ...
import gym from gym import error, spaces, utils from gym.utils import seeding import pybullet as p import pybullet_data import numpy as np import cv2 import os import inspect import time import pkg_resources currentdir = os.path.dirname(os.path.abspath( inspect.getfile(inspect.currentframe()))) parentdir = os.pa...
import time import numpy as np import torch.optim as optim from torch import nn from torch.utils.data import DataLoader from data_gen import VaeDataset from models import SegNet from utils import * from torchvision.datasets import ImageFolder from torchvision.transforms import transforms as T import argparse import ...
from collections import OrderedDict from aioredis.util import wait_convert, wait_make_dict, wait_ok def fields_to_dict(fields, type_=OrderedDict): """Convert a flat list of key/values into an OrderedDict""" fields_iterator = iter(fields) return type_(zip(fields_iterator, fields_iterator)) def parse_mes...
from typing import List, Optional, Tuple import torch import torch.nn as nn import torch.nn.functional as F from kornia.feature.laf import denormalize_laf, laf_is_inside_image, normalize_laf from kornia.feature.orientation import PassLAF from kornia.feature.responses import BlobHessian from kornia.geometry import Con...
from numpy.testing import assert_array_equal, assert_allclose, assert_raises import numpy as np from skimage.data import camera from skimage.util import random_noise, img_as_float def test_set_seed(): seed = 42 cam = camera() test = random_noise(cam, seed=seed) assert_array_equal(test, random_noise(c...
#!/usr/bin/env python2 """ Script to annotate MS2LDA documents using MAGMa Writes json to stdout, according to following schema: doc_annotations = [{ 'name': 'document name', # The MS file name 'scan': scanid, # The scanid in the magma DB, this can be ignored! 'mol': 'molb...
""" This module extracts syntactic features. """ import subprocess import os import re import nltk.tree from utils import file_utils from utils.lexicosyntactic import yngve def get_lu_complexity_features(lu_analyzer_path, transcript_filepath, transcript_filename, output_lu_parse_dir): ''' This function extracts...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module contains functions/values used repeatedly in different modules of the ``builtin_frames`` package. """ import warnings import erfa import numpy as np from astropy import units as u from astropy.time import Time fro...
# pylint: disable=C0111, too-many-statements, too-many-locals # pylint: too-many-arguments,too-many-instance-attributes,too-many-locals,redefined-outer-name,fixme # pylint: disable=superfluous-parens, no-member, invalid-name """ architecture file for deep speech 2 model """ import json import math import argparse impor...
# General structure from https://github.com/pytorch/examples/blob/master/mnist/main.py from __future__ import print_function import argparse import os import math import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.optim...
#python file import argparse import nltk from nltk import ne_chunk from nltk.corpus import stopwords from nltk.corpus import wordnet from nltk.tokenize import sent_tokenize,word_tokenize from nltk import flatten import os import re import ntpath import ssl import glob nltk.download('averaged_perceptron_tagger') nltk.d...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2019-07-24 18:29:48 # @Author : <NAME> (<EMAIL>) # @Link : http://iridescent.ink # @Version : $1.0$ import numpy as np from pyailib.utils.const import EPS from pyailib.base.arrayops import sl from pyailib.base.mathops import nextpow2, complex2real, real2co...
# Copyright 2019, The TensorFlow Federated 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...
# Copyright (c) 2009, Motorola, 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: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
# Copyright 2019 The AdaNet 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable la...
#!/usr/bin/env python3 """ Read the artifacts generated by a particular commit of the environments repo, parse out the various image tags, and update a yaml file with the appropriate values (probably bumpenvs.yaml). So if before running this script, the yaml file looked like this: some_image: old: a123 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import json try: # 3.8 and up from collections.abc import Iterable except ImportError: from collections import Iterable from util import check_if_numbers_are_consecutive import six import copy import re from math import isnan def _construct_key(p...
import numpy as np import matplotlib.image as mpimg import matplotlib.pyplot as plt import cv2 # Load our image binary_warped = mpimg.imread('warped_example.jpg') def find_lane_pixels(binary_warped): # Take a histogram of the bottom half of the image histogram = np.sum(binary_warped[binary_warped.sh...
# From https://github.com/MHG-LAB/RSSBOX/ import queue import sys import threading import requests from bs4 import BeautifulSoup import time import re import os import yaml import random def load_config(path): f = open(path, 'r', encoding='utf-8') ystr = f.read() ymllist = yaml.load(ystr, Loader=yaml.FullL...
from abc import ABC, abstractmethod import tensorflow as tf from tensorflow import keras, image from tensorflow.keras import Model, layers, activations as acts, losses, metrics from tensorflow.keras.layers import Layer import numpy as np from typing import Optional, Union import time class Patches(Layer): """Patch...
"""Utilities for probabilistic error control at voxel- and cluster-level in brain imaging: cluster-level thresholding, false discovery rate control, false discovery proportion in clusters. Author: <NAME>, 2015 -- 2019 """ import warnings import numpy as np from scipy.ndimage import label from scipy.stats import norm...
import traceback from flask_mail import Message from flask_principal import PermissionDenied from smtplib import SMTPRecipientsRefused from flamejam import app, db, mail, cache from flamejam.models import Jam, User, Team, Game, JamStatusCode from flamejam.utils import get_current_jam from flask import render_template...
"""Define the user-facing `run` object; this is where it all comes together.""" import dis import sys from inspect import currentframe from uuid import uuid4 from weakref import WeakKeyDictionary, WeakSet from dask import distributed from dask.distributed import get_worker from ._abra import cadabra from ._inspect im...
import logging import math import tempfile import threading import time import zipfile from datetime import datetime from pathlib import Path import shutil import boto3 import requests from tqdm import tqdm from ..api import API from ..common import annotation_status_str_to_int, upload_state_int_to_str from ..excepti...
from __future__ import absolute_import from __future__ import division from __future__ import print_function """Schedule functions for controlling hparams over time.""" from abc import ABCMeta from abc import abstractmethod import math from research.brain_coder.common import config_lib # brain coder class Schedul...
import atexit import json import logging import socket import time import traceback from threading import Timer import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry # Global Functions and Variables instances = [] # All running classes are stored in instance...
# Copyright 2017 The dm_control 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 or agreed to i...
''' Sample This script loads a pretrained net and a weightsfile and sample ''' import functools import math import numpy as np from tqdm import tqdm, trange import torch import torch.nn as nn from torch.nn import init import torch.optim as optim import torch.nn.functional as F from torch.nn import Parameter as P i...
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import sys import json import logging from itertools import count import vim from powerline.bindings.vim import vim_get_func, vim_getvar, get_vim_encoding, python_to_vim from powerline import Powerline...
""" This example attempts to uses VTK efficiently to: - create an model (unstructured grid) with multiple element types - create arrows (glyphs) to represent some vector quantity (e.g., forces) - TODO: makes use of masking to remove small forces Multiple challenges are addressed in this example: - how to add ...
import pytest import socket as stdlib_socket import errno import attr import trio from trio import ( open_tcp_listeners, serve_tcp, SocketListener, open_tcp_stream ) from trio.testing import open_stream_to_socket_listener from .. import socket as tsocket from .._core.tests.tutil import slow, creates_ipv6, binds_...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import os import random import logging import argparse import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from tqdm import tqdm import numpy as np from distutils.version import Loose...
# --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.6.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # Camera calibration & hand-eye coordination # ## Ho...
""" Copyright 2019 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 agreed to in writing, software di...
from pathlib import Path import re import panel as pn pn.extension() import lsst.daf.butler as dafButler config = None butler = None registry = None collections = [] config2 = None butler2 = None registry2 = None collections2 = [] pattern = re.compile(".*Plot.*") plot_paths = {} plot_paths2 = {} pn.extension() d...
# ------------------------------------------------------------------------------ # Copyright (c) Microsoft # Licensed under the MIT License. # Written by <NAME> (<EMAIL>) # ------------------------------------------------------------------------------ from __future__ import absolute_import from __future__ import divi...
"""The top-level Biip parser.""" from dataclasses import dataclass from typing import Callable, Iterable, List, Optional, Tuple from biip import ParseError from biip.gs1 import DEFAULT_SEPARATOR_CHARS, GS1Message, GS1Symbology from biip.gtin import Gtin, GtinFormat, RcnRegion from biip.sscc import Sscc from biip.symb...
# Copyright 2011 Piston Cloud Computing, 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 # # Unle...
# Copyright 2021 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 #<NAME> - feb 2022 #https://github.com/thomasfla/odri-spi-rpi #https://github.com/open-dynamic-robot-initiative/master-board/blob/master/documentation/BLMC_%C2%B5Driver_SPI_interface.md import struct import spidev import RPi.GPIO as GPIO import spidev from IPython import embed from math import p...
# Copyright 2017 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, ...
# Copyright (c) 2011-2020 <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, publish, distrib...
#import os import sys import miind.include as include import miind.algorithms as algorithms import miind.nodes as nodes import miind.connections as connections import miind.simulation as simulation import miind.variables as variables import xml.etree.ElementTree as ET import argparse import miind.directories as directo...
import hashlib import unicodedata import os from functools import reduce from collections import deque ###{standalone import sys, re import logging from io import open logger = logging.getLogger("lark") logger.addHandler(logging.StreamHandler()) # Set to highest level, since we have some warnings amongst the code # By...
# -*- coding: utf-8 -*- __all__ = ['RegNetX200MF', 'RegNetX400MF', 'RegNetX600MF', 'RegNetX800MF', 'RegNetX1_6GF', 'RegNetX3_2GF', 'RegNetX4_0GF', 'RegNetX6_4GF', 'RegNetX8_0GF', 'RegNetY200MF', 'RegNetY400MF', 'RegNetY600MF', 'RegNetY800MF', 'RegNetY1_6GF', 'RegNetY3_2GF', 'RegNetY4_0G...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import collections import logging from typing import List, Dict, Optional, OrderedDict, Tuple, Any import torch from torch.nn import Module from nni.common.graph_utils import TorchModuleGraph from nni.compression.pytorch.utils import get_module...
#!/usr/bin/env python3 # # (C) Copyright 2020 Hewlett Packard Enterprise Development LP. # Licensed under the Apache v2.0 license. # import re import os import sys import json import time import copy import argparse import tempfile import subprocess from threading import Thread threads = {} results = {} vmcmd_clon...
# encoding=utf8 # pylint: disable=mixed-indentation, line-too-long, singleton-comparison, multiple-statements, attribute-defined-outside-init, no-self-use, logging-not-lazy, unused-variable, arguments-differ, unused-argument, dangerous-default-value import logging from scipy.spatial.distance import euclidean from numpy...
# coding=utf-8 # Copyright 2021 TF-Transformers 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 r...
import pytest import random import string import numeric_types import os import inspect import re import math from decimal import Decimal, getcontext README_CONTENT_CHECK_FOR = [ '__init__', 'number_transformation', '__repr__', '__str__', '__add__', '__eq__', '__float__', '__ge__', ...
""" Tensorflow implementation of WV-DR algorithm wrapper class(sklearn style) :author: <NAME> (<EMAIL>), :refer: http://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf :refer: https://github.com/GradySimon/tensorflow-glove/blob/master/tf_glove.py """ from _...
""" This set of functions will link all hits together into a network. """ import dc_parse import dc_links_to_net import networkx as nx import matplotlib.pyplot as plt def make_bed_from_node_name(node_name): """ :param node_name: takes standard node that is bed3 format and returns bed string. :return: ...
import re from typing import Dict, List, Optional, Tuple from xml.etree import ElementTree as ET from .data import Slide, Panorama, Acquisition class MCDParserError(Exception): def __init__(self, *args) -> None: """Error occurring when parsing invalid IMC .mcd file metadata""" super(MCDParserErr...
# Copyright 2019-2020 the ProGraML authors. # # Contact <NAME> <<EMAIL>>. # # 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...
# -*- coding: utf-8 -*- """ eve.methods.post ~~~~~~~~~~~~~~~~ This module implements the POST method, supported by the resources endpoints. :copyright: (c) 2017 by <NAME>. :license: BSD, see LICENSE for more details. """ from datetime import datetime from flask import current_app as app, abo...
from typing import Optional import os import numpy as np # type: ignore from scipy import linalg # type: ignore from d3m.container import ndarray from d3m.primitive_interfaces.base import CallResult from d3m.primitive_interfaces.unsupervised_learning import UnsupervisedLearnerPrimitiveBase from d3m.metadata import ...
import numpy as np import torch from torch import nn from onnx import numpy_helper from onnx2pytorch.operations import ( BatchNormWrapper, InstanceNormWrapper, LSTMWrapper, ) from onnx2pytorch.convert.attribute import extract_attributes, extract_attr_values def _deserialize_to_torch(onnx_param): retu...
import re import logging logger = logging.getLogger(__name__) # Page permissions. PERM_NONE = 0 PERM_READ = 2**0 PERM_EDIT = 2**1 PERM_CREATE = 2**2 PERM_DELETE = 2**3 PERM_HISTORY = 2**4 PERM_REVERT = 2**5 PERM_SEARCH = 2**6 PERM_UPLOAD = 2**7 # Site-wide premissions. PERM_INDEX = 2**8 PERM_LIST = 2**9 PERM_LISTRE...
# @Author : <NAME> # @Contact : <EMAIL> import argparse import numpy as np from sklearn.metrics import normalized_mutual_info_score import torch from torch import nn from dataloader import get_dataset from kmeans import get_cluster_centers from module import Encoder from adverserial import adv_loss from eval import...
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__ = ['youku_download', 'youku_download_playlist', 'youku_download_by_id'] from ..common import * import json from random import randint from time import time import re import sys def trim_title(title): title = title.replace(' - 视频 - 优酷视频 - 在线观看', '') title...
from unittest.mock import Mock, patch import click import pytest from cumulusci.core.config import BaseProjectConfig from cumulusci.core.exceptions import CumulusCIUsageError from cumulusci.cli.runtime import CliRuntime from .. import task from .utils import DummyTask, run_click_command color_opts = {"options": {"c...
# 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...
# # 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...
# -*- coding: iso-8859-1 -*- """ Created on April 29 2020 Description: This routine identifies and reduce all polarimetric sequences in a given data set. @author: <NAME> <<EMAIL>> Institut d'Astrophysique de Paris, France. Simple usage example: python ~/spirou-tools/spir...
import sys import os import time import numpy as np from os.path import join,exists import glob from tqdm import trange, tqdm import cv2 import math import scipy import torch from torch.nn import functional as F import json def automkdir(path): if not exists(path): os.makedirs(path) def automkdirs(path):...
import traceback import sys import time import re import watchdog.events import pytest from mitmproxy.test import tflow from mitmproxy.test import tutils from mitmproxy.test import taddons from mitmproxy import exceptions from mitmproxy import options from mitmproxy import proxy from mitmproxy import master from mitmp...
# Copyright 2004 by <NAME>. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """ Code to deal with COMPASS output, a program for profile/profile comparison. Compass is described...
# Copyright (c) 2013 Intel, Inc. # Copyright (c) 2013 OpenStack Foundation # 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/li...
import matplotlib matplotlib.use('Agg') import sys import yaml from argparse import ArgumentParser from tqdm import tqdm from scipy.spatial import ConvexHull import numpy as np import imageio from skimage.transform import resize from skimage import img_as_ubyte import torch from modules.inpainting_network i...