text
stringlengths
3.07k
22.1k
from .input_output import _BaseInputOutputBlockData from pyomo.core.base.block import declare_custom_block from .utils import build_full_space_formulation, build_reduced_space_formulation,\ build_relu_mip_formulation, build_relu_complementarity_formulation import weakref import abc """ This module contains the impleme...
#! python34 $this # TODO support for libarchive (7z) # libarchive may render the other implementations void import os,sys import zipfile import tarfile try: import rarfile except ImportError: #sys.stderr.write("rar not supported by zipfs\n") rarfile = None import io # this one uses the dll ...
# coding: utf-8 # # SMS Spam detection using Naive Bayes # # Source : talk on "Data Science with Python" at the [University of Economics](https://www.vse.cz/english/) in Prague, December 2014. [@RadimRehurek](https://twitter.com/radimrehurek). # # The goal of this talk is to demonstrate some high level, introductor...
# This file is part of the GBI project. # Copyright (C) 2013 Omniscale GmbH & Co. KG <http://omniscale.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 # # http://www.apache.org/licens...
#!/usr/bin/env python3 from __future__ import absolute_import from __future__ import print_function import six.moves.configparser import argparse import json import logging import os import sys import time import duo_client from logging.handlers import TimedRotatingFileHandler # For proxy support import urllib.parse ...
#!/usr/bin/env python3 # -*-coding: utf-8;-*- ## Copyright (C) 2012-2018 RIKEN R-CCS ## \file kmrgenscript.in.py KMR-Shell Job-Script Generator. import sys import os from optparse import OptionParser kmrhome = '@KMRHOME@' ## Checks file existence. # If file does not exist, it prints an error message and exit. # ...
import numpy as _np def categorical_features(X, categorical_headers, strategy = 'most_frequent', estimator = None, verbose= 0): """ Impute (fill nan) values for categorical features Arguments: ...
import sys import copy import datetime import dateutil import pytz import simplejson as json from singer import logger, metadata, metrics, utils from tap_redshift import resolve from tap_redshift import discover from tap_redshift import sync from tap_redshift import bookmarks LOGGER = logger.get_logger() class Mess...
# (c) 2019–2021 <NAME> <<EMAIL>> from __future__ import annotations import argparse import asyncio import getpass import sys import subprocess import yaml import os.path import logging from typing import List, Optional, Dict, Any, Union from systemd.journal import JournalHandler # type: ignore from limit import Li...
import json from functools import partial from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QTableWidget, QTableWidgetItem, QPushButton, QDialog, QLabel, QLineEdit, QComboBox from win32api import GetSystemMetrics def incrementStat(field): currentNumber = int(field.text()) currentNumber += 1 field.s...
import pygame import random import math class Map: def __init__(self,start,goal,obsdim,obsnum): self.start = start self.goal = goal self.nodeRad = 2 self.nodeThickness = 0 self.edgeThickness = 1 self.obstacles = [] s...
#!/usr/bin/env python3 # Copyright 2019 IBM Corp. # # 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 requir...
import os, sys, json file_path = os.path.abspath(__file__) sys.path.append(os.path.abspath(os.path.join(file_path, "..", "..", "..", ".."))) from code_aculat.visualize.visual_base import show_two_image import numpy as np import cv2 def stastic_single_class_images(json_path, cate_id): if isinstance(json_path, st...
# GENERATE IDA-FORMAT OBSERVATIONS FILE # ---------------------------------------------------------------------- # Copyright (c) 2017 <NAME>. # # See the LICENSE file for details # ---------------------------------------------------------------------- #-------------------- # System wide imports # -------------------...
import time import json from importlib import resources from typing import Sequence, Union, Optional, Any import pandas as pd import numpy as np import keras import tensorflow as tf import nltk from sklearn.model_selection import train_test_split, RandomizedSearchCV from scipy.stats import reciprocal from sklearn.pip...
import pygame as pg import sys import random from pygame.locals import * pg.init() # Constant values # width,height -> x,y screensize = width, height = 640, 720 screen = pg.display.set_mode(screensize) time_clock = pg.time.Clock() # directions right_direction = 'RIGHT' left_direction = 'LEFT' up_direction = 'UP' down_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ validator.py ~~~~~~~~~~~~ This script contains methods for validating all available mwTab data files, creating log files, and generating a JSON file containing the validation metadata. """ import mwFileStatusWebsite.compare import mwtab import json import re from date...
# -*- coding: utf-8 -*- """Utilities for getting and initializing KGE models.""" from typing import Any, List, Mapping, Optional import logging import timeit from tqdm import trange import random import numpy as np import torch from torch import nn import torch.optim as optim from pykeen.constants import ( EMB...
''' Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related docu...
# vim: set fileencoding=utf-8 : import operator import unittest from functools import reduce import pyvips from .helpers import PyvipsTester, noncomplex_formats, run_fn2, run_fn # point convolution def conv(image, mask, x_position, y_position): s = 0.0 for x in range(0, mask.width): for y in range(0,...
# # Copyright 2012 keyes.ie # # License: http://jkeyes.mit-license.org/ # """ intercom module All of the API requests are created, and the API responses are parsed here. >>> from intercom import Intercom >>> Intercom.app_id = 'dummy-app-id' >>> Intercom.api_key = 'dummy-api-key' """ import functools import json im...
import functools import os from typing import Sequence import tensorflow as tf import seqio.preprocessors from seqio import PrefixLMFeatureConverter, LMFeatureConverter, autoregressive_inputs, \ non_padding_position from t5.data import get_default_vocabulary import jax from t5x.checkpoints import PartitionSpec f...
# ------------------------------------------------------------------------------- # # Helper functions # define all functions that will be useful for this project # # Inspriered by: https://github.com/fotisk07/ # ------------------------------------------------------------------------------- # # Imports import PIL imp...
import numpy as np from sklearn.datasets import load_iris def manhattan_distance(x1, x2): return np.sum(np.absolute(x1 - x2), axis=-1) def euclidean_distance(x1, x2): return np.sqrt(np.sum((x1 - x2) ** 2, axis=-1)) class ModelKNN: def __init__(self, k=3, dis=euclidean_distance): """ ...
# flake8: noqa import numpy as np from types import SimpleNamespace import torch from torch import nn import bias_act_cuda # ---------------------------------------------------------------------------- activation_funcs = { 'linear': SimpleNamespace(func=lambda x, **_: x, def_alpha=0, def_gain=1, ...
from decimal import Decimal import pytest from dyntastic import A from dyntastic.attr import translate_updates def _assert_expression(expression, attributes, values, *update_actions): translated_attributes = {f"#{i}": attr for i, attr in enumerate(attributes)} translated_values = {f":{i}": value for i, valu...
import os from ase import Atoms from pymatgen import Structure as StructureP from pymatgen import Molecule from ibslib import Structure from ibslib.io import read,write from ibslib.io.check import check_ext,check_format,format2extension,check_dir class StructDict(dict): """ Specifies the bahvior of a Struc...
import pytest import unittest from sklearn.utils.estimator_checks import check_estimator from sklearn.base import TransformerMixin from sklearn.pipeline import make_pipeline from sklearn.utils import check_random_state from sklearn.utils.estimator_checks import is_public_parameter from sklearn.utils.testing import (ass...
""" ImageNet-1K classification dataset. """ import os import math import mxnet as mx from mxnet.gluon import HybridBlock from mxnet.gluon.data.vision import ImageFolderDataset from mxnet.gluon.data.vision import transforms from .dataset_metainfo import DatasetMetaInfo class ImageNet1K(ImageFolderDataset): ""...
from __future__ import unicode_literals import re from ..utils import urljoin from .common import InfoExtractor class NhkBaseIE(InfoExtractor): _API_URL_TEMPLATE = ( "https://api.nhk.or.jp/nhkworld/%sod%slist/v7a/%s/%s/%s/all%s.json" ) _BASE_URL_REGEX = r"https?://www3\.nhk\.or\.jp/nhkworld/(?P<...
"""Documentation generation ============================ When generating docs, the documentation of the properties listed in ``__config_props__`` can dumped to a yaml file using :func:`create_doc_listener`. :func:`write_config_props_rst` can load the docstrings from this yaml file and then generate a nicely formatted...
""" test get/set & misc """ from datetime import timedelta import re import numpy as np import pytest from pandas import ( DataFrame, IndexSlice, MultiIndex, Series, Timedelta, Timestamp, date_range, period_range, timedelta_range, ) import pandas._testing as tm def test_basic_ind...
# debvrat # from __future__ import print_function import os import sys import numpy as np from PIL import Image def pixel_accuracy(output, target): output = np.asarray(output) target = np.asarray(target) pixel_labeled = np.sum(target > 0) pixel_correct = np.sum((output == target) * (target >...
import numpy as np from autokeras.nn.layers import StubDense, StubReLU, get_n_dim, get_conv_class, get_batch_norm_class NOISE_RATIO = 1e-4 def deeper_conv_block(conv_layer, kernel_size, weighted=True): n_dim = get_n_dim(conv_layer) filter_shape = (kernel_size,) * 2 n_filters = conv_layer.filters wei...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2020, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: gitlab_group_members sh...
import re import typing from uuid import uuid4 import os import pymongo import requests from pymongo import MongoClient from mongogrant.config import Config, ConfigError path = os.path.join(os.getenv("HOME") or os.path.expanduser("~"), ".mongogrant.json") def seed(): """Initial config.""" return { ...
from copy import deepcopy import numpy as np import torch from mvn.models.v2v import Basic3DBlock, Res3DBlock, Pool3DBlock import torch.nn as nn import torch.nn.functional as F from mvn.utils import op, volumetric from mvn.models import pose_resnet class Encoder(nn.Module): def __init__(self): super()._...
''' Copyright 2012-2014 The MITRE 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 applicab...
import numpy as np import astropy.table as t import astropy.io.fits as fits from astropy import (units as u, constants as c, coordinates as coords, table as t, wcs, cosmology as cosmo) import os, sys from glob import glob from matplotlib import gridspec, colors import matpl...
# Copyright 2019 NEC 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 applicable law or agreed to in writi...
# -*- coding: utf-8 -*- """ togglwrapper.api """ import json import requests from requests.auth import HTTPBasicAuth from .decorators import error_checking, return_json from .mixins import GetMixin, CreateMixin, UpdateMixin, DeleteMixin BASE_URL = 'https://www.toggl.com/api' API_VERSION = 'v8' API_URL = '{base}/{...
from tkinter import *; window = Tk(); window.title("Boss HP Gauge"); screenWidth = window.winfo_screenwidth(); screenHeight = window.winfo_screenheight(); windowWidth = 0; windowHeight = 0; horizontalOffset = 0; verticalOffset = 0; canvasWidth = 400; canvasHeight = 50; # "4k" Displays if(screenWid...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu """ (c) 2013 - <NAME> Process Utils :author: <NAME> """ import os import sys import subprocess import signal import uuid as UUID from datetime import datetime import time import tempfile import threading import re import shutil import atexit...
# pylint: disable=no-self-argument from enum import Enum from pathlib import Path import warnings from typing import Any, Dict, List, Optional, Tuple, Union try: from typing import Literal except ImportError: from typing_extensions import Literal from pydantic import ( # pylint: disable=no-name-in-module ...
# Copyright (C) 2020 Intel Corporation # # SPDX-License-Identifier: MIT import logging as log import os import os.path as osp from collections import OrderedDict from enum import Enum import numpy as np from datumaro.components.converter import Converter from datumaro.components.extractor import (AnnotationType, Co...
# -*- test-case-name: epsilon.test.test_ampauth -*- # Copyright (c) 2008 Divmod. See LICENSE for details. """ This module provides integration between L{AMP<twisted.protocols.amp.AMP>} and L{cred<twisted.cred>}. """ from hashlib import sha1 from zope.interface import implements from twisted.python.randbytes import...
""" Model definition. """ import tensorflow as tf import numpy as np import time from layers import WindowLayer, HiddenLayers, MDNLayer from utilities import * import matplotlib.pyplot as plt def gaussian_sample(e, mu_x, mu_y, sg_x, sg_y, rho): cov = np.array([ [sg_x*sg_x, sg_x*sg_y*rho], [sg_x*sg_y*rho, sg_y*s...
""" Seq2seq based: Attention Is All You Need https://arxiv.org/abs/1706.03762 """ import math import torch import torch.nn as nn import torch.onnx.operators import torch.nn.functional as F from torch.autograd import Variable from utils.constants import PAD_TOKEN class Encoder(nn.Module): """Encoder""" def __in...
""" data used by the adjacent tests Note: Some of these are defined as dictionaries for ease but all should be frozen before use so they are immutable within the tests """ def d2t(dyct): """turn the data dictionary into a frozenset so they are immutable """ return tuple(dyct.items()) BASE_SHORT_CLI...
import datetime import json import logging import requests import time from urllib.parse import parse_qs, urlparse from abc import ABCMeta from . import __version__, CLIENT_NAME from .exceptions import TembaMultipleResultsError, TembaNoSuchObjectError, TembaBadRequestError, TembaConnectionError from .exceptions impo...
from starlette.applications import Starlette from starlette.responses import JSONResponse from starlette.responses import PlainTextResponse from starlette.endpoints import WebSocketEndpoint from starlette.endpoints import HTTPEndpoint from starlette.middleware.gzip import GZipMiddleware from starlette.middleware.httpsr...
# internal imports from wsi_core.WholeSlideImage import WholeSlideImage from wsi_core.wsi_utils import StitchPatches from wsi_core.batch_process_utils import initialize_df # other imports import os import numpy as np import time import argparse import pdb import pandas as pd def stitching(file_path, downscale = 64): ...
#!/usr/bin/env python3 # file: utility_cost_calc.py """ Reads a csv file containing meeter readings. The name of the csv file can be provided as a parameter. If not parameter is provided, 'readings.csv' is the default. Returns a report to standard output. Typical usage: ./utility_cost_calc.py [input.csv] >> stat...
import os import io import zipfile import shutil from ipywidgets import embed as wembed import ipyvolume from ipyvolume.utils import download_to_file, download_to_bytes from ipyvolume._version import __version_threejs__ html_template = u"""<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{...
# ported from: # https://github.com/aio-libs/aiopg/blob/master/aiopg/sa/connection.py import asyncio import weakref from sqlalchemy.sql import ClauseElement from sqlalchemy.sql.dml import UpdateBase from sqlalchemy.sql.ddl import DDLElement from . import exc from .result import create_result_proxy from .transaction i...
from __future__ import print_function import time import requests as _requests import copy from contextlib import contextmanager import retrying from future.standard_library import install_aliases install_aliases() # This library is different between python 2 and 3. This negates the difference # noinspection PyComp...
from bs4 import BeautifulSoup from selenium import webdriver import datetime from modules.crawler.login import campuspick from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.ke...
# Copyright 2021 MosaicML. All Rights Reserved. import collections.abc import os from dataclasses import dataclass from typing import Dict, List, Optional, Sequence from unittest import mock import pytest import torch import torch.distributed import yahp as hp from _pytest.monkeypatch import MonkeyPatch import compo...
import torch from torch import nn import torch.optim as optim import numpy as np from pathlib import Path import os class LazierDataset(torch.utils.data.Dataset): ''' Inspects the data at partition_path, creates a list (data_paths) and a dictionary (labels) - data_paths : list [<path to spe...
#!/usr/bin/env python2.7 import json import jwt import os import random import re import select import subprocess import socket import time import threading import traceback import zmq import requests import six.moves.queue from datetime import datetime, timedelta from functools import partial from jsonrpc import JSONR...
# ---------------------------------------------------------------------------- # CLASSES: nightly # # Test Case: cinema-a.py # # Tests: Tests various aspects of "visit -cinema". # # Notes: # # Programmer: <NAME> # Date: Thu Feb 15 16:37:20 PST 2018 # # Modifications: # <NAME>, Friday Decembe...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
#!/usr/bin/env python3 import argparse import copy import io import json import logging import os import sys from tempfile import NamedTemporaryFile, mkstemp from fastavro import writer, parse_schema from joblib import Parallel, delayed, parallel_backend from jsonschema import Draft7Validator, FormatChecker from sing...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
import asyncio import contextlib import warnings import pytest from aiohttp.helpers import PY_37, isasyncgenfunction from aiohttp.web import Application from .test_utils import ( BaseTestServer, RawTestServer, TestClient, TestServer, loop_context, setup_test_loop, teardown_test_loop, ...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distr...
import copy import numpy as np import pandas as pd from ...highlevelgraph import HighLevelGraph from ...layers import DataFrameIOLayer from ...utils import random_state_data from ..core import DataFrame, tokenize __all__ = ["make_timeseries"] def make_float(n, rstate): return rstate.rand(n) * 2 - 1 def make_...
import re import sys import codecs import functools import copy from lxml import etree from django.core.exceptions import (ObjectDoesNotExist, FieldError, MultipleObjectsReturned,) from django.db.models.base import subclass_exception from django.utils.encoding import force_text fro...
# =============================================================================== # Copyright 2013 <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/LI...
import argparse, time, math import numpy as np import mxnet as mx from mxnet import gluon from functools import partial import dgl import dgl.function as fn from dgl import DGLGraph from dgl.data import register_data_args, load_data class NodeUpdate(gluon.Block): def __init__(self, in_feats, out_feats, activation...
from collections import namedtuple from django import forms from django.utils import timezone from django.utils.translation import gettext_lazy as _, gettext from taggit.models import Tag import django_filters from elasticsearch_dsl.query import Q from froide.account.models import User from froide.publicbody.models ...
#!/usr/bin/env python3 import argparse from pathlib import Path from time import monotonic from uuid import uuid4 from multiprocessing import Process, Queue import cv2 import depthai as dai def check_range(min_val, max_val): def check_fn(value): ivalue = int(value) if min_val <= ivalue <= max_val:...
""" Template tags for working with lists of model instances which represent trees. """ from django import template from django.apps import apps from django.core.exceptions import FieldDoesNotExist from django.utils.encoding import force_str from django.utils.safestring import mark_safe from django.utils.translation imp...
"""Library of functions related to file system contents and manipulation.""" ##==============================================================# ## SECTION: Imports # ##==============================================================# import atexit import os import os.p...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org...
# -*- coding: utf-8 -*- ''' Connection library for VMWare .. versionadded:: 2015.8.2 This is a base library used by a number of VMWare services such as VMWare ESX, ESXi, and vCenter servers. :depends: pyVmomi Python Module ''' # Import Python Libs from __future__ import absolute_import import atexit import logging ...
from __future__ import print_function import platform PY3 = False if platform.python_version().startswith('3'): PY3 = True import json import requests import sys import os from bottle import ( run, route, post, put, delete, request, # response, hook ) if PY3: from urllib.parse import unquote else: ...
# 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 operator import attrgetter from flask import request, session from sqlalchemy.orm import joinedload ...
import os from ..discretization.modeltime import ModelTime from ..discretization.structuredgrid import StructuredGrid from ..mbase import BaseModel from ..modflow import Modflow from ..mt3d import Mt3dms from ..pakbase import Package from .swtvdf import SeawatVdf from .swtvsc import SeawatVsc class SeawatList(Packag...
import re import json import time import base64 import random import logging import cbor2 from requests.models import Response from localstack import config from localstack.constants import APPLICATION_JSON, APPLICATION_CBOR from localstack.utils.aws import aws_stack from localstack.utils.common import to_str, json_saf...
__author__ = "aemerick <<EMAIL>>" # --- external --- import numpy as np # --- internal --- from .constants import CONST as const from . import config as config # helper functions for computing physics models def s99_wind_velocity(L, M, T, Z): """ Starburt99 stellar wind velocity model which computes ...
#!/usr/bin/env python2 """ This is the command-line front-end: In charge of processing arguments and call the framework. """ from __future__ import print_function import os import sys import logging from framework.core import Core from framework.dependency_management.component_initialiser import ComponentInitialiser...
#!/usr/bin/env python3 import argparse import re from os.path import basename def parse(): parser = argparse.ArgumentParser( description="The gernerator for maxwell protocol api." ) parser.add_argument("--proto_file", required=True, type=argparse.FileType("r")) parser.add_argument("--enum_typ...
# -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> """ import argparse as ap import os import cv2 from nicr_scene_analysis_datasets import Hypersim from nicr_scene_analysis_datasets.utils.img import save_indexed_png import numpy as np import onnx import onnxruntime as ort from tqdm import tqdm from utils im...
import os import logging import re from contextlib import contextmanager from rnode_testing.docker import docker_network import rnode_testing.resources as resources from rnode_testing.util import log_box, make_tempfile, make_tempdir from rnode_testing.wait import wait_for, node_started import shlex from multiprocessin...
from typing import Optional, Dict, List, Any, Callable import os import functools from dataclasses import dataclass from copy import deepcopy import yaml from openai_tools import Client from datetime import datetime, timezone from pathlib import Path import re from .db import Client as DBClient # Set a version numbe...
''' This module provides support for defining several options on your Elixir entities. There are three different kinds of options that can be set up, and for this there are three different statements: using_options_, using_table_options_ and using_mapper_options_. Alternatively, these options can be set on all Elixir...
import os import csv import json import pytest import numpy as np import pandas as pd from ivadomed.loader import utils as imed_loader_utils from testing.unit_tests.t_utils import create_tmp_dir, __tmp_dir__ from testing.common_testing_util import remove_tmp_dir PATH_DATA = os.path.join(__tmp_dir__, 'bids') LOG_PATH =...
# coding=utf-8 # Copyright (c) 2019 Uber Technologies, 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 applicabl...
# 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...
import glob import os import pickle import re from concurrent import futures import requests from bs4 import BeautifulSoup from thread_files import utilities from cachecontrol import CacheControl from cachecontrol.caches.file_cache import FileCache class BatchDownloader: DBG_DOWNLOAD = False THREAD_SAVE_NAM...
# using scaled time so each data point is 1 time unit import pandas as pd import numpy as np import matplotlib.pyplot as plt import math import time import os import argparse import torch import torch.nn as nn import torch.optim as optim from scipy.io import savemat parser = argparse.ArgumentParser() parser.add_argu...
import matplotlib.pyplot as plt import numpy as np import random import networkx as nx import operator import sys sys.path.append('./') # from graph_generation import SBM_graph from utils import graph_util import SBM_graph from matplotlib import rc import seaborn import os font = {'family': 'serif', 'serif': ['compute...
# 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...
''' Common methods for beamtools package Created Fri May 12 @author: cpkmanchee ''' import numpy as np from beamtools.file_formats import file_formats import dill __all__ = ['saveObj','loadObj','normalize','rmbg','gaussian','sech2','lorentzian', 'gaussian2D','rk4','moments','d4sigma','roi','alias_dict']...
# Copyright (C) 2019-2021 Intel Corporation # # SPDX-License-Identifier: MIT from collections import defaultdict import logging as log import os.path as osp from defusedxml import ElementTree import numpy as np from datumaro.components.annotation import ( AnnotationType, Bbox, CompiledMask, Label, Mask, ) from d...
import getpass import json import logging from uuid import UUID, uuid4 import immutables import pytest from freezegun import freeze_time from standardised_logging import ( ImmutableContextError, LogLevelException, StandardisedLogger, StandardisedLogHandler, ) def parse_log_lines(logs): log_lines...
from datetime import datetime import os import re import h5py as h5 import matplotlib.pyplot as plt import numpy as np import pandas as pd from decimal import Decimal import datajoint as dj from pipeline import (reference, subject, utilities) path = os.path.join('.', 'data', 'data', 'L4FS_loose_seal_ION_cut') fname ...
# -*- coding: utf-8 -*- # Copyright 2009-2021 <NAME>. All Rights Reserved. # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. #=========================================...