text
stringlengths
6.04k
39.5k
from __future__ import division import csv,sys,codecs try: import ujson as json except: import json import remmets wd = './' #TODO: what do we want the wd to be? import re text_ex = re.compile(r"[\w'#@]+", re.UNICODE) text_URL_ex = re.compile(r"http[s]{0,1}://\S+|[\w'#@]+", re.UNICODE) #TODO: allow tokenizat...
#aaaa14a2 def save2nc(array, ncfile=None, name='data',\ #aaaa14a3 def nc_modify(oldNcFile, newNcFile=None, op=None) #aaaa14a4 def get_offset(ncVar) #== def_copy_att #== def_copy_dim #== def_copy_var import os, string, time from netCDF4 import Dataset import numpy as np tmpDir = '/tmp' axislib0 = { 'x':{'name': 'lon',...
# Extra files loaded (May need for compiling AMP) # 1) cuda/10.2.89 3) mpfr/3.1.4 5) ppl/1.2 7) dejagnu/1.6 9) isl/0.16.1 # 2) gmp/6.1.1 4) mpc/1.0.3 6) cloog/0.18.4 8) autogen/5.18.7 10) gcc/7.5.0 from matplotlib import pyplot as plt import seaborn as sns import torch ...
#!/usr/bin/env python from optparse import OptionParser import re import sys from peewee import * from peewee import print_ try: from MySQLdb.constants import FIELD_TYPE except ImportError: try: from pymysql.constants import FIELD_TYPE except ImportError: FIELD_TYPE = None RESERVED_WORD...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import re import sys import termios PY2 = sys.version_info.major < 3 # is needed for correct mypy checking if ...
#-*- coding:utf-8 -*- from __future__ import division import pygame import time import sys from pygame.locals import * import hero import enemy import bullet import supply import random pygame.init() pygame.mixer.init() #创建一个窗口,用来显示内容 bg_size = width,height = 470,690 screen = pygame.display.set_mode(bg_size,0,32) #添...
# This Python module is part of the PyRate software package. # # Copyright 2017 Geoscience Australia # # 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/l...
from __future__ import annotations import json import re from typing import Optional from aws_error_utils import ClientError import boto3 import pkg_resources from access_undenied_aws import event from access_undenied_aws import common from access_undenied_aws import logger from access_undenied_aws import utils ACC...
# Copyright 1999-2021 Alibaba Group Holding 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 a...
import numpy as np from pymoo.model.sampling import Sampling from customized_utils import if_violate_constraints_vectorized, is_distinct_vectorized def sample_one_feature(typ, lower, upper, dist, label, rng, size=1): assert lower <= upper, label+','+str(lower)+'>'+str(upper) if typ == 'int': val = rng....
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as tmodels import numpy as np from utils import utils import itertools import math import collections from torch.distributions.bernoulli import Bernoulli def load_word_embeddings(emb_file, vocab): vocab = [v.lower() for ...
# coding: utf-8 # created by deng on 8/5/2018 from itertools import product from collections import Counter from os.path import exists from sklearn.model_selection import StratifiedKFold from sklearn.metrics import f1_score, accuracy_score from sklearn.svm import LinearSVC from sklearn.linear_model import LogisticRegr...
import os os.environ["CUDA_VISIBLE_DEVICES"]="0" import numpy as np import re import tensorflow as tf import tensorflow.keras.backend as K import tensorflow.keras.layers as KL import tensorflow.keras.models as KM import tensorflow.keras.utils as KU from tensorflow.keras.layers import Layer import tensorflow_addons a...
from . import frontend from web_app import app from web_app.api.db_functions import * from flask import render_template, abort import json from scipy.stats import linregress, spearmanr from statsmodels.stats.multitest import multipletests @frontend.route("/", methods=["GET"]) def show_index(): isomiRs = get_al...
from collections import deque from time import time import gym import numpy as np from chainer import functions import edward import edward.models as edm import tensorflow as tf from helpers.ReplayBuffer import ReplayBuffer class VDQN: class VariationalQFunction: def __init__(self, stateSpace, actionSp...
#!/usr/bin/env python3 from neml import history, interpolate, elasticity from neml.math import tensors, rotations from neml.cp import crystallography, slipharden, sliprules, inelasticity, kinematics import common from common import differentiate from nicediff import * import unittest import numpy as np import numpy....
"""Transformations on dict annotations containing scalars and same-sized masks. The annotations that can be processed are supposed to be a dict with string keys and values of floats or :py:class:`numpy.ndarray` (binary) masks. The logical merging operations derived from :py:class:`Merge` allow for concatenation. Usin...
"""Simple association model The core class here is AssociationSet, a holder for a set of associations between entities such as genes and ontology classes. AssociationSets can also be throught of as subsuming traditional 'gene sets' The model is deliberately simple, and does not seek to represent metadata about the as...
''' coverageMaster - Main - <NAME> ''' from optparse import OptionParser from glob import glob import sys,os,re import matplotlib matplotlib.use('PDF') from pylab import * from collections import defaultdict import time from sympy import Union, Interval, SympifyError from multiprocessing import Pool,Manager import p...
import inspect import multiprocessing as mp import os import gin import gym import numpy as np import tensorflow as tf def get_space_attr(space, attr='shape'): """Recursive utility function to get a (possibly nested) attribute of a gym Space""" assert isinstance(space, gym.Space) if hasattr(space, 'spaces'):...
from __future__ import absolute_import, print_function, division import numpy as np from astropy import log from astropy.wcs import WCS as AstropyWCS def decode_ascii(string): try: return string.decode('ascii') except AttributeError: return string class WCS(AstropyWCS): def __init__(...
"""anomaly_detection ********************** MLPerf Tiny anomaly detection reference model - Source code: `anomaly_detection.py <https://github.com/siliconlabs/mltk/blob/master/mltk/models/tinyml/anomaly_detection.py>`_ - Pre-trained model: `anomaly_detection.mltk.zip <https://github.com/siliconlabs/mltk/blob/master/m...
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ # Tests the Entity Search Python API while the Editor is running import azlmbr.editor as editor import azlmbr....
import os import sys import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from datetime import datetime import joblib import argparse from deep_gmm import DeepGMM import itertools from utils import plot_3d def deep_iv_fit(x, z, t, y, epochs=100, hidden=[128...
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 u...
# 加载文件内容的方法 """ 这个文件主要是: 对yaml,json用例加载转换成用例模型、套件模型 预置函数加载成方法字典, 项目路径加载 变量写入环境 可用资料 [importlib]. https://docs.python.org/zh-cn/3/library/importlib.html [funcitons]. https://docs.python.org/zh-cn/3/library/functions.html 借助impotlib 动态导入module, vars内置函数解析module中的信息, 并将其处理和加入方法字典中name 作为 ke...
#! /usr/bin/env python """ The main script for a general run of the WFC3/UVIS External CTE monitor's pipeline over four main scenarios: postfash=0, pixel-based cte-correction=False postfash=0, pixel-based cte-correction=True postfash=12, pixel-based cte-correction=False postfash=12, pi...
from __future__ import annotations import collections.abc as abc from abc import abstractmethod, ABC from copy import copy from dataclasses import is_dataclass from itertools import chain from typing import Optional, List, Dict, Union, Tuple, Callable, Generic, TypeVar from .generic import AutoEqHash, AutoRepr from ....
""" Title: Knowledge distillation recipes Author: [<NAME>](https://twitter.com/RisingSayak) Date created: 2021/08/01 Last modified: 2021/08/01 Description: Training better student models via knowledge distillation with function matching. """ """ ## Introduction Knowledge distillation ([Hinton et al.](https://arxiv.org...
from contextlib import suppress import io import logging import os import queue import sys import threading from time import sleep import traceback from .threadpool import SpiderFootThreadPool # begin logging overrides # these are copied from the python logging module # https://github.com/python/cpython/blob/main/Lib...
import sys from pyvcsshark.parser.baseparser import BaseParser import pygit2 import logging import re import uuid import multiprocessing from pyvcsshark.parser.models import BranchModel, PeopleModel, TagModel, FileModel, CommitModel, Hunk, BranchTipModel class GitParser(BaseParser): """ Parser for git repositor...
''' Controller module: The main gateway between the information contained in the database, the fileinfo objects and the display of the thumbnails. ''' import sys import os import glob from tkinter import ttk from tkinter import filedialog as tkfiledialog from PIL import ImageTk from . import conditionmodules as CM fro...
# -*- coding: utf-8 -*- """ =============== AOTF controller =============== This controller (aa_modd18012.py) supplies one class with several methods to communicate with the AOTF driver from AA optoelectronics model: 1MODD18012_0074 :copyright: 2020by Hyperion Authors, see AUTHORS for more det...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Pushdown automaton # Context-free grammar from collections import deque from graphviz import Digraph from finit import EPCILON class _symbol: index = 0 def __init__(self, identity=None): if(identity is None): self.identity = '<Symbol' + ...
"""SwingTwist is a dependency graph node that decomposes the local rotation of a transform to drive the rotation of another transform allowing the user to scale the swing and twist components of the local rotation. To create the node, select the driver, then the driven and run cmds.swingTwist(name='swingTwistNodeName'...
""" Module for parameters used for describing models. """ # [ANDES] (C)2015-2022 <NAME> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your opt...
# # ---------------------------------------------------------------------------------------------------- # # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify ...
# ----------------------------------------------------------------------------- # # Cell Diagramming Language # # Copyright (c) 2018 <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 ...
#!/usr/bin/python3 # TODO: think about what to do about string results in future - enum? ignore? import bs4 import click import itertools import logging import requests import time from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, REGISTRY from prometheus_client import start_http_server DEFA...
from django.apps import apps from django.core.exceptions import ValidationError from django.db import IntegrityError, models from django.urls import reverse from django.utils import timezone from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from mptt.models impor...
#!/usr/bin/env python3 """ This script will convert a GTDB taxonomy into the style of an NCBI taxonomy, appropriate for usage when building a Centrifuge or Kraken database. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free...
""" Make simple models for testing :Author: <NAME> <<EMAIL>> :Author: <NAME> <<EMAIL>> :Date: 2018-04-27 :Copyright: 2018, Karr Lab :License: MIT """ from obj_tables.math.expression import Expression from scipy.constants import Avogadro from wc_lang import (Model, Submodel, Compartment, SpeciesType, Species, ...
# Copyright 2015 Google Inc. 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...
import numpy as np import matplotlib.pyplot as plt import torch import time import datetime import sys import shutil from pathlib import Path import os import logging import argparse import json import pickle pickle.HIGHEST_PROTOCOL = 4 import pandas as pd from collections import OrderedDict try: from StringIO impo...
# -*- coding: utf-8 -*- import os from itertools import compress import matplotlib.patches as mpatches import matplotlib.pylab as plt import numpy as np import seaborn as sns from .utils import get_sig_feats, make_ticks_int # load plot style plt.style.use('ggplot') def plot_sig_num_feats(datacol, sig_df, feat_sub...
import os import csv import json import shutil import time import errno from yuntu.core.db.base import embeddedDb, RAMDb from yuntu.core.db.methods import lDbUpdateField, lDbTimedInsert,\ lDbCrossSelectAnn from yuntu.core.db.utils import addTimeFields, loadParser from yuntu.core.datastore.base import simpleDatastor...
""" `fallback_mode` for cupy. Whenever a method is not yet implemented in CuPy, it will fallback to corresponding NumPy method. """ import types import numpy as np import cupy as cp class _RecursiveAttr(object): """ RecursiveAttr class to catch all attributes corresponding to numpy, when user calls fall...
from __future__ import annotations from typing import Dict, List, Optional, Tuple from openhab_creator import CreatorEnum, _, classproperty class WeatherCondition(CreatorEnum): THUNDERSTORM_WITH_LIGHT_RAIN = 1, _( 'Thunderstorm with light rain') # Gewitter mit leichtem Regen THUNDERSTORM_WITH_RAIN ...
# Copyright 2020 Dragonchain, Inc. # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # 6. Tr...
from abc import ABCMeta, abstractmethod from copy import deepcopy from kornia import homography_warp import numpy as np import torch from torch import nn from torch.nn import functional as F from torch.optim import Adam, RMSprop from torchvision.models import vgg16_bn from .mini_resnet import get_resnet_model as get_...
#!/usr/bin/python3 # coding: utf-8 # # websocket relay daemon for EqCare. # """ Copyright (c) 2015, <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. Redistributions of source code mus...
import torch.nn as nn from torch import Tensor from functools import partial from typing import Optional, List, Tuple, OrderedDict from util.util import init_weights from . import san from . import resnet from . import nl import torchvision.models.resnet as torchres from itertools import chain from collections.abc i...
import random import copy from queue import Queue from .layers import * from .utils import * def set_block_from_config(config): name2block = { TransitionBlock.__name__: TransitionBlock, ResidualTreeBlock.__name__: ResidualTreeBlock, } block_name = config.pop('name') block = name2bloc...
import os import shutil from drizzlepac import astrodrizzle from drizzlepac import tweakreg from drizzlepac import tweakback import scipy def coadd_ims(dlc_param): ''' Creates coadded template image from raw template images Parameters ---------- dlc_param : obj Parameter object from prep_...
""" Copyright 2018 EPAM Systems, 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 applicable law or agreed...
# Copyright 2019 Graphcore Ltd. import tensorflow as tf import os import time import argparse import numpy as np import random from tensorflow.python.ipu.scopes import ipu_scope from tensorflow.python.ipu import ipu_compiler from tensorflow.python.ipu import ipu_infeed_queue from tensorflow.python.ipu import ipu_outfe...
from django.shortcuts import render,get_object_or_404,redirect from django.http import HttpResponseRedirect from django.db.models import Q from comments.forms import CommentForm from .forms import CreateExeForm from .forms import EditExeForm from django.contrib import messages from .models import Exercise,Tags,TagsExe...
from multiprocessing import Process, Pipe import os import threading import time import numpy as np process_number = 3 event_number = 3 def sending_events_thread(pid, event_queue, pipe_list_local, process_id, event_list, lamport_clock, event_total_number): print("P%s:PID%s " % (str(process_id), str(pid))) pr...
import sys from math import floor, ceil, sin, radians import qdarkstyle from byow.climbing_wall import climbing_wall from byow.parts import Bar, Panel from byow.util import make_compound, get_boundingbox_shape, get_boundingbox, export_to_step from OCC.Display.backend import load_any_qt_backend, get_qt_modules load_a...
"""Class definitions of various tasks and the central control The control class is for communicating with the front-end GUI, and to organize the task into parallel. Different tasks are defined by different classes. The "task" class is a unique entrance that leads to different task instance based on the input task. Eac...
import copy import argparse import importlib import time import os.path from config import * import arcade from multiprocessing import Pool, TimeoutError class KingsheepWindow(arcade.Window): """Graphical Interface for Kingsheep""" def __init__(self, name, iterations, ks, player1, player2, pool, reason): ...
# -*- encoding: utf-8 -*- import tensorflow as tf from tensorflow.contrib.layers import batch_norm import os from PIL import Image, ImageOps from random import shuffle from preproc import * class Model(): """ Common ancestor to ML models """ def __init__(self, batch_size=10, train_p...
#!/usr/bin/env python3 # # Copyright (c) <NAME> and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. import copy import os import stat import subprocess import time from .eval import cfg_interpolate from .utils import env, textMD5, expand_time, format_durati...
import pyximport; pyximport.install() from tracing import trace import numpy as np import matplotlib.pyplot as plt import scipy.sparse from scipy.sparse import coo_matrix, lil_matrix import h5sparse from scipy.stats import rv_continuous from scipy.stats import wrapcauchy import os import urllib from astropy.io import f...
# Modified by <NAME> (<EMAIL>) # # Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- """ Specification for a single Test-Case. (see :py:class:`Test`) """ from typing import Optional, Union, List, Set, Tuple, Callable import os import re import sys import signal import difflib import subprocess import pathlib from enum import Enum import threading from...
# Copyright 2021-2022 AstroLab Software # Author: <NAME>, <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
import collections import pickle import numpy as np nax = np.newaxis import pylab import tsne TINY = 1e-30 DEFAULT_TRAINING_CONFIG = {'batch_size': 100, # the size of a mini-batch 'learning_rate': 0.1, # the learning rate 'mome...
from __future__ import absolute_import, division, print_function from cctbx.development import random_structure from cctbx import crystal, xray from cctbx.array_family import flex from smtbx.refinement import constraints import smtbx.refinement.constraints.adp as adp_constraints import smtbx.refinement.constraints.geom...
import csv import re import requests import logging import datetime as dt """ Exports Issues from a specified repository to a CSV file Uses basic authentication (Github username + password) or token to retrieve Issues from a repository that username has access to. Supports Github API v3. """ # params_payload = {'is':...
# % --------------------------------------------------------------------------------------------------------------------------------------- # % Hospitalization Models # % --------------------------------------------------------------------------------------------------------------------------------------- # % This c...
import re import string import unittest # Set to true to run implementation targets include_failing = False # Tests adapted from https://github.com/python/cpython/blob/master/Lib/test/test_re.py class S(str): def __getitem__(self, index): return S(super().__getitem__(index)) class ReTests(unittest.TestC...
import pandas as pd import numpy as np import statsmodels.api as sm from statsmodels import regression import matplotlib.pyplot as plt import requests import re import bs4 import akshare as ak import pickle import numpy as np from datetime import datetime from datetime import date def save_obj(obj, name): with ope...
from errors import BoxError import units from boxes import Box, SimpleItem from packing_algorithm import (best_fit, does_it_fit, insert_items_into_dimensions, pack_boxes, packing_algorithm, ItemTuple, volume) from collections import Counter import math ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ## # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U. # This file is part of openmano # 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 # ...
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models import jsonfield # https://github.com/bradjasper/django-jsonfield from django.dispatch import receiver from django.db.models.signals import post_init from django.conf import settings from django.contrib.aut...
''' MODULE GET GRID DIVISIONS Obtain the divisions in kx and ky for non-linear runs. For non-linear runs we simulate a box of size (x0, 2*pi*y0) around the magnetic field line. The input parameters are (y0, nzed, ny and nx); then (x0, nakx, naky) are calculated by stella. The resolution of the simulation is: - ...
import numpy import time import unittest from scipy.optimize import linear_sum_assignment from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import rdmolops from rdkit import DataStructs from rdkit.Chem.Fingerprints import FingerprintMols _BK_ = { Chem.rdchem.BondType.SINGLE: 1, Chem.rdchem.B...
import time import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision.transforms as transforms from torch import nn from torch.nn.utils.rnn import pack_padded_sequence from models import Encoder, DecoderWithAttention, DecoderWithBertEmbedding from sgr_datasets import * from sgr_...
import discord import random from fpl_api import get_player_image from bot import fplApi def underscore(string): return string.replace(' ', '_') import json emojis = {} emoji_files = ['GOALIE_EMOJIS.json', 'LOGO_EMOJIS.json', 'SHIRT_EMOJIS.json', 'PLAYER_EMOJIS.json'] for emoji_file in emoji_files: emojis ...
import os import struct import unicodedata import zipfile from typing import List, Sequence, Optional, Dict, Union, Iterable, BinaryIO from zipfile import ZipFile import numpy as np from .token_mapper import TokenMapper, default_token_mapper, HashTokenMapping root_path = os.path.join(os.path.dirname(os.path.realpath...
#Analyze statistics import pandas as pd import numpy as np import matplotlib.pyplot as plt import alphapept.io import os import alphapept.io import seaborn as sns from tqdm.notebook import tqdm as tqdm import warnings def prepare_files(path1, path2): df1 = pd.read_hdf(path1, 'protein_fdr') # add sequence cha...
# global import os import ivy import math import logging import numpy as np import multiprocessing try: import ray from ray import tune from ray.tune import CLIReporter from ray.tune.schedulers.async_hyperband import AsyncHyperBandScheduler except ModuleNotFoundError: ray = None tune = None # l...
import torch import syft as sy from syft.generic.frameworks.types import FrameworkTensor from syft.generic.utils import allow_command from syft.generic.utils import remote def linear(*args): """ Un-hook the function to have its detailed behaviour """ return torch.nn.functional.native_linear(*args) ...
from tkinter import * import tkinter.messagebox as tmsg from math import sqrt, pi, ceil def calculation(sin): global value3 outputvalue1.delete(0, END) if sin == "add": value3 = float(inputvalue1.get()) + float(addvalue1.get()) elif sin == "sub": value3 = float(inputvalue1.get()) - flo...
# SPDX-FileCopyrightText: 2021 <NAME> # # SPDX-License-Identifier: MIT """ `displayio_switchround` ================================================================================ A sliding switch widget with a round shape. * Author(s): <NAME> Implementation Notes -------------------- **Hardware:** **Software and ...
""" Title: Augmenting convnets with aggregated attention Author: [<NAME>](https://twitter.com/ariG23498) Date created: 2022/01/22 Last modified: 2022/01/22 Description: Building a patch-convnet architecture and visualizing its attention maps. """ """ ## Introduction Vision transformers ([Dosovitskiy et. al](https://ar...
from .core import BaseHMF from .utils import stride_util from .utils import border_idx_util from .utils import save_obj from .utils import load_obj from .parallel import WriterProcessManager import numpy as np import pandas as pd import os import shutil import psutil from multiprocessing import sharedctypes from colle...
import argparse import math import shutil from pathlib import Path import yaml import torch from torch.utils.tensorboard import SummaryWriter import dataset import algorithm from utils import mkdir_archived, dict2str, DistSampler, create_dataloader, CPUPrefetcher, init_dist, set_random_seed, \ CUDATimer, create_l...
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
# -*- coding: utf-8 -*- import numpy as np import pyn5 """ MIT License Copyright (c) 2017, <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 limitati...
from types import ModuleType from typing import Callable, Any, Optional, Coroutine, Type, Union, List, ClassVar try: import gcsfs except ImportError: gcsfs: ModuleType = None try: import s3fs except ImportError: s3fs: ModuleType = None from .base import rewrite_async_syntax, NormalAccessor, func_as_method_coro cla...
import os import concurrent import logging import json import time import aiohttp from aiohttp import web import aiohttp_jinja2 import cerberus import kubernetes as kube import prometheus_client as pc from prometheus_async.aio import time as prom_async_time from prometheus_async.aio.web import server_stats from hailt...
#!/usr/bin/env python """ Batch Normalization + SVRG on MNIST CPU Version Independent Study May 18, 2016 <NAME> """ from __future__ import print_function import sys import os import time import matplotlib import matplotlib.pyplot as plt import pylab import numpy as np import theano import theano.tensor as T impo...
import os import os import re import string import time import unicodedata import pandas as pd import rdflib import yaml from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError, MultipleObjectsReturned from django.db.models.fields import...
#!/usr/bin/env python # -*- coding: utf-8 -*- from pygame import * from game import * from cooperative_game import * font.init() from math import cos,radians try: import GetEvent except: from . import GetEvent from inputbox import * def menu( menu, # iterable of str as ("item",) or (...
from bpnet.plot.utils import strip_axis from concise.utils.plot import seqlogo from bpnet.plot.tracks import plot_track, plot_tracks import matplotlib.pyplot as plt from scipy.cluster.hierarchy import linkage, optimal_leaf_ordering, cut_tree, leaves_list from bpnet.stats import perc from bpnet.plot.vdom import df2html,...
#!/usr/bin/env python2 # vim: set tabstop=4 shiftwidth=4 textwidth=79 cc=72,79: """ check_shadow_edges: Open an image and a ground truth. Detect the shadow/object edges in the ground truth. Find the contours of those edges. Generate normals of those edges, sample data across those edges in the original ...
import ast import sys import six import pudb import time import inspect import os import cgi import re import traceback from threesdk.core import core from threesdk import __all__ as sdkall from threesdk import _get_doc_line, _get_doc from prompt_toolkit.application import get_app from prompt_toolkit.keys import Keys ...
# 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...