text
stringlengths
6.04k
39.5k
import tensorflow as tf import tensorflow.keras as keras import wandb import matplotlib.pyplot as plt import seaborn as sns import numpy as np from tensorflow.python.keras import backend as K from augmentation.methods.robust.utils import irm_penalty_explicit class ConfusionMatrix(keras.metrics.Metric): def __ini...
import time from datetime import datetime from dateutil.tz import tzlocal import decimal D = decimal.Decimal import sys import logging from operator import itemgetter from . import (config, exceptions, bitcoin) b26_digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' # Obsolete in Python 3.4, with enum module. BET_TYPE_NAME = {0: ...
import torch import easydict import torch.nn as nn import torch.nn.functional as F from . import utils from . import box_utils from .make_anchors import MakeAnchors from .box_sampler_helper import BoxSamplerHelper from .bilinear_roi_pooling import BilinearRoiPooling from .apply_box_transform import ApplyBoxTransform fr...
#!/home/ubuntu/connectedhomeip/out/python_env/bin/python """ Listen for incoming chip requests and publish the results onto response topic --request-topic - defaults to chip/request --response-topic - defaults to chip/response Command message structure (JSON): { "command": "onoff toggle 1", "txid": "12345ABC",...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import urllib.request, urllib.error, urllib.parse import ui from PyQt4 import QtCore, QtGui, uic import models from utils import validate_ISBN, SCRIPTPATH from metadata import BookMetadata from pluginmgr import manager, isPluginEnabled from templite...
import random import cv2 import numpy as np from aug import Operation, perform_randomly from aug import SaltNoise from aug.ops import utils @perform_randomly class Erosion(Operation): def __init__(self, kernel_size=5, reversed=False): self._kernel_size = kernel_size self._reversed = reversed ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2020-03-13 11:08 # @Author : jianxlin # @Site : # @File : host.py # @Software: PyCharm import logging from datetime import datetime, timedelta import math from time import sleep from libs.aws.bill import get_project_budget, update_project_budget from libs.aws.ec2...
import argparse import glob import json import multiprocessing import os import re import shutil import sys from typing import List, Optional from calendon.cmake import generator_settings_for_compiler from calendon.context import ProjectContext import calendon.multiplatform as mp from calendon.run import run_program ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
import os import shutil import signal import time from datetime import timedelta, datetime from secrets import randbelow import psutil from dateutil.tz import tzlocal from athina.file_functions import * from athina.tester.docker import * from athina.tester.firejail import * from athina.users import * from athina.user...
import logging from typing import List from bubuku.features.rebalance import BaseRebalanceChange from bubuku.zookeeper import BukuExhibitor, RebalanceThrottleManager FAKE_ZONE = 'fake_zone' FAKE_BROKER_ID = 'fake_id' class Partition(object): def __init__(self, topic: str, partition: str, brokers: List['Broker'...
import os import json from os.path import join import re import requests import wikitextparser as wp from joblib import Parallel, delayed import Config import DataUtils from ThirdParty.WikiCleaner import clean def cell_is_header(cell): try: return cell.string.strip().startswith('!') except Attribute...
from typing import List, Union, Optional, Set, TYPE_CHECKING if TYPE_CHECKING: from s2and.data import NameCounts import re import warnings import numpy as np from numpy import inner from numpy.linalg import norm from collections import Counter from text_unidecode import unidecode import fasttext import pycld2 as...
import gym import numpy as np import unittest from numpy.testing import * import src.envs.frozen_lake.flake_constants from src.envs.frozen_lake.frozen_maps import MAPS from src.envs import * from src.envs.frozen_lake.utils import OptimalAgent, \ create_reward_shaping_map, value_iteration import src.envs.frozen_lak...
''' MIT License Copyright (c) 2020 <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, di...
#!/usr/bin/env python3 # Copyright (c) 2016-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import re import fnmatch import sys import subprocess import datetime import os ########################...
import random import os import time import logging # Hide the pygame support prompt os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "1" import pygame from pygame import Vector2 import sprites # Using the C API to change the app ModelID # This changes the taskbar icon from the python one to the game-specific one import c...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: ragged_array_ops.cc """ import collections from tensorflow.python import pywrap_tfe as pywrap_tfe from tensorflow.python.eager import context as _context from tensorflow.python.eager import core as _core ...
# Copyright 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 accompan...
# Copyright 2020-2021 Cambridge Quantum Computing # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
# This file was generated import ctypes import nimodinst._library_singleton as _library_singleton import nimodinst._visatype as _visatype import nimodinst.errors as errors # Used for __repr__ and __str__ import pprint pp = pprint.PrettyPrinter(indent=4) class AttributeViInt32(object): def __init__(self, owne...
# encoding: utf-8 import datetime import logging import json from six import string_types from sqlalchemy.orm.exc import NoResultFound import ckan.plugins as plugins import ckan.lib.uploader as uploader from ckan.common import _ import ckantoolkit as t from ckanext.validation.model import Validation from ckanext.va...
# encoding: utf-8 u"""A module for coding standards tests. These are tests that are not functional- or unit-testing any particular piece of CKAN code, but are checking coding standards. For example: checking that there are no errors in the Sphinx build, that there are no PEP8 problems, etc. """ import importlib imp...
# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved. # Use of this source code is governed by a BSD License (see LICENSE). import json from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client import Client from huxley.accounts.models import User f...
################################################################## ## ## file: sorngen_parse.py ## ## (c) 2018/2019 <NAME> ## University of Bremen ## ################################################################## ## 0/ imports # 0.1/ python-specific essentials import ast import re import math import sys # 0.2/...
''' Created on Feb. 9, 2020 @author: cefect Template for worker scripts ''' #========================================================================== # logger setup----------------------- #========================================================================== import logging, configparser, datetime, copy, shuti...
import argparse import torch import torchvision.transforms from torch import nn from torchvision import transforms import torch.nn.modules.utils as nn_utils import math import timm import types from pathlib import Path from typing import Union, List, Tuple from PIL import Image class ViTExtractor: ...
# standart modules import os # blender modules import bpy # addon modules from .. import xray_ltx from .. import version_utils from .. import menus from .. import hotkeys from .. import ie_props def update_menu_func(self, context): menus.append_menu_func() def build_auto_id(prop): return prop + '_auto' ...
import argparse import torch import torch.nn as nn from wildcat.engine import MultiLabelMAPEngine from wildcat.models import resnet101_wildcat from wildcat.voc import Voc2007Classification from wildcat.boxesPredict import object_localization from wildcat.tf_faster_rcnn.lib.datasets.factory import get_imdb from shut...
# 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...
# Copyright 2019 Elasticsearch BV # # 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...
r"""*Direct expect-good API tests for* ``sphobjinv``. ``sphobjinv`` is a toolkit for manipulation and inspection of Sphinx |objects.inv| files. **Author** <NAME> (<EMAIL>) **File Created** 20 Mar 2019 **Copyright** \(c) <NAME> 2016-2020 **Source Repository** http://www.github.com/bskinn/sphobjinv ...
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`simplejson` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is the externally maintained versi...
import numpy as np from numpy.testing import assert_allclose from kawin.Thermodynamics import BinaryThermodynamics, MulticomponentThermodynamics from kawin.tests.datasets import * AlZrTherm = BinaryThermodynamics(ALZR_TDB, ['AL', 'ZR'], ['FCC_A1', 'AL3ZR'], drivingForceMethod='approximate') NiCrAlTherm = Multicomponen...
from app import apfell, db_objects, links, use_ssl, server_header from sanic.response import json from sanic import response from sanic.exceptions import NotFound, Unauthorized, MethodNotSupported, SanicException, RequestTimeout from jinja2 import Environment, PackageLoader from app.database_models.model import Op...
# Copyright 2018 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...
# Copyright (c) 2012-2016 Seafile Ltd. # -*- coding: utf-8 -*- import os import posixpath import logging from django.urls import reverse from django.db.models import F from django.http import Http404, HttpResponseRedirect from django.shortcuts import render from django.utils.translation import ugettext as _ from djang...
import django from datetime import datetime from django.db import models, transaction from django.db.models.query import QuerySet, EmptyQuerySet from django.db.models.manager import ManagerDescriptor from django.core.exceptions import ImproperlyConfigured from .exceptions import ObjectSetError from .decorators import c...
''' author: bg goal: type: modelz - sklearn for workflow management + PyTorch/keras for transfer learning components + pytorch for nn modules how: wrapper class for workflow management (pytorch opt&loss + sklearn pipe&metrics) + ArchitectureMixin and implementation for custom architectures. ref: refactors: ''' f...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Example: Bayesian Models of Annotation ====================================== In this example, we run MCMC for various crowdsourced annotation models in [1]. All models have discrete latent variables. Under the hood, we enumerate...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD (3-clause) import warnings import os.path as op import numpy as np from nose.tools import assert_true, assert_equal, assert_raises from numpy.testing import assert_array_equal, assert_allclose from mne import pick_ty...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
"""Streamlit display.""" import os import json from logging import INFO, basicConfig, getLogger import pandas as pd import i18n from sys import stdout from ..constants import ( CHANGE_DATE, DOCS_URL, EPSILON, FLOAT_INPUT_MIN, FLOAT_INPUT_STEP, VERSION, ) from ..model.parameters import Paramet...
# -*- coding: utf-8 -*- """ pygments.lexers.shell ~~~~~~~~~~~~~~~~~~~~~ Lexers for various shells. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu...
"""Tests on symbolic differentiation using ModelSpec Quantity objects. <NAME>, September 2005. """ from __future__ import print_function from math import pi from numpy import ndarray from numpy.linalg import norm from numpy.testing.utils import assert_approx_equal, assert_allclose, assert_almost_equal from PyDSToo...
# -*- coding: utf-8 -*- ''' Management of the windows update agent. ======================================= .. versionadded:: 2014.7.0 Set windows updates to run by category. Default behavior is to install all updates that do not require user interaction to complete. Optionally set ``category`` to a category of your...
import re import logging import itertools import random import sentry_sdk from typing import Dict, Tuple, Optional from os import getenv import pathlib import _pickle as cPickle from common.custom_requests import ( request_entities_entitylinking, request_triples_wikidata, ) from common.utils import entity_to_l...
import SimpleITK as sitk # For loading the dataset import numpy as np # For data manipulation import glob # For populating the list of files from scipy.ndimage import zoom # For resizing import re # For parsing the filenames (to know their modality) import cv2 # For processing images import matplotlib.pyplot as pl...
import os import errno import select import socket import sys import threading import time import traceback from typing import Optional # noqa from mitmproxy.net import tls from OpenSSL import SSL from mitmproxy import certs from mitmproxy import exceptions from mitmproxy.coretypes import basethread socket_fileob...
#!/usr/bin/python # logging should be setup first so imported modules' logging is configured too import os from vai.dpuv1.rt import logging_mp log_file = os.environ['VAI_ALVEO_ROOT'] + "/neptune/logging.ini" logging_mp.setup_logger(log_file, 'neptune') from datetime import datetime import json import signal import th...
from __future__ import division, unicode_literals import http.client import json import math import os import time try: import concurrent.futures can_threaded_download = True except ImportError: can_threaded_download = False from .common import FileDownloader from .http import HttpFD from ..aes import ae...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
# HelixStudios import re, os, platform, urllib from difflib import SequenceMatcher #Fix HTTPS errors when connecting to Facebox (neural.vigue.me) and Thumbor CDN (cdn.vigue.me) import certifi import requests PLUGIN_LOG_TITLE = 'Helix Studios' # Log Title VERSION_NO = '2019.03.11.1' # Delay used when req...
import torch import torch.nn as nn from torch import Tensor from functorch import make_fx from torch.fx import immutable_collections import torch.utils._pytree as pytree import torch.utils.dlpack from torch.nn.utils import _stateless from functorch._C import CompileCache from .decompositions import register_decompositi...
"""Detect all Python scripts in HTML pages in current folder and subfolders. Generate brython_modules.js, a bundle with all the modules and packages used by an application. Generate a Python package ready for installation and upload on PyPI. """ import os import shutil import html.parser import json import traceback ...
from cmath import log from dataclasses import replace import os import json import time import datetime from traceback import print_tb from tqdm import tqdm import numpy as np import pandas as pd import logging import sklearn logging.basicConfig(level = logging.INFO,format = '%(asctime)s - %(name)s - %(levelname)s - ...
# # 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 us...
from __future__ import unicode_literals import pytz from copy import copy, deepcopy from math import ceil from datetime import date, datetime from .utils import comma_join, string_or_func, arg_to_sql # TODO # - check that field names are valid class Operator(object): """ Base class for filtering operators. ...
import asyncio import json import logging import random from pathlib import Path import discord from discord.ext import commands from fuzzywuzzy import fuzz from bot.constants import Roles from bot.constants import NEGATIVE_REPLIES from typing import Optional, List, Tuple logger = logging.getLogger(__name__) VARIA...
#!/usr/bin/env python """ Convert quantum-code files to a LASTZ scores file ------------------------------------------------- Given background probabilities, probabilities of each DNA substitution event, and one (or two) quantum code files, we create a log-odds scoring matrix suitable for LASTZ. Typical command line:...
# coding=utf-8 # Copyright 2022 The Deeplab2 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 ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from six.moves import range import frappe, copy, json from frappe import _, msgprint from frappe.utils import cint import frappe.share rights = ("read", "write", ...
#!/usr/bin/env python3 # Copyright (c) 2020-2022, 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 # distribu...
import requests import json import pprint import time import argparse import getpass import sys import os import urllib3 urllib3.disable_warnings() try: import keyring except ModuleNotFoundError: pass ROTATING_CURSOR = '|/-\\|/-\\' # Print iterations progress def print_progress(percentage, finished=Fal...
import copy from contextlib import ExitStack from datetime import datetime from typing import TYPE_CHECKING, Any, Callable, Dict, List, NamedTuple, Optional, Union, cast import pendulum from dagster import check from dagster.seven import funcsigs from ...serdes import whitelist_for_serdes from ...utils import ensure_...
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
# Copyright 2019 Image Analysis Lab, German Center for Neurodegenerative Diseases (DZNE), Bonn # # 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...
from . import __version__, __file__ as module_path from .request import StationRESTServerThread, DEFAULT_REST_KWARGS from .utils import ProtocolContextLoggingHandler, LocalWebServerLogger from .lights import Button, BlinkingLightHTTP, BlinkingLight from opentrons.protocol_api import ProtocolContext from opentrons.types...
from __future__ import print_function import copy import os import time import warnings from collections import OrderedDict from contextlib import contextmanager import tensorflow as tf from tfsnippet.utils import StatisticsCollector, DisposableContext from .early_stopping_ import EarlyStopping from .logs import sum...
import random import logging import itertools import os import subprocess from collections import defaultdict import edgelist_pb2 # protobuf import networkx as nx class PushDown: class StackDistance: def __init__(self, calls, returns): self.calls = calls self.returns = returns ...
import calendar import math import pandas as pd import time import twstock import requests from datetime import datetime, timedelta from dateutil import relativedelta from db.Connection import session from enum import Enum from model.StockHistory import StockHistory from sys import float_info from talib import abstract...
""" TensorMONK :: data :: transforms """ import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from random import random, choices from ..layers.dog import GaussianKernel class Flip(nn.Module): r"""Does horizontal or vertical flip on a BCHW tensor. Args: horizontal (bo...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
# -*- coding: utf-8 -*- import random from abc import ABC from argparse import ArgumentParser from collections import OrderedDict from os import path, makedirs import numpy as np import torch from torch.nn import Conv2d, MaxPool2d, ReLU, Linear, Module, Flatten, Sequential, BatchNorm2d, Dropout from torch.nn.function...
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import sys import sqlite3 import attendance import cv2 import os import numpy as np from PIL import Image import csv from datetime import datetime from PyQt5.uic import loadUiType coursesUi,course_iu = loadUiType('courses.ui') welcomeUi...
# 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 ...
# -*- coding: utf-8 -*- """Simulate satellite orbit data using Two Line Elements (TLEs) and SGP4. Properties ---------- platform 'missions' name 'sgp4' tag None supported inst_id None supported """ import datetime as dt import functools import numpy as np import pandas as pds import pysat from pysat...
import flask from flask import g from flask import render_template from flask import request from flask import url_for import uuid import hashlib import sys import json import logging from datetime import datetime # Mongo database from pymongo import MongoClient from bson.objectid import ObjectId # Date handling imp...
# Copyright 2018 The Bazel 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 applicable la...
""" Copyright (c) 2017 Corvidim (corvidim.net) Licensed under the BSD 2-Clause License (see LICENSE for details) Authors: <NAME>, <NAME> """ from __future__ import (absolute_import, division, print_function, unicode_literals) from pdb import set_trace as keyboard import os, platform import n...
# -*- coding: utf-8 -*- """ Copyright (c) 2020 <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, pub...
# Copyright (c) <NAME> (<EMAIL>). # # 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, distri...
# -*- coding: utf-8 -*- """ Вектор """ import numpy as np from openre.errors import OreError from openre.metadata import ExtendableMetadata import cPickle class Vector(object): """ Хранит в себе одномерный массив, который можно копировать на устройство и с устройства. Допускается создание вектора нулевой ...
import numpy as np from numpy import array def NearZero(z): return abs(z) < 1e-6 ########################################################################## ######### Conversion between S03 and euler angle, quaternion ######### ########################################################################## """ All co...
import asyncio import logging import time from typing import ( TYPE_CHECKING, Awaitable, Callable, Dict, List, NamedTuple, Tuple, Union, cast, ) import base58 from lru import LRU from libp2p.exceptions import ParseError, ValidationError from libp2p.host.host_interface import IHost ...
from . import utils from operator import itemgetter import itertools DEFAULT_SNAP_TOLERANCE = 3 DEFAULT_JOIN_TOLERANCE = 3 DEFAULT_MIN_WORDS_VERTICAL = 3 DEFAULT_MIN_WORDS_HORIZONTAL = 1 def snap_edges(edges, tolerance=DEFAULT_SNAP_TOLERANCE): """ Given a list of edges, snap any within `tolerance` pixels of ...
import numpy as np from PIL import Image import cv2 #opencv import io import time import pandas as pd import numpy as np from IPython.display import clear_output from random import randint import os from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys...
#!/usr/bin/env python import argparse import atexit import copy import multiprocessing import os import select import signal import sys import threading import utils import mapsolvers import CNFsolvers from MCSEnumerator import MCSEnumerator from MarcoPolo import MarcoPolo def parse_args(): parser = argparse.Ar...
import enum import logging from collections import OrderedDict from typing import Union from .commons import first_in, wrap_val from .fields import ( FunctionCall, Map, Negative, NonNegative, NonPositive, Positive, StructureReference, Integer, Number, Float, Array, Strin...
import math from pathlib import Path from typing import Dict, Iterator, List, Optional, Tuple, Union import numpy as np import torch import torch.distributed as dist import torchaudio from torch import Tensor from torch.utils.data import BatchSampler, Dataset, DistributedSampler class BucketizeBatchSampler(BatchSamp...
#!/usr/bin/python # This file is part of Ansible # # Ansible 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. # # Ansible is distributed...
import pytest import numpy as np import pandas as pd import os from pathlib import Path from pandas.testing import assert_series_equal from obsidiantools.api import Vault # NOTE: run the tests from the project dir. WKD = Path(os.getcwd()) @pytest.fixture def expected_metadata_dict(): return { 'rel_file...
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging from dataclasses import dataclass from typing import Any, Iterable, List, Optional, Tuple, cast from pants.backend.docgen.targets.doc import Page from pants.backend.jvm.tar...
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # 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 mus...
# global import ivy import math import ivy_mech import numpy as np from operator import mul from functools import reduce # local from ivy_vision import single_view_geometry as _ivy_svg MIN_DENOMINATOR = 1e-12 def downsampled_image_dims_from_desired_num_pixels(image_dims, num_pixels, maximum=False): """ Com...
from itertools import islice import os import sys import inspect import traceback from . import cmd_with_io from .parameters import Parameter from .exception import MetaflowException, MetaflowInternalError, \ MissingInMergeArtifactsException, UnhandledInMergeArtifactsException from .graph import FlowGraph from .un...
import abc from collections import OrderedDict from functools import reduce from operator import mul from cached_property import cached_property from sympy import Expr from devito.ir.support.vector import Vector, vmin, vmax from devito.tools import (PartialOrderTuple, as_list, as_tuple, filter_ordered, ...
# Copyright 2018 The TensorFlow Probability 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 o...
################################################################################ # # Package : AlphaPy # Module : data # Created : July 11, 2013 # # Copyright 2017 ScottFree Analytics LLC # <NAME> & <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in c...
import networkx as nx from monty.json import MSONable import itertools import time as time from typing import Dict, List, Tuple, Union, Any, FrozenSet, Set from mrnet.core.mol_entry import MoleculeEntry from mrnet.core.reactions import ( ConcertedReaction, CoordinationBondChangeReaction, IntermolecularReact...