text
stringlengths
3.07k
12.6k
""" The TimelineType definition. """ __classification__ = "UNCLASSIFIED" __author__ = "<NAME>" from typing import List, Union import numpy from sarpy.io.xml.base import Serializable, SerializableArray from sarpy.io.xml.descriptors import FloatDescriptor, IntegerDescriptor, \ DateTimeDescriptor, SerializableDes...
import matplotlib.pyplot as plt import numpy as np import math umekomi_runge4 = [[ 0.0, 0, 0, 0, 0, 0, 0], [ 0.25, 0.25, 0, 0, 0, 0, 0], ...
import numpy as np import random def my_ransac_v2(data, distance_threshold=0.3, P=0.99, sample_size=3, max_iterations=10000, ): """ 更改迭代条件 加速计算 :param data: :param sample_size: :param P : :param dis...
import sys import pytest from makefun import create_function # Python 2 does not support function annotations; Python 3.0-3.4 do not support variable annotations. params_type_hints_allowed = sys.version_info.major >= 3 and sys.version_info.minor >= 5 if params_type_hints_allowed: type_hints_variants = [False, ...
# -*- coding: utf-8 -*- # 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...
"""This module contains the general information for StorageLocalDiskOperation ManagedObject.""" from ...ucscmo import ManagedObject from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta from ...ucscmeta import VersionMeta class StorageLocalDiskOperationConsts(): ADMIN_VIRTUAL_DRIVE_ID_UNSPECIFIED = "un...
# traverse all import numpy as np import pandas as pd from argparse import ArgumentParser from utils import powerset, subset import os, sys import seaborn as sns def option(): parser = ArgumentParser() parser.add_argument('--dataset', default='Cora', type=str, help='dataset') parser.add_argument('--multip...
# -*- coding: utf-8 -*- from . import Pipeline, Converter, Options, Accessor, accessors #from .. import xlplatform from ..main import Range import datetime try: import numpy as np except ImportError: np = None _date_handlers = { datetime.datetime: datetime.datetime, datetime.date: lambda year, mon...
# -*- coding: utf-8 -*- import pickle import unittest import numpy as np import pandas as pd from os import path from tqdm import tqdm from scipy import sparse from pprint import pprint from irmet.metrics import nDCG from matplotlib import pyplot as plt from sklearn.metrics import mean_squared_error GROUP_KEY = 'race...
# SPDX-License-Identifier: MIT import os import os.path import platform import shutil import stat import subprocess import sys import sysconfig import tempfile import pytest def _setup(): """At the start of the test suite initialize the environment in case of path/wheel/sdist mode""" mode = os.environ.get('...
from PySide2 import QtCore from eqt.threading import Worker import paramiko from brem import BasicRemoteExecutionManager import os, ntpath, posixpath import socket from .brem import Windows, POSIX class RemoteAsyncCopyOverSSHSignals(QtCore.QObject): status = QtCore.Signal(tuple) job_id = QtCore.Signal(int) cla...
import logging import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.nn.utils import clip_grad_norm_ logger = logging.getLogger('deepmatcher.optim') class SoftNLLLoss(nn.NLLLoss): """A soft version of negative log likelihood loss with support for label sm...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' # The script is written to peform prob classification using 4 layer DNN model using pytorch wrapper skorch # The script is revised by <NAME> on 2020-09-05 ''' import os, sys Ranger_Path='/projects/camde/Project/External/2003_GNN8CP/script/TorchOptimizer/' #'C:/GDrive/...
#!/usr/bin/python3 # # ./compute_stats_for_pages_in_course.py course_id # # it outputs a XLSX file with the name statistics_for_course_xx.xlsx # where xx is the course_id # # <NAME>: <NAME>. # # 2020.03.27 # based on compute_stats_for_pages_in_course.py from 2016.07.15 # # with the option "-v" or "--verbose" you get...
import os import shutil import sys from kivy import Config from kivy.storage.jsonstore import JsonStore from katrain.core.ai import ai_rank_estimation from katrain.core.constants import ( PLAYER_HUMAN, PLAYER_AI, PLAYING_NORMAL, PLAYING_TEACHING, OUTPUT_INFO, OUTPUT_ERROR, OUTPUT_DEBUG, ...
import json import os import six from avro import schema from io import StringIO from avro.schema import SchemaFromJSONData as make_avsc_object from .core_writer import generate_namespace_modules, clean_fullname from .tabbed_writer import TabbedWriter from .core_writer import write_preamble, start_namespace, write...
#!/usr/bin/env python """Wrapper for WoLF PSORT v0.2 for use in Galaxy. This script takes exactly four command line arguments: * the organism type (animal, plant or fungi) * number of threads to use (integer) * an input protein FASTA filename * output tabular filename. It then calls the standalone WoLF PSORT v0.2...
# -*- coding: utf-8 -*- # @Author: liangou # @Date: 2021-02-26 11:14:00 # @Last Modified by: liangou # @Last Modified time: 2021-04-06 10:52:31 ''' 1.filter and combination all the motif site 2.apply model to features table ''' import itertools import pickle,subprocess from collections import defaultdict from co...
#@+leo-ver=5-thin #@+node:ekr.20170428084207.311: * @file ../external/npyscreen/fm_form_edit_loop.py #!/usr/bin/env python # encoding: utf-8 import leo.core.leoGlobals as g assert g #@+others #@+node:ekr.20170428084207.312: ** Declarations """ form_edit_loop.py Created by <NAME> on 2008-03-31. Copyright (c) 2008 __MyC...
""" The MNIST dataset. """ __authors__ = "<NAME>" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["<NAME>"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "<EMAIL>" import numpy as N np = N from theano.compat.six.moves import xrange from pylearn2.datasets import dense...
import json import six from flask import Response, request from flask.views import View from werkzeug.exceptions import BadRequest, MethodNotAllowed from graphql import Source, execute, parse, validate from graphql.error import format_error as format_graphql_error from graphql.error import GraphQLError from graphql.e...
from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.ensemble.forest import BaseForest from sklearn.tree import DecisionTreeClassifier from sklearn.utils import check_random_state, check_array from sklea...
#!/usr/bin/env python """ Uses the official Khronos-XML specs to generate a Vulkan/GL/GLES/EGL/GLX/WGL Loader made for your needs. Subcommands have additional help information, query with: `{subcommand} --help` """ from itertools import groupby import logging import os import glad.files from glad.config import Con...
#!/usr/bin/env python # -*- coding: utf-8 -*- import builtins import os import typing from pathlib import Path from shutil import copyfile import pytest from torch.utils.data import DataLoader, Dataset, IterableDataset from combustion.data import SerializeMixin, TorchDataset def check_file_exists(filepath): __...
# -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # # Licensed to ...
# Copyright 2016 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 ...
import concurrent.futures from pprint import pprint from collections import Counter some_primes = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59,61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, ...
from ..core import Source, log, utils import re import requests re_extract_tartans = re.compile( '<option\s+value="([^"]*)">([^<]*)', re.IGNORECASE) re_extract_palette = re.compile( '^(([a-z]*#[0-9a-f]{6})*)(\[|\]|$)', re.IGNORECASE ) re_extract_warp = re.compile( '\[(([a-z]+[0-9]+|\(|\))*)(\]|$)...
from abc import ABCMeta, abstractmethod from Banco.Erros import * from Banco.Moeda import * class ContaBancaria (metaclass=ABCMeta): """Classe abstrata da conta bancária""" quantidade_contas = 0 @classmethod def status_contas(cls): return cls.quantidade_contas @classmethod def increm...
#!/usr/bin/env python # -*- coding: utf-8 -*- import rospy import cv2 from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image from std_msgs.msg import Int32 import time import numpy as np from std_msgs.msg import UInt8 class DetectRed: def __init__(self): self.obj_buf = [] ...
# coding: utf-8 # In[ ]: import os, cv2, keras import numpy as np from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D, MaxPooling2D # manipulate with numpy,load with panda import numpy as np import pandas as pd # data visualization import cv2 import...
from __future__ import division import time import train import option_parse from numpy.random import uniform, randint, choice import torch from argparse import Namespace def check_params(opts, prev_opts, mem_specific_stds): stds = {'dropout': .02, 'lr': 10**-6, 'lr_decay': .1, 'start_decay_at': 5, 'i...
import discord import random import sys from functions import Functions from trivia import Trivia from discord.ext import commands from discord.utils import get bot = commands.Bot(command_prefix = '!') functions = Functions() trivia = Trivia() @bot.event async def on_message(message): # Don't talk to yourself,...
# Practical Machine learning # Association rule based learning - fpgrowth example # Chapter 7 # encoding: utf-8 """ Testing code for the FP-growth implementation. """ import unittest import fp_growth from itertools import izip class NodeTester(object): def __init__(self, case, node): self.case = case ...
from __future__ import print_function import numpy as np import sys import math import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F from torch.nn.init import xavier_normal, xavier_uniform from plyfile import (PlyData, PlyElement) # -------------------------------- #...
#!C:\Users\RIchardC\Documents\digitizePlots\venv\Scripts\python.exe # Create Lyman/Fitz style long flat Design Files from plain-text onset files # EKK / June 2015 # Python 2/3 compatibile, depends on Pandas and Numpy/Scipy from __future__ import print_function from pandas import concat, read_csv from argparse import A...
# -*- coding: utf-8 -*- """ Created on Tue Jan 25 20:45:38 2022 @author: Pena There is a bag full of white balls. Each ball has a fixed unknown chance to break when tested. This program uses BAYESIAN INFERENCE to estimate the break rate. From each test, it collects more evidence to update the probability distribution ...
from bs4 import BeautifulSoup import requests def get_page_number(content): start_index = content.find('index') end_index = content.find('.html') page_number = content[start_index + 5: end_index] return int(page_number) + 1 def craw_page(res, push_rate): soup_ = BeautifulSoup(res.text, 'html.pa...
#!/usr/bin/env python3 from django.shortcuts import render from devnet2019.forms import NetFlowProtocol, NetFlowApplication from devnet2019.models import NetflowClassicSeven, ApplicationMap, FieldTypeMap from django.http import JsonResponse from django.db.models import Count def devnet_netflow(request): # 设备配置默认页面...
# # This source file is part of the EdgeDB open source project. # # Copyright 2016-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...
# Copyright (C) 2020 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
# Examples of GradCAM visualization import numpy as np import os from tensorflow.keras.preprocessing import image import argparse import matplotlib.pyplot as plt from matplotlib import cm from vis.visualization import overlay from utils import imgUtils, trainFeatures import gc """Grad-CAM Visualization This script wi...
# -*- coding: utf-8 -*- # Copyright 2022 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...
import copy import os import random import shutil import numpy as np import torch from root import absolute from torch import nn """ Some handy functions for model training ... """ def save_checkpoint(state, is_best, save_dirname="output", save_filename...
import csv import gzip from argparse import Namespace import pytest from piicatcher.explorer.databases import PostgreSQLExplorer from tests.test_databases import pg_conn @pytest.fixture def load_sample_data_2(): connection = pg_conn()[1] create_table = """ CREATE TABLE SAMPLE_2( ID VARCH...
#!/usr/bin/python2 # -*- coding: utf-8 -*- # # Policy generator # # AUTHORS # # The Veracruz Development Team. # # COPYRIGHT # # See the `LICENSE.markdown` file in the Veracruz root directory for licensing # and copyright information. import argparse import subprocess import datetime import os.path from os import path...
# -*- coding: utf-8 -*- import json import os import subprocess from .logger import Logger log = Logger() class TmuxException(Exception): pass class Tmux(object): """ Tmux controller """ def command(self, cmd, formats=None, many=False): """ Send custom Tmux command and return ri...
from __future__ import print_function import argparse import json import sys import time import requests import urllib.robotparser from urllib.parse import urlparse from requests.exceptions import Timeout from pickle import NONE def main(): """ Check Seed URLs coming from the Commons Collection API. Cycles...
# A simple neural network which learns XOR using back propagation. import random from math import exp # See wikipedia for the neural network structure # http://en.wikipedia.org/wiki/Feedforward_neural_network # http://en.wikipedia.org/wiki/File:XOR_perceptron_net.png # Pitiful inline diagram: # z-b3 ...
# -*- coding: utf-8 -*- """ @date: 2020/4/11 下午2:41 @file: res_net.py @author: zj @description: """ import torch import torch.nn as nn from models.resnet.basic_block import BasicBlock from models.resnet.basic_block_v2 import BasicBlock_v2 from models.resnet.bottleneck import Bottleneck from models.resnet.bottleneck...
import imghdr from functools import partial from pathlib import Path from typing import Optional, Tuple, Union import imagehash import pandas as pd from PIL import ExifTags, Image from pandas_profiling.config import Settings from pandas_profiling.model.summary_algorithms import ( describe_image_1d, named_aggr...
# Copyright © 2020 Interplanetary Database Association e.V., # Planetmint and IPDB software contributors. # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 """ Script to build http examples for http server api docs """ import json import os import os.path from planetmi...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
"""Advent of Code 2018 Day 22.""" import heapq ROCKY = '.' WET = '=' NARROW = '|' MOUTH = 'M' TARGET = 'T' NEITHER = 0 TORCH = 1 GEAR = 2 TYPE_TO_RISK = { ROCKY: 0, WET: 1, NARROW: 2, } EROSION_TO_TYPE = { 0: ROCKY, 1: WET, 2: NARROW } MOVES = ( (1, 0), (0, 1), (-1, 0), (0, -...
import numpy as np import cv2 import torch import torch.nn as nn from torch.autograd import Variable from torch.nn import functional as F class VanillaGrad(object): def __init__(self, pretrained_model, cuda=False): self.pretrained_model = pretrained_model self.features = pretrained_model.children(...
import torch import numpy as np from torch import nn device = "cuda" if torch.cuda.is_available() else "cpu" class ResAttentionBlock(nn.Module): def __init__(self, dim: int, n_heads: int, attention_mask: torch.Tensor = None): super().__init__() self.attention_mask = attention_mask self.multihead_attenti...
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS"...
# Copyright 2021 The FastEstimator 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 appl...
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import arrow import functools import logbook import pyscp import re import yaml from . import ext, lex #############...
import os import struct import torch.utils.data import torchvision import torchvision.datasets as datasets import torchvision.transforms as transforms from dcp.utils.sampler import * def get_cifar_dataloader(dataset, batch_size, n_threads=4, data_path='/home/dataset/', logger=None): """ Get dataloader for c...
import asyncio import json import logging from random import random from typing import List, Union, Dict, Callable, Awaitable from enum import Enum from shortid import ShortId import websockets as ws class SubscribeCategory(str, Enum): account = 'subscribeToAccounts' accounts = 'subscribeToAccounts' mark...
import logging import random import re from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import MiddlewareNotUsed from django.http import JsonResponse from django.template.response import TemplateResponse from django.utils import timezone from django.utils.functi...
# -*- coding: utf-8 -*- """ Functions to apply the energy lowerinf distortion found for a certain charge state of a defect \ to the other charge states. """ import numpy as np import os from ase.io.vasp import read_vasp, write_vasp from pymatgen.io.ase import AseAtomsAdaptor, Structure from pymatgen.core...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. from enum import Enum import infra.proc import infra.proposal import infra.crypto import ccf.clients import http import os import base64 import json from loguru import logger as LOG class NoRecoveryShareFound(Except...
""" Slack chat-bot Lambda handler. """ import boto3 import collections import json import logging import os import random import re import string from urllib.parse import parse_qs import slack DEFAULT_LOG_LEVEL = logging.DEBUG LOG_LEVELS = collections.defaultdict( lambda: DEFAULT_LOG_LEVEL, { "critica...
# coding: utf-8 import ansible.runner import ansible.inventory from parkworker.task_processor import TaskResult from parkworker.monit import Monit from parkworker import const from parkworker2.base import AnsibleMixin class ParseStdoutException(Exception): pass class PingMonit(AnsibleMixin, Monit): name = ...
import glob import json import os import shutil import operator import sys import argparse import math import cv2 import numpy as np MINOVERLAP = 0.5 # default value (defined in the PASCAL VOC2012 challenge) parser = argparse.ArgumentParser() parser.add_argument('-na', '--no-animation', help="no animation is shown."...
import cv2 H_MIN = 0 H_MAX = 255 S_MIN = 0 S_MAX = 255 V_MIN = 0 V_MAX = 255 #default capture width and height FRAME_WIDTH = 640 FRAME_HEIGHT = 480 #max number of objects to be detected in frame MAX_NUM_OBJECTS=50 #minimum and maximum object area MIN_OBJECT_AREA = 20*20 MAX_OBJECT_AREA = FRAME_HEIGHT*FRAME_WIDTH/1.5 ...
import abc import logging from distutils.version import StrictVersion from acconeer.exptool import SDK_VERSION, modes from acconeer.exptool.structs import configbase log = logging.getLogger(__name__) class BaseClient(abc.ABC): @abc.abstractmethod def __init__(self, **kwargs): self.squeeze = kwargs....
import metric_constant as c import collections class Type(object): def __init__(self, id, type, long_name): self.__id = id self.__type = type self.__long_name = long_name @property def id(self): return self.__id @property def type(self): retur...
# Copyright (c) 2020 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 appli...
""" =============================================== vidgear library source-code is deployed under the Apache 2.0 License: Copyright (c) 2019 <NAME>(@abhiTronix) <<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 ob...
#!/usr/bin/env python3 USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_0) AppleWebKit/537.36 (KHTML, like Gecko) ' \ 'Chrome/77.0.3865.120 Safari/537.36' def get_hex_digest(value: str) -> str: import hashlib m = hashlib.sha256() m.update(value.encode()) return m.hexdigest() ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- from additional_urwid_widgets.widgets.time_picker import TimePicker from additional_urwid_widgets.widgets.selectable_row import SelectableRow from datetime import datetime import urwid # Color schemes that specify the appearance off focus and on focus. PALETTE = [("r...
from core.advbase import * from pprint import pprint class Sylas(Adv): def prerun(self): self.s2_states = {(None, None, None): 1} self.combined_states = None self.dmg_test_event = Event("dmg_formula") self.dmg_test_event.dmg_coef = 1 self.dmg_test_event.dname = "test" ...
import datetime import logging import sys import traceback from celery import task from multidb.pinning import pin_this_thread, unpin_this_thread from django_statsd.clients import statsd from kitsune.search.es_utils import index_chunk, UnindexMeBro, write_index, get_analysis from kitsune.search.utils import from_clas...
# This is a part of the experimental Interactive Data Visualization import os import cyglfw3 as glfw import numpy as np import OpenGL.GL as GL from yt import write_bitmap from .input_events import EventCollection, MouseRotation class EGLRenderingContext: """Rendering context using EGL (experimental) Param...
# Copyright (c) 2019, Danish Technological Institute. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. # -*- coding: utf-8 -*- """ Command to get diff between two or three experiments or trials """ # diff -ru [F...
"""A model-based algorithm for the realignment of dMRI data.""" from pathlib import Path from tempfile import TemporaryDirectory, mkstemp from pkg_resources import resource_filename as pkg_fn from tqdm import tqdm import numpy as np import nibabel as nb import nitransforms as nt from nipype.interfaces.ants.registration...
import os, discord from attendance import Member, conn, table_init, get_all_attendance_info, scoreboard from datetime import datetime, timedelta from discord.ext import commands import logging import asyncio import pytz from config import timezone logger = logging.getLogger(__name__) lock = asyncio.Lock() async def p...
#!/usr/bin/env python """ Use the PyZ3950 zoom & marc scripts to: -run a Z39.50 query -save the results to a set of files -parse the Author from the saved results files PyZ3950 <http://www.pobox.com/~asl2/software/PyZ3950/> is part of <NAME>'s Tyrannioware <http://www.pobox.com/~asl2/software/Tyrannio/> This example c...
# ---------------------------------------------------------------------------- # PyWavefront # Copyright (c) 2018 <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of...
# Copyright (c) OpenMMLab. All rights reserved. from unittest.mock import MagicMock, patch import pytest import torch import torch.nn as nn from torch.nn.parallel import DataParallel, DistributedDataParallel from mmcv.parallel import (MODULE_WRAPPERS, MMDataParallel, MMDistributedDataParall...
# -*- coding: utf-8 -*- # Copyright 2015 www.suishouguan.com # # Licensed under the Private License (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://github.com/samuelbaizg/ssguan/blob/master/LICENSE # # Unless ...
#-*- coding:utf-8 -*- import os import argparse import numpy as np import time import sys import argparse import paddle import paddle.fluid as fluid import cv2 from collections import Counter from models.unet import unet from models.PAN import pannet from models.dense_unet import dense_unet from models.multires_unet i...
# PROJECT LONGBOW # AWS LAMBDA WORKER NODE FOR TRANSMISSION BETWEEN AMAZON S3 import json, os, urllib, ssl, logging import boto3 from s3_migration_lib import step_function, step_fn_small_file from botocore.config import Config from pathlib import PurePosixPath import urllib.request import urllib.parse # 环境变量 table_qu...
import csv import re import unicodedata import difflib from Levenshtein import distance def normalize_unicode_to_ascii(data): normal = unicodedata.normalize('NFKD', data).encode('ASCII', 'ignore') val = normal.decode("utf-8") val = val.lower() # remove special characters val = re.sub('[^a-z0-9 ]+'...
#!/usr/bin/env python3 # Copyright 2020 The gRPC 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 ...
import sys import math import time import collections.abc import numpy as np import sympy as sp class CoordFrame(collections.abc.Sequence): def __init__(self, labels): self._data = list(labels) def __len__(self): return len(self._data) def __getitem__(self, key): return self._data[key] def slice_ar...
import torch from torch import nn import FrEIA.modules as Fm import torch.nn.functional as F from torch.distributions.normal import Normal import torch.distributions as dist from nflows.utils import sum_except_batch from einops import repeat import numpy as np from src.models.layers.mixtures.mixture_gaussian import ini...
#!/usr/bin/python # encoding: utf-8 import random import torch from torch.utils.data import Dataset from torch.utils.data import sampler import torchvision.transforms as transforms import lmdb import six import sys from PIL import Image, ImageOps import numpy as np import h5py class THUCNewsDataset(Dataset): '''...
#!/usr/bin/env python # -*- coding: utf8 -*- import sys import os from xml.etree import ElementTree from xml.etree.ElementTree import Element, SubElement from lxml import etree import codecs from libs.constants import DEFAULT_ENCODING TXT_EXT = '.txt' ENCODE_METHOD = DEFAULT_ENCODING class YOLOWriter: def __init...
import colorsys from braindecode.datasets.base import BaseConcatDataset import matplotlib as mpl from matplotlib.colors import LinearSegmentedColormap from matplotlib.lines import Line2D from matplotlib.collections import LineCollection import matplotlib.pyplot as plt import numpy as np from sklearn.decomposition impo...
import collections import os from strictdoc.helpers.sorting import alphanumeric_sort class FileOrFolderEntry: def get_full_path(self): raise NotImplementedError def get_level(self): raise NotImplementedError def is_folder(self): raise NotImplementedError def mount_folder(se...
# ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. # ==================================================================...
""" NiceHash API interface References: - https://docs.nicehash.com/main/index.html - https://github.com/nicehash/rest-clients-demo/blob/master/python/nicehash.py """ from datetime import datetime from hashlib import sha256 import hmac import httpx import json import logging import re import sys from time import mkti...
# Copyright (C) 2021 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 in wri...
# 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 # d...
import sublime import sublime_plugin if sublime.version() < '3000': # we are on ST2 and Python 2.X _ST3 = False from latextools_utils import settings, tex_directives from getTeXRoot import get_tex_root else: _ST3 = True from .latextools_utils import settings, tex_directives from .getTeXRoot...
import io import string import mt940 from pretix.base.decimal import round_decimal """ The parse_transaction_details and join_reference functions are Copyright (c) 2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Softw...