text
stringlengths
3.07k
22.1k
from guillotina import app_settings from guillotina import configure from guillotina import glogging from guillotina.component import get_utility from guillotina_amqp.exceptions import TaskNotFinishedException from guillotina_amqp.exceptions import TaskNotFoundException from guillotina_amqp.exceptions import TaskAlread...
# Disassembler 8051/8052 # # Dictionary of opcodes and instructions # # Copyright (c) 2022 <NAME> # # 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/LICENS...
import os import os.path import shutil import paramiko import subprocess import shlex from stat import S_ISDIR import resorganizer.settings as rser from resorganizer.aux import * paramiko.util.log_to_file("paramiko.log") class Host(object): """Host is the structure storing all necessary information about the host...
### Script for hyperparameter training of non-causal keras tcn #Setup import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import numpy as np import keras_tuner as kt import json from tcn import TCN, tcn_full_summary from tcn import compiled_tcn #Read in the data data = np.load('/...
# file: gui.py # vim:fileencoding=utf-8:fdm=marker:ft=python # lamprop GUI - main program. # # Copyright © 2018,2021 <NAME> <<EMAIL>>. All rights reserved. # Created: 2018-01-21 17:55:29 +0100 # Last modified: 2021-01-02T23:41:26+0100 # # SPDX-License-Identifier: BSD-2-Clause from functools import partial import os im...
import tensorflow as tf import glob, os import util.ops import util.image from data.data_base import Data import conf.path_config as pf import util.flow import data.data_util import numpy as np import cv2 BASE_PATH = pf.get_path('SintelBasePath') BASE_PATH_FULLSET = pf.get_path('SintelFullsetBasePath') FULLSET_NUM_PNG...
import collections import itertools import logging from django.conf import settings from django.contrib.auth.mixins import PermissionRequiredMixin from django.urls import reverse from django.db.models import Count, Prefetch from django.http import HttpResponseNotFound, HttpResponseRedirect from django.utils import tra...
from __future__ import division import argparse, time, logging, os, math from tqdm import tqdm import numpy as np import mxnet as mx from mxnet import gluon, nd from mxnet import autograd as ag from mxnet.gluon import nn from mxnet.gluon.data.vision import transforms from gluoncv.data import mscoco from gluoncv.mode...
# filesetlang.py - parser, tokenizer and utility for file set language # # Copyright 2010 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from .i18n import _ from . import (...
# =================================================================== # # Copyright (c) 2014, Legrandin <<EMAIL>> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source...
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2018, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = ''' --- module: etcd3 short_description: "Set or ...
#coding:utf-8 # Copyright (c) 2019 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 re...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- ''' Manage conversion from SMS 2dm format to gr3. Some material borrowed @author: snegusse ''' import numpy as np import string import re import math import os import argparse import logging class Boundary(object): def __init__(self,name,btype,nodestring): self.name = name s...
# coded by <NAME> #Important: During development and for tests purposes, please use http://sandbox.thesubdb.com/ as the API url. import os import re import sys import time import locale import hashlib import gettext import requests import argparse import numpy as np from os import path from pathlib import Path from tk...
# Copyright (c) 2021, Aakvatech Limited and contributors # For license information, please see license.txt from __future__ import unicode_literals import json import frappe import time import datetime from frappe.model.document import Document from frappe import _ from frappe.model.mapper import get_mapped_doc from fr...
#!/usr/bin/env python3 # Pancancer_Aberrant_Pathway_Activity_Analysis scripts/alternative_genes_pathwaymapper.py import os import sys import pandas as pd import argparse import matplotlib.pyplot as plt import seaborn as sns import argparse from sklearn.metrics import roc_auc_score, average_precision_score sys.path.in...
# Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np from PointwiseFunctions.GeneralRelativity.ComputeGhQuantities import ( spacetime_deriv_detg, deriv_lapse, dt_lapse, deriv_spatial_metric, dt_spatial_metric, deriv_shift, dt_shift) from PointwiseFunctions.GeneralRelativity.C...
"""Various useful constants and enums.""" from enum import Enum, Flag import operator import functools import sys def add_unknown(ns: dict, long: bool = False) -> None: """Add dummy members for enums to allow all bits to be set. This is useful to allow for some compatibility with unhandled games, so the ...
""" Authors: <NAME>, <NAME>, <NAME>, <NAME> <<EMAIL>> This package is distributed under New BSD license. """ from __future__ import division import six import numpy as np from types import FunctionType from scipy.stats import norm from scipy.optimize import minimize from smt.utils.options_dictionary import Option...
"""Graphical visualisation support for prov.model. This module produces graphical visualisation for provenanve graphs. Requires pydot module and Graphviz. References: * pydot homepage: https://github.com/erocarrera/pydot * Graphviz: http://www.graphviz.org/ * DOT Language: http://www.graphviz.org/doc/info/la...
""" nftfwedit - Manage entries in the nftfw blacklist database usage: nftfwedit [-h] [-d | -a | -b] [-p PORT] [-n PATTERN] [-q] [-v] [ipaddress [ipaddress ...]] Manage IP addresses in the nftfw blacklist database positional arguments: ipaddress IP address list optional arguments: -h...
import itertools import os from dataclasses import dataclass, field from pathlib import Path from typing import List, Optional import tvm import tvm.autotvm import tvm.target import tvm.target.tag from omegaconf import OmegaConf from tvm import relay from tvm.driver.tvmc.common import convert_graph_layout, target_from...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- from __future__ import absolute_import from .base import BaseDiagram from .base import BaseProcessor from subprocess import Popen as execute, PIPE, STDOUT, call from os import getcwd, chdir from os.path import abspath, dirname, exists, isdir, join, splitext, basename fr...
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
import torch import torch.nn as nn from torch.optim import Adam from torch.distributions import Normal from crazycar.algos_torch.base import BaseNetwork, BaseModel from crazycar.algos_torch.common import make_mlp class Actor(BaseNetwork): def __init__(self, encoder, act_dim, hiddens=[256, 256]): super()...
# 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...
__path__ = __import__("pkgutil").extend_path(__path__, __name__) from abc import abstractmethod from collections.abc import Iterable, Iterator, Mapping from operator import attrgetter from typing import Any, ClassVar, Literal, Optional from pydantic import PrivateAttr, validator from arti.internal.models import Mode...
import __future__ import gocept.httpserverlayer.wsgi import gocept.selenium import mock import pkg_resources import plone.testing import re import transaction import zeit.cms.interfaces import zeit.cms.testcontenttype.testcontenttype import zeit.cms.testing import zeit.content.image.testing import zeit.content.modules....
# Copyright (c) 2022 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 ap...
# -*- coding: utf-8 -*- # Module: default # Author: <NAME>. # Created on: 28.11.2014 # License: GPL v.3 https://www.gnu.org/copyleft/gpl.html import sys from urllib import urlencode from urlparse import parse_qsl import xbmcgui import xbmcplugin # Get the plugin url in plugin:// notation. _url = sys.argv[0] # Get the...
import glob import os import sys import logging sys.path.append('../../') from config import * sys.path.append(scripts_dir) from classes import * from utils import * # from util_cluster import * # from residue import * def parseFR3D(fr3d_fn, detailed=False, model_id="1"): ret = [] if not os.path.isfile(fr3d_...
import os import sys from lxml import etree from lxml.builder import E ''' 1) Check sample-apps project structure 2) Parse excludes from pom.xml of sample apps project 3) For every sample-app project 4.1) For every sample-app sub project 4.1.1) Check assembly folder 4.1.2) Find corresponding info in the projects.xml ...
import email import locale import os import time from dateutil.parser import parse import docutils.core import docutils.writers.html5_polyglot import feedparser from flask import ( Flask, abort, jsonify, redirect, render_template, request, send_from_directory, url_for, ) from flask_cach...
#!/usr/bin/env python3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit checks for the buildbot code.""" def _MakeFileFilter(input_api, include_extensions=None, ...
import os import itertools import argparse from functools import partial from multiprocessing import Pool, cpu_count import h5py from tqdm import tqdm from tqdm import trange import numpy as np from numpy.lib import recfunctions # np.seterr(all='raise') import scipy.optimize as optimize import scipy.interpolate as int...
import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn import metrics from math import ceil, floor from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA import matplotlib.pyplot as plt...
# -*- coding: utf-8 -*- """ Created on Thu Oct 25 16:25:25 2018 @author: <NAME> This script apply 3 different methods to turn continuous emotion (valence and arousal) to discrete emotion(joy, anger...) based on the self-report from DEAP dataset. Method 1: Find the nearest position and take it as results, call KN...
import argparse import sys from typing import Callable, List, Optional from PlatformNlp import utils from PlatformNlp.data import get_available_word_split_impl, get_available_type def get_preprocessing_parser(default_task="multi_class"): parser = get_parser("Preprocessing", default_task) add_preprocess_args(...
import json import base64 import select import socket import os import sys import multiprocessing from subprocess import call as executeSH from subprocess import run,Popen import subprocess as sp import shutil import random from rich import print as rprint class SetupIPC(): def __init__(self): self.Base_D...
import sys from numpy import cos, sin, tan, degrees, radians, arctan2, pi, arcsin, log import numpy as np from datetime import datetime import calendar import os.path import pytz def date_to_julian_day(my_date): """Returns the Julian day number of a date.""" a = (14 - my_date.month)//12 y = my_date.year + ...
import numpy as np from tinytorch.tensor.data import ( MAX_DIMS, broadcast_index, index_to_position, shape_broadcast, to_index, ) def tensor_map(fn): """ Low-level implementation of tensor map between tensors with *possibly different strides*. Simple version: * Fill in the `...
from keckdrpframework.primitives.base_primitive import BasePrimitive from kcwidrp.core.kcwi_get_std import kcwi_get_std from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \ kcwi_fits_reader, strip_fname import numpy as np from scipy.ndimage import shift from astropy.nddata import CCDData import ...
# -*- coding: utf-8 -*- import os, sys, json, asyncio, pymongo, datetime, time, pandas as pd, math, re sys.path.append(os.path.abspath(os.getcwd())) from flask import jsonify, request, Blueprint from bson.json_util import dumps, ObjectId from api_server.enviroment.enviroment import db from api_server.robots.get_statu...
import os import time from filelock import FileLock import torch from torch.utils.data.dataset import Dataset from torch.nn.utils.rnn import pad_sequence PAD = '<PAD>' SOS = '<SOS>' EOS = '<EOS>' UNK = '<UNK>' PRESET_SPECIAL_TOKENS = [PAD, SOS, EOS, UNK] class Vocab: def __init__( self, vocab, ...
import sys import os import subprocess import time import traceback import tempfile import shutil from io import StringIO from collections import namedtuple import re import git import yaml _PYTHON = sys.executable class TestCase(namedtuple( "TestCase", ("name", "script", "arguments", "output", "tes...
#!/usr/bin/env python import argparse import concurrent.futures import pathlib import boto3 import pyathena class Bucket: def __init__(self, bucket, path): self.bucket = bucket self.path = path class Work(Bucket): def __init__( self, athena_region, athen...
import os os.environ['CUDA_VISIBLE_DEVICES'] = '3' from convnext import ConvNeXt, model_configs from tensorflow.keras.layers import concatenate from imgaug.augmentables.segmaps import SegmentationMapsOnImage from glob import glob import tensorflow as tf import numpy as np import utils_tf1 import imgaug as ia import im...
import numpy as np import pandas as pd import sys np.random.seed(0) def one_hot_encoder(Y): new_Y = np.zeros((Y.shape[0], np.max(Y)+1)) new_Y[np.arange(Y.shape[0]), Y] = 1 return new_Y #Sigmoid function def sigmoid(Z): return 1/(1+np.exp(-Z)) #Tanh function, can be written in terms of sigmoid def tanh(Z): retu...
__all__ = ["get_single_site"] from xarray import Dataset from typing import Optional, Union from pandas import Timestamp def get_obs( sites, species, start_date=None, end_date=None, inlet=None, average=None, keep_missing=False, network=None, instrument=None, status_flag_unflag...
"""Manages Git.""" import logging import os import shlex from functools import partial from funcy import cached_property from pathspec.patterns import GitWildMatchPattern from dvc.exceptions import GitHookAlreadyExistsError from dvc.progress import Tqdm from dvc.scm.base import ( Base, CloneError, FileNo...
import mmap import struct import sys import unittest from macholib import ptypes if sys.version_info[:2] <= (2, 6): import unittest2 as unittest else: import unittest try: from io import BytesIO except ImportError: from cStringIO import StringIO as BytesIO try: long except NameError: long = ...
# coding=utf-8 import os import re import json from PIL import Image DST_DIR="/srv/dev-disk-by-label-DownLoad/BT" #DST_DIR="G:\Download\ff\test" INPUT_VIDEO_SUFFIX=[".ra",".rm",".rmvb",".asf",".wmv",".dat",".mpeg",".MPEG",".mpg",".MPG", ".avi",".AVI",".divx",".vod",".mp4",".MP4",".mov","...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch import torch.nn as nn import torch.nn.functional as F from fairseq import metrics, utils from fairseq.criterions imp...
# -*- coding: utf-8 -*- """ Module summary description. More detailed description. """ from pyrasta.crs import srs_from from pyrasta.io_.files import RasterTempFile, VrtTempFile from pyrasta.tools import _gdal_temp_dataset, _return_raster from osgeo import gdal_array import affine import gdal @_return_raster def ...
import configargparse import logging from pathlib import Path home = Path.home() # Looking at the home folder, then at current folder (later ones in list override previous ones) default_config_files = [ str(home / '.config/platalea/config.ini'), str(home / '.config/platalea/config.yml'), 'config.ini', ...
import math import f import pytest import six # # helpers # @f.maybe_wraps(f.p_num) def mdiv(a, b): if b: return a / b else: return None @f.maybe_wraps(f.p_num) def msqrt(a): if a >= 0: return math.sqrt(a) else: return None @f.either_wraps(f.p_str, f.p_num) def ...
""" Environment agent interface is designed for rollout and simulation. """ import os import gym import ray import numpy as np from collections import defaultdict from dataclasses import dataclass from concurrent.futures import ThreadPoolExecutor from malib import settings from malib.algorithm.common.policy import P...
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
import os import numpy as np import torch import torchaudio import librosa from .swcreaders import load_readers_word_info, save_word_infor_per_reader print("torch version: ", torch.__version__) cwd=os.getcwd() cfilewd=os.path.dirname(os.path.realpath(__file__)) #Audio Processing mfcc_transform = torchaudio.transf...
import asyncio import logging from typing import ( # noqa: F401 Any, Callable, cast, Dict, List, Optional, Set, Tuple, Type, ) from async_lru import alru_cache from eth_keys import ( # noqa: F401 datatypes, keys, ) from eth_utils import ( encode_hex, ) from evm.chain...
import functools import json import logging import random from pathlib import Path from typing import Callable, Iterable, Tuple, Union from discord import Embed, Message from discord.ext import commands from discord.ext.commands import Bot, Cog, Context, MessageConverter from bot import utils from bot.constants impor...
############################################################################################ # 该py文件用于增加一些工具方法 # Created by 吴贻能 on 2019/12/10. ############################################################################################ import collections import heapq from Assay import * VISUAL_ONE_BY_ONE = 0 # 液滴一个...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Time related utils are compiled in this script """ import bisect from datetime import datetime, time, date from typing import List, Optional, Tuple, Union import functools import re import pandas as pd from qlib.config import C @functools....
from django.shortcuts import render, get_object_or_404, redirect from django.db.models import Prefetch from django.forms import modelformset_factory, inlineformset_factory from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.contrib.auth.models import User from django.db.models imp...
import copy from typing import List, Union from django import forms from django.conf import settings from django.forms import ( BaseForm, BaseInlineFormSet, BaseModelForm, BaseModelFormSet, ) from django.forms.forms import DeclarativeFieldsMetaclass from django.forms.models import ModelFormMetaclass from django.ut...
# -*- coding: utf-8 -*- from datetime import date, timedelta from baguette.scrapper.webclient import Webclient from baguette.scrapper.storage import Storage from os import getpid def get_date(anything): if isinstance(anything, date): return anything if type(anything)== type(0): date.fromtimest...
from . import ClientConstants as CC from . import ClientGUICommon from . import ClientGUIMedia from . import ClientGUIMediaControls from . import ClientGUIShortcuts from . import HydrusConstants as HC from . import HydrusData from . import HydrusGlobals as HG from . import HydrusImageHandling from . import HydrusPaths ...
import kabuki import hddm import numpy as np import pandas as pd from numpy.random import rand from scipy.stats import uniform, norm from copy import copy def gen_single_params_set(include=()): """Returns a dict of DDM parameters with random values for a singel conditin the function is used by gen_rand_para...
""" Functions that help in constructing django queries """ from typing import Iterable, Optional from django.db import models from django.db.models import Sum, Q from django.db.models.functions import Coalesce from django.shortcuts import get_object_or_404 from charts.models import ReportDataView from core.logic.date...
""" Tools for managing networking for Docker for Mac. """ import sys import tarfile import time from io import BytesIO from pathlib import Path from shutil import copy, copytree, rmtree from tempfile import TemporaryDirectory from typing import ( # noqa: F401 Any, Callable, Dict, Iterable, List, ...
# PyGetWindow # A cross-platform module to find information about the windows on the screen. # Work in progress # Useful info: # https://stackoverflow.com/questions/373020/finding-the-current-active-window-in-mac-os-x-using-python # https://stackoverflow.com/questions/7142342/get-window-position-size-with-pyth...
from django.db.models.query_utils import Q from django_cron import CronJobBase, Schedule from utilities import config as settings from master_tables.models import Bureau, Organisation, Sector, DocumentCategory, \ Region, OperatingUnit, MapBoundary, Sdg, SdgTargets, SignatureSolution from undp_outputs.models import ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import re import sys import shutil import os import urllib.request from inflect import engine as num_to_word_gen from peche import setup from peche.logging.handlers import StdoutColour _, log = setup('simple-icons-rs-builder') num_to_word = num_to_word_gen()...
import torch import sys from loguru import logger from pathlib import Path from tqdm import tqdm import utils import pandas as pd import numpy as np import librosa import soundfile as sf import uuid import argparse from models import crnn SAMPLE_RATE = 22050 EPS = np.spacing(1) LMS_ARGS = { 'n_fft': 2048, 'n_m...
# --- Imports --- # import time import torch import torch.nn.functional as F import torchvision.utils as utils from math import log10 from skimage import measure import torch.nn as nn import numpy as np import cv2 def to_psnr(pred_image, gt): mse = F.mse_loss(pred_image, gt, reduction='none') mse_split = torc...
# Copyright (C) 2020 coneypo # SPDX-License-Identifier: MIT # Author: coneypo # Blog: http://www.cnblogs.com/AdaminXie # GitHub: https://github.com/coneypo/Dlib_face_recognition_from_camera # Mail: <EMAIL> # 进行人脸录入 / Face register import dlib import numpy as np import cv2 import os import shutil import t...
import os import logging import shlex import re import sys import traceback log = logging.getLogger("emk.asm") utils = emk.module("utils") fix_path_regex = re.compile(r'[\W]+') class _GccAssembler(object): """ Assembler class for using gcc as an assembler. In order for the emk asm module to use an ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved """ API for exporting a pytorch model to a predictor, the predictor contains model(s) in deployable format and predefined functions as glue code. The exported predictor should generate same output as the original pytorch mod...
# 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 applic...
from torch.utils.data import Dataset from torchvision import transforms from PIL import Image import tarfile import hashlib import os import os.path import sys import shutil import tempfile import errno import numpy as np import csv import math try: from requests.utils import urlparse import requests.get as ur...
# Copyright 2018-present Facebook, 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 i...
# This file is part of the pyBinSim project. # # Copyright (c) 2017 <NAME>, <NAME>, <NAME>, <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 lim...
# Copyright (c) 2015-2018 Cisco Systems, Inc. # Copyright (c) 2018 Red Hat, Inc. # # 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 #...
''' Created on May 9, 2018 Takes already run simulations and approximates the probability that one mean is greater than another as well as the average difference in values from the posteriors based on the final posteriors over each condition. @: ''' import beta_bernoulli import ng_normal import pandas as pd import...
import json from typing import Dict, List from mach_nix.data.providers import WheelDependencyProvider, SdistDependencyProvider, NixpkgsDependencyProvider from mach_nix.data.nixpkgs import NixpkgsIndex from mach_nix.generators import ExpressionGenerator from mach_nix.resolver import ResolvedPkg def unindent(text: str...
from typing import Sequence, List import math import torch from allennlp.common.checks import ConfigurationError from allennlp.modules.seq2seq_encoders.seq2seq_encoder import Seq2SeqEncoder class ResidualBlock(torch.nn.Module): def __init__(self, input_dim: int, layers: Sequence...
import torch import torch.nn.functional as F import torch.nn as nn from torch.autograd import Variable import math from utils.beamsearch import * from utils.graph_utils import * def loss_nodes(y_pred_nodes, y_nodes, node_cw): """ Loss function for node predictions. Args: y_pred_nodes: Prediction...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- """ Office Math Markup Language (OMML) """ from dwml import ET,NotSupport from dwml.utils import PY2 from dwml.latex_dict import (CHARS,CHR,CHR_BO,CHR_DEFAULT,POS,POS_DEFAULT ,SUB,SUP,F,F_DEFAULT,T,FUNC,D,D_DEFAULT,RAD,RAD_DEFAULT,ARR ,LIM_FUNC,LIM_TO,LIM_UPP,M,BRK,BLANK,BACKSLASH,ALN,FUNC_P...
import pytest import io from aiocloudstorage.helpers import ( file_checksum, file_content_type, parse_content_disposition, read_in_chunks, validate_file_or_path, is_valid_bucket_name, clean_object_name, random_filename, is_file_url, parse_file_url, check_file_not_empty, ) fr...
#!/usr/bin/env python3 import sys import os import argparse import subprocess import readline import pandas as pd import numpy as np from plio.io.io_bae import read_gpf, save_gpf from appl_tools.surfacefit import run_pc_align, update_gpf ## Create an argument parser def parse_args(): parser = argparse.ArgumentPar...
import processor2000 import fitter2000 from cv2 import cv2 import jigsaw import os import queue import threading import time import numpy as np datadir = r'C:\jigsaw\data\2000' ######### THREAD STUFF ############# threadList = ["Thread-1", "Thread-2", "Thread-3","Thread-4", "Thread-5", "Thread-6"] exitFlag = 0 queueL...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import division import string import re import math import operator from collections import Counter import pkg_resources import repoze.lru from pyphen import Pyphen from . import config CACHE_SIZE = config.CACHE_SIZE easy_word_set = set(...
import copy from functools import wraps from typing import * import couchbase.exceptions import ctypes from couchbase_core import abstractmethod, ABCMeta, operation_mode from couchbase_core._pyport import with_metaclass from datetime import timedelta from enum import IntEnum try: from typing import TypedDict excep...
import itertools import operator import random import pytest from vyper.codegen.types.types import UNSIGNED_INTEGER_TYPES, parse_integer_typeinfo from vyper.exceptions import InvalidType, OverflowException, ZeroDivisionException from vyper.utils import SizeLimits, evm_div, evm_mod, int_bounds PARAMS = [] for t in so...
from typing import Any, Dict, List, Optional, Tuple, Union import lightgbm as lgbm import numpy as np import pandas as pd import scipy from sklearn import impute from sklearn import pipeline from sklearn import preprocessing TDtype = Union[str, type, np.dtype] # TODO(ehotaj): The distinction between Encoder/Model is...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import numpy as np import os.path import sys import random if '/home/opt/ros/kinetic/lib/python2.7/dist-packages' in sys.path: sys.path.remove('/home/opt/ros/kinetic/lib/python2.7/dist-packages') if '/opt/ros/kinetic/lib/python2.7/dist-packages' in sys....
""" Usage: blender --background --python data_preprocess.py ***注意:先修改stl路径, obj保存路径 和 测试集路径*** """ import sys sys.path.append(r"/home/heygears/jinhai_zhou/work/package/hgapi") import hgapi # from hgapi import hgapi import os import glob # from vedo import load from multiprocessing import Process # from tqdm import tq...
# Copyright 2012 by <NAME>. All rights reserved. # This file is part of the Biopython distribution and governed by your # choice of the "Biopython License Agreement" or the "BSD 3-Clause License". # Please see the LICENSE file that should have been included as part of this # package. """Bio.SearchIO parser for HMMER t...