text
stringlengths
3.07k
22.1k
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
#!/usr/bin/python3 # # Copyright (C) 2012 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code must retain the above copyright notice, # this list o...
''' create REMC Regional R16 Error summary Section data in the column sequence Regional Solar, Regional Wind, Regional Combined (Solar+wind), ISTS Solar, ISTS Wind, ISTS Combined (Solar+wind) ''' import pandas as pd from data_fetchers.remc_data_store import getRemcPntData, FCA_FORECAST_VS_ACTUAL_STORE_NAME from utils.r...
#!/usr/bin/env python ############################################################################## ## # This file is part of Sardana ## # http://www.tango-controls.org/static/sardana/latest/doc/html/index.html ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Sardana is free software: you can redi...
#!/usr/bin/env python3 # coding: utf8 # Author: <NAME>, 2018 ''' Create training samples from input documents. ''' import io import os import pickle import logging import tarfile import multiprocessing as mp from collections import defaultdict, namedtuple import numpy as np from ..datasets.load import load_data,...
#!/usr/bin/python3 from sofi.app import Sofi from sofi.ui import Container, View, Row, Panel, Column, ListGroup, ListItem, Div from sofi.ui import Paragraph, Heading, Anchor, Image, Label, Span, Textarea, Input from sofi.ui import Navbar, Dropdown, DropdownItem, UnorderedList from sofi.ui import Button, ButtonGroup, B...
""" Copyright, the CVXPY authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software ...
import asyncio import io import logging import os import shlex import subprocess from tempfile import SpooledTemporaryFile, NamedTemporaryFile from typing import Awaitable, BinaryIO, Optional, Dict from PIL import Image, ImageDraw, ImageOps, UnidentifiedImageError from telethon import TelegramClient, events from telet...
# -*- coding: utf-8 -*- ''' The backend for serving files from the Azure blob storage service. To enable, add ``azurefs`` to the :conf_master:`fileserver_backend` option in the Master config file. .. code-block:: yaml fileserver_backend: - azurefs Starting in Oxygen, this fileserver requires the standalon...
# # Copyright (c) 2018 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...
import numpy as np import torch import torch.nn as nn from torch.autograd import Variable import copy from methods import BaseMethod, get_optimizer from networks import to_device import losses class MultiObjectiveMethod(BaseMethod): """ Multi-objective Optimization for multi-loss weighting. Pape...
""" 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 use this ...
from skills_ml.algorithms.occupation_classifiers.classifiers import CombinedClassifier, KNNDoc2VecClassifier, SocClassifier from skills_ml.algorithms.embedding.train import EmbeddingTrainer from skills_ml.algorithms.occupation_classifiers import SOCMajorGroup, DesignMatrix from skills_ml.algorithms.embedding.models imp...
# Copyright 2019 ICON Foundation # # 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 writi...
from lxml import html, etree import re import os, sys sys.path.append(os.path.dirname(__file__)) import json import argparse import loguru BBOX_COORDINATES_PATTERN = re.compile(".*bbox\s(-?[0-9]+)\s(-?[0-9]+)\s(-?[0-9]+)\s(-?[0-9]+)") DATA_COORDINATES_PATTERN = re.compile("(-?[0-9]+)\s(-?[0-9]+)\s(-?[0-9]+)\s(-?[0-9]...
from pathlib import Path import logging import yaml import pandas as pd from pyam import IamDataFrame from datetime import datetime, timedelta # set up logging formatting logger = logging.getLogger(__name__) stderr_info_handler = logging.StreamHandler() formatter = logging.Formatter('%(name)s - %(levelname)s: %(mess...
# -*- coding: utf-8 -*- # Copyright 2020 ICON Foundation # # 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 ...
from docassemble.base.core import DAObject, DAList, DADict, DAOrderedDict from docassemble.base.util import Value, PeriodicValue, FinancialList, PeriodicFinancialList, DAEmpty from decimal import Decimal import datetime import docassemble.base.functions from collections import OrderedDict import json def flatten(list...
# Exports an HTML-formatted report for the fault injection results stored in the database # TODO: custom grouping conditions, detailed summary page (refactor the functionality from ./obsolete/analyzer.py) # Author: <NAME>, Universitat Politecnica de Valencia import sys import xml.etree.ElementTree as ET import re impo...
import tensorflow as tf import logging,glob import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler logger = logging.getLogger(__name__) gconfig = None labels_dict = {0:0,1:0, -1:0, 2:0, -2:0, 3:0, -3:0, 4:0, -4:0, 5:0, -5:0, 11:1,-11:1,13:2,-13:2,-99:2, 15:2, -15: 2} c...
# Copyright 2016 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 or at # https://developers.google.com/open-source/licenses/bsd """Servlet to export a range of issues in JSON format. """ from __future__ import print_functio...
import requests from .fetcher import Fetcher from ..excepts import DownedSite, MangaNotFound class Mangadex(Fetcher): __doc__ = """this is the new fetcher for mangadex using their new v5 api, the api is still in beta so all of this fetcher is subject to changes quickly""" def __init__(self, link:str=None, m...
'''A few pure-python statistical tools to avoid the need to install scipy. ''' from __future__ import division # Division of integers with / should never round! from math import exp, log, sqrt, gamma, lgamma, erf import itertools __author__ = "<EMAIL>, <EMAIL>" try: # Python 3.4 from statistics import mean, m...
from waflib import Configure, Errors import os import re class Windows(Configure.ConfigurationContext.Platform): NAME = 'windows' SUPPORTED_TARGETS = ( re.compile('.*mingw32.*'), re.compile('.*windows-gnu'), re.compile('.*windows-msvc'), re.compile('.*windows-intel'), r...
from datetime import date, datetime from dateutil.tz.tz import tzoffset import numpy as np import pytest import pytz from pandas._libs import iNaT, tslib from pandas.compat.numpy import np_array_datetime64_compat from pandas import Timestamp import pandas._testing as tm @pytest.mark.parametrize( ...
# coding: utf8 """ This software is licensed under the Apache 2 license, quoted below. Copyright 2014 Crystalnix 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/...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from datetime import date, timedelta from workalendar.core import WesternCalendar, ChristianMixin from workalendar.core import SUN, MON, TUE, WED, FRI, SAT class Brazil(WesternCalendar...
import torch import torch.nn as nn import torch.nn.functional as F from .DCNv2.dcn_v2 import DCN task = {'center':1, 'dis':4, 'line':1} class Bottleneck2D(nn.Module): expansion = 2 def __init__(self, inplanes, planes, stride=1, downsample=None): super(Bottleneck2D, self).__init__() self.bn1 =...
import bpy from bpy.types import Operator, Panel, Menu from ..icons import preview_collections # bl_parent_id = "PT_PT_transform_panel" # bl_category = 'Pivot Transform' class PS_PT_uv_maps_panel(Panel): bl_label = "UV Channel" bl_space_type = 'VIEW_3D' bl_region_type = 'WINDOW' bl_idname = 'PS_PT_...
#!/usr/bin/env python import vtk ROOT_SPLIT = 10 TARGET_LEVEL = 8 TARGET_LEVEL = 6 CUT_OFF = TARGET_LEVEL # ----------------------------------------------------------------------------- # Helpers # ----------------------------------------------------------------------------- def mandelbrotTest(x, y, timeStep = 0): ...
# Borrowed from Pew. # See https://github.com/berdario/pew/blob/master/pew/_utils.py#L82 import contextlib import inspect import io import os import re import sys from dataclasses import dataclass from itertools import zip_longest from pathlib import Path from typing import Any, Callable, Dict, Iterator, List, Mapping,...
r""" Guava error-correcting code constructions. This module only contains Guava wrappers (Guava is an optional GAP package). AUTHORS: - <NAME> (2005-11-22, 2006-12-03): initial version - <NAME> (2006-12-10): factor GUAVA code to guava.py - <NAME> (2007-05): removed Golay codes, toric and trivial codes and placed...
"""This module contains the general information for MgmtBackup ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class MgmtBackupConsts: ADMIN_STATE_DISABLED = "disabled" ADMIN_STATE_ENABLED = "enabled" FSM_RMT_INV_ER...
# MIT 6.034 Lab 5: Bayesian Inference import copy from functools import reduce def approx_equal(a, b, epsilon=0.0000000001): """Returns True if two numbers a and b are equal to within epsilon, otherwise False""" return abs(a-b) <= epsilon def product(factors): "Computes the product of a list of numbe...
# 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 # distributed under t...
#! -*- coding: utf-8 import gc import json import logging import os import os.path as path import sys from argparse import ArgumentParser from enum import IntEnum import numpy as np os.environ.pop('http_proxy', None) os.environ.pop('https_proxy', None) LOGFORMAT = "[%(asctime)s] <%(levelname)s> %(me...
# Copyright 2019 The Glow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
"""This module contains the general information for ComputePsuControl ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class ComputePsuControlConsts: CLUSTER_STATE_N_A = "N/A" CLUSTER_STATE_NOT_CLUSTERED = "not-clustered...
# good turing smoothing unigram & bi-gram by wk '''1. 标点符号是否算作一个词。 是 2. 如何进行分句 接受按行分句或者按句号\问号\感叹号分句,请在文档中注明分句方式 3. 文档库大小 按training set n-gram的总数量(unigram计算1-gram, bigram计算2-gram数量) 4. 数据输出格式 每一行输出两个结果,先输出unigram,后输出bigram 5. 关于单词词性 可将同一单词不同词性看做同一个词或者不同词,请在文档中注明具体选择''' import os import numpy as np tra...
# # Copyright (c) nexB Inc. and others. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/debian-inspector for support or download. # See https://aboutcode.org for more information about nexB OSS projects. # # ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, int_or_none, parse_iso8601, parse_duration, try_get, update_url_query, ) class TVNowBaseIE(InfoExtractor): _VIDEO_FIEL...
import random #128 bit key round constants rcon_128 = [0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,0x1B,0x36] #Substitution Box sbox = ( 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0x...
from sympy.core.numbers import Integer, Rational from sympy.core.singleton import S from sympy.core.sympify import _sympify from sympy.utilities.misc import as_int def continued_fraction(a): """Return the continued fraction representation of a Rational or quadratic irrational. Examples ======== ...
''' Package support for FreeBSD ''' # Import python libs import logging # Import salt libs import salt.utils log = logging.getLogger(__name__) def __virtual__(): ''' Set the virtual pkg module if the os is FreeBSD ''' return 'pkg' if __grains__['os'] == 'FreeBSD' else False def _check_pkgng(): ...
# -*- coding: utf-8 -*- from os import stat from nonebot import on_command, get_bot, scheduler from requests.sessions import session from rin import aiorequests, priv from ast import literal_eval import rin import os, json from .. import _pcr_data from ..chara import download_chara_icon, roster # 卡池更新是否通知管理员 NOTICE = ...
#!/usr/bin/env python from optparse import OptionParser import glob import pdb import os import sys import h5py import numpy as np import pandas as pd from scipy.stats import combine_pvalues, pearsonr, ttest_rel, wilcoxon from tabulate import tabulate import matplotlib.pyplot as plt import seaborn as sns ''' basenj...
''' Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying this...
#!/usr/bin/env python3 import argparse import csv import logging import os import shutil import subprocess log = logging.getLogger(__name__) class ScriptException(Exception): """Custom exception class with message for this module.""" def __init__(self, value): self.value = value super().__...
# -*- coding: utf-8 -*- ############################################################################### # Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. # # All rights reserved. # # This file is part of the AiiDA-FLEUR package. ...
import torch import math import numpy as np import torch.nn.functional as F from torch import nn from mmcv.ops import ModulatedDeformConv2dPack from mmcv.runner import auto_fp16 from mmdet.models.builder import BACKBONES from .dla import DLA BN_MOMENTUM = 0.1 def fill_fc_weights(layers): for m in layers.modules(...
#!/usr/bin/env python from sys import argv import json import glob import os import subprocess def create_params(target): target.write("\n") target.write("#+-------------------------------------------------------------------------------\n") target.write("# The following parameters are assigned with defaul...
"""The main API for the client-side of hsdev. """ import json import pprint import queue import random import socket import sys import threading import time import traceback import SublimeHaskell.internals.atomics as Atomics import SublimeHaskell.internals.logging as Logging import SublimeHaskell.internals.settings a...
import numpy as np from sklearn.metrics import accuracy_score, f1_score from pytorch_metric_learning.losses.ntxent_loss import NTXentLoss from pytorch_metric_learning.utils import common_functions as c_f import torch def get_all_pairs_indices(labels, ref_labels=None): """ Given a tensor of labels, th...
import logging from abc import abstractmethod from enum import Enum from pathlib import Path from typing import Tuple, Union import numpy as np from hyperopt import hp, fmin, tpe import flair.nn from flair.data import Corpus from flair.embeddings import DocumentPoolEmbeddings, DocumentRNNEmbeddings from flair.hyperpa...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2019 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Tests for OpenAIRE dataset loaders and resolvers.""" from __future__ import abso...
# gpl: authors <NAME>, <NAME> import bpy import os from bpy.types import ( Operator, Panel, ) from bpy.props import IntProperty import subprocess from . import functions proxy_qualities = [ ("1", "25%", ""), ("2", "50%", ""), ("3", "75%", ""), ("4", "100%", ""), ("5", ...
# coding: utf-8 """Test function in module.""" import pytest from colorama import Fore from colorclass import Color from termcolor import colored from terminaltables.width_and_alignment import align_and_pad_cell @pytest.mark.parametrize('string,align,width,expected', [ ('test', '', 4, ['test']), (123, '', 3...
""" functionality specific to the RP2. See: https://docs.micropython.org/en/v1.18/library/rp2.html The ``rp2`` module contains functions and classes specific to the RP2040, as used in the Raspberry Pi Pico. See the `RP2040 Python datasheet <https://datasheets.raspberrypi.org/pico/raspberry-pi-pico-python-sdk.pdf>`_ f...
# Copyright (c) 2017, 2020 ADLINK Technology Inc. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 # which is available at https://www.apache.org/license...
# -*- coding: utf-8 -*- #!/usr/bin/env python # # Copyright 2017-2020 BigML # # 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...
# -*- coding: utf-8 -*- # Apache Software License 2.0 # # Copyright (c) 2018, <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/LICENSE-2.0 # # Unless ...
""" A basic forum model with corresponding thread/post models. Just about all logic required for smooth updates is in the save() methods. A little extra logic is in views.py. """ from django.db import models import datetime from django.contrib.auth.models import User, Group from django.conf import settings from dja...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models, fields, api, _ from odoo.exceptions import UserError class SaleOrder(models.Model): _inherit = 'sale.order' carrier_id = fields.Many2one('delivery.carrier', string="Delivery Method", d...
# Tencent is pleased to support the open source community by making ncnn available. # # Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. # # Licensed under the BSD 3-Clause License (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the...
# -* coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.conf import settings from django.contrib import admin from django.http import HttpResponse from django.core.mail import send_mail from django.template.loader import render_to_string from django.utils.translation import ugettext...
"Template tags for rendering snippet content." import django from django import template from django.template import base as template_base from django.conf import settings from django.core.cache import cache from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ImproperlyConfigur...
# Copyright 2017 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. from google.appengine.ext import ndb from common import exceptions from common.findit_http_client import FinditHttpClient from common.waterfall import failu...
#!/usr/bin/env python # Copyright Contributors to the Open Shading Language project. # SPDX-License-Identifier: BSD-3-Clause # https://github.com/AcademySoftwareFoundation/OpenShadingLanguage def run_2space_tests (triptype) : global command command += testshade("-t 1 -g 32 32 -od uint8 -o Cout out_transform_...
# Copyright 2019 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 ...
# coding=utf-8 # Copyright 2021 The Rliable Authors. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
#!/usr/bin/python3 """ You gotta run this with sudo!! optional arguments: * supply with --no-notifs if you don't want to use telegram-sent to get notifications. * supply with --no-logfile to disable printing. * supply with --no-gnuplot to disable gnuplot. For a full documentation on how to use this and how to set it...
import os from glob import glob import dask.array as da import numpy as np import scipy.ndimage as sc import tables as tb from bokeh.models import ColumnDataSource, Float from inqbus.graphdemo.bokeh_extension.helpers import \ binary_from_data_map from inqbus.graphdemo.constants import ( MAX_NUMBERS_DEFAULT, ...
#!/usr/bin/python3 """ All heavy lifting performed by mveres01 at https://github.com/mveres01/multi-contact-grasping src/collect_grasps.py """ # Command line args import sys, getopt # Triangular mesh tools import numpy as np import trimesh # Plots from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import ...
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name from typing import Dict import pytest from models_library.projects import Project from models_library.projects_nodes import Inputs, InputTypes, SimCoreFileLink from pydantic import create_model from simcore_service...
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.fields import GenericForeignKey from django.conf import settings from . import registry from .compat import reverse from .settings import import_setting class Run(models.Model): user = models.F...
import random import pygame as pg import config, environment class TileGrid(list): def __init__(self, sub, rows, columns): super().__init__([[None] * columns for row in range(rows)]) self.sub = sub self.rows = rows self.columns = columns # For an even length row, the two m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 19 14:55:02 2021 @author: <NAME> Copyright 2021 <NAME> 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 copyrigh...
"""Functions for moving money between Gratipay and the outside world. """ from __future__ import unicode_literals from decimal import Decimal, ROUND_UP import balanced from aspen import log from aspen.utils import typecheck from gratipay.exceptions import NegativeBalance, NoBalancedCustomerHref, NotWhitelisted from ...
import argparse import logging import os import re from io import BytesIO from tempfile import TemporaryFile import boto3 import botocore from warcio.archiveiterator import ArchiveIterator from warcio.recordloader import ArchiveLoadFailed from pyspark import SparkContext, SparkConf from pyspark.sql import SQLContex...
"""py-motmetrics - metrics for multiple object tracker (MOT) benchmarking. <NAME>, 2017 https://github.com/cheind/py-motmetrics Files ----- All file content, ground truth, and test files have to comply with the format described in <NAME>, et al. "Mot16: A benchmark for multi-object tracking." arXiv preprint arXiv:16...
import numpy as np import cv2 import PIL from random import shuffle import torch from torchsummary import summary from torch import from_numpy, tensor from torch.utils.data import Dataset, DataLoader from torchvision import transforms import time from timm.models.efficientnet import efficientnet_b3 # timm library ...
"""Perform joint genotyping using GATK HaplotypeCaller with gVCF inputs. For GATK4, merges into a shared database using GenomicsDBImport. For GATK3 handles merging of large batch sizes using CombineGVCFs. For both, follows this with joint variant calling using GenotypeGVCFs. """ import math import os import shutil imp...
import sys import numpy as np from .skeleton import Skeleton, Bone from . import posquat as pq fbxsdkpath = r'D:\Software\fbx_python37_x64' if fbxsdkpath not in sys.path: sys.path.append(fbxsdkpath) import FbxCommon as fb import fbx def find_mesh_node(pScene): def _get_mesh(pNode): if isinstance(pNo...
# Copyright (c) 2021 AccelByte Inc. All Rights Reserved. # This is licensed software from AccelByte Inc, for limitations # and restrictions contact your company contract manager. # # Code generated. DO NOT EDIT! # template file: justice_py_sdk_codegen/__main__.py # justice-platform-service (4.10.0) # pylint: disabl...
""" This file contains all operations about training saliency map using PyTorch Paper: <The limitations of Deep Learning in Adversarial Settings> Created by <NAME> Date: 2020/09/04 """ import torch as t import torchvision as tv import matplotlib.pyplot as plt from torch.nn import functional as F import nump...
from __future__ import annotations import inspect from typing import Callable, cast, FrozenSet, Iterable, Optional, overload, TypeVar, Union from typing_extensions import final, get_type_hints from ._factory import FactoryMeta, FactoryWrapper from ._internal import API from ._internal.utils import Copy, FinalImmutab...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, string_types """build query for doclistview and return results""" import frappe.defaults import frappe.share from frappe import _ import frappe.permi...
#-*-coding:utf-8-*- import argparse import os import mmcv import torch import torch.nn as nn import numpy as np from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpoint from mmdet.apis import multi_gpu_test, single_gpu_test from mmdet.core i...
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np import abc import functools import operator import utils import approximators from constants import FLOAT_DTYPE # ============================================================================== # === abstract base class of hedge model class BaseHedge(t...
from kernel_tuner import tune_kernel import numpy import argparse import json def generate_code(tuning_parameters): code = \ "__global__ void fct_ale_b2(const int maxLevels, const <%REAL_TYPE%> dt, const <%REAL_TYPE%> fluxEpsilon, const int * __restrict__ nLevels, const <%REAL_TYPE%> * __restrict__ area, ...
import bottle import inspect import logging from collections import defaultdict from functools import wraps, partial __version__ = "2019.12.22" common_kwargs = {"request": bottle.request, "response": bottle.response} def __cors_dict__(allow_credentials, origin, methods): cors_string = "Origin, Accept , Content-T...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import os from itertools import product import numpy as np import pytest from chemreac import ReactionDiffusion from chemreac.integrate import run from chemreac.serialization import load from chemreac.ch...
# Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. ...
# Copyright 2021 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
# coding=utf-8 """ Training model """ import pickle import time import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split import config from batch_generate import BatchGenerator from NER_Model_advanced import bi_lstm_crf # 数据导入 data_path = "/Users/li/workshop/MyRepository/DeepNa...
# @author: <NAME> (CVIT) from fairseq import options, utils from fairseq.models import ( register_model, register_model_architecture, ) from fairseq.models.fairseq_model import CVITLanguageModel from fairseq.models.transformer import ( Embedding, TransformerEncoder, ) from fairseq.modules import ( ...
#!/usr/bin/env python3 import urllib.request import json import hashlib import shutil import os import requests from threading import Thread from pathlib import Path from zipfile import ZipFile from PIL import Image BUFF_SIZE = 65536 root_dir = Path(__file__).parent def create_dir(path): if not Path(path).exis...
""" Script to generate the skeleton of a Flask REST API from an OpenAPI 3.0 YAML specification. """ from ruamel.yaml import YAML from typing import List from pprint import pprint MODELS_PREAMBLE = '''\ import json from uuid import uuid4 from enum import Enum, unique from typing import Optional, List from dataclasses ...
import pandas as pd import requests import os.path import bs4 import requests import urllib3 import csv from os import path #Data loader functions belong here. This is where # information about the data files is found. def load_proteomics(version='current', level='protein', prefix="", suffix="To...
import numpy as np import tvm from tvm import autotvm import topi import logging import topi.testing from tvm.contrib.pickle_memoize import memoize from topi.util import get_const_tuple import json import os import sys import tensorflow as tf flags = tf.flags flags.DEFINE_string("input_path", "", "path of input file")...