text
stringlengths
6.04k
39.5k
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyexcel from openpyexcel.compat import basestring, unicode from openpyexcel.descriptors.serialisable import Serialisable from openpyexcel.descriptors import ( Alias, Typed, Integer, Set, MinMax, ) from openpyexcel.descriptors.exc...
import numpy as np from jrieke.utils import resize_image from tqdm import tqdm_notebook import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable # ---------------------------- Interpretation methods -------------------------------- def sensitivity_analysis(model, image_...
import atexit import datetime import faulthandler import os import re import tempfile import unittest import numpy faulthandler.enable() # to debug seg faults and timeouts import cfdm n_tmpfiles = 1 tmpfiles = [ tempfile.mkstemp("_test_Field.nc", dir=os.getcwd())[1] for i in range(n_tmpfiles) ] (tmpfile,) ...
import numpy as np from scipy.stats import norm from scipy.stats import ncx2 class EuropeanOption: def __init__(self, initial_stock_price, risk_free_rate, sigma, strike_price, maturity): self.initial_stock_price = initial_stock_price self.risk_free_rate = risk_free_rate self.sigma = sigma...
import argparse import os import sys import numpy as np import logging import torch import torchvision import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torchvision.transforms as transforms import torchvision.models from torch.utils.data.sampler import SubsetRandomSampler import m...
import math from collections import Counter, defaultdict from datetime import datetime import networkx as nx import numpy as np import pandas as pd import plotly.graph_objects as go import pyproj from numpy import mean, nanmean from cognite.power.data_classes import PowerAssetList # unified plotting colors _MARKER_E...
# Copyright 2018 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...
# -*- coding: utf-8 -*- """ flask_security.datastore ~~~~~~~~~~~~~~~~~~~~~~~~ This module contains an user datastore classes. :copyright: (c) 2012 by <NAME>. :license: MIT, see LICENSE for more details. """ from .utils import get_identity_attributes, string_types class Datastore(object): de...
# -*- coding: utf-8 -*- from datetime import timedelta, date from icemac.ab.calendar.browser.calendar import EventDescription, hyphenated from icemac.ab.calendar.browser.calendar import TabularCalendar from icemac.ab.calendar.browser.interfaces import IEventDescription from icemac.ab.calendar.browser.interfaces import ...
from pathlib import Path import os import logging import shutil import requests import zipfile import urllib3 from config import settings def get_module_logger(module_name: str) -> logging.Logger: """Instantiates a logger object on stdout Args: module_name (str): Name of the module outputting the lo...
import sys import shutil from pathlib import Path from functools import wraps, lru_cache import datetime as dt import email.utils import csv import json from git import Repo, Git from git.exc import GitCommandError from git.exc import InvalidGitRepositoryError from gitgud import actor, skills, InitializationError fr...
# ***************************************************************************** # Copyright (c) 2020, NVIDIA CORPORATION. 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...
import utils import torch import time import os import pickle import numpy as np import torch.nn as nn import torch.optim as optim from dataloader import load_gan_data import argparse INPUT_DIM = 16 OUTPUT_DIM = 1 INPUT_SIZE = 32 CLASS_NUM = 1 class generator(nn.Module): # Network Architecture is exactly same as...
# Copyright (c) 2018 Uber Technologies, 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 ...
"""Functions for plotting EEG processing results. """ import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import sklearn.metrics as skm import seaborn as sns import pandas as pd import pywt import scipy.signal import sklearn.decomposition fro...
from collections import OrderedDict, defaultdict from itertools import count from warnings import warn from torch import nn from torch.nn.init import xavier_normal import torch from torch.nn import functional as F, Parameter import torch.nn.init as init from attorch.regularizers import LaplaceL23d, LaplaceL2 from torc...
# -*- coding: utf-8 -*- # Created on Sun Feb 16 12:48:18 2020 # @author: arthurd # Useful packages import os import numpy as np import random as rd # Test if pygame is installed try: import pygame except ModuleNotFoundError: print("Module PyGame is not installed.\nEither install this package or turn off the '...
from datetime import datetime import io import os from pathlib import Path import dateutil.parser import numpy as np import pytest from pandas.errors import ( EmptyDataError, PerformanceWarning, ) import pandas.util._test_decorators as td import pandas as pd import pandas._testing as tm # https://github.co...
""" Created on 01 Apr 2021 21:40:47 @author: jiahuei """ import logging import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from argparse import ArgumentParser, _ArgumentGroup from typing import Optional, Union, Dict from copy import deepcopy from models import...
# -*- coding: utf-8 -*- import unreal import os from Utilities.Utils import Singleton from Utilities.Utils import cast import Utilities import QueryTools import re import types import collections from .import Utils global _r COLUMN_COUNT = 2 class DetailData(object): def __init__(self): self.filter_str ...
# Defines core methods shared amongst system test scripts import sets import unittest import shlex import subprocess import os import binascii import requests import logging import random import time import datetime import json import pprint import xml.etree.ElementTree as ET from StringIO import StringIO DEFAULT_GRO...
""" Collect up schoolnet data into files we have for outgoing... """ from __future__ import print_function import sys import os import subprocess import tempfile import calendar import datetime from metpy.units import units, masked_array import psycopg2.extras import pytz from pyiem.network import Table as NetworkTabl...
import json import time import asyncio import random import typing from typing import Dict, Tuple, Type, Optional, Any, List from torba.client.mnemonic import Mnemonic from torba.client.bip32 import PrivateKey, PubKey, from_extended_key_string from torba.client.hash import aes_encrypt, aes_decrypt, sha256 from torba.c...
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # 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...
"""Functions for converting colors from one representation to another. .. seealso:: - W3C-Wiki: - `CSS3/Color <https://www.w3.org/wiki/CSS3/Color>`_ - `Extended color keywords <https://www.w3.org/wiki/CSS3/Color/Extended_color_keywords>`_ - Wikipedia: - `RGB color model <https://en.wiki...
from os.path import isdir, isfile from os import system # return list with each line an element, clear of whitespace def read_file(filename): with open(filename) as f: content = f.readlines() content = [x.strip() for x in content] return content def test_parameters_processing_step(): if not ...
import numpy as np import torch import torch.nn as nn import functools import open3d from torch.autograd import Function from .base_model import BaseModel from ...utils import MODEL from ..modules.losses import filter_valid_label from ...datasets.augment import SemsegAugmentation if open3d.core.cuda.device_count() > ...
""" Module containing tasks used for reading and writing to disk Credits: Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2017-2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME> (Sinergise) Copyright (c) 2018-2019 <NAM...
# -*- coding: utf-8 -*- from __future__ import division import pandas import source.cymdist_tool.type_lookup as lookup import pickle import numpy as np import json try: import cympy except: # Only installed on the Cymdist server pass def list_loads(): """List all the loads and their demand on each pha...
#!/usr/bin/env python import sys #from heapq import heappush, heappop, heapify from random import randint, choice, seed try: import numpy #import scipy.sparse.linalg as la except ImportError: print("numpy not found") if sys.version_info.major>=3: long = int from bruhat.util import write class Poi...
import codecs import copy import json import os import shutil from functools import reduce from urllib import parse as url_parser from typing import Dict from pathlib import Path import traceback from flask import Response from .logger_helper import get_logger from . import context _logger = get_logger() """ 文件管理系统 ...
''' 1 put flags on the field, bots have to each collect all flags. 2 start with one flag 3 Add in some quality-of-life sensing function Might want to be able to ask if a tile is any sort of conveyor and then be able to ask where you would move to next if conveyed by it. 4 write a basic AI 5 add 3 more flags. flags then...
# Copyright 2020 Standard Cyborg # # 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 w...
import asyncio import contextlib import json import logging from typing import (Any, Callable, Coroutine, Dict, Iterator, List, Optional, Type, TypeVar, Union, cast, overload) import backoff import pydantic import websockets import websockets.exceptions from websockets.legacy import client as ws_cl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author:<NAME>, <NAME> This module will concentrate all the functions related to quality measurements for the pipeline and also make some ploting for comparing those measures. """ import os import logging import pickle import numpy as np import datetime import c...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import logging import functools import numpy as np import torch import torch.nn as nn import torch._utils import torch.nn.functional as F BN_MOMENTUM = 0.1 logger = logging.getLogger(__name__) d...
# Copyright 2020 Splunk, 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 to in writing,...
#!/usr/bin/env python # -*- coding: utf-8 -*- import math import geopandas as gpd import libpysal import networkx as nx import numpy as np from shapely.geometry import Point __all__ = [ "unique_id", "gdf_to_nx", "nx_to_gdf", "limit_range", ] def unique_id(objects): """ Add an attribute wi...
import dataclasses from functools import lru_cache import jax.numpy as jnp import numpy as np import scipy.sparse as sp from .typing import Size, Size3, Spacing, Optional, List, Union, Dict, Op, Tuple from .utils import curl_fn, yee_avg, fix_dataclass_init_docs, Box try: DPHOX_IMPORTED = True from dphox.patt...
'''The framework module contains the logic used in building the graph and inferring the order that the nodes have to be executed in forward and backward direction.''' import sys import warnings import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from . import dummy_modules as du...
import os import shutil from conans import DEFAULT_REVISION_V1 from conans.client.cache.cache import CONAN_CONF, PROFILES_FOLDER from conans.client.conf.config_installer import _ConfigOrigin, _save_configs from conans.client.tools import replace_in_file from conans.errors import ConanException from conans.migrations i...
import sys import json import io import enum from messagebird.balance import Balance from messagebird.call import Call from messagebird.call_list import CallList from messagebird.contact import Contact, ContactList from messagebird.error import Error, ValidationError from messagebird.group import Group, GroupList from...
import emcee import emcee.utils try: import pymultinest except: has_pymultinest = False else: has_pymultinest = True try: import chainconsumer except: has_chainconsumer = False else: has_chainconsumer = True try: # see if we have mpi and/or are using parallel from mpi4py i...
# coding: utf-8 from flask import Flask, request, session from twilio.twiml.messaging_response import MessagingResponse from twilio.rest import Client import random import pprint pp = pprint.PrettyPrinter(indent=4) import requests import urllib2 import ssl file_phone_numbers = open("file_phone_numbers", "r") # This ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # coding=utf-8 import abc import bisect import logging import pandas as pd import numpy as np from ...log import get_module_logger, TimeInspector from ...data import D from ...utils import parse_config, transform_end_date from . import process...
# -*- coding: utf-8 -*- # File: imagenet_utils.py import multiprocessing import numpy as np import os from abc import abstractmethod import cv2 import tensorflow as tf import tqdm from tensorpack import ModelDesc from tensorpack.dataflow import ( AugmentImageComponent, BatchData, MultiThreadMapData, MultiPro...
#!/usr/bin/env python3 from __future__ import print_function import sys import re import argparse import datetime from time import sleep from ipaddress import IPv4Network from threading import Thread, activeCount if sys.version_info[0] < 3: from commands import getoutput else: from subprocess import getoutput...
from tqdm import tqdm import numpy as np from sklearn.preprocessing import MinMaxScaler from datetime import datetime import os import cv2 from io import StringIO, BytesIO import matplotlib.pyplot as plt import tensorflow as tf import tensorflow.keras.backend as K from utils.data_utils import binary_labels_to_image,...
#!/usr/bin/env python3 # # github.py """ GitHub backend. """ # # Copyright © 2021 <NAME> <<EMAIL>> # # 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 withou...
#!/usr/bin/python #stats.py ''' Classes and functons to implement calculation and output of statistics ''' #geonomics imports from geonomics.utils.io import (_append_array2d_to_array_stack, _append_row_to_csv, _write_dict_to_csv) from geonomics.ops.selection import _calc_fitness from ...
import torch import torch.nn as nn import torch.nn.functional as Func from utils import calc_topk_accuracy from .aggregator import Encoder from .backbone.st_gcn_aaai18 import SpatialGCN_18 from .graph import nw_ucla, ntu_rgb_d, uwa3d from .mlp import gen_prednet from .tokenizer import Encoder as Token_Encoder class ...
#!/usr/bin/python3 """ File: QuTech_VSM_Module.py Author: <NAME>, TNO/QuTech Purpose: Instrument driver for Qutech Vector Switch Matrix Usage: Notes: # General The VSM consists of 32 qubit tuners: 8 modules (numbered from left to right) 4 channels per module (numbe...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ######################################################################### # Copyright (c) 2017-2018, UChicago Argonne, LLC. All rights reserved. # # # # Copyright 2018. UChicago Argonne, LLC. This...
import discord from discord.ext import commands, tasks, flags from typing import List, Union, Dict, Optional from random import choice import os from extra import utils from extra.view import GiveawayView from extra.prompt.menu import Confirm from mysqldb import the_database server_id = int(os.getenv('SERVER_ID')) g...
#!/usr/bin/env python3 # -*- coding: utf-8 -* # @FileName: showGraph # @Date: 2019-03-16 11:02 # @Author: HuGuodong <EMAIL>[at]<EMAIL> import networkx as nx import matplotlib.pyplot as plt import math import networkx.algorithms.shortest_paths.generic as alg import itertools import numpy as np import src.co...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
''' This file contains several helper methods for working with service provider and component metainfo, as well as basic service provider functionality and subclasses appropriate for real service provider types. ''' import cPickle import logging log = logging.getLogger("service_provider") import wx import hooks impor...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
import os import re import time import json import logging import urllib.error import urllib.request from celery import Celery from collections import defaultdict from slackclient import SlackClient logger = logging.getLogger(__name__) class Parser: def __init__(self): self.message_listener = defaultdic...
""" Copyright (c) Facebook, Inc. and its affiliates. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. """ import math import pathlib import os import random import numpy as np import torch import torch.backends.cudnn as cudnn from pytorch_lightni...
import inspect import os import shutil import tempfile from distutils.version import LooseVersion from pathlib import Path from typing import Any, Callable, Dict, Optional, Tuple, Type, Union import warnings from ray.ml.utils.torch_utils import load_torch_model import torch import transformers import transformers.mode...
#!/usr/bin/env python # coding: utf-8 # # Import all dependencies # In[1]: import numpy as np import torch import torch.nn as nn import matplotlib.pyplot as plt import numpy.matlib as npm import torch.optim as optim from tensorboardX import SummaryWriter import os import pandas as pd # # Probability distribution ...
import unittest import log import sys import os import json import textwrap import sysfont import util from PIL import Image, ImageDraw, ImageFont def wrap_pixel_width(text, maxwidth, font, linesep='\n'): """ Split into a list of text lines, such that none of them exceeds the pixel width """ ret = [] # Start...
from __future__ import unicode_literals import datetime import decimal import json from collections import OrderedDict from django.contrib.auth import get_permission_codename from django.contrib.auth.decorators import login_required from django.core.exceptions import FieldDoesNotExist from django.core.exceptions imp...
''' Graphical display classes. Experimental tasks involving graphical displays inherit from these classes. ''' import os import numpy as np from OpenGL.GL import * from riglib.experiment import LogExperiment from riglib.experiment import traits from .render import stereo from .models import Group from .xfm import Q...
# -*- coding: utf-8 -*- """Tests of array utility functions.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op import numpy as np from pytest import raises from ..array im...
# -*- coding: utf-8 -*- # $ pip install opencv-python # $ pip install pillow # Python3 # Usage: $ Python yolo-img-x28_windows.py image_folder # import sys import cv2 import glob import numpy as np from PIL import Image from PIL.ExifTags import TAGS import shutil import os from os import listdir, getcwd from os.path im...
# # DAPLink Interface Firmware # Copyright (c) 2009-2019, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 11 10:30:16 2018 @author: chrelli """ import time, os, sys, shutil # for math and plotting import pandas as pd import numpy as np import scipy as sp import matplotlib.pyplot as plt import math # small utilities import csv from colour import Co...
import argparse import torch from plnn.branch_and_bound.relu_branch_and_bound import relu_bab import plnn.branch_and_bound.utils as bab_utils from tools.bab_tools.model_utils import load_cifar_1to1_exp, load_mnist_1to1_exp from plnn.proxlp_solver.solver import SaddleLP from plnn.network_linear_approximation import Line...
"""Subcluster core module""" __author__ = "<NAME>, and <NAME>" __date__ = "01 Oct 2016" __version__ = "1.0" from collections import namedtuple import itertools import logging import mmtbx.superpose import numpy import re import os import shutil from ample.util import ample_util, pdb_edit logger = logging.getLogger(...
import datetime from briefmetrics.lib.table import Table, Column from briefmetrics.lib.gcharts import encode_rows from briefmetrics.lib import helpers as h from briefmetrics.lib.report import ( EmptyReportError, WeeklyMixin, MonthlyMixin, cumulative_by_month, ) from .base import GAReport from .helpers ...
#!/usr/bin/python # coding: utf-8 """Visual keyboard for Pygame engine. Aims to be easy to use as highly customizable as well. ``VKeyboard`` only require a pygame surface to be displayed on and a text consumer function, as in the following example : ```python from pygame_vkeyboard import * # Initializes your window...
'''Copyright 2018 Province of British Columbia 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,...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
import collections import datetime import json from dataclasses import dataclass, field from enum import Enum from typing import Dict, Callable, NamedTuple, Set from django.db.models import Sum from django.urls import reverse from django.utils.html import format_html from django.utils.http import urlencode from django...
# 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/...
from __future__ import division import numpy as np import tensorflow as tf import matplotlib matplotlib.use('Agg') def generator_conditional(z, conditioning): # Convolution Generator with tf.variable_scope("generator", reuse=tf.AUTO_REUSE): z_combine = tf.concat([z, conditioning], -1) conv1_g = tf...
# -*- coding:utf-8 -*- from keras.callbacks import ModelCheckpoint from models import c3d_model from keras.optimizers import SGD,Adam from keras.utils import np_utils from schedules import onetenth_4_8_12 import numpy as np import random import cv2 import os import random import matplotlib matplotlib.use('AGG') import...
#!/usr/bin/env python """ Access to nuclide atomic weights, abundances, and decay constants. Data from NIST and NNDC * http://physics.nist.gov/cgi-bin/Compositions/stand_alone.pl?ele=&ascii=ascii2&isotype=all * http://www.nndc.bnl.gov/wallet/ """ import os.path import warnings import re import gzip import copy imp...
# # Copyright (C) 2019 GreenWaves Technologies # # 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 agree...
from . import string_utils from . import filepath_utils from . import scene_utils from . import shadergraph_utils from .property_utils import BlPropInfo #from . import object_utils from .prefs_utils import get_pref from ..rfb_logger import rfb_log from rman_utils import txmanager from rman_utils.txmanager import core a...
import hashlib import inspect import json import os import re import subprocess import tempfile import urllib.error import urllib.request from lxml import etree def http_download_file(_uri, _fh, _hash): _response = http_request(_uri) if _response: _chunk = 16 * 1024 _sha512 = hashlib.sha512(...
# MIT License # # Copyright (C) IBM Corporation 2019 # # 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...
# Importing the Kratos Library import KratosMultiphysics from KratosMultiphysics.python_solver import PythonSolver import KratosMultiphysics.python_linear_solver_factory as linear_solver_factory # Import applications import KratosMultiphysics.FluidDynamicsApplication as KratosCFD from KratosMultiphysics.FluidDynamicsA...
from database import Database, LoadDatabase from numba import njit, vectorize import matplotlib.pyplot as plt import numpy as np import pickle import time import bz2 import os os.environ['NUMBA_DISABLE_INTEL_SVML'] = '1' CENTER = 1200 RATEDBOUND = np.inf def prepare_data(db): CALCS_FILE = "calcs.pickle.bz2" ...
# -*- coding: utf-8 -*- # # Copyright (c) 2021, <NAME> # All rights reserved. # # Licensed under the BSD 3-Clause License: # http://opensource.org/licenses/BSD-3-Clause # import random import re import textwrap from .quiz import Quiz, Question, GroupStart, GroupEnd, TextRegion from .markdown import Markdown markdo...
import matplotlib.pyplot as plt import numpy as np import pickle from matplotlib.pyplot import cm import os import utils def show_tfidf(tfidf, vocab, filename): # [n_doc, n_vocab] plt.imshow(tfidf, cmap="YlGn", vmin=tfidf.min(), vmax=tfidf.max()) plt.xticks(np.arange(tfidf.shape[1]), vocab, fontsize=6, ro...
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
# Core functionality for database implementation import os import json import numpy as np import pandas as pd from copy import deepcopy from astropy import units as u from astropy.table import QTable from astropy.units import Quantity from astropy import uncertainty as unc def get_values_from_distribution(distributio...
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
from scipy.stats import scoreatpercentile import re import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt try: from . import plotting except ImportError: print( 'WARNING: unable to import "plotting" in stats. some functions may be disabled' ) from . import reshape class BlockMath( reshape....
""" autoencoder.py: An example of autoencoder trained by ImageNet dataset and used for training of Cifar-100 """ from util import get_dataset, get_dataset2 from model import BaseConfig, BaseModel import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from operator import mul from...
''' ''' import datetime import logging import os from os import path import sys import time from fuel.datasets.hdf5 import H5PYDataset from fuel.schemes import ShuffledScheme, SequentialScheme from fuel.streams import DataStream import h5py import lasagne from lasagne.layers import ( InputLayer, Resh...
"""Functions for data augmentation and related preprocessing.""" import random import numpy as np import torch import cv2 from PIL import Image import torchvision import pdb class IdentityTransform(object): def __call__(self, data): return data def color_aug(img, random_h=36, random_l=50, random_s=50): ...
#! /usr/bin/env python3 """ This utility does the following: 1. Check that all the following are synchronized: - The google spreadsheet (as csv: File->Download->csv[current sheet]) > Checks that the list count is proper. - The ini files: test_ - The ini files: assessment_ ...
# -*- coding: utf-8 -*- """HousingModel Main model class """ import time import numpy as np import pandas as pd # consav package from consav import ModelClass from consav.misc import elapsed, nonlinspace, markov_rouwenhorst # local import post_decision import negm import nvfi import simulate def solve_model(model...
"""Hyperparameter optimization.""" import datetime import os import inspect import logging import math import pathlib import pprint import random from typing import ( Any, Iterable, Mapping, MutableMapping, Optional, Sequence, Tuple, Type, Union, ) import joblib import numpy import ...
# SPDX-FileCopyrightText: 2019 ladyada for Adafruit Industries # SPDX-FileCopyrightText: 2020 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_wiznet5k_socket` ================================================================================ A socket compatible interface with the Wiznet5k ...
# sectormapping.py (flowsa) # !/usr/bin/env python3 # coding=utf-8 """ Contains mapping functions """ import os.path import pandas as pd import numpy as np from esupy.mapping import apply_flow_mapping import flowsa from flowsa.common import get_flowsa_base_name, \ return_true_source_catalog_name, check_activities_s...