text
stringlengths
3.07k
12.6k
""" A collection of descriptors used to mark-up elements in a workflow, such as the inputs or outputs of workflow protocols. """ import abc import copy from enum import Enum from propertyestimator import unit from propertyestimator.utils.quantities import EstimatedQuantity from propertyestimator.workflow.typing impor...
from __future__ import absolute_import from django import template from django.conf import settings from django.contrib.humanize.templatetags.humanize import intcomma from django.db.models import Sum from django.template.defaultfilters import floatformat from openaid.projects import models as projects_models from opena...
# # ------------------------------------------------------------- # Copyright (c) Cavedu. All rights reserved. # ------------------------------------------------------------- """ Skeleton code showing how to load and run the TensorFlow Lite export package from Lobe. """ import argparse import json impor...
from flask import Flask, request, json from flask_restful import reqparse, abort, Api, Resource import k8s_manager import socket, requests as req, json, yaml, re, copy import k8s_distribute_pods app = Flask(__name__) api = Api(app) # parset init parser = reqparse.RequestParser() parser.add_argument('task') # k8s-man...
import torch import torch.nn as nn import math class EvoNormBatch2d(nn.Module): def __init__(self, num_features, apply_act=True, momentum=0.1, eps=1e-5, drop_block=None): super(EvoNormBatch2d, self).__init__() self.apply_act = apply_act # apply activation (non-linearity) self.momentum = ...
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 <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, co...
#!/usr/bin/env python # coding:utf-8 import atexit import os import sys import time import platform import shutil from datetime import datetime # reduce resource request for threading # for OpenWrt import threading try: threading.stack_size(128 * 1024) except: pass try: import tracemalloc tracemalloc...
#!/usr/local/bin/python #!/usr/bin/python import argparse import glob import os.path import time import sys import numpy as np import inference import inference_redmon import tensorflow as tf FLAGS = None TRAIN_FILE = '/root/imagenet-data/train-00004-of-01024' VALIDATION_FILE = '/root/imagenet-data/validation-00127-of...
from itertools import product from tensorflow.keras.preprocessing.image import array_to_img from pandas import DataFrame from typing import io, List import seaborn as sns import matplotlib.pyplot as plt import numpy as np def create_countplot(data: DataFrame, file: io, x: str, hue: str = None, title: str = '', annot...
#!/usr/bin/env python3 # ============================================================== # author: <NAME> # # TSEBRA: Transcript Selector for BRAKER # ============================================================== import argparse import sys import os import csv class ConfigFileError(Exception): pass gtf = [] anno ...
#!/usr/bin/env python import time from functools import reduce import operator from collections import defaultdict from datetime import datetime import numpy as np import pvapy as pv import logging PV_NAME = "pvapy:alarm" EPOCH = datetime.utcfromtimestamp(0) logging.basicConfig( filename="servePvWithAlarm.log"...
import os import argparse import argcomplete from add import add from rm import rm from ls import ls from edit import edit from inspect import inspect from load import load path = os.path def verify_clmanager_dir(): '''Verify that the root directory used by clmanager exists''' # the main directory that clma...
# # Proximate - Peer-to-peer social networking # # Copyright (c) 2008-2011 Nokia Corporation # # All rights reserved. # # This software is licensed under The Clear BSD license. # See the LICENSE file for more details. # import time from ioutils import valid_ip from meta import Meta, Meta_Attribute, validate_list, is_u...
# 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...
""" Ingress example for Kusto DB (from CSV file) There must be a file called ".env" in this folder with the environment variables (each is NAME_OF_VAR=value, one per line). It must be an AAD application that is cleared by the engineering team for access to the databases below and the variables needed are: - TENANT_...
import time import sys import sqlite3 import os import datetime from flask import Blueprint from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import jsonify from flask import url_for from werkzeug.exceptions import abort from ba...
import geo import numpy as np import os def cRMSD(coo1, coo2, norm=100): rmsd = np.sqrt(np.mean(np.square(np.linalg.norm(coo1-coo2, axis=-1)))) if norm: norm_rmsd = rmsd / (1 + np.log(np.sqrt(len(coo1) / norm))) return norm_rmsd else: return rmsd def GDT(coo1, coo...
import torch from torch.autograd import Variable import torch.nn.functional as F import torchvision.transforms as transforms import torch.nn as nn import torch.utils.data import numpy as np from .opt import opt from .dataloader import ImageLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco from .yolo.uti...
# Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type __author__ = "<NAME>" __license__ = "GPLv3" __email__ = "<EMAIL>" __version__ = "1.0" import sys from ansible.errors import AnsibleError, AnsibleFilterError from ansible.module_utils._text import to...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division from future.utils import viewitems, with_metaclass import abc # Abstract Base Classes # We use OrderedDict to obtain stable, deterministic results, and to make sure # particle definitions always come before decay channel ones. from collections i...
import os import torch import uproot import numpy as np import pandas as pd from torch.utils.data import DataLoader, TensorDataset, ConcatDataset import pytorch_lightning as pl from torch.utils.data import random_split from utils import print_dict from sklearn.preprocessing import StandardScaler class DatasetModule(p...
import math import sys from direct.showbase.InputStateGlobal import inputState from direct.task import Task from panda3d.core import Vec3 from panda3d.core import WindowProperties from src.graphics import changePlayerHeadingPitch from src.logconfig import newLogger from src.world import makePlayerBullet from src.wor...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Validate environment states.""" import math import multiprocessing import multiprocessing.pool from typing import Callable, Iterable, List, ...
import pygame import random pygame.init() win = pygame.display.set_mode((288,512)) pygame.display.set_caption("Flappy Bird") # images birdImg = [pygame.image.load("bird0.gif"),pygame.image.load("bird1.gif"),pygame.image.load("bird2.gif")] pipeImg = [pygame.image.load("tube1.gif"),pygame.image.load("tube2.gif")] bgImg...
import bittensor import torch import random import time import concurrent.futures from loguru import logger from unittest.mock import MagicMock from bittensor import bittensor_pb2 from bittensor.metagraph import Metagraph from bittensor.config import Config from bittensor.subtensor.interface import Keypair from bittens...
""" Version information. Based on ``_version_helper.py`` from PyCBC. """ import argparse import distutils.version import os import re import subprocess import sys import time class Version(object): """ This class manages version information. Attributes ---------- date githash branch tag ...
import json import urllib.request import logging import os.path from collections import deque from functools import partial from time import sleep, time from threading import Thread from scapy.all import sniff, Packet, TCPSession, conf, load_layer from scapy.layers.l2 import Ether from scapy.layers.inet import IP, TCP ...
#! python """ Modified version of barcode report for use in Iso-Seq 3. """ from pprint import pformat import functools import logging import json import os.path as op import sys from pbcommand.models import DataStore, FileTypes from pbcommand.models.report import PlotGroup from pbcommand.cli import pbparser_runner f...
import sys sys.path.append('../../') from datasets.camvid_loader import Loaddata, class_weight, mean, std, MaskToTensor import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader import models.deconvnetmodel as deconvnetmodel import torch import torch.nn.functional as F from...
# Copyright 2015-2016 Canonical Ltd. # # This file is part of the Apt layer for Juju. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # This program is distributed in the hope tha...
import os, datetime, logging from datapackage_pipelines.wrapper import ingest, spew from datapackage_pipelines_knesset.common.get_mk_faction import get_mk_faction def get_vote_faction_num_members(faction_memberships, vote_datetime): faction_num_members = {} vote_date = vote_datetime.date() for row in fact...
""" This module generates Python profiles only for the libximc library, because the protocol file format and URPC protocol files are not compatible and the bindings used in the libraries are different. """ from io import StringIO from json import loads from textwrap import dedent, indent from zipfile import ZipFile, ZI...
#!/usr/bin/env python # <NAME>, 2016, Astronomisches Rechen-Institut/GAVO, GPLv2+ # Aladin is kept in revision control, but the repository is not published # Aladin is published externally in unversioned .jar tarballs. # This script tries to obtain and rename the latest source versions # to enable re-import + allow tag...
#!/usr/bin/env python # # 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 # "...
import csv import sys import logging import re def get_csv_content(infile): """Open a CSV and get it contents into a list.""" # use Dialect to guess with open(infile, 'r') as f: for size in [1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072]: try: dialect = csv.Sniffe...
#!/usr/bin/env python3 # calculate metrics from collected data, generate plots and tables from locale import LC_ALL, setlocale from math import log10 from os import listdir, makedirs from statistics import mean, stdev import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import pandas as pd # ...
# 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 app...
import sys class Gender: Male = 0 Female = 1 class Graph(object): __slots__ = ['actresses', 'actors', 'n', 'm', 'role'] def __init__(self) -> None: super().__init__() self.actresses = set() self.actors = set() self.n = 0 self.m = 0 se...
# -*- coding: utf-8 -*- import os import itertools import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import globalcache import definitions # sns.set(style="white", rc={"axes.facecolor": (0, 0, 0, 0)}) sns.set() pd.options.mode.chained_assignment = 'raise' import votesim fr...
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: <NAME> (<EMAIL>) ...
import numpy as np import jpegio as jio from tqdm import tqdm import os from scipy import fftpack from numpy.lib.stride_tricks import as_strided from collections import defaultdict quantization_dict = dict() quantization_dict[95] = np.array([[ 2, 1, 1, 2, 2, 4, 5, 6], [ 1, 1,...
import gym import numpy as np import torch import torch.nn as nn class ReplayMemory: def __init__(self, obs_shape, size): self.states = np.empty([size, *obs_shape], dtype=np.float32) self.actions = np.empty([size], dtype=np.uint8) self.next_states = np.empty([size, *obs_shape], dtype=np.fl...
#!/usr/bin/env python3 import ipaddress import logging import os import signal import subprocess import sys import time import jinja2 def handle_SIGCHLD(signal, frame): os.waitpid(-1, os.WNOHANG) def handle_SIGTERM(signal, frame): sys.exit(0) signal.signal(signal.SIGINT, handle_SIGTERM) signal.signal(signa...
import celery from datetime import datetime import pandas as pd import logging import numpy import time from caravel import app, db, models, utils, dataframe QueryStatus = models.QueryStatus celery_app = celery.Celery(config_source=app.config.get('CELERY_CONFIG')) def is_query_select(sql): return sql.upper()....
import logging import cherrypy import requests from oidcmsg.key_jar import init_key_jar from oidcrp.util import get_deserialization_method from oidcservice.client_auth import factory as ca_factory from oidcservice.exception import OidcServiceError from oidcservice.exception import ParseError from oidcservice.servic...
#! /usr/bin/env python3 import random import copy import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.signal import find_peaks_cwt LENGTH = 50000000 N_TRIALS = 350 selection_strength = 1 replicates = 3 window = 1000000 step = 20000 out_pre = '/Volumes/Jacob_2TB_storage/sim_sec_recombi...
import numpy as np from os import path import torch from torch.utils.data.dataloader import default_collate from torch_geometric.data import Data, Batch, InMemoryDataset, Dataset, download_url from torch_geometric.transforms import ToDense class Cover(Data): """Augment a Data object with `"cover_index"` and `n...
#!/usr/bin/env python ''' ''' from __future__ import print_function try: import traceback from multiprocessing import Process import argparse import json import os from pprint import pformat import sys import time import uuid sys.path.append("../") import matplotlib matp...
#!/usr/bin/env python # encoding: utf-8 ''' editing.filter_known_snps removes known SNPs (BED3) from a candidate list of editing sites (VCF). @author: brian @copyright: 2017 yeolab. All rights reserved. @license: license @contact: <EMAIL> @deffield updated: 4-21-2017 ''' import sys import os import ...
# https://www.python.org/dev/peps/pep-0257/ import nltk import itertools import time import os import library.helpers as h from os.path import join as j import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) MAX_SEQ_LEN=2000 def default_tokenize(sentence, SPLIT_TOKEN=['.', '"' , "...
#!/usr/bin/env python3 import json import logging import sys from flask import Blueprint import flask from yabgp.agent import prepare_service from yabgp.common import constants from yabgp.handler import BaseHandler from yabgp.api import app from yabgp.api import utils as api_utils from yabgp.api.v1 import auth LOG...
#!/usr/bin/env python # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
""" .. module:: write.py :platform: Unix, Windows :synopsis: Maps raw AtMoDat vocab files to normalized pyessv format. .. moduleauthor:: <NAME> <<EMAIL>> """ import argparse import datetime as dt import json import os import pyessv # Define command line options. _ARGS = argparse.ArgumentParser...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "<NAME>" __doc__ = r""" Created on 22/03/2020 """ from enum import Enum from pathlib import Path from typing import Tuple, Union import numpy import torch from PIL import Image from draugr.numpy_utilities import Split from draugr.open...
import os import sys import h5py import numpy as np import numba as nb from mpi4py import MPI from gadgetutils.snapshot import ParticleData from gadgetutils.utils import calc_vr_phys, center_box_pbc import time @nb.njit def find_first(value, vector): """Find the index of the first occurence of value in vector.""...
"""BitBake Persistent Data Store Used to store data in a central location such that other threads/tasks can access them at some future date. Acts as a convenience wrapper around sqlite, currently, providing a key/value store accessed by 'domain'. """ # Copyright (C) 2007 <NAME> # Copyright (C) 2010 <NA...
#!/usr/bin/python # -=- encoding: latin-1 -=- """Download files from Wikimedia Commons.""" import os import logging import argparse from commonsdownloader.thumbnaildownload import download_file, DownloadException from itertools import zip_longest def get_category_files_from_api(category_name): """Yield the fil...
import function_pipe as fpn # create string lambda function # can have an inteleave() processor # can have a replace() process # both can be fed from other string processors def fn(): # givne a bunch of callables (lambdas, functions, callable instances), we can easily compose them a = fpn.FunctionNod...
# # Copyright 2020--2021 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 required by applicable la...
# -*- coding=utf-8 -*- import numpy as np import networkx as nx import math import sys import os # sentence_delimiters = ['?', '!', ';', '?', '!', '。', ';', '……', '…', '\n'] sentence_delimiters = "(\?|!|;|?|!|。|;|……|…|\n)" # 清华分词工具词性 http://thulac.thunlp.org/demo thu_allow_speech_tags = ["n", "np", "ns", "ni", "nz",...
from os import path import logging import numpy as np import pandas as pd import time from covidata import config from covidata.municipios.ibge import get_codigo_municipio_por_nome from covidata.persistencia import consolidacao from covidata.persistencia.consolidacao import consolidar_layout from covidata.webscraping...
# TODO: incomplete code import argparse from cerebralcortex.kernel import Kernel from cerebralcortex.markers.brushing.util import get_max_features, reorder_columns, classify_brushing from cerebralcortex.markers.brushing.util import get_orientation_data, get_candidates, filter_candidates def generate_candidates(CC, ...
# # Copyright 2018 PyWren Team # (C) Copyright IBM Corp. 2019 # (C) Copyright Cloudlab URV 2020 # # 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-...
# Copyright 2015 Huawei Technologies Co., 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 # # Unl...
import tensorflow as tf import cv2 import numpy as np import time def preprocess_image(img): means = [0.485, 0.456, 0.406] stds = [0.229, 0.224, 0.225] preprocessed_img = img.copy()[:,:,::-1] for i in range(3): #mean = preprocessed_img[:,:,i].mean() preprocessed_img[:,:,i] = preprocesse...
# -*- coding: utf-8 -*- # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: Simplified BSD import collections.abc from colorsys import rgb_to_hls from contextlib import contextmanager import platform import signal import sys from decorator impo...
''' Created on 7 Apr 2017 @author: jkiesele ''' from __future__ import print_function from .ReduceLROnPlateau import ReduceLROnPlateau from ..evaluation import plotLoss from keras.callbacks import Callback, EarlyStopping,History,ModelCheckpoint #, ReduceLROnPlateau # , TensorBoard # loss per epoch from time import t...
# -*- coding: utf-8 -*- from random import randint import json from openeo_grass_gis_driver.models.process_graph_schemas import \ ProcessGraph, ProcessGraphNode from openeo_grass_gis_driver.actinia_processing.base import \ PROCESS_DICT, PROCESS_DESCRIPTION_DICT, Node, \ check_node_parents, DataObject, G...
# Author: Taoz # Date : 8/26/2018 # Time : 2:47 PM # FileName: q_network.py import numpy as np from mxnet import init, nd, autograd, gluon import esheep_sdk.example.medusa.algorithm1.dueling_dqn as dueling_dqn import esheep_sdk.example.medusa.algorithm1.utils as g_utils from esheep_sdk.example.medusa.algorithm1.conf...
from chainer.backends import cuda import cupy import numpy as np from chainerkfac.optimizers.cholesky_inverse import inverse import warnings PI_TYPE_TRACENORM = 'tracenorm' def get_diagval(link, attrname, damping): param = getattr(link, attrname, None) if param is None: return r = getattr(par...
import torch import torchvision from functools import partial import vision_transformer as vit from torchvision import transforms import torch.nn as nn import utils import widen_resnet class TWIST(nn.Module): def __init__(self, args): super(TWIST, self).__init__() if args.backbone.startswith('resn...
from thirdParty.OpenKE import config from thirdParty.OpenKE import models from embedding import Embedding import time import sys import os from argparse import ArgumentParser def train(benchmark_folder, embedding_folder, train_model_str, test_flag=False, \ work_threads=32, epoch_count=1000, batch_count=100, le...
""" This file contains resource functions that access and manipulate user data """ from util.webshared import JSONResponse, Message, Error, secure from collections import namedtuple from bottle import request, response from util.validation import validate_name, validate_username, validate_password from data.db_mode...
from numpy.random import random import matplotlib.pyplot as plt import time import random start = time.time() class Patient(): # default state is susceptible def __init__(self, state = 'susceptible'): self.state = state def infect(self): self.state = 'infected' def isolate(self): self.state = 'iso...
## NOTE: ONLY WORKS ON MAC import subprocess, re, sys import os from sympy import mathematica_code as mcode from beluga.utils import sympify # Credits: http://sapiensgarou.blogspot.com.br/2012/06/how-to-run-mathematica-functions-on.html def mathematica_run(command): """Call the shell script which in turn calls math...
#!/usr/bin/env python3 # Unfortunately python3 does not seem to work on FreeBSD # Sharing # Copyright (c) 2020, <NAME> <<EMAIL>> # 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. Redistribut...
""" A module for a fast looping through a dataset (using python's multiprocessing) Author: <NAME> (<EMAIL>) and <NAME> Last update: March 9, 2014 """ import multiprocessing import numpy as np import h5py, os, sys, time import utils __all__ = ['FastLoop'] def _worker_call(worker, pipe): work_package = pipe...
import os import os.path as osp import json __all__ = ['AppConfig', 'AppHistory'] def check_all_keys_exist(template, target): if not isinstance(template, dict): raise TypeError('`template` should be a dict, got %s' % type(template)) if not isinstance(target, dict): raise TypeError('`target` s...
""" This example shows how you could use Keras `Sequence`s and multiprocessing/multithreading for Keras models in Determined. Information for how this can be configured can be found in `make_data_loaders()`. Tutorial based on this example: https://docs.determined.ai/latest/tutorials/tf-cifar-tutorial.html Useful ...
from flask import abort, request, redirect, url_for from flask_login import current_user from dmcontent.html import to_summary_list_rows from dmutils.dates import get_publishing_dates from dmutils.flask import timed_render_template as render_template from app import data_api_client from ... import main, content_loade...
import glob import os import sys import hydra import numpy as np import pandas as pd import pytorch_lightning as pl import soundfile as sf import torch from omegaconf import DictConfig, OmegaConf, open_dict from sklearn.metrics import f1_score, precision_score, recall_score from torch.utils.data import DataLoader, Dat...
import datetime import shutil import os from ruamel import yaml from pathlib import Path TEMPLATE = """\ package: name: ros version: 0.0.1 source: build: number: 0 about: home: https://www.ros.org/ license: BSD-3-Clause summary: | Robot Operating System extra: recipe-maintainers: - ros-forge...
from io import StringIO import fire import inspect import sys from collections.abc import Mapping from dataclasses import dataclass from functools import wraps from . import figutils from .config_functions import MasterConfig from . import fields def init_config(default_config, cli_args=None): assert default_confi...
from flask import Flask, request, jsonify import pickle import datetime from datetime import date import pandas app = Flask(__name__) import json import csv import math import pytz import random import os, time from sklearn.preprocessing import PolynomialFeatures def get_daytype(now): if now < 5: return ...
# -*- coding: utf-8 -*- # 14-8-8 # create by: snower from __future__ import absolute_import, division, print_function, with_statement import greenlet import sys import struct import traceback from pymysql import err from pymysql.constants import CR from pymysql.connections import Connection as _Connection from . impo...
import argparse import os import torch import random import torch.backends.cudnn as cudnn import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from model.VDSR import Net from model.Asym_VDSR import Asym_Net from model.Back_Asym_VDSR import Back_Ne...
import numpy as np import tensorflow as tf import gym np.random.seed(2) tf.set_random_seed(2) # reproducible # Superparameters OUTPUT_GRAPH = False MAX_EPISODE = 3000 DISPLAY_REWARD_THRESHOLD = 200 # renders environment if total episode reward is greater then this thresholf MAX_EP_STEPS = 1000 # maximum time step in...
"""Interface to use behaviors to handle HRI.""" # Copyright (c) 2022, ABB # 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 copy...
import torch import torch.multiprocessing as mp from torchsupport.data.io import make_differentiable from torchsupport.data.namedtuple import namedtuple class AbstractCollector: def pull_changes(self): raise NotImplementedError("Abstract.") def push_changes(self): raise NotImplementedError("Abstract.") ...
import os import glob import numpy as np import torch from PIL import Image from torch.utils import data import misc as ms from datasets import base_dataset palette = [128, 64, 128, 244, 35, 232, 70, 70, 70, 102, 102, 156, 190, 153, 153, 153, 153, 153, 250, 170, 30, 220, 220, 0, 107, 142, 35, 152, 251, 152...
import re def instantiate_request_uri_templates(json_content): """Instantiate the parameters for all the requests URI templates Arguments: json_content -- JSON object containing the API parsed spec """ json_content["has_example"] = False for resource_group in json_content["resourceGroups"]: ...
import tensorflow as _tf from utils import logutil as _logutil import math _logging = _logutil.get_logger() _FLAGS = _tf.app.flags.FLAGS def adjust_size(x, y): x = _tf.image.resize_images(x, (_FLAGS.dim_dataset_h, _FLAGS.dim_dataset_w)) y = _tf.image.resize_images(y, (_FLAGS.dim_dataset_h, _FLAGS.dim_dataset...
""" What do you claim per day? """ import pandas as pd import utils from utils import get_total from day_summaries import DaySummaries from main import Ausfahrliste as AusfahrlisteToTable import glob import os import sys from tqdm import tqdm from datetime import datetime import json import natsort whole_table_file = "...
# Hierarchcal Bayesian linear regression on 1d synthettic data # Based on: https://github.com/aloctavodia/BAP/blob/master/code/Chp3/03_Modeling%20with%20Linear%20Regressions.ipynb import numpy as np import matplotlib.pyplot as plt import pymc3 as pm import numpy as np import scipy.stats as stats import matplotlib.py...
import ast from typing import List, Dict from dataframe_expressions import ast_DataFrame from dataframe_expressions.render import render from func_adl_xAOD import ServiceXDatasetSource import pytest from hep_tables import xaod_table from hep_tables.utils import ( _find_dataframes, _find_root_expr, _index_text_tup...
#!/usr/bin/env python3 """Worker module polling events from argus incidents""" import argparse import os import socket import sys import time import traceback from logging import debug, error, info, warning from typing import Any, Dict, Generator, Optional, Text, cast, List import caep import requests import urllib3...
# coding : utf-8 """ Learning procedure of residual blocks in ResFGB. """ from __future__ import print_function, absolute_import, division, unicode_literals import sys from logging import getLogger, DEBUG import numpy as np import theano import theano.tensor as T from resfgb.utils import minibatches, minibatch_indice...
""" This file contains code for the library "Apfloat". Author: DigitalCreativeApkDev """ # Importing necessary libraries from MPComplex.mp_complex import MPComplex from mpmath import * mp.pretty = True # Creating static function to check whether an object is a number or not def is_number(obj: object) -> bool: ...
# Copyright 2016-2021, Pulumi 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 t...
import random from os import path from typing import Any, Dict from clinicadl.train.train_utils import get_train_dict def get_space_dict(toml_options: Dict[str, Dict[str, Any]]) -> Dict[str, Any]: """Transforms the TOML dictionary in one dimension dictionary.""" if "Random_Search" not in toml_options: ...