text
stringlengths
6.04k
39.5k
import json import logging from decimal import Decimal from typing import TYPE_CHECKING, Any, Callable, Dict, Optional import Adyen import opentracing import opentracing.tags from django.conf import settings from django_countries.fields import Country from .....checkout.calculations import checkout_shipping_price, ch...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
import numpy as np from collections import Counter import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.stats as stats from pandas.api.types import is_object_dtype, is_numeric_dtype from scipy import stats def grubbs_remove_outlier(X, alpha): ''' This function runs Grubbs’ Sta...
"""Tweaked version of corresponding AllenNLP file""" import logging from collections import defaultdict from typing import Dict, List, Callable from allennlp.common.util import pad_sequence_to_length from allennlp.data.token_indexers.token_indexer import TokenIndexer from allennlp.data.tokenizers.token import Token fr...
import mxnet as mx import numpy as np from config import config from rcnn.PY_OP import fpn_roi_pooling, proposal_fpn, mask_roi, mask_output, proposal_fpn_out, rpn_fpn_ohem FPN = False USE_DCN=False def conv_act_layer(from_layer, name, num_filter, kernel=(1,1), pad=(0,0), \ stride=(1,1), act_type="relu", bias_wd_mu...
""" bomb.py - Simple Sopel bomb prank game Copyright 2012, <NAME> http://embolalia.net Licensed under the Eiffel Forum License 2. http://sopel.chat """ from __future__ import division, unicode_literals from sopel.module import * from sopel.tools import Identifier from sopel import formatting from random import choice,...
# Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE.md file in the project root # for full license information. # ============================================================================== """ Unit tests for reshaping operations. """ from __future__ import division impor...
#! /usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2018, ARM Limited and contributors. # # 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/l...
""" Copyright (c) 2018-2020 Cyberhaven Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
# coding: utf-8 """Test function in module.""" import pytest from colorama import Fore, Style from colorclass import Color from termcolor import colored from terminaltables.build import build_border @pytest.mark.parametrize('outer_widths,horizontal,left,intersect,right,expected', [ ([5, 6, 7], '-', '<', '+', '>...
# The copyright in this software is being made available under the BSD # License, included below. This software may be subject to other third party # and contributor rights, including patent rights, and no such rights are # granted under this license.   # # Copyright (c) 2021, BBC Research & Development # All rights r...
# Copyright 2019 Scalyr Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
import argparse import sys from collections import Counter from collections import defaultdict import itertools import time import numpy as np import math import pickle import setRank_TREC def string2dict(s): d = {ele.split(":")[0]: float(ele.split(":")[1]) for ele in s.split(",")} return d def dict2string(d): ...
#!/usr/bin/env python import pytest import networkx as nx from networkx.testing.utils import * from .test_graph import BaseAttrGraphTester, TestGraph class BaseMultiGraphTester(BaseAttrGraphTester): def test_has_edge(self): G = self.K3 assert G.has_edge(0, 1) == True assert G.has_edge(0...
r""" Sonora Spectrum ----------------- A container for a single grid-point of the Sonora precomputed synthetic model spectrum of brown dwarfs and free-floating Gas Giant planets. The spectrum is a vector with coordinates wavelength and flux :math:`F(\lambda)`. SonoraSpectrum ############### """ import copy import w...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse import re import sys import time import traceback from functools import wraps from typing import Generator, TextIO, BinaryIO import serial MAX_RETRIES = 5 NAND_SIZE = 524288 * 1024 BLOCK_SIZE = 128 * 1024 PAGE_SIZE = 2048 line_regex = re.compile(r'(?P<addr>[...
from inspect import isfunction from math import ceil import torch from torch import nn, einsum import torch.nn.functional as F from einops import rearrange, repeat # helpers def exists(val): return val is not None def uniq(arr): return{el: True for el in arr}.keys() def default(val, d): if exists(val):...
"""Tasmota sensor.""" from __future__ import annotations import logging from typing import Any import attr from .const import ( CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, CONCENTRATION_PARTS_PER_BILLION, CONCENTRATION_PARTS_PER_MILLION, CONF_DEVICENAME, CONF_MAC, CONF_SENSOR, ELECTRICAL_CU...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Determining whether files are being measured/reported or not.""" # For finding the stdlib import atexit import inspect import itertools import os import platfor...
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany...
# Copyright (c) 2018, NVIDIA CORPORATION. import warnings import numpy as np import pandas as pd from toolz import partition_all import dask import dask.dataframe as dd from dask import compute from dask.base import normalize_token, tokenize from dask.compatibility import apply from dask.context import _globals from ...
#**************************************************************************# # This file is part of pymsc which is released under MIT License. See file # # LICENSE or go to https://github.com/jam1garner/pymsc/blob/master/LICENSE # # for full license details. # #***********...
# Copyright 2021 Foreseeti AB <https://foreseeti.com> # # 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...
from re import compile as re_compile from os import path as os_path, listdir import os, glob, time, random from Components.MenuList import MenuList from Components.Harddisk import harddiskmanager from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename, pathExists, fileExists, crawlDirectory from enigma import...
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """This module defines Auth Server frontend url handlers.""" import os import base64 import webapp2 from google.appengine.api import app_identi...
""" Pyro MessageBus: a simple pub/sub message bus. Provides a way of cummunicating where the sender and receivers are fully decoupled. Pyro - Python Remote Objects. Copyright by <NAME> (<EMAIL>). """ import threading import uuid import datetime import time import logging import traceback import sys import pickle fro...
import sys import os import arcade """ >>> from dill.source import getname >>> >>> def add(x,y): ... return x+y ... >>> squared = lambda x:x**2 >>> >>> print getname(add) 'add' """ print("https://www.slideshare.net/tzanany/escaping-the-python-sandbox") print("https://blog.teclado.com/python-abc-abstract-base-...
import os import pickle import re import sys from mock import patch, Mock, call from pytest_relaxed import trap from pytest import skip, raises from raft import ( AuthFailure, Context, Config, FailingResponder, ResponseNotAccepted, StreamWatcher, MockContext, Result, ) from _util impo...
#!/usr/bin/env python """ Copyright (c) 2015-2016 <NAME>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,...
"""Widely useful utility methods. """ from collections import OrderedDict, Iterable, Sequence from datetime import datetime import errno import functools import logging import math from numbers import Number import time from atropos import AtroposError # TODO: the nucleotide table should be implemented as an alphabet....
""" Module: libfmp.c6.c6s2_tempo_analysis Author: <NAME>, <NAME> License: The MIT license, https://opensource.org/licenses/MIT This file is part of the FMP Notebooks (https://www.audiolabs-erlangen.de/FMP) """ import numpy as np import librosa from scipy import signal from scipy.interpolate import interp1d from matplo...
from abc import abstractmethod from typing import List, Optional, Pattern, Dict, Match from datetime import datetime, timedelta from collections import namedtuple import regex from recognizers_text.utilities import RegExpUtility, QueryProcessor from recognizers_text.extractor import Extractor, ExtractResult from recog...
import os import math import sys import matplotlib.pyplot as plt from matplotlib.ticker import ScalarFormatter, LogFormatter, StrMethodFormatter, FixedFormatter import sklearn.metrics as skl_metrics import numpy as np from NoduleFinding import NoduleFinding from tools import csvTools # Evaluation settings bPerformB...
""" Normalize :class:`~pySPACE.resources.data_types.feature_vector.FeatureVector` """ import os import cPickle import scipy.stats import numpy from collections import defaultdict from pySPACE.missions.nodes.base_node import BaseNode from pySPACE.resources.data_types.feature_vector import FeatureVector from pySPACE....
""" The source code is developed by <NAME> https://github.com/mgrubisic from University of Osijek, Croatia. The numerical model with the associated analysis was described in detail by Prof. <NAME> in the Portwood Digital blog https://portwooddigital.com/2021/01/03/sensitivity-training/. Run the source code in your favo...
# coding: utf-8 """Tests for lightgbm.dask module""" import socket from itertools import groupby from os import getenv from sys import platform import lightgbm as lgb import pytest if not platform.startswith('linux'): pytest.skip('lightgbm.dask is currently supported in Linux environments', allow_module_level=Tru...
from __future__ import print_function import unittest import tarfile import shutil import json import os import tempfile from subprocess import Popen import subprocess import numpy as np from coremltools.converters import caffe as caffe_converter from coremltools.models.utils import macos_version import coremltools imp...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
# -*- coding: utf-8 -*- # # Copyright (c) 2010 by xt <<EMAIL>> # # This program 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 of the License, or # (at your option) any later version. # # Thi...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2012 HDE, 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, inc...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
''' Copyright (c) 2018 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublice...
import torch import torch.nn.functional as F import torch.utils.checkpoint as cp from mmcv.cnn import build_activation_layer, build_conv_layer, build_norm_layer from mmcv.runner import BaseModule, Sequential from mmcv.utils.parrots_wrapper import _BatchNorm from ..builder import BACKBONES from ..utils.se_layer import ...
import transformers import torch import torch.nn as nn from textblob import TextBlob from torch.nn import functional as F print('transformer version:', transformers.__version__) from transformers import PreTrainedModel, RobertaConfig, RobertaTokenizer from transformers import RobertaPreTrainedModel, RobertaEmbeddings...
#!/usr/bin/env python # -*- coding: utf-8 -*- # gui_calibrate.py # Copyright (c) 2017-2021, <NAME> # # This file is part of the cameratransform package. # # cameratransform is free software: you can redistribute it and/or modify # it under the terms of the MIT licence. # # cameratransform is distributed in the hope th...
""" ******************************************************************* Copyright (c) 2017, 2019 IBM Corp. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 and Eclipse Distribution License v1.0 which accompany this distributi...
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
# Copyright 2014-2015, Tresys Technology, LLC # # This file is part of SETools. # # SETools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 2.1 of # the License, or (at your option) any l...
import aiohttp import asyncio import json import logging import pytest from aiorpcx import JSONRPCv1, JSONRPCLoose, RPCError, ignore_after, Request from quantumx.lib.coins import BitcoinCash, CoinError, Bitzeny, Dash from quantumx.server.daemon import Daemon, FakeEstimateFeeDaemon coin = BitcoinCash # These should...
# -*- coding: utf-8 -*- ''' Define the Transformer model ''' import torch import torch.nn as nn import numpy as np import torch.nn.init as init __author__ = "<NAME>" #refer to "https://github.com/jadore801120/attention-is-all-you-need-pytorch" class ConstantsClass(): def __init__(self): self.PAD = 0 ...
# Copyright 2016 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 accompa...
#!/usr/bin/python3 """ Help sysops to quickly check and/or delete pages listed for speedy deletion. This bot trawls through candidates for speedy deletion in a fast and semi-automated fashion. It displays the contents of each page one at a time and provides a prompt for the user to skip or delete the page. Of course, ...
""" QNetworkListWidget: a list of networks QNetworkInternals: details of a network """ # standard imports import logging # Qt imports from PyQt5.QtCore import Qt, QCoreApplication, QEvent, pyqtSignal from PyQt5.QtGui import QPaintEvent, QPalette from PyQt5.QtWidgets import QWidget from PyQt5.QtWidgets import QPushBu...
from django.shortcuts import render from django.http import HttpResponse from . models import Scraper, Twitter, Country from django.conf import settings import os import json from .apps import ScraperConfig from scraper.forms import RouteForm from django.views.generic import FormView from django.core.mail import send_m...
# 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 agree...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ desispec.io.meta ================ IO metadata functions. """ from __future__ import absolute_import, division, print_function import os import datetime import glob import re import numpy as np from .util import healpix_subdir...
"""Definitions for the review request detail view.""" from __future__ import unicode_literals from collections import Counter, defaultdict from datetime import datetime from django.db.models import Q from django.template.loader import render_to_string from django.utils import six from django.utils.timezone import ut...
import copy import datetime import logging from typing import Dict, List from dateutil.relativedelta import relativedelta from django.conf import settings from django.db import IntegrityError, models, transaction from django.db.models.functions import window from django.utils.translation import ugettext_lazy as _ from...
from django.http import ( HttpResponse, Http404, HttpResponseForbidden, HttpResponseRedirect) from django.shortcuts import render_to_response, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from django.template import RequestContext from django.template.loader import rende...
''' Copyright (C) 2013-2016 ddurdle This program 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 of the License, or (at your option) any later version. This program is di...
import sys import os import cv2 import numpy as np from scipy import interpolate import time from math import ceil import argparse class ProgressBar(): def __init__(self, bar_length=40, slug='#', space='-', countdown=True): self.bar_length = bar_length self.slug = slug self.space = space...
"""Astronomical coordinate functions.""" import re,pdb import numpy as np from numpy import arccos,sin,cos from math import pi # constants DEG_PER_HR = 360. / 24. # degrees per hour DEG_PER_MIN = DEG_PER_HR / 60. # degrees per min DEG_PER_S = DEG_PER_MIN / 60. # degrees per sec DEG_PER_AMIN = 1./...
# Copyright (c) 2021, NVIDIA CORPORATION. from __future__ import annotations import itertools from collections.abc import MutableMapping from functools import reduce from typing import ( TYPE_CHECKING, Any, Callable, Dict, Mapping, Optional, Tuple, Union, ) import pandas as pd import...
from __future__ import print_function import os import platform import subprocess import sys import tempfile import textwrap from timing import monotonic_time_nanos from tracing import Tracing from buck_tool import BuckTool, which, check_output, JAVA_MAX_HEAP_SIZE_MB from buck_tool import BuckToolException, RestartBuc...
from django.shortcuts import render, redirect, get_object_or_404 as G404 from crop_rotator.settings import LANGUAGES as L from strona.models import ( PageSkin as S, PageNames as P, RotatorEditorPageNames, ) from .classes import ( PageElement as pe, PageLoad, ) from .snippets import flare from .model...
# Copyright 2018 CNRS - Airbus SAS # Author: <NAME> # # 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 of conditions and the follow...
''' =============================== XMODEM file transfer protocol =============================== .. $Id$ This is a literal implementation of XMODEM.TXT_, XMODEM1K.TXT_ and XMODMCRC.TXT_, support for YMODEM and ZMODEM is pending. YMODEM should be fairly easy to implement as it is a hack on top of the XMODEM protocol...
from __future__ import print_function, division import scipy #from keras.datasets import mnist from keras_contrib.layers.normalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import BatchNormalization, Activation, ZeroPadding2D from ke...
"""PSS_utils.py A place to organize methods used by multiple modules """ from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np import scipy as sp from astropy import units as u from pint import models #try: # import pyfftw # use_pyfftw = Tr...
from sdf_timing import sdfparse, sdfwrite from sdf_timing import utils as sdfutils from pathlib import Path import argparse import re import json from datetime import date from collections import defaultdict from .liberty_to_json import LibertyToJSONParser from . import log_printer from .log_printer import log class ...
#!/usr/bin/env python3 # Description: This script creates an html report of all the events. # It assumes that event (json) files are created by each # MPI process indepdently. import os import argparse import sys import json from collections import defaultdict import shutil from line_high...
from __future__ import print_function # -*- coding: utf-8 -*- """ Created on Tue Mar 10 13:18:46 2015 @author: nadiablago """ from matplotlib import pylab as plt import glob from astropy.io import fits as pf import os, sys from optparse import OptionParser import matplotlib import numpy as np from astropy.wcs import...
import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) from sklearn.metrics import precision_recall_fscore_support from sklearn.metrics import mean_squared_log_error from sklearn.metrics import mean_squared_error from sklearn.metrics import confusion_matrix from sklea...
#! /usr/bin/env python # Copyright (c) 2014 <NAME>, ESAT-STADIUS # 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, ...
""" Module provides an interface to sub-interfaces on an engine. A 'top level' interface is linked from the engine and will be PhysicalInterface, TunnelInterface, etc. Within the top level interface, there are sub-interface configurations that identify the basic settings such as ip address, network, administrative sett...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ***************************************************************************** # $Id: validate_cloud_optimized_geotiff.py d464f5b35ba2c5ad85fe60b723509122909a7127 2020-05-15 20:32:31 +0200 Even Rouault $ # # Project: GDAL # Purpose: Validate Cloud Optimized GeoTIFF f...
# -*- coding: utf-8 -*- import json import os import re import tempfile from hashlib import md5 from oslo.config import cfg from ping import quiet_ping from dnsdb.constant.constant import ZONE_MAP, VIEW_ZONE, NORMAL_TO_VIEW from . import commit_on_success from . import db from .models import DnsHeader from .models i...
import pytest import numpy as np from syndata.core import ClusterData from syndata.maxmin import MaxMinClusters, MaxMinCov, MaxMinBal, maxmin_sampler # Test Cases for maxmin_sampler def test_maxmin_sampler(): """ Make sure the sampling mechanism doesn't break when wrong inputs are supplied. """ # Test cases th...
import torch import torch.nn as nn from timm.models.layers import DropPath, trunc_normal_ import math import numpy as np class Mlp(nn.Module): def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.): super().__init__() out_features = out_features or in_f...
# Copyright 2019 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...
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output import numpy as np import casadi from casadi import SX, DM from math import cos, sin import plotly.graph_objects as go app = dash.Dash(__name__) server = app.server app.layout = html.Div( ...
#!/usr/bin/python # The following section is neccesary in order for DocOpt command line argument parsing module to operate # Do not change the following syntax unless you are familiar with DocOpt specifications. """Resume Ranker reviews resumes and assigns a score based on percentile matching file content. Valid fil...
from collections import namedtuple from mock import patch import re import unittest from urllib import urlencode from wtforms.validators import ValidationError import pytest from fixtures import standard_graph, graph, users, groups, session, permissions # noqa from fixtures import fe_app as app # noqa from util imp...
# This code is deprecated by BERT_revised.py # Please see that code for updated detail import argparse import os import pickle from itertools import chain import numpy as np import torch from pytorch_pretrained_bert import BertTokenizer from seqeval.metrics import accuracy_score from tensorflow.python.keras.preproce...
""" """ import random import torch from tqdm import tqdm import json from torch.utils.data import Dataset, DataLoader from bert_seq2seq import Tokenizer, load_chinese_base_vocab from bert_seq2seq import load_bert import numpy as np import time vocab_path = "./state_dict/roberta_wwm_vocab.txt" # roberta模型字典的位置 model_na...
from collections import namedtuple import json import logging import os from numpy import array, array_equal # type: ignore from opentrons.util import linal from typing import Any, Dict, List, NamedTuple, Tuple, Union from opentrons import config from opentrons.config import CONFIG, feature_flags as fflags log = lo...
# Copyright 2021 DeepMind Technologies Limited. 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 ...
import warnings from collections import defaultdict, OrderedDict from functools import partial, update_wrapper from contextlib import contextmanager from .controlled_vocabulary import obo_cache, ControlledVocabulary from .utils import add_metaclass, ensure_iterable, Mapping from .xml import ( id_maker, CVParam, U...
# Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.s # # 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 accomp...
""" Code to load data and to create batches of 2D slices from 3D images. Info: Dimensions order for DeepLearningBatchGenerator: (batch_size, channels, x, y, [z]) """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join import random im...
import sys import json import threading import pickle from random import random from funcy import select_keys, cached_property, once, once_per, monkey, wraps, walk, chain from funcy import lmap, map, lcat, join_with from django.utils.encoding import smart_str, force_text from django.core.exceptions import ImproperlyC...
from datetime import date, datetime, timezone import copy import json import os from . import config from .exif import Exif from .geocoder import Geocoder from .log_helper import LogHelper _logger = LogHelper.getLogger() def _load_template(filename): """Loads a claim template JSON file. Args: file...
""" Created on Tue Jan 18 15:26:31 2022 Refactoring V1.2 """ from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import p...
# # Copyright 2019 <NAME> Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause # # Functionality to build extensible variable spaces into ReFrame tests. # import math import copy import reframe.core.fiel...
# ****************************************************************************** # Copyright 2017-2018 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.apa...
# Copyright (c) 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
import ast import os import joblib import json import datetime import numpy as np import pandas as pd from joblib import Parallel, delayed from bgp.rl.rlkit_platform import simulate_policy, get_best_itr from bgp.rl import reward_functions BGP_DIR = '/bgp/dir' def process_filename(file, splitlast): """ Extract...
from __future__ import absolute_import, division, print_function import os import cv2 import numpy as np import time import torch from torch.utils.data import DataLoader from torchvision.utils import save_image from layers import disp_to_depth from utils import readlines, sec_to_hm_str, estimateA, water_types_Nrer_rg...