text
stringlengths
6.04k
39.5k
import optparse import datetime import os import sys import signal import subprocess from pprint import pprint import socket import time import json import re import urllib.request, urllib.parse, urllib.error import copy import yaml from termcolor import colored from openpyxl.workbook import Workbook from openpyxl.ut...
from cmd import Cmd from modules.utils import * from modules.dict_editor import DictEditor def check_nb_args(cmd, maxi=None, mini=1): """Check if the number of arguments from a list. :param list cmd: the list of arguments to check. :param int maxi: the maximum number of arguments, can be None if there is...
# Test binary and formatted data readers import os import numpy as np import pytest from ci_framework import FlopyTestSetup, base_test_dir import flopy base_dir = base_test_dir(__file__, rel_path="temp", verbose=True) def test_formattedfile_read(): model_ws = f"{base_dir}_test_formattedfile_read" test_setu...
import torch import torchani import time import timeit import argparse import pkbar import gc import pynvml import os import pickle from torchani.units import hartree2kcalmol summary = '' runcounter = 0 def build_network(): H_network = torch.nn.Sequential( torch.nn.Linear(384, 160), torch.nn.CELU...
""" This file is used to compute the expected number of fields with invariants (q, d) over 2. Data comes from the datbase of local fields (LMDFB.org) and <NAME> and <NAME> database of local fields (https://math.la.asu.edu/~jj/localfields/). @author <NAME> """ import csv import sys import textwrap from collections imp...
# -*- coding: utf-8 -*- # This file is used to train models and save the model into model database. import os import pickle import sys import argparse import numpy as np import xgboost as xgb import sklearn as sl from sklearn.linear_model import Lasso from .params import get_defparams from tqdm import tqdm #add exam...
# Copyright 2020 The StackStorm Authors. # Copyright 2019 Extreme Networks, 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import hashlib from inspect import signature import json import ctypes # from PyQt5 import uic from PyQt5.QtWidgets import (QApplication, QMainWindow, QDialog, QFileDialog, QAction) from PyQt5.QtGui import QKeySequence fro...
""" Operator classes for eval. """ from __future__ import annotations from datetime import datetime from functools import partial import operator from typing import ( Callable, Iterable, ) import numpy as np from pandas._libs.tslibs import Timestamp from pandas.core.dtypes.common import ( is_list_like,...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
import logging from angr import SIM_PROCEDURES, options from archinfo.arch_soot import (ArchSoot, SootAddressDescriptor, SootAddressTerminator, SootArgument, SootNullConstant) from claripy import BVS, BVV, StringS, StringV, FSORT_FLOAT, FSORT_DOUBLE, FPV,...
# -*- coding: utf-8 -*- """Page and page Component classes The keteparaha Page and Component classes represent web pages and components of web pages. Pages are identified by the URL of the browser, and components by the CSS selector that is used to retrieve them. If you perform an action that causes the browser to v...
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # ------------------------------------ import torch from torch import nn from torch.utils.data import ConcatDataset from collections import OrderedDict from vihds.distributions import ChainedDistribution # p...
"""``PartitionedDataSet`` loads and saves partitioned file-like data using the underlying dataset definition. It also uses `fsspec` for filesystem level operations. """ import operator from copy import deepcopy from typing import Any, Callable, Dict, List, Type, Union from urllib.parse import urlparse from warnings imp...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#!/usr/bin/python3 ############################################################ # Class DStarLiteView # The class DStarLiteView implements an interactive view # for the vertexGrid of the D*Lite algorithm. It implements # the interactive design of the terrain with start-, goalnode # and obstacles and the pathplann...
""" Provides a controller for controlling the default media players on the Chromecast. """ import abc from datetime import datetime import logging from collections import namedtuple import threading from ..config import APP_MEDIA_RECEIVER from ..const import MESSAGE_TYPE from . import BaseController STREAM_TYPE_UNKN...
import torch from torch import nn from torch.nn import Parameter import torch.nn.functional as F class MultiheadAttention(nn.Module): """ MultiheadAttention module I learned a lot from https://github.com/pytorch/fairseq/blob/master/fairseq/modules/multihead_attention.py """ def __init__(self, args...
import distutils import os import shutil import sys from distutils.core import Extension from distutils.dist import Distribution from distutils.sysconfig import customize_compiler from os.path import abspath, dirname, exists, join, getmtime from random import choice from shutil import move from string import ascii_lowe...
# Copyright (c) 2018, Xilinx, Inc. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # # ================================================================= """ This script validates pretrained (FP32) and Graffitist quantized networks on ImageNet (ILSVRC2012) validation set (50k images). Appropriate preproc...
import numpy as np import pandas as pd from ixmp import IAMC_IDX from message_ix import Scenario from message_ix.utils import make_df models = { 'dantzig': { 'model': 'Canning problem (MESSAGE scheme)', 'scenario': 'standard', }, 'westeros': { 'model': 'Westeros Electrified', ...
import nbformat import os import re import shutil # Paths are set to work by invoking this scrip from the notebooks repo, presuming the transformers repo is in the # same parent folder as the notebooks repo. PATH_TO_DOCS = '../transformers/docs/source' PATH_TO_DEST = 'transformers_doc' DOC_BASE_URL = "https://huggingf...
# Copyright 2017 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 logging import os import shlex import pytest from piptools.scripts.compile import cli as compile_cli from piptools.utils import ( as_tuple, dedup, flat_map, format_requirement, format_specifier, get_compile_command, get_hashes_from_ireq, is_pinned_requirement, is_url_require...
# Copyright 2018 Iguazio # # 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...
import abc from collections import OrderedDict from functools import partial from time import time import cgen from devito.dle.blocking_utils import Blocker, BlockDimension from devito.dle.parallelizer import Ompizer, OmpizerGPU from devito.exceptions import DLEException from devito.ir.iet import (Call, Iteration, Li...
# -*- coding: utf-8 -*- """Markov Decision Process (MDP) Toolbox: ``example`` module ========================================================= The ``example`` module provides functions to generate valid MDP transition and reward matrices. Available functions ------------------- :func:`~mdptoolbox.example.forest` ...
#!/usr/bin/env python from peyotl.nexson_validation.helper import _NEXEL, errorReturn from peyotl.nexson_validation.err_generator import (gen_InvalidKeyWarning, gen_MissingCrucialContentWarning, gen_MissingMandatoryK...
"""Chain replication and command interface logic. """ import json import logging import socket import traceback from collections import defaultdict from collections import namedtuple from functools import partial from multiprocessing.dummy import Pool import swailing import chorus # Command represents the call fo...
#!/usr/bin/env python # # This file is in the Public Domain. # SirNickolas, 2015-2017 # from __future__ import print_function import argparse import itertools import os import re import shlex import signal import subprocess import sys import tempfile COMPILER = R"g++" COMMON_OPTIONS = r""" -Wall -Wextra -peda...
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 <NAME> # Copyright (c) 2008-2021 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following c...
# stdlib import sys from typing import Any from typing import Dict from typing import Iterator from typing import List from typing import Optional from typing import Tuple from typing import Union # third party from google.protobuf.reflection import GeneratedProtocolMessageType from nacl.signing import SigningKey from...
from collections import defaultdict import logging import dash_html_components as html from dash.dependencies import Input, Output, State from ..dash_id import init_ids from ..utility.plot_builder import * from ..utility.table_builder import table_tabs_call_ready, cutoff_table_data_merged from ..utility import df_man...
""" CartesianProductGP implementation working on molecular domains. Kernels are in mols/mol_kernels.py TODO: * think on how to set alpha and beta optim boundaries in _set_up_hyperparams_for_domain() * [OLD] check values in get_molecular_kernel """ # general imports import numpy as np import logging # imports from dr...
import pandas as pd import networkx as nx import numpy as np from scipy.spatial.distance import cosine import numpy as np from copy import deepcopy from tqdm import tqdm from sklearn.neighbors import NearestNeighbors import random import pickle5 as pickle import time import scipy.sparse import matplotlib.pyplot as plt ...
import logging import operator from datetime import datetime, timezone from pathlib import Path from typing import Dict, List, Optional, Tuple import arrow from pandas import DataFrame from freqtrade.configuration import TimeRange from freqtrade.constants import DEFAULT_DATAFRAME_COLUMNS from freqtrade.data.converter...
# -*- coding: utf-8 -*- """ Budgetting module NB Depends on Project Tracking module @ToDo: Rewrite to use Inventory for Items @ToDo: Rewrite to use HRM for Staff @ToDo: Rewrite to remove the dependency on Geraldo - Items easy - Kits harder """ # NB Requires 'project' module...
# Various polar tests. More integration less unit. Could move this into the module # later if we wish to. # Main things to test. # - Direct tests of polar code. # - Property tests for polar parser. # - Property tests for polar semantics. # - External functions / python binding tests of some kind, maybe. from pathlib im...
#!/usr/bin/python3 """ Periodically grab list of new articles and analyze to blank or flag them. Script to follow new articles on the wiki and flag them with a template or eventually blank them. There must be A LOT of bugs! Use with caution and verify what it is doing! The following parameters are supported: &param...
import gym import time import torch import warnings import numpy as np from copy import deepcopy from numbers import Number from typing import Dict, List, Union, Optional, Callable from tianshou.policy import BasePolicy from tianshou.exploration import BaseNoise from tianshou.data.batch import _create_value from tians...
from functools import lru_cache from typing import ( TYPE_CHECKING, ClassVar, Generic, Iterable, List, Literal, Protocol, Sequence, Type, TypeVar, Union, abstractmethod, get_args, runtime_checkable, ) from fastapi import HTTPException, status from pydantic import...
""" 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 """ # Test case ID : C4976201 # Test Case Title : Verify that the value assigned to the Mass of the object, gets a...
from __future__ import division # For Python 2 import os import fnmatch import json import csv import argparse import math import shelve import numpy as np import pandas as pd import dc_gym.utils as dc_utils # configure logging import logging log = logging.getLogger(__name__) PLOT_DIR = os.path.dirname(os.path.abspa...
"""Utility classes and functions for the apps.""" import logging import os from struct import pack from pydicom import dcmread from pydicom.datadict import tag_for_keyword, repeater_has_keyword, get_entry from pydicom.dataset import Dataset from pydicom.filewriter import write_file_meta_info from pydicom.tag import T...
""" Module for accessor objects for viewable HoloViews objects. """ from __future__ import absolute_import, unicode_literals from collections import OrderedDict from types import FunctionType import copy import param from param.parameterized import add_metaclass from . import util from .pprint import PrettyPrinter ...
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
from django.conf import settings from django.utils.safestring import mark_safe from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_lazy, ugettext_noop from couchdbkit.exceptions import ResourceNotFound from memoized import memoized from couchforms.analytics import ( ge...
from attr import has from nipype.interfaces import fsl from nipype.interfaces.base import traits_extension from pydra.engine import specs from pydra.engine.helpers import ensure_list import os, sys, yaml, black, imp import traits from pathlib import Path import typing as ty import inspect import click import warnings ...
""" Example script to train an affine VoxelMorph model. For the CVPR and MICCAI papers, we have data arranged in train, validate, and test folders. Inside each folder are normalized T1 volumes and segmentations in npz (numpy) format. You will have to customize this script slightly to accommodate your own data. All ima...
# !/usr/bin/python # -*- coding: utf-8 -*- # @time : 2020/4/26 22:00 # @author : Mo # @function: layers of keras from __future__ import print_function, division from macadam import keras, K, L, M, O __all__ = ["AttentionWeightedAverage", "dynamic_k_max_pooling", "wide_convolution", ...
""" Copyright 2019 <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, software distribut...
from collections import Counter import json import os from typing import Dict, List, Tuple, Union import numpy as np import openml import pandas as pd import scipy from scipy.stats import wilcoxon, rankdata from sklearn.impute import SimpleImputer from sklearn.model_selection import train_test_split from sklearn.prepr...
"""Training code for `solaris` models.""" import numpy as np import pandas as pd from .model_io import get_model, reset_weights from .datagen import make_data_generator from .losses import get_loss from .optimizers import get_optimizer from .callbacks import get_callbacks from .torch_callbacks import TorchEarlyStoppin...
# -*- coding: utf_8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import cv2 import argparse import pickle import nsml import numpy as np from nsml import DATASET_PATH import keras from keras.models import Sequential from keras.layers impo...
""" This file is intended for running prediction on a single image. This is useful in an on-line case, where we don't want the overhead of writing predictions to file, then reading them, and displaying them. """ import avod.builders.config_builder_util as config_builder from avod.builders.dataset_builder import Dataset...
from __future__ import division from __future__ import print_function from __future__ import absolute_import import io import os import cv2 import glob import pandas as pd import numpy as np import tensorflow as tf import xml.etree.ElementTree as ET from enum import Enum from random import shuffle from PIL import Imag...
#FrITA - Free Interactive Text Aligner # Copyright (C) 2013 <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 Licen...
#!/usr/bin/env python3 ''' This script takes an input AV object and outputs an access copy. It is relatively tailored to use within BAMPFA's EDITH app, but mostly in terms of the output folder structure (it expects you to want a folder called 'resourcespace'). The transcoding options are set in dicts in `pymmconfig`...
# -*- coding: utf-8 -*- """ Create graph splits exposing tbox proxies. """ from irt.graph import graph from irt.common import helper import yaml import random import pathlib import textwrap import logging import dataclasses from datetime import datetime from functools import lru_cache from dataclasses import data...
# MIT License # # (C) Copyright [2022] Hewlett Packard Enterprise Development LP # # 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 righ...
""" JSON API Python client https://github.com/qvantel/jsonapi-client (see JSON API specification in http://jsonapi.org/) Copyright (c) 2017, Qvantel All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: ...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import os import os.path import concurrent.futures import re from datetime import datetime, timedelta, timezone import tempfile from typing import List import json import yaml from flask import Flask, jsonify import requests from requests.auth import HTTPBasicAuth from requests.exceptions import HTTPError from reque...
from __future__ import print_function import importlib as IM import logging import rdflib as R import yarom from itertools import count from .rdfTypeResolver import RDFTypeResolver from six import with_metaclass from .mapperUtils import parents_str from .utils import FCN from pprint import pformat __all__ = ["Mapper"...
# -*- coding: utf-8 -*- from renormalizer.mps.matrix import tensordot, multi_tensor_contract, asnumpy, asxp from renormalizer.mps.backend import xp, USE_GPU from renormalizer.mps import Mps, Mpo, MpDm from renormalizer.mps.lib import Environ, compressed_sum from renormalizer.lib import davidson import numpy as np imp...
from evennia import utils from evennia.utils import search from evennia.utils.spawner import spawn import time def clothing_list(caller): text = \ """ Welcome! Take a |wlook|n around to see which suits of armor are for sale today. Unfortunately, supplies and artisans are scarce...
#!/usr/bin/env python """ Tests for `text` module. """ import unittest import yaml import six if six.PY2: b = bytes = ensure_string = str else: def ensure_string(s): if isinstance(s, str): return s elif isinstance(s, bytes): return s.decode('utf-8') ...
"""User-facing functions.""" import html import textwrap from typing import Union import dask import dask.array import xarray import zarr from xarray.backends.zarr import ( DIMENSION_KEY, encode_zarr_attr_value, encode_zarr_variable, extract_zarr_variable_encoding, ) from xarray.conventions import enco...
#!/usr/bin/env python3 import argparse import xml.etree.ElementTree as ET import os import sys class Pedigree: def __init__(self, added, addedEP, updated, updatedEP, deprecated, deprecatedEP): self.added = added self.addedEP = addedEP self.updated = updated self.updatedEP = updat...
import tkinter as tk from tkinter import ttk import math import time import random # Yes, I know pygame can do a better job at this than tkinter. def draw_oval(canvas, center, radius, color): """ Draw a filled circle centered at (x, y).""" canvas.create_oval( \ center.x - radius, center.y -...
# Copyright 2021 University of Chicago # # 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...
import argparse import math import os import shutil import sys import tempfile from io import StringIO from textwrap import TextWrapper from typing import ( Any, List, NamedTuple, ) import yaml from boltons.iterutils import remap try: from gravity.util import settings_to_sample except ImportError: ...
"""Quality Assessment of In-the-Wild Videos, ACM MM 2019""" # # Author: <NAME> # Email: <EMAIL> AT pku DOT edu DOT cn # Date: 2019/11/8 # # tensorboard --logdir=logs --port=6006 # CUDA_VISIBLE_DEVICES=1 python VSFA.py --database=KoNViD-1k --exp_id=0 from argparse import ArgumentParser import os import h5py import torc...
# # Fastpath - YAML normalization func tests # from io import BytesIO from pathlib import Path import hashlib import logging import os import boto3 # debdeps: python3-boto3 import gzip import lz4.frame as lz4frame # debdeps: python3-lz4 import pytest import requests import tarfile import ujson import fastpath.norm...
"""Python process Django Models.""" import json import os from pathlib import Path from typing import Any, Dict, List, MutableMapping, Optional, Type from .communicator import communicator from .fields import ( BooleanField, DateTimeField, Field, IntegerField, JsonField, ListField, Relation...
# -*- coding: utf-8 -*- import sys if sys.version[0] == '2': reload(sys) sys.setdefaultencoding("utf-8") import os import re import time import json import redis import codecs import shutil import hashlib import tempfile import argparse import subprocess from collections import defaultdict from functools imp...
""" Test basic methods for Mojave 10.14.6 """ import datetime from collections import namedtuple import pytest from osxphotos._constants import _UNKNOWN_PERSON PHOTOS_DB = "./tests/Test-10.14.6.photoslibrary/database/photos.db" PHOTOS_DB_PATH = "/Test-10.14.6.photoslibrary/database/photos.db" PHOTOS_LIBRARY_PATH = ...
# ================================================= # = Exceptions and Handlers = # ================================================= from time import time from datetime import timedelta disabledModules = [] class TooManyRequestsException(Exception): def __init__(self, retryAfter): ...
# -*- coding: utf-8 -*- # Copyright (c) 2021 <NAME>. # All rights reserved. # Licensed under BSD-3-Clause-Clear. See LICENSE file for details. from django.conf import settings from django.http import HttpResponseRedirect, Http404 from django.urls import reverse from django.db.models import Count from django.views....
# -*- coding: utf-8 -*- # ================================================================= # # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Copyright (c) 2019 <NAME> # Copyright (c) 2015 <NAME> # Copyright (c) 2017 <NAME> # # Permission is hereby granted, free of charge, to an...
import pymysql from sqlalchemy import create_engine pymysql.install_as_MySQLdb() import MySQLdb class Create(): # db 서버 연결 def connect_sql(self, IP, DB, PW): engine = create_engine(f"mysql+mysqldb://root:{PW}@{IP}/{DB}") conn = engine.connect() mydb = pymysql.connect( user=...
#!/usr/bin/env python # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Uncomment to enable logging during tests # import logging # from logging.config import dictConfig import asyncio import contextlib import os import json import pathlib import re import shutil import tempfile from collections import namedtuple from functools import partial from uuid import uuid4 as uuid import pytes...
from .adt import ADT from .adt import memo as ADTmemo from .prelude import * from . import atl_types as T from fractions import Fraction from functools import lru_cache from collections import namedtuple import math from .frontend import AST # --------------------------------------------------------------------...
import os import sqlite3 from contextlib import contextmanager import datetime import inspect from pathlib import Path from _collections import defaultdict import shutil import logging import utils from configVar import config_vars from db.indexItemTable import IndexItemsTable from svnTree import SVNTable log = loggi...
import numpy as np import numpy.linalg as la import pdb class Map(): """map object Attributes: getGlobalPosition: convert position from (s, ey) to (X,Y) """ def __init__(self, halfWidth): """Initialization halfWidth: track halfWidth Modify the vector spec to change the g...
#!/usr/bin/python # -*- coding: utf-8 -*- # # ============================================================================= # Version: 2.2 (December 30, 2012) # Author: <NAME> (<EMAIL>), University of Pisa # <NAME> (<EMAIL>), University of Pisa # # Contributors: # <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # <NAME> (<EM...
########################################################################## # # Copyright (c) 2019, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
""" By <NAME> (DTAI lab KU Leuven, 2019) A script to evaluate a learned ProbLog model by calculating the regret compared to the correct model. Input Learned models to evaluate: ./data/results/{drop_prob}_0.5_{nb_of_examples}/{file}_result.pl The correct file is assumed to be in ./data/processed/{drop_prob}_0....
from .models import Socs, BlsOes, StateAbbPairs, OccupationTransitions, SocDescription from rest_framework import viewsets, permissions, generics from rest_framework.throttling import AnonRateThrottle from rest_framework.response import Response from django.forms.models import model_to_dict from collections import name...
import datetime import json import os import re import threading from collections import defaultdict from typing import ( Any, Iterable, Mapping, MutableSequence, Optional, Sequence, Set, Union, ) from uuid import uuid4 import boto3 import sentry_sdk import smart_open from flask import ...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from collections import namedtuple # Custom from src.network import hyper from src.helpers import maths, utils from src.compression import hyperprior_model, prior_model MIN_SCALE = 0.11 LOG_SCALES_MIN = -3. MIN_LIKELIHOOD = 1e-9 MAX...
# -------------------------------------------------- # Компилятор # -------------------------------------------------- """ Представлены больше байт-кодов, чем реализованы """ from object_ import Object, CodeObject, ObjectBoolean, ObjectFloat, ObjectNone, ObjectStr import re from parse_funcs import read, isa from o...
# Copyright (c) 2018 StorPool # 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 ...
''' Created on Feb. 8, 2021 @author: cefect converting 'Depth Damage Functions.xlsx' to CanFlood format ''' #=============================================================================== # imports--------- #=============================================================================== import os, datetime start = ...
import torch import torch.nn as nn import torch.nn.functional as F import math import warnings import os try: from transformers import DistilBertModel, BertModel, AutoModel, AutoConfig, AutoModelWithLMHead from transformers.modeling_bert import gelu except: from pytorch_transformers import DistilBertModel...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import random import logging import sys import numbers import math #import sklearn import time import datetime import numpy as np import cv2 import mxnet as mx from mxnet import ndarray as nd from mxn...
import collections import argparse from configVar import config_vars class OptionToConfigVar: """ when attribute of CommandLineOptions is get or set OptionToConfigVar will read/write it to configVar if default is provided to __init__ the configVar is a priori set with this value if set_va...