text
stringlengths
3.07k
22.1k
import json import logging import os import sys import tornado.gen import tornado.httpclient import tornado.httpserver import tornado.ioloop import tornado.web import torngithub from biothings.web.handlers import BaseHandler as BioThingsBaseHandler from jinja2 import Environment, FileSystemLoader from tornado.httputil...
# -*- coding: utf-8 -*- # Copyright 2014-2018 Rumma & Ko Ltd # License: BSD, see LICENSE for more details. """ Defines the :rst:dir:`sigal_image` directive. .. rst:directive:: sigal_image .. _picsel: https://github.com/lsaffre/picsel .. _Shotwell: https://en.wikipedia.org/wiki/Shotwell_%28software%29 .. _digiKam: ht...
import webapp2 from data_models import User, FBFriends, TWFriends, Friends from basichandler import BasicHandler import call_api from google.appengine.api import memcache from google.appengine.ext import db import logging FRIENDS_EACH_BULK = 24 class GetFriendHandler(BasicHandler): def get(self): FB_frien...
"""This submodule contains the path_parse() function used to convert SVG path element d-strings into svgpathtools Path objects. Note: This file was taken (nearly) as is from the svg.path module (v 2.0).""" # External dependencies from __future__ import division, absolute_import, print_function import re import numpy a...
from __future__ import unicode_literals from decimal import Decimal import binascii from collections import OrderedDict from django.db import models from gcoin import decode_op_return_script class Address(models.Model): address = models.CharField(unique=True, max_length=40) def __str__(self): retu...
import unittest from mako.template import Template import pybald from pybald import context from datetime import datetime, timedelta from pybald.core.router import Router now = datetime(2018, 6, 15, 3, 0) this_year = now.year helpers = ( ('page_js', '''${page.add_js('/test.js')}''', b'''<script src="/test.js?v=None">...
import numpy as np import logging import os.path as osp import torch from torch import nn from torch.serialization import default_restore_location from tensorboardX import SummaryWriter from lib.test import test from lib.utils import checkpoint, precision_at_one, \ Timer, AverageMeter, get_prediction, get_torch_d...
# Utility Commands, most come with special configurations and run in the background import discord from discord.ext import tasks, commands import asyncio import datetime from wax.helpers import abs_path from wax.logger import log from PIL import Image from io import BytesIO class Utility(commands.Cog): def __init_...
import statistics import matplotlib.pyplot as plt import numpy as np from celluloid import Camera def plot_population_on_the_surface( function, boundaries=(-100, 100), points=30, ax=None, population_coordinates=None, filename=None, display=False, ): """Plot population and the surface....
# 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...
import qt import numpy as np import os import shutil import sys import progressbar from constants import * def copy_script(once): if once: shutil.copy2('%s'%sys.argv[0],'%s/%s'%(data.get_filepath()[:-(len(data.get_filename())+1)],os.path.basename(sys.argv[0]))) # def predict_fm(vg): # return ...
# Copyright WillianFuks # # 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, softw...
#!/usr/bin/env python """ restructure-land.py =================== Restructures land data for the cdm-lite. Function -------- For a given <batch_id>: - get list of input files - gather years - for each <year>: - get input files - create dataframe list - derive output and log file paths - CHECK: if ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import operator from str_utils import * from time import gmtime, strftime import os VAR_SIM_FACTOR = 0.0 SUFFIX_SIM_FACTOR = 1.0 def _log(msg): print (msg) class TypeMiner(object): def __init__(self, training_file, types_file, suffix_file): s...
from __future__ import absolute_import import tangos as db import tangos.config import os from tangos.tools import add_simulation from tangos.tools import property_writer from tangos.input_handlers import output_testing from tangos import parallel_tasks, log, testing from tangos import properties from tangos.util impor...
import sys import numpy as np import scipy.sparse as sp from ctypes import c_int, byref from numpy.ctypeslib import ndpointer import time import qutip.settings as qset # Load solver functions from mkl_lib pardiso = qset.mkl_lib.pardiso pardiso_delete = qset.mkl_lib.pardiso_handle_delete if sys.maxsize > 2**32: # Runn...
import time from twisted.python.failure import Failure from twisted.internet import protocol, reactor, error, defer from foolscap.tokens import (NoLocationHintsError, NegotiationError, RemoteNegotiationError) from foolscap.info import ConnectionInfo from foolscap.logging import log from foo...
# @Time : 2018/3/27 10:59 # @File : roibatchLoader.py # @Author : <NAME> # @Email : <EMAIL> # @Personal homepage : https://coderskychen.cn """The data layer used during training to train a Fast R-CNN network. """ from __future__ import absolute_import from __future__ import division from __future__...
import numpy as np import math import operator from core.Qubit import Qubit import time def tensor_product_simple(q1, q2): """ Simple element-wise tensor product :param q1: Qubit Type Object :param q2: Qubit Type Object :return: [4 x 1] system state vector """ try: return np.asarra...
import re as regexp from django import forms from django.contrib import admin from django.contrib.admin import SimpleListFilter from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from husky.models import Parent, Children,...
#!/usr/bin/env python """ @package: - @script: send-msg.py @purpose: IP Message Sender. Sends TCP/UDP messages (multi-threaded). @created: Aug 26, 2017 @author: <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior @mailto: <EMAIL> @site: https://github.com/yorevs/homesetup @license: Please refer to <https:...
import json import uuid import logging import pkg_resources from itertools import count from pathlib import Path from urllib.parse import urlencode, urljoin from banal import ensure_dict, ensure_list from requests import RequestException, Session from requests_toolbelt import MultipartEncoder # type: ignore from typin...
# Copyright (c) 2021 PPViT 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 l...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Feb 9 20:17:38 2021 @author: lucasmurtinho """ import numpy as np from ExKMC.Tree import Node import time import random from find_cut import get_distances def get_best_cut_makarychev(data, data_count, valid_data, centers, valid_centers, ...
from datetime import datetime from decimal import Decimal from typing import Dict, List, Optional, Union import paramiko from fastapi.exceptions import HTTPException from pydantic import BaseModel as PydanticBaseModel from pydantic import EmailStr, root_validator, validator from pydantic.utils import GetterDict as Pyd...
# @license # Copyright 2019 Google LLC. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
# -*- coding: utf-8 -*- """ @author:XuMing(<EMAIL>) @description: """ from difflib import SequenceMatcher import numpy as np from similarities.utils.util import cos_sim zero_bit = 1e-9 def try_divide(x, y, val=0.0): """ try to divide two numbers """ if y != 0.0: val = float(x) / y retur...
# -*- coding: utf-8 -*- import numpy as np import torch import copy class Hypothesis(object): ''' a hypothesis which holds the generated tokens, current state, beam score and memory reading weights ''' def __init__(self, tokens, states, score, read_aligns): self.score = score s...
# -*- coding: utf-8 -*- # # Copyright 2015-2022 BigML # # 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 ...
import sys import math import random from copy import deepcopy from itertools import combinations from unittest.mock import patch, MagicMock import pytest import numpy as np from text_rank.graph import AdjacencyList, AdjacencyMatrix, Vertex from text_rank.text_rank import ( sum_edges, accumulate_score, text...
''' Simple text based Sudoku solver. ''' __author__ = '<NAME>' import copy def uniqueInsert(l, v): ''' Add v to list if it is not already there, else raise ValueError ''' if v is not None: if v in l: raise ValueError('list already contains value %s' % v) assert 0 < v < 10, ...
import torch.nn as nn from ...modules import SeparableConv2d from .registry import BACKBONE_REGISTRY from ...config import cfg __all__ = ['Xception65', 'Enc', 'FCAttention'] class XceptionBlock(nn.Module): def __init__(self, channel_list, stride=1, dilation=1, skip_connection_type='conv', relu_first=True, ...
#!/usr/bin/python3 import zlib import sys import os import io class TItem: def __init__(self, _id, _off, _arr = 0): self.ID = _id self.off = _off self.arr = _arr ID = 0 off = 0 arr = 0 class TEra: shift = 0 items = None strm = None tabl = None def __init__(self, fpath, shifter = True): self.items ...
#!/usr/bin/env import time import random from pynput import keyboard import tkinter as tk from tkinter import messagebox class Block(object): def __init__(self, x, y, parent): self.parent = parent self.x = x self.y = y self.previousx = x # initialize self.previousy = y # initialize class Snake(object): de...
# Copyright 2018 REMME # # 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...
#!/bin/env/python3 import serial import sys import glob def getActivePorts(): """ Find the open serial ports and return as a list. Main part of the code from: http://stackoverflow.com/questions/12090503/listing-available-com-ports-with-python Returns ------- (list) a list of strings denoting names of o...
""" desispec.scripts.preproc ======================== Command line wrappers for pre-processing a DESI raw exposure """ from __future__ import absolute_import, division import argparse import os import sys from desispec import io from desiutil.log import get_logger log = get_logger() def parse(options=None): par...
# Copyright (c) 2019 NVIDIA Corporation import argparse import datetime import os import random from collections import namedtuple from functools import partial from pprint import pformat import numpy as np import torch from ruamel.yaml import YAML from tensorboardX import SummaryWriter import nemo from nemo.core.cal...
# # Train Rev. 02 # # Online Detection and Classification of Dynamic Hand Gestures with Recurrent 3D Convolutional Neural Networks에서 # RGB Image를 Conv 3D에 넣어서 분류하는 부분만을 적용 # from tabnanny import verbose import numpy as np import tensorflow as tf import pandas as pd from collections import deque import cv2 as cv from...
# Adapted for numpy/ma/cdms2 by convertcdms.py from cdms2.selectors import SelectorComponent import MV2 import numpy import cdtime class PickComponent(SelectorComponent): """ Let the user pick non contiguous values along an axis keyword "match" is reserved for handling of non-existing values match=1 :...
#!/usr/bin/python # -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 """ parse, merge and write gstdoc-scanobj files """ from __future__ import print_function, unicode_literals import sys import os def debug(*args): pass # OrderedDict class based on # http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/1077...
"""`kedro_viz.api.graphql` defines graphql API endpoint.""" # pylint: disable=no-self-use, too-few-public-methods, unnecessary-lambda from __future__ import annotations import asyncio import json import logging from collections import defaultdict from typing import ( TYPE_CHECKING, AsyncGenerator, Dict, ...
# Copyright (C) 2019 Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # import sys import subprocess # nosec import board_cfg_lib, scenario_cfg_lib import hv_cfg_lib import common DESC = """# Board defconfig generated by acrn-config tool """ HV_RAM_SIZE_MAX = 0x40000000 MEM_ALIGN =...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import time import shutil import subprocess from PySide2.QtWidgets import QGridLayout, QFileDialog, QDialog, QPushButton,\ QLineEdit, QTableWidget, QTableWidgetItem, QCheckBox, QProgressBar, QLabel from PySide2.QtCore import QTimer, Signal, QThread class d...
""" Miscellanous functions to handle models. Date: September 2018 Author: <NAME> Email: <EMAIL> Github: ignacioheredia """ import os import json from tensorflow.keras import applications from tensorflow.keras import regularizers, callbacks from tensorflow.keras import backend as K from tensorflow.keras.models import...
# The MIT License (MIT) # Copyright (c) 2019 <NAME> # Copyright (c) 2020 <NAME> # https://opensource.org/licenses/MIT # Purpose: # - read 32-bit audio samples from the left channel of an I2S microphone # - snip upper 16-bits from each 32-bit microphone sample # - write 16-bit samples to an internal flash file ...
import re from collections import namedtuple, Mapping from dataclasses import dataclass, field, fields from typing import List, Any from inspect import isfunction from itertools import cycle from .complex import SerialisableObject, MCColor, MCLocation, MCPotionType, MCPotionEffect, MCPotionData, MCParticle, \ MCVi...
""" Handles CREATE actions for the Resource """ import logging import time from typing import Optional, Mapping from pathlib import Path from cloudformation_cli_python_lib import OperationStatus, SessionProxy from .util import upload_ignition_files_to_s3, write_kubeconfig, \ fetch_openshift_binary, terminate_boot...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import numbers import os def is_integral(x): """Any integer value""" try: return is...
import os import sys import subprocess import time import json import argparse from six.moves import shlex_quote import torch # Runners from rlpyt.runners.minibatch_rl import MinibatchRl, MinibatchRlEval # Policies from rlpyt.agents.pg.atari import AtariFfAgent, AtariLstmAgent from rlpyt.agents.pg.mujoco import Mujoc...
from __future__ import print_function import contextlib import copy import glob import itertools import json import logging import os import shutil import socket import subprocess import sys import tempfile import time from collections import OrderedDict import psutil from . import six from .configuration import Iro...
''' Created on Jun 25, 2018 @author: <NAME> ''' import turtle from random import randint from time import time, sleep from Section1.Video1_FINAL_Setup_Game_Area import create_game_screen, BORDER_WIDTH, GAME_AREA_START_X, GAME_AREA_START_Y from Section1.Video2_FINAL_Create_Running_Track_Labels import create_track_...
#!/usr/bin/env python3 """tabasco - Time Based Source Control. Usage: tabasco start [--frequency=<seconds>] tabasco stop tabasco monitor <directory> tabasco unmonitor <directory> tabasco log tabasco apply <commit> tabasco rm <commit> tabasco -h | --help tabasco --version Options: ...
""" Before running this, make sure that the chunk prefix are computed. Look for those code in plan2vec_experiments/rope/rope_pairwise.py First make sure you have a trained rope local metric function, if not train one. Then run the `pair_wise` function, which computes this matrix in parallel chunks. """ import networ...
"""This module contains changed pytest for report-portal.""" # This program is free software: you can redistribute it # and/or modify it under the terms of the GPL licence import dill as pickle import logging import time import pytest import requests from pytest_reportportal import LAUNCH_WAIT_TIMEOUT from reportpo...
# 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...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# Copyright (c) 2007-2009, Linden Research, Inc. # Copyright (c) 2007, IBM Corp. # # 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 re...
import codecs from .global_vars import * from .editor_client import cli from .text_helpers import * from .panel_manager import get_panel_manager class FileInfo: """Per-file info""" def __init__(self, filename, cc): self.filename = filename self.is_open = False # 'pre_change_sent' mea...
""" """ # Add imports here from . import utilities as _utilities from . import io as _io from ._configs import STANDARD_AAS, STANDARD_CONVERSION from . import protfasta as _protfasta import os from . protfasta_exceptions import ProtfastaException # Handle versioneer from ._version import get_versions versions = get_ve...
import random import requests import datetime from datetime import timedelta import pytz import time import json # Functions that control the bots logic def writeJSON(file, key, value): with open(file, 'r+') as f: data = json.load(f) data[key] = value f.seek(0) json.dump(data, f, in...
# AVL Rank Tree: # Skeleton source: https://gist.github.com/Jekton/d161ccf57bdcc9da5ee134c191f81af7 # Further added methods and all the delta-functionality, independently from typing import Optional, Tuple, NamedTuple, List # # Wrapper class for AvlRankTree # # for consecutive double-edged integers with values # cla...
#!/usr/bin/env python3 # Copyright © 2019-2020 Intel Corporation # 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, ...
# Define as funções de restrições. from collections import Counter ################################################################################################################## """ -> Disciplinas do mesmo e curso e periodo não podem ter aulas no mesmo horario. R1; """ def R1(disciplines): disp = [] ...
#!/usr/bin/env python3 import torch import torch.utils.data import numpy as np import pandas as pd from .mixedDataset import mixedDatasetInstance from .imageDataset import imageDatasetInstance from .model_utils import nll_categ_global, nll_gauss_global from sklearn.metrics import roc_auc_score as auc_compute from skl...
# Copyright (C) 2020 <NAME>. # All rights reserved. import deezloader import os import shutil import time import datetime import asyncio from hachoir.metadata import extractMetadata from hachoir.parser import createParser from telethon import events from telethon.errors.rpcerrorlist import YouBlockedUserError from te...
import json from concurrent.futures import ThreadPoolExecutor import keras.backend as K import numpy as np from PIL import Image from keras import Input, Model from keras.layers import Conv2D, BatchNormalization, Activation, Dropout, AveragePooling2D, ZeroPadding2D, Permute, \ TimeDistributed, Flatten, Dense, Lamb...
import copy import csv from datetime import datetime from io import StringIO import logging import xml.etree.ElementTree as et from aiohttp import ClientSession from dateutil import parser, tz import lxml.html import voluptuous as vol from .constants import USER_AGENT STATIONS_URL = "https://climate.weather.gc.ca/h...
#! -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> """ Reference: RoadNet: Learning to Comprehensively Analyze Road Networks in Complex Urban Scenes From High-Resolution Remotely Sensed Images. https://ieeexplore.ieee.org/document/8506600 """ import torch import torch.nn as nn import torch.nn.functional as F f...
import PySimpleGUI as sg import csv import os import webbrowser sg.theme("DarkBrown4") rightclickfontsize = 10 savefile = "saved.csv" delimiter = "\\" fontsize = 15 fonttype = "Helvetica" txtcolor = [sg.theme_text_color(), "#404040"] buttoncolor = txtcolor[0] settingsfile = "settings.csv" initialwins...
""" Defines various utilities including: - parse_patran_syntax - parse_patran_syntax_dict - Position - PositionWRT - transform_load """ from __future__ import annotations from copy import deepcopy from typing import List, Dict, TYPE_CHECKING import numpy as np # type: ignore from numpy import cross, dot # type:...
""" Index metadata for Faiss indices. """ import re from enum import Enum from math import ceil from autofaiss.utils.cast import cast_bytes_to_memory_string from autofaiss.external.descriptions import ( INDEX_DESCRIPTION_BLOCKS, IndexBlock, TUNABLE_PARAMETERS_DESCRIPTION_BLOCKS, TunableParam, ) clas...
from __future__ import print_function, absolute_import import argparse import os import os.path as osp import random import numpy as np import torch from torch.backends import cudnn from torch.utils.data import DataLoader import torchvision from gcl import datasets from gcl import models from gcl.trainer import DGNet...
# # Copyright 2017 FrogSquare. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/env python # # Copyright 2019 Autodesk # # 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 ...
# -*- coding: utf-8 -*- # Copyright 2014-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#/u/GoldenSights import praw import time import traceback import sqlite3 ''' USER CONFIG ''' APP_ID = "" APP_SECRET = "" APP_URI = "" APP_REFRESH = "" # https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/ USERAGENT = "" # This is a short description of what the bot does. # For example "/u/GoldenS...
from __future__ import unicode_literals import base64 import json from django.conf import settings from django.contrib.auth import authenticate, login from django.http import HttpResponse, HttpResponseForbidden, HttpResponseBadRequest from django.shortcuts import get_object_or_404 from django.views.decorators.csrf im...
import os import sys import glob import time import copy import logging import argparse import random import numpy as np import torch import torch.nn as nn import torch.utils import torch.nn.functional as F import torch.backends.cudnn as cudnn import utils from controller import NAO from nasbench import api def build...
#!/usr/bin/env python """ (single) focus lock. Hazen 04/17 """ import importlib from PyQt5 import QtCore, QtWidgets import storm_control.sc_library.parameters as params import storm_control.hal4000.halLib.halDialog as halDialog import storm_control.hal4000.halLib.halMessage as halMessage import storm_control.hal400...
# -*- coding: utf-8 -*- """ :author: <NAME> (李辉) :url: http://greyli.com :copyright: © 2018 <NAME> <<EMAIL>> :license: MIT, see LICENSE for more details. """ from flask import jsonify, request, current_app, url_for, g from flask.views import MethodView from todoism.apis.v1 import api_v1 from todoism.ap...
from django.db import models from django.db.models import Sum class GamificationInterface(models.Model): """ A user should have a foreign key to a GamificationInterface to keep track of all gamification related objects. game_tracking = ForeignKey(GamificationInterface) """ @property def ...
import torch from torch import nn from tf_bind_transformer.optimizer import get_optimizer from tf_bind_transformer.data import read_bed, collate_dl_outputs, get_dataloader, remap_df_add_experiment_target_cell from tf_bind_transformer.data import RemapAllPeakDataset, NegativePeakDataset, ScopedNegativePeakDataset def e...
#!/usr/bin/env python3 import sys from threading import Lock from PyQt5.QtWidgets import QApplication, QHBoxLayout from PyQt5.QtWidgets import QWidget from PyQt5.QtGui import QColor, QPainter, QPixmap from PyQt5.QtCore import pyqtSignal, Qt, QSize from prodj.pdblib.usbanlzdatabase import UsbAnlzDatabase from .wavefor...
import cv2 import grpc from configparser import ConfigParser from confluent_kafka import Producer, Consumer, KafkaError, KafkaException import generator import io import json import keras.backend as K import logging import matplotlib.pyplot as plt import numpy as np import os from PIL import Image import scipy.misc fro...
#Author: <NAME> #Contact: <EMAIL> #Date: Apri 03, 2019 import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm def m_ensampl_plt(m_smpls_pos, m_smpls_pri, layernum, i_dim, j_dim, k_dim, dobs): ''' Plot the the ensemble mean and variance of prior and posterior Args: m_smpls_po...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """General utilities for helping to serve foremanlite requests.""" import logging import typing as t from pathlib import Path from flask import make_response from flask.wrappers import Request from flask_restx.inputs import boolean from flask_restx.reqparse import ParseRe...
# Copyright 2020 <NAME> # Copyright 2020-2021 The Matrix.org Foundation C.I.C. # # 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 re...
from collections import defaultdict from typing import Tuple, Sequence, List, Union, Dict import torch import numpy as np import SimpleITK as sitk from ....data.io import nib_to_sitk from ....data.subject import Subject from ....typing import TypeTripletFloat from ... import IntensityTransform, FourierTransform from ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @authors: <NAME> (e-mail: <EMAIL>) : <NAME> (e-mail: <EMAIL>) : <NAME> (e-mail: <EMAIL>) """ '''Train CIFAR10 with PyTorch.''' import torch import torch.nn as nn import torch.optim as optim import torch.backends.cudnn as cudnn import torch.distributed ...
import os import os.path as op import time import click from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint from tensorflow.keras.mixed_precision import experimental as mixed_precision from tensorflow_addons.callbacks import TQDMProgressBar from fastmri_recon.config import * from fastmri_recon.data.da...
# coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. # # 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...
""" Music Metadata - EDI is a base library for several EDI-based formats by CISAC, most notably Common Works Registration (CWR) and Common Royalty Distribution (CRD). This file contains the file and group handling.""" import io # import re from weakref import ref from .records import * from .transactions import EdiT...
import tensorflow as tf from .util import * from .args import global_args from .const import EPSILON from .print_util import * from .component import * class Attention(Component): def __init__(self, args, table:Component, query:Component, key_width:int=None, seq_len:int=None, keys_len:Tensor=None, table_represent...
''' The file contains an adjacency list representation of an undirected weighted graph with 200 vertices labeled 1 to 200. Each row consists of the node tuples that are adjacent to that particular vertex along with the length of that edge. For example, the 6th row has 6 as the first entry indicating that this row corr...
""" Model classes for suretime. Copyright 2021 <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 https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
import numpy as np # ------------------------------------------------------------------------------ # NOTE: The following code is based on: https://github.com/matterport/Mask_RCNN/ def compute_iou(box, boxes, box_area, boxes_area): """Calculates IoU of the given box with the array of the given boxes. box: 1D...
import os import re import io import datetime import argparse from math import log from flask import * from functools import wraps from dateutil.parser import parse as parse_datetime app = Flask(__name__) class Logs(object): # extendable menu list MENU = [] # void def __init__(self, dir_project, dat...
import argparse import os import os.path as osp import pickle import shutil import tempfile import mmcv import torch import torch.distributed as dist from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import get_dist_info, init_dist, load_checkpoint from mmdet.core import wrap_fp16_m...
# =============================================================================== # Copyright 2018 ross # # 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/LICE...