text
stringlengths
6.04k
39.5k
"""Primitive data structures that constitute the foundation of the BLP model.""" import abc from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union import numpy as np import patsy from . import options from .configurations.formulation import ColumnFormulation, Formulation from .configurations.i...
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2013-2015 First Flamingo Enterprise B.V. # # 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...
import dataclasses import enum import functools import inspect import threading import typing as tp from abc import ABCMeta from contextlib import contextmanager from copy import copy as python_copy from dataclasses import dataclass from types import MappingProxyType import jax import jax.tree_util from treeo import ...
""" 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 tensorflow as tf import numpy as np import matplotlib.pyplot as plt import os import cv2 import random import json import tensorflow as tf from AE import CAE, hparametersDef import argparse from sklearn.model_selection import train_test_split defMus = {"alpha0": 4.0, "alphaTau": 4.0, "lam": 6, "betaMom": 1, "...
#!/usr/bin/python # encoding: utf-8 from __future__ import unicode_literals import os import re import glob import json import uuid import yaml import urllib import logging import hashlib import datetime import requests from beaker.middleware import SessionMiddleware import bottle import bottle.ext.sqlite from bottl...
# Software License Agreement (BSD License) # # Copyright (c) 2018, Fraunhofer FKIE/CMS, <NAME> # 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 t...
import sys from contextlib import redirect_stdout import torch import torch.nn as nn import torch.nn.functional as F from torch.hub import load_state_dict_from_url from torch_fidelity.feature_extractor_base import FeatureExtractorBase from torch_fidelity.helpers import vassert from torch_fidelity.interpolate_compat_t...
import os import shutil from uuid import uuid4 from flask import request, jsonify, flash from flask_restful import Resource,reqparse from flask_jwt_extended import create_access_token, create_refresh_token, jwt_required, jwt_refresh_token_required, get_jwt_identity, get_raw_jwt, get_jwt_claims from werkzeug.utils imp...
# Copyright (c) 2020, <NAME> # See LICENSE file for details: # <https://github.com/moble/quaternionic/blob/master/LICENSE> import numpy as np from numba import float64 import quaternionic from . import guvectorize @guvectorize([(float64[:, :], float64[:, :])], '(i,j)->(i,j)') def _unflip_gufunc(q_in, q_out): # pra...
# -*- coding: utf-8 -*- # @Time : 2018/11/22 12:33 # @Author : <NAME> # @Email : <EMAIL> import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models import collections import math def weights_init(m): # Initialize filters with Gaussian random weights if isinstance(m, nn...
import ee import json import logging import numpy as np import os from copy import deepcopy from hydroengine_service import config from hydroengine_service import error_handler EE_CREDENTIALS = ee.ServiceAccountCredentials( config.EE_ACCOUNT, config.EE_PRIVATE_KEY_FILE ) ee.Initialize(EE_CREDENTIALS) # visualiz...
"""Perform pretraining.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from absl import app from absl import flags import absl.logging as _logging import numpy as np import tensorflow.compat.v1 as tf import data_utils import input_func_build...
# Copyright(c) <NAME> 2009 <EMAIL> # http://vosolok2008.narod.ru # BSD license __version__ = '0.2' __versionTime__ = '2013-01-22' __author__ = '<NAME> <<EMAIL>>' __doc__ = ''' pybassmidi.py - is ctypes python module for BASSMIDI - extension to the BASS audio library, enabling the playing of MIDI files and real-time ev...
import numpy as np from omegaconf import DictConfig, OmegaConf import os import pandas as pd from pytorch_lightning.core.lightning import LightningModule from pytorch_lightning import LightningDataModule import time import torch from torch.utils.data import DataLoader from torchtyping import patch_typeguard from tqdm i...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <NAME>. 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 Lic...
""" **Othello** is a turn-based two-player strategy board game. The players take turns placing pieces--one player white and the other player black--on an 8x8 board in such a way that captures some of the opponent's pieces, with the goal of finishing the game with more pieces of their color on the board. Every move mu...
import discord import time import asyncio import random from discord.ext import commands from utils import get_youtube from utils import page from utils import confirm loop = asyncio.get_event_loop() class Music(commands.Cog): def __init__(self, bot): self.bot = bot self.queues = {} async de...
import json import time import os from typing import Optional, Union from utils import create_sub_dir, load_files, get_file_logger, save_file from utils.rest import (get_blocks, get_all_validators, get_balance, get_profile, ...
############################################################################ ## ## Copyright (C) 2006-2010 University of Utah. All rights reserved. ## ## This file is part of VisTrails. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundat...
import random import pickle import copy import itertools import math import multiprocessing as mp def sigmoid(x): """Return the S-Curve activation of x.""" return 1/(1+math.exp(-x)) def tanh(x): """Wrapper function for hyperbolic tangent activation.""" return math.tanh(x) def LReLU(x): """Leaky R...
import math from tqdm import tqdm import numpy as np import skfmm import msfm from scipy.interpolate import RegularGridInterpolator from scipy.ndimage.morphology import binary_dilation from skimage.morphology import skeletonize_3d from .soma import Soma from .swc import SWC class Tracer(object): def __init__(sel...
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import copy import pickle from abc import abstractmethod from builtins import object, str...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Impute unknown variations given an input vcf file. """ from __future__ import print_function import os.path as op import logging import sys from jcvi.utils.cbook import percentage from jcvi.apps.grid import MakeManager from jcvi.formats.base import must_open from jcv...
# -*- coding: utf-8 -*- # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # Copyright (C) 2014-2017 <NAME> <<EMAIL>> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public...
# Copyright (c) 2013, jyoti and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt, getdate, comma_and from collections import defaultdict from datetime import datetime import time import math ...
import flask from flask import render_template from flask import request from flask import url_for import uuid import json import logging # Date handling import arrow # Replacement for datetime, based on moment.js # import datetime # But we still need time from dateutil import tz,parser # For interpreting local tim...
try: import matplotlib import mplfinance as mpf from mplfinance._arg_validators import _get_valid_plot_types # noqa matplotlib.use('Qt5Agg') except ImportError: raise import pandas as pd from PySide2.QtCore import Slot, Qt, QEvent from PySide2.QtWidgets import ( QMainWindow, QWidget, QGridLa...
#JG #simple program to handle opening of my favorite websites # #[TODO]--expand idea #new,open, ''' The program maintains a set of bookmarks as pairs of (name, (URL, site_description)) strings and has facilities for the user to add, edit, and remove bookmarks, and to open their web browser at a particular bookmarked...
import os.path import json import os from collections import OrderedDict import numpy as np from PyQt5 import QtGui, QtCore, uic, QtWidgets from lib.fps.fps import subav, simulate_traj, RDAMeanE, RDAMean, dRmp, density2points, spherePoints, asa from lib.io import PDB from lib.structure import Structure import LabelLib...
import argparse import os import torch import time import copy from plnn.proxlp_solver.solver import SaddleLP from plnn.explp_solver.solver import ExpLP from plnn.network_linear_approximation import LinearizedNetwork from plnn.anderson_linear_approximation import AndersonLinearizedNetwork from plnn.model import cifar_m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vi: set ft=python : """ Telit QMI connection test script with libqmi version 0.1 pyqmi --path </path/to/cdc-wdm> --iface wwan0 [other options] e.g. pyqmi --path /dev/cdc-wdm0 --iface wwan0 --apn testapn --type 4 # IPv4 single connectio...
# ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: 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, ...
# # Copyright 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
#MIT License # #Copyright (c) 2019 <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, copy, modify, merge, publish, di...
import faiss import math import numpy as np from tqdm import tqdm from einops import rearrange, repeat from functools import partial import torch from torch.utils.data import Dataset, DataLoader from torch import nn, einsum import torch.nn.functional as F from marge_pytorch.autoregressive_wrapper import Autoregressi...
#!/usr/bin/python # searchspace.py # # Supply an instruction stream for the broker by combining all the # individual instruction files and filtering according the the # user's request. # Eliminate possibly redundant instructions. # Check to see that the user's restrictions were not too strong. # # The dictionar...
#! python3.6 """ Creates an artificial neural network by initializing layers using parameters from `NNGenome`. Built on top of pytorch, providing a convenient abstraction. Author: <NAME>, 2017 """ import os import math import pickle import random import numpy as np import torch, torch.optim import torch.autograd from...
# -*- coding: utf-8 -*- # Copyright 2020 <NAME> (@dathudeptrai) # # 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...
# Lint as: python3 """Copy from tensor2tensor.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import multiprocessing from absl import flags import tensorflow as tf FLAGS = flags.FLAGS def pack_dataset(dataset, length, keys=None, use_...
#!/usr/bin/env python import os import subprocess import re import logging __all__ = ['NanoCA'] __version__ = '0.8' __author = '<NAME> <<EMAIL>>' openssl_cnf_template = """ RANDFILE = $ENV::ROOT/private/.rnd [ ca ] default_ca = CA_default [ CA_default ] dir = $ENV::ROOT certs = $...
import tensorflow as tf import numpy as np import pandas as pd import pickle from sklearn.metrics import roc_curve, auc, f1_score, roc_auc_score, jaccard_score from matplotlib import pyplot as plt import sys sys.argv = [''] sys.path.insert(1,'/home/mmesarcik/NLN/') from inference import infer, get_error from data i...
import torch import pickle import random from tqdm import tqdm from search.rm_search.params import * from search.rm_search.utils.model_utils import device from search.rm_search.ofa_profile.constants import * from search.rm_search.ofa_profile.arch_utils import * def sample_ofa_pn_configs(stage_n_blocks=OFA_PN_STAGE_N_...
from ._ffi.function import register_func import os, subprocess, time, re, glob from ..report import parse_xml from ..devices import Project debug = True def replace_text(f_name, prev, new): with open(f_name, 'r') as fp: data = fp.read() data = data.replace(prev, new) with open(f_name, 'w') as fp: ...
""" This module contains items that are "missing" from the Python standard library, that do miscelleneous things. """ import re import copy import inspect import weakref import functools import six from six.moves import range __all__ = [ 'get_name', 'classproperty', 'singleton', 'hash...
import unittest import functools import numpy from operator import mul import chainer from chainer.backends import cuda import chainer.functions as F from chainer import testing from chainer.testing import attr from chainer.testing import parameterize from chainer.utils import conv from chainer.utils import type_chec...
#!/usr/bin/env python # coding: utf-8 # In[1]: import os import copy import matplotlib.pyplot as plt import matplotlib.font_manager as fm from math import ceil from openpyxl import load_workbook from MyPythonDocx import * # In[2]: def prevent_document_break(document): tags = document.element.xpath('//w:tr/w...
from __future__ import print_function import numpy as np from pixell import enmap,utils """ Utilities that manipulate pixel-pixel covariance matrices for small geometries. Applications include: 1. fast brute force inpainting of circular holes 2. maximum-likelihood CMB halo lensing """ ### ENMAP HELPER FUNCTIONS AND...
from numbers import Number from .tags import IfTagContainer from .tags import ElifTag from .tags import ElseTag from .tags import CaseTag from .tags import OptionTag from .tags import LoopTag from .tags import NamespaceTag from .tags.NullTag import NullTag from .tags import SaveEvalTag from .tags import Sav...
import cv2 import numpy as np import os import csv KEY_UP = [0,91] KEY_DOWN = [1,93] KEY_RETURN = [13] KEY_ESCAPE = [27] KEY_BACKSPACE = [8,127] MODE_VIEW = 0 MODE_ENTRY = 1 CV_FONT_WIDTH = 10 INT_STRING = "01234567890-" FLOAT_STRING = "01234567890.-" STR_STRING = "".join([chr(i) for i in range(33,127)]) THEME_DEF...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import sep import numpy as np from astropy.modeling.fitting import LevMarLSQFitter from astropy.stats import gaussian_fwhm_to_sigma from astropy.table import Table from scipy.optimize import curve_fit from scipy.ndimage.filters import convolve from ._ut...
from copy import deepcopy import logging import numpy as np import os.path as osp import strax from strax import exporter import straxen NT_AUX_INSTALLED = False STRAX_AUX_INSTALLED = False try: import ntauxfiles NT_AUX_INSTALLED = True except (ModuleNotFoundError, ImportError): pass try: import stra...
import os import sys import warnings import pickle from IPython.core.display import display import numpy as np import pandas as pd from generator_labeler.ActiveModel import RandomForestQuantileRegressor from generator_labeler.FeatureExtraction import PredictorFeatureExtraction as PFE from generator_labeler.Analysis.mo...
from pathlib import Path import numpy as np from pydicom import dcmread import cv2 import os from pandas import read_csv def dir_dicom_paths(directory): """Return list of paths to files within a directory at any level below, beginning with 'I'. This is the naming convention expected for the project. Args...
# Round lcd driver GC9A01 (240x240). Driver derived from Waveshare team which which is originally licensed : see below # Minor changes to work on micropython # ******************************************************************************************************** # /***************************************************...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import os import torch from PIL import Image, ImageFile from torchvision import transforms import torchvision.datasets.folder from torch.utils.data import TensorDataset, Subset, ConcatDataset from torchvision.datasets import MNIST, ImageFolder from...
# Realtor Estate 0.1 (tk) # A web scraper for gathering data relevant to real estate professionals. # Little note on the imports here... You may need to install tkinter for your OS. # On Ubuntu you can run apt to install the package python3-tk and you're all set. # region Imports import time import requests import p...
from tkinter import * #from PIL import Image, ImageTk from tkinter.ttk import Progressbar import random,time from playsound import playsound import webbrowser import speech_recognition as sr import pyttsx3 import datetime import os #--------------UI-----------------# root = Tk() root.title("Shrek chat box") root.re...
import pandas as pd from geopy import distance import os def assign_bus_to_lat_lon(lat, lon, cords): # assign the generator to the nearest bus temp_cords = cords.copy() for key in temp_cords.keys(): temp_cords[key] = distance.distance(temp_cords[key], (lat, lon)).km return min(temp_cords, key=t...
############################################################################### # # This file manages all tag related classes and encapsulates much of the # functionality that the rest of this evaluation script works off of. # It is based on a class hierarchy and most of the tag specific information # is ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Management of dockers ===================== .. note:: This state module is beta; the API is subject to change and no promise as to performance or functionality is yet present Available Functions ------------------- - built .. code-block:: yaml corp...
#!/usr/bin/env python3 # ============================================================== # <NAME> # # genome_anno.py: Handles the data structure for a genome annotation file # ============================================================== import os import sys import csv class NotGtfFormat(Exception): pass class T...
from delta.tables import DeltaTable from notebookutils import mssparkutils from pyspark.sql.types import StructType, StructField, StringType, IntegerType, DoubleType, ArrayType, TimestampType, BooleanType, ShortType from pyspark.sql import functions as F from pyspark.sql.utils import AnalysisException import log...
import collections import logging import os import resource import h5py import keras import numpy as np import tensorflow as tf import tqdm from keras.callbacks import ReduceLROnPlateau, TensorBoard from keras.optimizers import TFOptimizer from citeomatic import file_util from citeomatic.candidate_selectors import Ca...
import os from flask import Flask, render_template, redirect, flash from flask import url_for, request, session from flask_pymongo import PyMongo from werkzeug.security import generate_password_hash, check_password_hash from bson.objectid import ObjectId from datetime import date from os import path # import file whe...
""" The different agnocomplete classes to be discovered """ from copy import copy from six import with_metaclass from abc import abstractmethod, ABCMeta import logging from django.db.models import Q from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import force_text as text from django...
from django.db import models from django.db.models import Q from django.urls import reverse from django.utils.safestring import mark_safe from django_extensions.db.models import TimeStampedModel def capitalize_phrase(string): phrase = "" for word in string.split(): phrase = f"{phrase} {word[0].upper()...
import torch from torch import nn import math from .loss import make_gau_loss_evaluator from .inference import make_gau_postprocessor class GauHead(torch.nn.Module): def __init__(self, cfg, in_channels): super(GauHead, self).__init__() num_classes = cfg.MODEL.GAU.NUM_CLASSES - 1 # cls_tow...
# -*- coding: utf-8 -*- # pylint: disable=too-many-instance-attributes # pylint: disable=too-many-arguments # pylint: disable=too-many-locals """ Agent that implements the Deep Deterministic Policy Gradient algorithm. """ import collections import errno import os import pickle # Scipy import numpy as np # Torch im...
import glob import os import logging import time import requests from random import randint from tqdm import tqdm from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.firefox.options import Options from selenium.webdriver.support.wait import WebDriverWait from selenium.web...
#!/usr/bin/env python ############################################################################### # - FILE: prob_to_bitmap # - DESC: Takes in tsv of dp matrix and creates a bitmap. ############################################################################### import sys import numpy as np import cv2 as cv from...
from plugins.mgba_bridge.script_disassembler.utils import barray_to_u16_hex, barray_to_u32_hex, barray_to_s16 import struct ROM_OFFSET = 0x08000000 SCRIPTS_START = 0x08008B5C SCRIPTS_END = 0x08016984 # A list of all the commands, their correspondingScriptCommand_ functions and what kind of parameters they take comma...
#!/usr/bin/env python # encoding: utf-8 """ crawler.py Created by <NAME> on 2011-11-24. Copyright (c) 2011 __MyCompanyName__. All rights reserved. """ import requests from requests import Response, RequestException import random import re import copy import time try : import json except ImportError: imp...
import math import torch import torch.nn as nn import torch.nn.functional as F """ modified to fit dataset size """ class ResNeXtBottleneck(nn.Module): """ RexNeXt bottleneck type C (https://github.com/facebookresearch/ResNeXt/blob/master/models/resnext.lua) """ def __init__(self, in_channels, out...
#! -*- coding: utf-8 -*- """ Implementation of Bert """ # Author: DengBoCong <<EMAIL>> # https://arxiv.org/pdf/1706.03762.pdf # # License: MIT License from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import torch import torch.nn as nn from sim.b...
# sbmlutil.py - libsbml helper functions # RMM, 14 Aug 2018 # # Copyright (c) 2018, Build-A-Cell. All rights reserved. # See LICENSE file in the project root directory for details. import logging from random import randint from typing import List from warnings import warn import libsbml # Reaction ID number (global)...
import sys import numpy as np from common import config, sender_obs from simulator.network_simulator.constants import BYTES_PER_PACKET from simulator.network_simulator.monitor_interval import MonitorInterval MIN_PKTS_PER_MI = 5 MAX_RATE = 4000 MIN_RATE = 40 class Sender(): _next_id = 1 def __init__(self, ...
# pylint: disable = redefined-outer-name import os import re from datetime import datetime from enum import Enum, auto import colorsys import pytest from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.firefox.webelement import FirefoxWebElement from universum...
# -*- coding: utf-8 -*- # Copyright (C) 2021 The Linux Foundation # # 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 glob import yaml import argparse import sys import re from os import path, walk, remove import json from jinja2 import Environment, FileSystemLoader import datetime from stix2 import FileSystemSource from stix2 import Filter from pycvesearch import CVESearch CVESSEARCH_API_URL = 'https://cve.circl.lu' def loa...
# ------------------------------------------------------------------------------ # ui.py - CLI commands module # # November 2015, <NAME> # ------------------------------------------------------------------------------ import cmd, sys, io, pydoc from . import database, query class _BaseCmd(cmd.Cmd): """Base clas...
# coding: utf-8 # # Edge and Corner Detector # CS 4501 [Project 1](http://www.cs.virginia.edu/~connelly/class/2017/intro_vision/proj1/) # # By <NAME> (jw7jb) # In[1]: import numpy # Import libraries import numpy, skimage, skimage.io, scipy, math, sys from scipy import ndimage from skimage import feature import nump...
from six import string_types from . import ast from .error import LanguageError from .lexer import Lexer, TokenKind, get_token_desc, get_token_kind_desc from .source import Source __all__ = ['parse'] def parse(source, **kwargs): """Given a GraphQL source, parses it into a Document.""" options = {'no_location...
import re import os import sys import json import argparse from subprocess import Popen, PIPE from distutils.version import LooseVersion import yaml import requests from Tests.scripts.constants import CHECKED_TYPES_REGEXES, PACKAGE_SUPPORTING_DIRECTORIES, CONTENT_GITHUB_LINK, \ PACKAGE_YML_FILE_REGEX, UNRELEASE_HEA...
from test_pytorch_common import TestCase, run_tests, skipIfNoLapack, flatten import test_onnx_common import torch import torch.onnx from torch.autograd import Variable, Function from torch.nn import Module import torch.nn as nn import onnx import onnx.checker import onnx.helper import google.protobuf.text_format im...
#!/usr/bin/python3 from tkinter import * from tkinter.messagebox import * fenetre = Tk() fenetre.title("The Enigma Machine") fenetre.configure(background='white') fenetre.geometry("550x800") class AutoScrollbar(Scrollbar): #create a 'responsive' scrollbar def set(self, lo, hi): if float(lo) <= 0.0 and ...
# coding=utf-8 # Copyright (c) Microsoft. All rights reserved. # This script reuses some code from https://github.com/huggingface/transformers """ Model configuration """ from __future__ import absolute_import, division, print_function, unicode_literals import copy import json import logging import os from typing ...
"""A collection of native images. """ import errno import glob import logging import os import pwd import shutil import stat import treadmill from treadmill import appcfg from treadmill import cgroups from treadmill import fs from treadmill import runtime from treadmill import subproc from treadmill import superviso...
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from math import ceil import time import visdom import numpy as np import argparse from data.dataset_benchmark import BenchmarkDataset from datasets import ShapeNet_v0 # from model.gan_network import Generator, Discrimina...
import datetime import io import os import subprocess import uuid import zipfile import magic import six from constance import config as site_config from django.core.cache import cache from django.db.models import Count, Prefetch, Q from django.http import HttpResponse, HttpResponseForbidden, StreamingHttpResponse fro...
import json from botocore.exceptions import ClientError from cloud_inquisitor import get_aws_session, AWS_REGIONS from cloud_inquisitor.config import dbconfig, ConfigOption from cloud_inquisitor.constants import NS_AUDITOR_CLOUDTRAIL from cloud_inquisitor.log import auditlog from cloud_inquisitor.plugins import BaseAu...
import datetime import logging import os import pathlib import time from typing import ( IO, ChainMap, List, Callable, Dict, Optional, Set, Text, Union, ) import collections from liara.template import TemplateRepository from . import config...
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ module: iosxr_config author: <NAME> (@rcarrillocruz) short_descripti...
from PyQt5 import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import math import paintool from paintool import deg storoni = [ "слева", "справа", "сверху", "снизу", "слева сверху", "справа сверху", "слева снизу", "справа снизу", ] men_arr = ["нет", "слева +", "слева -", ...
import scipy import torch import imageio import logging from pathlib import Path import sys import matplotlib.pyplot as plt import numpy as np import random import os import torch.nn as nn from tqdm import tqdm logging.basicConfig( level=logging.INFO, format="%(asctime)s | %(pathname)s:%(lineno)d | %(levelname...
import time from collections import OrderedDict import torch import warnings if torch.__version__ >= '1.6.0': from torch.cuda.amp import autocast, GradScaler else: from .torch_amp_dummy import autocast, GradScaler from tqdm import tqdm from torchvision_models.segmentation import deeplabv2_resnet101, deeplabv3_r...
from collections import OrderedDict from random import sample from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import ObjectDoesNotExist from django.shortcuts import redirect, render from django.urls import resolve, reverse from django.utils import ...
import torch import torch.nn as nn import torch.nn.functional as F from math import sqrt as sqrt from itertools import product as product from dl.models.ssd.modules.boxes import DBoxSSDOriginal from dl.models.ssd.modules.boxes import SSDCodec import os class PriorBox(object): """Compute defaultBox coordinates i...
import boto3 from botocore.exceptions import ClientError import logging.config from perfsize.perfsize import Config, EnvironmentManager from perfsizesagemaker.constants import Parameter from perfsizesagemaker.credentials import CredentialsManager from typing import Optional import yaml log = logging.getLogger(__name__...
import sys import os import ipdb from tqdm import tqdm import math import time import glob import datetime import random import pickle import json import numpy as np from collections import OrderedDict from argparse import ArgumentParser import torch import torch.nn as nn import torch.nn.functional as F import torch.o...