text
stringlengths
3.07k
22.1k
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2015, 2016, 2017, 2018 # <NAME>, <NAME>, <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software withou...
""" Message """ from __future__ import annotations from copy import deepcopy from typing import Any, Dict, Iterable, List, Optional, Tuple, Union from uuid import uuid1 from alsek._defaults import DEFAULT_MECHANISM, DEFAULT_QUEUE, DEFAULT_TASK_TIMEOUT from alsek._utils.printing import auto_repr from alsek._util...
# Copyright (c) 2021 ipyradiant contributors. # Distributed under the terms of the Modified BSD License. import traitlets as trt import ipycytoscape import ipywidgets as W import rdflib from ipycytoscape import Edge, Node from ipyradiant.query.api import SPARQLQueryFramer from ipyradiant.rdf2nx.uri_converter import U...
import argparse import importlib import logging import os import pprint import pickle as pkl from functools import reduce from core.detection_module import DetModule from utils import callback from utils.memonger_v2 import search_plan_to_layer from utils.lr_scheduler import WarmupMultiFactorScheduler, LRSequential, Ad...
# -*- encoding: utf-8 from sqlalchemy import Column from sqlalchemy import DDL from sqlalchemy import event from sqlalchemy import ForeignKey from sqlalchemy import Index from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import PrimaryKeyConstraint from sqlalc...
"""Base class for Human3.6M Keypoint Generation.""" import os import numpy as np import tensorflow as tf import h36m_input as input_generator import h36m_losses as losses import utils import model_utils from preprocess.video_proc_utils import VideoProc slim = tf.contrib.slim def _get_data_from_provider(inputs, bat...
import sys import pathlib import hashlib import contextlib from ..base import BaseConfig from ..df.base import BaseOrchestrator from ..df.types import DataFlow, Stage, Operation, Input from ..df.memory import ( MemoryOrchestrator, MemoryInputSet, MemoryInputSetConfig, StringInputSetContext, ) from ..co...
#!/usr/bin/env python3 """Check proposed changes for common issues.""" import re import sys import shutil import os.path import subprocess import sysconfig import reindent import untabify # Excluded directories which are copies of external libraries: # don't check their coding style EXCLUDE_DIRS = [os.path.join('Mod...
"""Metadata Parsers. This module contains metadata parsers, that is, parsers that pull out the metadata and add it to a TarsqiDocument. The only requirements on each parser is that it defines an __init__() method that takes a dictionary of options and a parse() method that takes a TarsqiDocument instance. Current par...
import sys import os import math inFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/ux/" outFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/" scriptFolder = "C:/Users/u416183/lab/work/node/htmlLang/dist/script/" def getTokenType(t): sentinel = t[0] if (sentinel == "."): return "attr" if (sentinel ==...
# Copyright (c) 2019-2020, NVIDIA CORPORATION. import datetime as dt import numpy as np import pandas as pd import pyarrow as pa import cudf._lib as libcudf from cudf._lib.nvtx import annotate from cudf.core.buffer import Buffer from cudf.core.column import column from cudf.utils import utils from cudf.utils.dtypes ...
import numpy as np import os import time import pandas as pd holidays = { 'moon': { 'begin': time.strptime('2016-09-15', '%Y-%m-%d'), 'end': time.strptime('2016-09-17 23:59:59', '%Y-%m-%d %H:%M:%S') }, 'national': { 'begin': time.strptime('2016-10-01', '%Y-%m-%d'), 'end': t...
#!/usr/bin/env python3 # # bank2ynab.py # # Searches specified folder or default download folder for exported # bank transaction file (.csv format) & adjusts format for YNAB import # Please see here for details: https://github.com/torbengb/bank2ynab # # MIT License: https://github.com/torbengb/bank2ynab/blob/master/LIC...
# Copyright (C) 2018 <NAME> (waxwing) # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php # Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8 import hashlib impo...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # Copyright 2020 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....
import json import time from unittest import mock import colander import pytest from pyramid.request import Request from ichnaea.api.key import get_key, Key from ichnaea.api import exceptions as api_exceptions from ichnaea.api.rate_limit import rate_limit_exceeded from ichnaea.api.schema import RenamingMapping from i...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test running processes with the APIs in L{twisted.internet.utils}. """ from __future__ import division, absolute_import import warnings, os, stat, sys, signal from twisted.python.compat import _PY3 from twisted.python.runtime import platfor...
#!/usr/bin/env python3 # # Copyright (C) [2020] Futurewei Technologies, Inc. # # FORCE-RISCV is 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 ...
import socketserver as SocketServer import socket import struct import bson from bson import codec_options from collections import OrderedDict from abc import abstractmethod import mindsdb.api.mongo.functions as helpers from mindsdb.api.mongo.classes import RespondersCollection, Session from mindsdb.api.mongo.responde...
import re from .lib.Gen.f_LineService import Operation class Filter: def __call__(self, message): raise NotImplementedError def __invert__(self): return InvertFilter(self) def __and__(self, other): return AndFilter(self, other) def __or__(self, other): return OrFilter...
# Copyright (C) 2016 Nippon Telegraph and Telephone Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
from pathlib import Path import bpy import bpy_extras def get_camera_coords(cam, pos): """ For a specified point, get both the 3D coordinates and 2D pixel-space coordinates of the point from the perspective of the camera. Inputs: - cam: Camera object - pos: Vector giving 3D world-space posit...
# -*- coding: utf-8 -*- import re from os.path import join, abspath, dirname import eng_to_ipa.stress as stress from collections import defaultdict class ModeType(object): def __init__(self, mode): self.name = mode if mode.lower() == "sql": import sqlite3 conn = sqlite3.co...
import json import math import time from collections import defaultdict from django.apps import apps from django.conf import settings from django.db import connection from pretix.base.models import Event, Invoice, Order, OrderPosition, Organizer from pretix.celery_app import app if settings.HAS_REDIS: import dja...
# test_storage.py - unit tests for the sbclassifier.storage module # # Copyright (C) 2002-2013 Python Software Foundation; All Rights Reserved # Copyright 2014 <NAME>. # # This file is part of sbclassifier, which is licensed under the Python # Software Foundation License; for more information, see LICENSE.txt. import g...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from functools import partial from itertools import chain from sqlalchemy.event import listen from sqlalc...
# -*- coding: utf-8 -*- '''Mancala Board https://www.thesprucecrafts.com/how-to-play-mancala-409424 ''' import pickle class DistributeIterator: def __init__(self, order, start, nth): self.order = order self.start = start self.nth = nth self.pos = 0 def _go_next(self): ...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# ---------------------------------------------------------------------------- # Copyright (c) 2020 <NAME> # All rights reserved. # # Distributed under the terms of the BSD 3-clause license. # # The full license is in the LICENSE file, distributed with this software. # # SPDX-License-Identifier: BSD-3-Clause # --------...
# Credits to Userge for Remove and Rename import io import os import os.path import shutil import time from datetime import datetime from os.path import basename, dirname, exists, isdir, isfile, join, relpath, splitext from shutil import rmtree from tarfile import TarFile, is_tarfile from zipfile import BadZipFile, Zi...
"""This module contains the Eventorial class and its utility functions. Attributes: URL_REGEX (Pattern): Regex used to check if a string is a url SANITISE_REGEX_STEPS (Tuple[Pattern]): Regex applied to a string in order to obtain a sanitised version of said string. """ import asyncio import logging import os ...
# Copyright (c) 2017 Hitachi, 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 ...
from dataclasses import dataclass import torch from MOCVRProblemDef import get_random_problems, augment_xy_data_by_8_fold @dataclass class Reset_State: depot_xy: torch.Tensor = None node_xy: torch.Tensor = None node_demand: torch.Tensor = None # shape: (batch, problem) @dataclas...
import argparse import os import shutil import sys import time import tensorflow as tf import tensorflow_datasets as tfds def get_parsed_in(): """ Parse command line inputs @return: arguments dictionary containing parsed command line inputs """ parser = argparse.ArgumentParser(description="Configu...
import contextlib from datetime import datetime import pandas as pd import numpy as np from scipy import sparse from sklearn.base import BaseEstimator, TransformerMixin from .cross_validation import DataWrapper from .pipeline import make_transformer_pipeline, _call_fit, TransformerPipeline from . import logger string_...
# type: ignore[misc] """Python module to download videos. This module contains the actual downloaders responsible for downloading the video files. """ # -*- coding: future_annotations -*- import os import signal import subprocess from pathlib import Path from queue import Queue from threading import Thread from time...
"""Tests for the Sonarr component.""" from socket import gaierror as SocketGIAError from homeassistant.components.sonarr.const import ( CONF_BASE_PATH, CONF_UPCOMING_DAYS, CONF_WANTED_MAX_ITEMS, DEFAULT_UPCOMING_DAYS, DEFAULT_WANTED_MAX_ITEMS, DOMAIN, ) from homeassistant.const import ( CON...
import numpy as np from numbers import Number import os def namelist_lines(namelist_dict, name): """ Converts namelist dict to output lines, for writing to file. Only allow scalars or lists. Do not allow np arrays or any other types from simplicity. """ lines = [] lines.append('...
################################################################ # Module Summary # # - Code generation for each command in kestrel.lark # - The execution function names match commands in kestrel.lark # - Each command takes 2 arguments # ( statement, session ) # - statement is the current ...
# Copyright 2016 Hewlett Packard Enterprise Development, LP # # 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/LICENS...
# coding=utf-8 # Copyright 2022 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...
from transformers.tokenization_bart import BartTokenizer from utils import extract_clusters2, extract_mentions_to_predicted_clusters_from_clusters, extract_clusters_for_decode from metrics import CorefEvaluator, MentionEvaluator from torch.utils.data import Dataset from utils import flatten_list_of_lists import js...
"""Tools to calculate mass balance and convert appropriately from volume.""" from __future__ import annotations import json import os import pathlib import warnings from typing import Any, Callable import geopandas as gpd import numpy as np import pandas as pd import rasterio as rio import shapely from tqdm import tq...
# Copyright 2017 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...
# Python imports from __future__ import print_function from collections import defaultdict import copy # Other imports from simple_rl.mdp.MDPClass import MDP from simple_rl.planning import ValueIteration from simple_rl.amdp.AMDPTaskNodesClass import NonPrimitiveAbstractTask, RootTaskNode from simple_rl.amdp.abstr_doma...
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import distributed from models import data_loader, model_builder from models.data_loader i...
# Copyright 2009 <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 required by applicable law or agreed to in writing, softwa...
"""Forecaster implementation for TimeSeries. Contain the classes compound_poisson.forecast.time_series.Forecaster compound_poisson.forecast.time_series.SelfForecaster compound_poisson.forecast.forecast_abstract.Forecaster <- compound_poisson.forecast.time_series.Forecaster <- compound_poisson.forec...
import struct from assemblyline.common.str_utils import safe_str LinkFlags_def = ['HasLinkTargetIDList', 'HasLinkInfo', 'HasName', 'HasRelativePath', 'HasWorkingDir', 'HasArguments', 'HasIconLocation', ...
import os import json from collections import namedtuple import yaml from ase.data import chemical_symbols from aiida_crystal_dft.io.d12 import D12 from aiida_crystal_dft.io.basis import BasisFile # NB only used to determine ecp from mpds_client import APIError from mpds_aiida import TEMPLATE_DIR verbatim_basis =...
# ####### # Copyright (c) 2016-2020 Cloudify Platform Ltd. 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...
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
import pandas as pd import json import numpy as np from dataclasses import dataclass import os from os.path import join, splitext import unidecode import pickle as pkl import sys from sklearn.model_selection import KFold import functools import rampwf from sklearn.base import is_classifier from sklearn.metrics import ...
# Copyright (c) 2016, The Bifrost Authors. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% [markdown] # # Streamlined testing for word embeddings # %% import numpy as np import pandas as pd from numpy import linalg import fasttext.util from gensim.models.fasttext import FastText, ...
import math import random size = 4 def compterLignes(grille, symbole): """Compte le nombre de fois où le symbole est sur une ligne qui peut gagner""" maximum = 0 for ligne in grille: count = 0 for case in ligne : if case == symbole : count += 1 ...
from qtpy.QtCore import Slot, Signal, QObject, QThread, Qt from qtpy.QtNetwork import QTcpSocket import struct import logging from QtPyNetwork.server.BaseServer import QBaseServer __all__ = ["QBalancedServer"] class _SocketWorker(QObject): """_SocketWorker manages sockets and handles messages. Outgoing si...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ lvmspec.io.spectra ===================== I/O routines for working with spectral grouping files. """ from __future__ import absolute_import, division, print_function import os import re import warnings import time import nump...
#!/usr/bin/env python """ Barebone Simulation without camera or extraneous sensors. """ from __future__ import print_function # ============================================================================== # -- find carla module --------------------------------------------------------- # =========================...
from __future__ import print_function from __future__ import absolute_import from builtins import input from past.builtins import basestring from builtins import object import os import cv2 import numpy as np from RRtoolbox.lib.arrayops import contours2mask, findContours from RRtoolbox.lib.cache import MemoizedDict...
import logging import torch.nn as nn import torch.utils.checkpoint as cp from mmcv.cnn import ConvModule, constant_init, kaiming_init from mmcv.runner import load_checkpoint from torch.nn.modules.batchnorm import _BatchNorm from mmcls.models.utils import make_divisible from ..builder import BACKBONES from .base_backb...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/10/23 10:43 # @Author : ganliang # @File : tf_linear_regression.py # @Desc : 单特征的线性回归 import tensorflow as tf from tensorflow.contrib.learn.python.learn import datasets import numpy as np from matplotlib import pyplot as plt from src.config import ...
# 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 from ... import _utilities, _tables from...
from django.db import models from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from django_scopes import ScopedManager from i18nfield.fields import I18nCharField from pretalx.common.urls import EventUrls class ReviewScoreCategory(models.Model): event = mod...
# This file is part of the Open Data Cube, see https://opendatacube.org for more information # # Copyright (c) 2015-2020 ODC Contributors # SPDX-License-Identifier: Apache-2.0 import numpy as np import toolz from ..model import Dataset from ..storage import reproject_and_fuse, BandInfo from ..storage._rio import Raste...
import numpy as np from numpy import exp, inf, log, mean, sqrt from scipy.stats import bernoulli from .ashr import my_e2truncnorm, my_etruncnorm from .output import result_in_output from .r_utils import length, numeric, pmax, pmin, rep, stop, unlist from .r_utils.stats import dnorm, pnorm, rtruncnorm from .workhorse_p...
#!/usr/bin/env python """These are standard aff4 objects.""" from __future__ import division from __future__ import unicode_literals import io from builtins import range # pylint: disable=redefined-builtin from future.utils import iteritems from future.utils import itervalues from grr_response_core.lib import rdfv...
import warnings from pyspark.sql.session import SparkSession from copy import deepcopy from .validate import get_default_value_from_schema from .case_statements import ( _check_jaro_registered, sql_gen_case_smnt_strict_equality_2, sql_gen_case_stmt_levenshtein_rel_3, sql_gen_case_stmt_levenshtein_re...
# --------------------------------------------------------------------- # Maintenance # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Python import datet...
import argparse import ast import pprint import mxnet as mx from mxnet.module import Module import numpy as np from tqdm import tqdm from symdata.bbox import im_detect from symdata.loader import TestLoader from symnet.logger import logger from symnet.model import load_param, check_shape def test_net(sym, imdb, args...
from typing import List, Union from asyncio import TimeoutError from discord.abc import Messageable from discord import ClientUser, User, Member, HTTPException from discord.ext import commands from bot.utils.embed_handler import info class Paginator: ARROW_TO_BEGINNING = "⏪" ARROW_BACKWARD = "◀" ARROW_F...
import pytest import numpy as np from kontiki.measurements import StaticRsCameraMeasurement, LiftingRsCameraMeasurement, NewtonRsCameraMeasurement, \ PositionMeasurement, GyroscopeMeasurement, AccelerometerMeasurement from kontiki.rotations import quat_to_rotation_matrix from kontiki.sfm import Landmark, View from...
# ========================================================================== # # Copyright NumFOCUS # # 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/...
"""Communication container startup script.""" import asyncio import functools import logging import os import shutil import signal import sys from contextlib import suppress from distutils.util import strtobool from pathlib import Path from typing import Optional import zmq import zmq.asyncio from executors.collect i...
import argparse import random from datetime import timedelta from operator import getitem from os import listdir, makedirs, remove from os.path import join, exists, getsize import h5py import librosa import numpy as np import pandas as pd import soundfile as sf from python_speech_features import mfcc from scipy.io imp...
#!/usr/bin/python3 from sys import argv from os.path import isdir, exists from os import listdir, makedirs, system from pipes import quote import numpy as np import scipy.io.wavfile as wav import tensorflow as tf class Configuration(object): dataset_directory = None model_iterations = None sampling_frequ...
#!/usr/bin/env python #=============================================================================== # Copyright 2014 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...
""" GraspNet dataset processing. Author: chenxi-wang """ import os import sys import numpy as np import scipy.io as scio from PIL import Image import torch from collections import abc as container_abcs from torch.utils.data import Dataset from tqdm import tqdm BASE_DIR = os.path.dirname(os.path.ab...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from logging import getLogger import os import pickle import faiss import torch import torch.distributed as dist from to...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import (assert_allclose, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal) from scipy.ndimage import convolve1d from scipy.signa...
import numpy as np import pandas as pd import scipy as sp from scipy import stats import os from sklearn import preprocessing from sklearn import svm from sklearn.metrics import make_scorer from sklearn.model_selection import cross_val_score from sklearn.model_selection import KFold import matplotlib.pyplot as plt from...
#!/usr/bin/env python ''' ASCII Toolbox for Converting Images, Movies, Gifs, and Video Feed Created on 14 Aug 2014 @author: <NAME> ''' from __future__ import print_function import time import os import platform from subprocess import Popen, PIPE import io import cv2 import numpy as np from asciisciit.conversion...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: <NAME> # Year: 2020 import os import sys import numpy as np from scipy.interpolate import NearestNDInterpolator, LinearNDInterpolator, griddata from scipy.ndimage.filters import uniform_filter1d import datetime import netCDF4 as nc import cftime def get_area...
import time from typing import List from bs4 import BeautifulSoup from django.test import override_settings from unittest.mock import Mock, patch from zerver.lib.realm_icon import get_realm_icon_url from zerver.lib.test_classes import ZulipTestCase from zerver.middleware import is_slow_query, write_log_line from zerve...
""" Tests for obtaining feature co-occurance and diffusing vectors """ import unittest from os.path import join from crossmap.settings import CrossmapSettings from crossmap.indexer import CrossmapIndexer from crossmap.diffuser import CrossmapDiffuser from crossmap.tokenizer import CrossmapTokenizer, CrossmapDiffusionT...
"""Flow based node and edge disjoint paths.""" import networkx as nx from networkx.exception import NetworkXNoPath # Define the default maximum flow function to use for the undelying # maximum flow computations from networkx.algorithms.flow import edmonds_karp from networkx.algorithms.flow import preflow_push from netw...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
import sys import os from PIL import Image, ImageOps from multiprocessing import Process, Queue, cpu_count # Change these 3 config parameters to suit your needs... TILE_SIZE = 50 # height/width of mosaic tiles in pixels TILE_MATCH_RES = 5 # tile matching resolution (higher values give better fit but require mor...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import h5py import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import time import os from datetime import timedelta os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1' plt.rcParams['figure.figsiz...
# Copyright 2020, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
from argparse import ArgumentParser from .compat import SafeConfigParser import inspect import os import sys from . import command, util, package_dir, compat class Config(object): """Represent an Alembic configuration. Within an ``env.py`` script, this is available via the :attr:`.EnvironmentContext.conf...
#!/usr/bin/env python3 import sys, time, datetime, math, logging, signal import numpy import simplesoapy from simplespectral import zeros from soapypower import psd, writer logger = logging.getLogger(__name__) _shutdown = False def _shutdown_handler(sig, frame): """Set global _shutdown flag when receiving SIG...
# -*- coding: utf-8 -*- # Natural Language Toolkit: Twitter client # # Copyright (C) 2001-2017 NLTK Project # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Utility functions for the :module:`twitterclient` module which do not require the `t...
""" Platform for the garadget cover component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/garadget/ """ import logging import voluptuous as vol import requests from homeassistant.components.cover import CoverDevice, PLATFORM_SCHEMA from homeassistant...
#!/usr/bin/python # # Copyright (c) 2012 <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...
import torch import torchvision # The main BackPACK functionalities from backpack import backpack, extend # The diagonal GGN extension # from backpack.extensions import DiagGGNMC import torch.optim as optim from backpack.extensions import TRIAL from torchsummary import summary import time # fixing HTTPS issue on Colab...
from typing import Dict, Callable, Optional import logging import ray from ray.tune.trainable import Trainable from ray.tune.logger import Logger, LoggerCallback from ray.tune.result import TRAINING_ITERATION, TIMESTEPS_TOTAL from ray.tune.trial import Trial from ray.util.annotations import Deprecated from ray.util.ml...
import glob import json import os import shutil import operator import sys import argparse import math import numpy as np import pdb def save_detection_to_file(input_dic, output_file, task): with open(output_file, 'w') as txt_file: if not input_dic: return class_list = input_dic['class...
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG), # acting on behalf of its Max Planck Institute for Intelligent Systems and the # Max Planck Institute for Biological Cybernetics. All rights reserved. # # Max-Planck-Gesellschaft zur Förderung der Wissens...
""" Various tricks for matching source locations to product locations from VIAL """ import re from typing import Optional, Tuple import url_normalize from vaccine_feed_ingest_schema.location import VaccineProvider from .log import getLogger logger = getLogger(__file__) # Add to this list in alphabetical order VACC...