text
stringlengths
3.07k
22.1k
# -*- coding: utf-8 -*- import os import json from zipfile import ZipFile from gluon.contrib.markdown import markdown2 import libConCoct.concoct @auth.requires_login() def view(): """ Shows all tasks if no argument is given or details of a specific task. /task/view/[task id] -> view detailed informati...
"""Print a GO term's lower-level hierarchy.""" __copyright__ = "Copyright (C) 2016-2018, <NAME>, <NAME>. All rights reserved." __author__ = "<NAME>" import sys import collections as cx from goatools.godag.consts import Consts from goatools.gosubdag.go_paths import GoPaths class WrHierGO(object): """Write hierar...
# originally based on https://github.com/allenai/bilm-tf/blob/master/bilm/training.py # Modifications copyright 2017 Neural Networks and Deep Learning lab, MIPT # # 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...
# Copyright 2019 DeepMind Technologies 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 required by appl...
""" This file contains methods allowing for interaction with the MetaNet website (https://metaphor.icsi.berkeley.edu/pub/en/). They are needed since it appears that there is no API available to access MetaNet programmatically. """ import re import json import logging from time import time from bs4 import BeautifulSoup ...
import argparse import logging import random import numpy as np import torch import torch.nn as nn import torch.optim as optim from sklearn.metrics import roc_auc_score from datasets import BioDataset from transfer import BioGNN_graphpred from transfer.utils import DataLoaderFinetune from transfer.utils import bio_ra...
from __future__ import print_function; import json; import os; import random; import sys; import unittest; import tempfile; import zipfile; import numpy as np; import hoomd; try: import gtar; except ImportError: print('Warning: gtar python module not found, some getar tests not run', file=sys.stderr...
from dataclasses import field from dataclasses import dataclass from dataclasses import asdict import random import decimal from decimal import Decimal import argparse import os import math import csv import copy import itertools import functools from munkres import Munkres import tabulate valve_count = 0 threshold: ...
# coding=utf-8 # Copyright 2018 Google LLC. 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...
# McSimps Titanfall Map Exporter Tool # Website: https://will.io/ import struct from enum import Enum import os map_name = "mp_glitch" map_path = f"E:/Mod/Titanfall2/mp_glitch/maps/{map_name}.bsp" dump_base = "E:/Mod/Titanfall2/mp_glitch/materials/" def read_null_string(f): chars = [] while True: c =...
#!/bin/python3 """KubeInit's CI utils.""" import base64 import os import re from github import Github from github import InputGitTreeElement from google.cloud import storage from jinja2 import Environment, FileSystemLoader def render_index(gc_token_path): """Render and upload the index file.""" # Google ...
from enum import Enum __author__ = "<NAME>" __credits__ = ["<NAME>"] __version__ = "0.0.1" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" """ CVPlus human model Using 15 Joint Point """ class CVPlusPart(Enum): Nose = 0 Neck = 1 RShoulder = 2 RElbow = 3 RWrist = 4 LShoulder = 5 LElbow = 6 LWrist = 7 RHip = 8...
#!/usr/bin/env python3 import sys import os import argparse import matplotlib.pyplot as plt colors = { 'B.1.1.7': (0.4980392156862745, 0.788235294117647, 0.4980392156862745, 1.0), 'B.1.351': (0.9921568627450981, 0.7529411764705882, 0.5254901960784314, 1.0), 'B.1.427': (0.2196078431372549, 0.42352941176470...
import os, sys from cqed_tools.calibration import * import matplotlib.pyplot as plt display = False def t_gen(eps_array): n_spectra = eps_array.shape[0] t_array = np.zeros(n_spectra, dtype=np.int) t_array += 3 * (eps_array <= 1e-5) t_array += 4 * (1e-5 < eps_array) * (eps_array <= 1e-4) t_array ...
import optimus_manager.envs as envs import optimus_manager.var as var import optimus_manager.checks as checks import optimus_manager.pci as pci from optimus_manager.acpi_data import ACPI_STRINGS from optimus_manager.bash import exec_bash, BashError class KernelSetupError(Exception): pass def setup_kernel_state(...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading import numpy as np import tensorflow as tf from tensorflow.python import keras from tensorflow.python.eager import context from tensorflow.python.framework import tensor_shape from tensorflow....
from __future__ import unicode_literals from django.core.paginator import Page, Paginator from django.urls import reverse from django.shortcuts import redirect from django.utils.functional import cached_property from .blocks import SkipState class SkipLogicPaginator(Paginator): """ Breaks a series of questi...
from ..kernel import core from ..kernel.core import VSkillModifier as V from ..character import characterKernel as ck from functools import partial from ..status.ability import Ability_tool from . import globalSkill from .jobbranch import pirates from .jobclass import adventurer from . import jobutils #TODO : 5차 신스킬 적용...
rate = {224: 1152, 256: 1088, 384: 832, 512: 576} rot_vals = [ [153, 231, 3, 10, 171], [55, 276, 36, 300, 6], [28, 91, 0, 1, 190], [120, 78, 210, 66, 253], [21, 136, 105, 45, 15] ] RC = [ 0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000, 0x00000000...
# # MIT License # # (C) Copyright 2022 Hewlett Packard Enterprise Development LP # # 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 righ...
import matplotlib # matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt import numpy as np from scipy.integrate import solve_ivp from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import scipy.io import time plt.rc("text", usetex=False) plt.rc("font", family="sans-serif", size=12) def f(v, w, a, ...
"""A very basic implementation of the boids algorithm as made famous by <NAME> in "Flocks, Herds, and Schools: A Distributed Behavioral Model" The primarily source was: http://www.vergenet.net/~conrad/boids/pseudocode.html by <NAME>. Reynolds, <NAME>. (1987) Flocks, Herds, and Schools: A Distributed Behavioral Mo...
""" DIRBS CLI for Whitelisting Process. Installed by setuptools as a dirbs-classify console script. Copyright (c) 2018-2021 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer bel...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import signal import argparse import functools ## 3rd party import telegram from telegram.ext import Updater, CommandHandler, MessageHandler, Filters import locks # python-daemon not supports Windows if not os.name == 'nt': import daemon ## my i...
'''Classes to help define tag and coordinate families.''' from __future__ import print_function, absolute_import, division try: from builtins import range as iter_range except ImportError: from __builtin__ import xrange as iter_range from collections import defaultdict from collections import Counter from copy ...
import numpy as np import tensorflow as tf import datetime import time import json def _parse_dense_features(s, dshape, dtype=tf.float32, delimiter=','): record_defaults = [[0.0]] * dshape[1] #过decode_csv输出一个list of tensors,长度为50,每个item是一个float32类型的batch data value = tf.decode_csv(s, record_defaults=record...
""" schema.py: Schema repository for known datasets for the refinery """ import pyarrow as pa import pyarrow.types as pt # # Utilities # def get_pa_type_factory(pa_type): """return type factory""" if pt.is_int8(pa_type): return pa.int8 elif pt.is_int16(pa_type): return pa.int16 elif p...
#!/usr/bin/python import os import sys import json import itertools import datetime import numpy as np import pandas as pd from windpowerlib.wind_turbine import WindTurbine from windpowerlib.wind_farm import WindFarm from windpowerlib.turbine_cluster_modelchain import TurbineClusterModelChain def load_data(path, fil...
""" Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). """ from __future__ import absolute_import from __future__ import division import argparse from functools import partial from config import cfg, ass...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for tests! More for checking compatability with Python versions than that the tests do what you would expect. We check both the positive and negative versions of all assertions (i.e.: in situations where we would expect them to pass and fail) in the hope of getti...
#!/usr/bin/python import os import sys sys.path.append(os.path.join("..", "core")) sys.path.append(os.path.join("..", "utils")) import numpy as np import math from datetime import datetime, timedelta # import readers from dataReaderSpam import DataReaderSPAM from dataReaderATS import DataReaderATS from dataR...
import logging from os import PathLike import re from typing import List, Optional, NamedTuple, Sequence, Union, Dict, Any import torch from torch import autograd from allennlp.common import Registrable, Lazy, plugins from allennlp.common.tqdm import Tqdm from allennlp.common.util import int_to_device from allennlp.d...
__all__ = ['AsyncPythonInterpreter'] try: import fcntl except: fcntl = None import os import sys import socket from StringIO import StringIO from netrepr import NetRepr, RemoteObjectPool, RemoteObjectReference import objc from Foundation import * IMPORT_MODULES = ['netrepr', 'remote_console', 'remote_pipe', '...
# coding: utf-8 import logging from tastypie import fields from django.db.models import Q from django.contrib.auth.models import User from tastypie.resources import ModelResource, Resource from tastypie.authorization import DjangoAuthorization from tastypie.authentication import ApiKeyAuthentication from tastypie.con...
#! python34 $this # http://www.rachaelrayshow.com/recipe/12896_Meat_Sauce_with_Pork_and_Fennel/ import io # ------------------ def generateUniquePath(view, path): count=1 dir,name = view.split(path) name,ext = view.splitext(path) while view.exists(path): path = view.join(dir,name+" (%d)"%cou...
# -*- encoding:utf-8 -*- """ Create, train and test a language-consistent open relation extractor. Created by <NAME> """ from LanguageIndividualModel import train_model, test_model, load_model from ProcessDataFile import create_data_file, create_index_ent, create_index_word import random import itertools # TOGGLE CP...
#!/usr/bin/env python # coding: utf-8 """Importing python libraries""" import os import json import argparse import concurrent.futures from concurrent import futures from datetime import datetime, timedelta import gcsfs import warnings warnings.filterwarnings("ignore") """Importing google-cloud libraries""" from googl...
import itertools import pyglet from pyglet.gl import * from freezegame.image_loader import * import freezegame.resources from freezegame.image_loader import ImageLoader from freezegame.abstract_state import AbstractState from freezegame.sprite import Sprite from freezegame.tile_map import TileMap from freezegame.broa...
import numpy as np class Mesh(object): """ Holds data structures for a uniform mesh on a hypercube in space, plus a uniform mesh in time. ======== ================================================== Argument Explanation ======== ================================================== ...
import datetime import errno import http.server import logging import sys from ggp.languages.sexpressions import s_expression_parser, SExpression __all__ = [ 'run_player_server', ] logger = logging.getLogger(__name__) class MessageError(Exception): def __init__(self, reason): super().__init__() ...
#!/usr/bin/env python # Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. #This script is used to obtain Pointwise Labelled point cloud along with the ...
import json import os import random import numpy as np from math import ceil import bottle from bottle import HTTPResponse # import time from timeit import default_timer as timer from util_fns import * from grid_data_maker import * from search import * # my_moves delta = [[-1, 0], # go up [0, -1], # go lef...
import os import random import struct import errno import time import pickle from functools import partial import zmq from zmq import * from . import core, channel from .core import gethub try: REP_SOCKET = zmq.XREP except AttributeError: REP_SOCKET = zmq.ROUTER try: REQ_SOCKET = zmq.XREQ except Attribut...
""" BSD license - created by <NAME> """ from __future__ import print_function from reportlab.pdfgen.canvas import Canvas from reportlab.platypus import Table from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from decimal import Decimal import cStringIO import datetime def listify(item): i...
#!/usr/bin/env python3 from PIL import Image, ImageDraw, ImageChops from pathlib import Path import sys import argparse class SimulatedPrinter: """Simulated Apple ImageWriter II""" def __init__(self, output_res): self.output_res = output_res self.cur_x_step = output_res / 72 self.cur_y_step = (outp...
import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F import math from torch.nn.utils.rnn import pad_packed_sequence, pack_sequence from utils import gen_efficientnet_lite_y from utils import BasicBlock, conv1x1 class PositionalEncoding(nn.Module): def __init__(self, d_model...
import torch import torch.nn as nn import torch.nn.functional as tnf model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth', ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
# --------------------------------------------------------------------- # fm.reportalarmcomments application # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # ---------------------------------------------------------------------...
""" A collection of utility functions and classes for generating config jsons for hyperparameter sweeps. """ import argparse import os import json import re import itertools from collections import OrderedDict from copy import deepcopy class ConfigGenerator(object): """ Useful class to keep track of hyperpar...
# pg template - skeleton for a new pg project import pygame as pg from random import randint, uniform vec = pg.math.Vector2 WIDTH = 1024 HEIGHT = 800 FPS = 60 GRIDSIZE = 32 NUM_MOBS = 1 MOB_SIZE = 16 NEIGHBOR_RADIUS = 75 ALIGN_WEIGHT = 1 COHERE_WEIGHT = 1.2 SEPARATE_WEIGHT = 1.6 MAX_SPEED = 5 MAX_FORCE = 0.2 APPROACH_...
# -*- coding:utf-8 -*- # TODO: Access the musicbrainz database and obtain tags for the new mp3 files import os import re from getpass import getuser # Modules for accessing online files import asyncio import aiohttp import aiofiles # Modules for logging and parsing config.ini data import logging import logging.confi...
# Copyright (c) 2020, <NAME> # Licensed under the BSD 3-clause license (see LICENSE.txt) # --------------------------------------------------------- # Base classes for feedforward, convolutional and recurrent # neural network (DNN, CNN, RNN) dj_models in pytorch # ----------------------------------------------------...
# # # Copyright (C) University of Melbourne 2013 # # # #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...
import logging import json import re from collections import defaultdict from operator import attrgetter from synthaser import settings from synthaser.models import Domain LOG = logging.getLogger(__name__) DOMAINS = {} def load_rules_json(json_file): with open(json_file) as fp: return json.load(fp) ...
import json from urllib.parse import unquote import click import geopandas as gpd import mercantile import pandas as pd from cogeo_mosaic.mosaic import MosaicJSON from rio_tiler.mercator import zoom_for_pixelsize from shapely.geometry import asShape, box @click.command() @click.option( '--meta-path', type=cl...
import time import datetime import pygiftgrab as pgg use_numpy = True try: import numpy as np except ImportError: use_numpy = False class StereoFrameBackwardsCompatibilityChecker(pgg.IObserver): """Descendant of GIFT-Grab's `Observer`, which will listen to `Observable`s for some time and when asked, ...
#!/usr/local/bin/python3 import argparse import gym import logging import tensorflow as tf from dqn_agent import DQNAgent from network import Network from replay_memory import ReplayMemory def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('--log_level', default='INFO', help='Log verbosity...
import statistics import time import os import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import numpy as np from sklearn import decomposition from sklearn import preprocessing from sklearn import cluster from sklearn import linear_model from sklearn import ensemble from sklearn import cross_val...
import math from utils import fman, fexp_embed # , log_wandb, exponent_metrics, summarize_metrics import torch.nn.functional as F from transformers.modeling_bert import * import numpy as np class NumberBertEmbeddings(nn.Module): """Construct the embeddings from word, position and token_type embeddings. """ ...
import globalsObj import commonlib as commonlib import easyspid.lib.database from response import ResponseObj from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser import easyspid.lib.database import datetime from cryptography import x509 from cryptography.hazmat.backends import default_backen...
from my_models import generator, latent_generator import tensorflow_probability as tfp import tensorflow as tf from tensorflow.keras import layers import numpy as np import cv2 from my_utils import * import os import shutil from time import time tfb = tfp.bijectors tfd = tfp.distributions FLAGS, unparsed = flags() ...
# Copyright 2017 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 required by applicable law or a...
import requests, json from steam.steamid import SteamID from tkinter import * from tkinter import filedialog from tkinter import ttk from tkinter import messagebox import pyperclip from functools import partial import sqlite3 import ast from datetime import datetime, timedelta import threading import timeago import we...
""" Copyright 2014 Rackspace 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 dist...
import asyncio import concurrent.futures import logging import multiprocessing import math from hashlib import sha256 from typing import List import aiohttp from kin import Keypair, KinClient from kin.blockchain.builder import Builder from kin_base import Keypair as BaseKeypair NETWORK_NAME = 'LOCAL' MIN_FEE = 100 M...
import logging import re from dynamo.policy.condition import Condition from dynamo.policy.variables import replica_variables import dynamo.dataformat as df from dynamo.core.components.persistency import InventoryStore LOG = logging.getLogger(__name__) class NameKeyDict(dict): __slots__ = [] def add(self, ob...
from typing import Type class Regle: Listprémisses: list Listconclusions: list mode :None def __init__(self, mode ,Listprémisses, Listconslusions): self.Listprémisses = Listprémisses self.Listconslusions = Listconslusions self.mode=mode class BaseConnaisance: Rè...
import os import pytest import json import pprint from commcareapi.comm_care_data import CommCareForm from commcareapi.xform import XForm def form_data(fixture): test_dir = os.path.abspath(os.path.dirname(__file__)) fixture = os.path.join(test_dir, 'test_fixtures', fixture) with open(fixture, 'r') as f: ...
import numpy as np import random import glob import sys from PIL import Image import shutil import os import cv2 import matplotlib.pyplot as plt import seaborn as sns import time import tensorflow as tf import keras import keras.backend as K from tensorflow.keras.layers import Conv2D, Concatenate from tensorflow.ker...
import io from django.conf import settings from django.utils import dateformat, formats, timezone, translation from django.utils.translation import gettext_lazy as _ from xlsxwriter import Workbook from customers.models import Boat from .enums import WinterStorageMethod def export_berth_applications_as_xlsx(applic...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import argparse import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torchvision from torchvision import transforms, datasets import ...
"""@package deepac.preproc Convert fasta files to numpy arrays for training. Uses distributed orthographic representation, i.e. every read is coded so that every nucleotide is a one-hot encoded vector. Assumes equal length of all the input sequences - no padding! Requires a config file describing the available devic...
# Author: <NAME> # Date: 2015 """ Entry-point for generating synthetic text images, as described in: @InProceedings{Gupta16, author = "<NAME>. and <NAME>. and <NAME>.", title = "Synthetic Data for Text Localisation in Natural Images", booktitle = "IEEE Conference on Computer Vision a...
import warnings import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from pytorch_widedeep.wdtypes import * # noqa: F403 from pytorch_widedeep.utils.deeptabular_utils import LabelEncoder from pytorch_widedeep.preprocessing.base_preprocessor import ( BasePreprocessor, check_...
import argparse import json args_list = ["keywords", "keywords_from_file", "prefix_keywords", "suffix_keywords", "limit", "format", "color", "color_type", "usage_rights", "size", "exact_size", "aspect_ratio", "type", "time", "time_range", "delay", "url", "single_image", "output_d...
import dill import os import sys from plumbum import local from benchbuild.settings import CFG from benchbuild.utils.cmd import mv, chmod, rm from benchbuild.utils.path import list_to_path, template_str from benchbuild.utils.run import run, uchroot_no_llvm as uchroot PROJECT_BIN_F_EXT = ".bin" PROJECT_BLOB_F_EXT = ".p...
import collections.abc import warnings from typing import Dict, Iterator, Optional, List, Tuple, Set, Iterable, \ Generator from collections import OrderedDict from .agents import IDLookupAgent from .curie import validate_prefix class CanonDict(collections.abc.MutableMapping): def __init__(self, *args, **kw...
import numpy as np import pandas as pd ots = pd.read_csv("data/ot.csv",sep=',') ots=ots.sort_values('Pedido') xlsx_file = "data/layout.xlsx" layout = pd.read_excel(xlsx_file, sheet_name="layout") adyacencia=pd.read_excel(xlsx_file, sheet_name="adyacencia") cant_ordenes=len(ots['Pedido'].unique()) pasillos=lay...
""" Unit test """ import zipfile import io import os from contextlib import contextmanager import logging from unittest.mock import patch, ANY import pytest from lxml import etree from lxml.builder import E from peerscout.shared.database import empty_in_memory_database from peerscout.preprocessing import importData...
from itertools import chain import nltk from sklearn.metrics import classification_report,confusion_matrix from sklearn.preprocessing import LabelBinarizer import sklearn import pycrfsuite import random from collections import Counter import sys def genDataset(file,trainSize): """ Generates the training and testing ...
import plotly.graph_objects as go import plotly.express as px import streamlit as st import pandas as pd import numpy as np from src.arcs import generate_arc from src.preprocess import get_last_known_bounty, get_latest_age, get_main_crew from configparser import ConfigParser, ExtendedInterpolation import warnings warni...
import tensorflow as tf import tensorflow_text as text import tensorflow_hub as hub from tensorflow.python.ops import math_ops, array_ops from tensorflow.python.keras.engine import keras_tensor # from .awdlstm_tf2 import * from .ulmfit_tf2 import * def ulmfit_rnn_encoder_native(*, pretrained_weights=None, fixed_seq_le...
# coding: utf-8 # # Copyright 2018 The Oppia 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 requi...
#! /usr/bin/env python """Generate prefix page for the requested ICAO prefix.""" import collections import json import os import pathlib import sys from typing import List, Union ENCODING = 'utf-8' COUNTRY_PAGE = os.getenv('GEO_COUNTRY_PAGE', '') PATH_NAV = os.getenv('GEO_PATH_NAV', '') HOST_NAV = os.getenv('GEO_HOST...
# -*- coding: utf-8 -*- import math import sys import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from transformers import BertConfig, BertModel, BertPreTrainedModel from hetero_model import HeteroGAT LABEL_NUM = 4 class SelfAttention(nn.Module...
#!/usr/bin/env python # Copyright 2020 <NAME> # License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import torch as th import torch.nn as nn import torch.nn.functional as tf from typing import Optional, List, Union from aps.transform.asr import TFTransposeTransform from aps.sse.bss.tcn import normalize...
# -*- coding: utf-8 -*- """ Manual Steps ~~~~~~~~~~~~ Requirements: Inputs: * **commit** - Program performs a dry-run by default. Enable this option to apply the changes. * **RELEASE_ID** - PDC release ID, for example 'fedora-24', 'fedora-24-updates'. * **REPO_FAMILY** - It is repo family in PDC. * **variant** - I...
"""rok output formatters. The API of this module is a decorator factory function :func:`printer` that can be used to annotate functions and print their return value in a format- specific way. """ import sys import json import yaml import os from datetime import datetime from dateutil.parser import parse from functool...
from __future__ import annotations from dataclasses import dataclass, asdict, field from datetime import datetime import logging import pathlib import secrets from typing import TYPE_CHECKING, Any, List, Union from aiohttp import ClientSession from awesomeversion import AwesomeVersion from homeassistant.core import H...
import ast import importlib import json import logging import numpy as np import os import random import string import matplotlib.pyplot as plt import time import traceback import warnings from collections import defaultdict, deque from hashlib import sha256 from tempfile import gettempdir from types import FunctionTyp...
from PIL import Image import random import os import time import random import image_training import configparser #原始路径 path = '/home/zgg/Python-3.7.1/captcha/captcha' #训练集原始验证码文件存放路径 captcha_path = path + '/data/captcha' #训练集验证码清理存放路径 captcha__clean_path = path + '/data/captcha_clean' #训练集存放路径 train_data_path = p...
import numpy as np import sunpy.map from sunpy.coordinates import frames from astropy.coordinates import SkyCoord import astropy.units as u from scipy import ndimage from coord_transform import hmi_disambig #plane2sphere.pro def plane2sphere(x,y,latc,lonc): """Convert (x,y) of a CEA map to Stonyhurst/Carrington ...
import torch import torch.nn as nn from torch.nn import Linear, Conv2d, BatchNorm1d, BatchNorm2d, PReLU, ReLU, Sigmoid, Dropout, MaxPool2d, \ AdaptiveAvgPool2d, Sequential, Module from collections import namedtuple # Support: ['IR_50', 'IR_101', 'IR_152', 'IR_SE_50', 'IR_SE_101', 'IR_SE_152'] class Flatten(Modu...
# Auto generated from linkml_issue_384.yaml by pythongen.py version: 0.9.0 # Generation date: 2021-12-11T03:14:54 # Schema: personinfo # # id: https://w3id.org/linkml/examples/personinfo # description: # license: https://creativecommons.org/publicdomain/zero/1.0/ import dataclasses import sys import re from jsonasobj2...
import trimesh import unittest import logging import time import os import sys import inspect import numpy as np import json from collections import deque try: from . import generic as g except BaseException: import generic as g TEST_DIM = (100, 3) TOL_ZERO = 1e-9 TOL_CHECK = 1e-2 log = logging.getLogger('tr...
""" Install holidays module """ from __future__ import absolute_import from datetime import datetime, timedelta, date, time from collections import defaultdict import logging import sys import grequests import requests from volttron.platform import jsonapi import pytz import pandas as pd from dateutil.parser import ...
from sympy import sin, cos, exp, E, series, oo, S, Derivative, O, Integral, \ Function, log, sqrt, Symbol, Subs, pi, symbols, atan, LambertW, Rational from sympy.abc import x, y, n, k from sympy.testing.pytest import raises from sympy.core.compatibility import range from sympy.series.gruntz import calculate_series ...
# This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This file follows the # PEP8 Python style guide and uses a max-width of 120 characters per line. # # Author(s): # <NAME> <www.cedricnugteren.nl> import ast from collections import defaultdict import clblast import bests ...
import os import sys import unittest import nose import yaml import copy from jinja2 import Template from checker import * from ofp.ofp import ofp_creators # test scenario items SCE_TESTCASES = "testcases" SCE_TESTCASE = "testcase" SCE_SWITCHES = "switches" SCE_SETUP = "setup" SCE_TEARDOWN = "teardown" SCE_TEST = "te...