text
stringlengths
8.04k
46.5k
from qtpy import QtCore, QtGui, QtWidgets, uic import os import copy import sys import pathlib import json from logzero import logger from modules.multithreading import Worker, ProgressDialog class_name = 'source_update_tab' class AddProcessingRuleDialog(QtWidgets.QDialog): def __init__(self): super(Add...
''' Driver for placing vm images in a LVM thin pool ''' import functools import logging import os import subprocess import time import asyncio import vanir import vanir.storage import vanir.utils def check_lvm_version(): #Check if lvm is very very old, like in Travis-CI try: lvm_h...
import numpy as np import click import time import pygame import pygame.locals as pyloc import librosa as lr import ffmpeg import logging import re import pyaudio import subprocess import json import os import signal import pdb logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(__name__) playlog = log.ge...
# The MIT License # # Copyright (c) 2008 <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,...
# Copyright 2019 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...
""" Python Bokeh program calculate the complex number """ from bokeh.plotting import figure from bokeh.layouts import column, row, Spacer from bokeh.models import ColumnDataSource, Arrow, Button, Div, NormalHead, LabelSet, Span from bokeh.io import curdoc from math import radians, cos, sin, sqrt, pi from bokeh.models...
#!/usr/bin/python3 """ poly MBA generation: poly = linear * linear * linear ... add 0-equality: 0-equality = 0 * linear = (part-term) * (-1*linear) poly = poly + 0-equality """ import argparse import numpy as np import os import random import re import sys sys.setrecursionlimit(30000) sys.p...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import datetime, time from http.server import HTTPServer, BaseHTTPRequestHandler import io, shutil , urllib, cgi import os, sys, pexpect, threading # #----------------------------------------------------------------------------------------------------------------------...
# Copyright (c) Facebook, Inc. and its affiliates. # Copyright (c) 2021 <NAME> and authors of arboEL. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import json import math import time import torch from torch....
from collections import deque from flask import Flask, request as user_req, jsonify from flask_cors import CORS, cross_origin import requests import re import json import time from tornado.wsgi import WSGIContainer from tornado.web import Application, FallbackHandler, RequestHandler from tornado.ioloop import IOLoop fr...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- #Copyright (c) 2018, <NAME> #Permission to use, copy, modify, and/or distribute this software for any #purpose with or without fee is hereby granted, provided that the above #copyright notice and this permission notice appear in all copies. #THE SOFTWARE IS PROVIDED "AS ...
## @ingroup Components-Energy-Storages-Batteries-Constant_Mass # Lithium_Ion_LiNiMnCoO2_18650.py # # Created: Feb 2020, <NAME> # Modified: Sep 2021, <NAME> # ---------------------------------------------------------------------- # Imports # ---------------------------------------------------------------------- imp...
# Copyright 2022 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 agreed to...
# -*- coding: utf-8 -*- """ The :mod:`parsimony.algorithms.utils` module contains auxiliary algorithms. Algorithms may not store states. I.e., if they are classes, do not keep references to objects with state in the algorithm objects. It should be possible to copy and share algorithms between e.g. estimators, and thus...
# -*- coding: utf-8 -*- """ Created on Sun Jun 30 14:36:25 2019 @author: HASEE Chapter 02 end to end machine learning project """ #################################### Set UP ################################### import os os.chdir(os.getcwd()) import numpy as np import pandas as pd # set the random seed np.random.seed...
"""Cascade RCNN Model.""" from __future__ import absolute_import import os import mxnet as mx from mxnet import autograd from mxnet.gluon import nn from .rcnn_target import RCNNTargetSampler, RCNNTargetGenerator from ..rcnn import RCNN2 from ..rpn import RPN from ...nn.coder import NormalizedBoxCenterDecoder, MultiPer...
import numpy as np import torch import numba as nb import open3d as o3d import frnn import dgl from numba import types, deferred_type from numba.typed import Dict, List import pickle from Constants import * from Operator import * from cuHelper import * import time I = 16 # 2^I is for hashing function Large = 2**I @...
from django.shortcuts import render, get_object_or_404, redirect from django.http import HttpResponseRedirect, HttpResponse from django.urls import reverse from .models import * from django.utils import timezone from django.template import RequestContext from django.shortcuts import render_to_response from django.con...
from __future__ import division import torch import math import random from PIL import Image, ImageOps, ImageFilter try: import accimage except ImportError: accimage = None import scipy.ndimage as ndimage import numpy as np import numbers import types import collections class Compose(object): """Composes...
"""Library to transport ISO7816-4 APDUs over anything""" import io import logging __version__ = '1.2.5' __title__ = 'pysatl' __description__ = 'Library to transport ISO7816-4 APDUs over anything' __long_description__ = """ A simple way to exchange ISO7816-4 APDUs over interfaces not covered in ISO7816-3. ISO7816-3 sta...
#!/usr/bin/env python import copy import sys import basis_set_exchange as bse from basis_set_exchange import lut import parameter import numpy as np from scipy.special import factorial2 as fact2 from one_int import shell_to_basis from one_int import S, T, V, ERI, DIP from timeit import default_timer as timer class ...
''' This file is used to read in the json files that contain the metadata from the PartNet meta data files and ultimately creates the first round of the dfmeta file. It uses some complicated tree structures to capture the data and attempt to generate a description. However, this method was mostly overwritten by the des...
import pandas as pd import numpy as np from typing import List import psycopg2 from psycopg2.extensions import register_adapter, AsIs import src.util import src.helpers # Setup system connection mode = "DEV" psycopg2.extensions.register_adapter(np.int64, AsIs) logger_wrapper = src.util.LoggerWrapper(algo_id=None) d...
# Copyright(c) 2017-2021 CloudNetEngine. 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...
from torch.autograd import Variable import torch from .module import Module from .container import Sequential from .activation import LogSoftmax from .. import functional as F def _assert_no_grad(variable): assert not variable.requires_grad, \ "nn criterions don't compute the gradient w.r.t. targets - ple...
#!/usr/bin/env python3 # # Name: ot_thermocycler_standalone # Description: A small python script to operate the Thermocycler Module WITHOUT OT-2 Robot. # Repository: https://github.com/mtoutai/ot_thermocycler_standalone.git # Author: <NAME>, Ph.D. https://orcid.org/0000-0002-1110-6375 # License: Apache-2.0 # import ...
from charcoaltoken import CharcoalToken as CT from unicodegrammars import UnicodeGrammars def PassThrough(r): return r def GetFreeVariable(s, n=1): r = "" for _ in range(n): r += next(filter(lambda c: c not in s + r, "ικλμνξπρςστυφχψωαβγδεζηθ")) return r def VerbosifyVariable(c): return ...
import pandas as pd import numpy as np from sklearn import svm from sklearn import model_selection from sklearn.model_selection import learning_curve from sklearn.ensemble import GradientBoostingRegressor from sklearn.ensemble import RandomForestRegressor from sklearn.model_selection import cross_val_score from skle...
from matplotlib import collections import json import os import copy import torch from torchvision import transforms import numpy as np from tqdm import tqdm from random import sample import torchaudio import logging import collections from glob import glob import sys import albumentations sys.path.insert(0, '.') # n...
# NeuroEvolution of Augmenting Topologies (NEAT) implementation in Python 3 # Created by <NAME> # Feel free to modify, redistribute, and use this code as you wish. # Credit is nice but not required! # 9 - 16 - 2017 import random import math from datetime import datetime random.seed(datetime.now()) #numero de neurons...
# The MIT License (MIT) # Copyright (c) 2020 by the xcube development team and contributors # # 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...
import datetime import re import socket import threading # from tkinter import * # from threading import Event import time # import datetime as dt import tkinter as tk # import winsound from collections import deque from queue import Queue from time import monotonic import matplotlib.pyplot as plt import rasterio impo...
#!/usr/bin/env python2.7 # This file is part of Snaptron. # # Snaptron is free software: you can redistribute it and/or modify # it under the terms of the # # The MIT License # # Copyright (c) 2016- by <NAME> <<EMAIL>> # and <NAME> <<EMAIL>> # # Permission is hereby granted, free of...
from __future__ import print_function import os import re import sys import subprocess from collections import namedtuple, defaultdict from time import time from pddlstream.language.constants import EQ, NOT, Head, Evaluation, get_prefix, get_args, OBJECT, TOTAL_COST, Action from pddlstream.language.conversion import ...
from __future__ import annotations from typing import Callable, Iterable, Optional, Tuple, Union import copy import materia as mtr from ..utils import memoize import numpy as np import scipy.integrate import scipy.interpolate # import matplotlib.pyplot as plt import warnings # __all__ = [] class DataSeries: de...
import time import numpy as np import struct import datetime import calendar import soaculib as aculib import scan_helpers as sh from soaculib.twisted_backend import TwistedHttpBackend import argparse from twisted.internet import reactor, protocol from twisted.internet.defer import inlineCallbacks import twisted.web.c...
# Copyright 2017 The TensorFlow Lattice 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 applicable law or a...
# 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...
#!/usr/bin/env python # coding: utf-8 """ unit tests for semiclassical propagators """ import unittest import numpy as np from numpy import fft import scipy.linalg as sla from scipy.interpolate import interp1d import logging # # Logging logger = logging.getLogger(__name__) logging.basicConfig(format="[testing] %(mess...
# -*- coding: utf-8 -*- """ Created on Mon Sep 28 11:46:09 2020 @author: <NAME> """ import pickle import numpy as np import numpy.linalg as la from numpy.random import default_rng # Create the random number generator rng = default_rng() class Organization(object): """Defines a class Organization which contains...
import os import errno import numpy as np from torch.nn import init import torch import torch.nn as nn from torch.autograd import Variable import torchvision from PIL import Image, ImageDraw, ImageFont from copy import deepcopy import skimage.transform import ntpath import sys from miscc.config import cfg # For vi...
''' License ======= copyright <NAME>, <NAME> (PTB) 2020 This software is licensed under the BSD-like license: 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 must retain the abo...
import copy import contextlib from functools import partialmethod from contextlib import contextmanager,redirect_stderr,redirect_stdout from os import devnull import tqdm from tqdm.auto import tqdm as tqdm_ import numpy as np from sklearn.base import BaseEstimator from sklearn.utils import check_X_y from mne.decoding ...
from typing import List, Optional import telebot import concurrent.futures from concurrent.futures import CancelledError import re import peewee import time import math import traceback import logging from core.models import UserInfo from core.AbstractFrontend import AbstractFrontend, FrontendUserInfo from telegram.j...
# Copyright (c) 2018, ZIH, Technische Universitaet Dresden, Federal Republic of Germany # # 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 the a...
""" Collection of database access functions. """ import os import re import json import logging from pathlib import Path import tempfile from contextlib import contextmanager from collections import defaultdict import numpy as np import pandas as pd import sh from tqdm import tqdm from sqlalchemy import create_engi...
import ast import operator from peval.tools import Dispatcher, immutableadict, ast_equal, replace_fields from peval.core.gensym import GenSym from peval.core.reify import KnownValue, is_known_value, reify from peval.wisdom import is_pure, get_signature from peval.core.callable import inspect_callable from peval.tools ...
from database.imports import * from database.models.base import Base #some global variables that are used here and there that would be magic otherwise _plusMinus='\u00B1' #FIXME MASSIVELY BROKEN class HasMirrors: #FIXME this should validate that they actually *are* mirrors? @declared_attr def mirrors_from_her...
import numpy as np import cv2 import os from tqdm import tqdm import random import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.patches as patches import pickle from glob import glob import imgaug as ia from imgaug import augmenters as iaa from shapely.geometry import Polygon cardW=63 c...
from warnings import warn from os.path import join import re from operator import itemgetter from cobra import Model, Reaction, Metabolite, Gene, DictList from .workspace import get_workspace_object_meta, get_workspace_object_data, put_workspace_object from .likelihood import LikelihoodAnnotation from .SeedClient imp...
"""Various utility classes and functions.""" from os import PathLike from pathlib import Path from typing import ( Any, Callable, Container, Dict, Iterable, List, Optional, Sequence, Tuple, TypeVar, Union, overload, ) import click import joblib import numpy as np import...
#-*- coding:utf-8 -*- # # 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, softwar...
""" * @author ['iostream04'] """ # -*- coding: utf-8 -*- from flask import Blueprint, request, current_app as app import flask import requests import time import os import logging from models.status import Status from models.response import CustomResponse import utils.docx_translate_helper as docx_helper from utils.a...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Classes and utilites to keep track of files associated to an analysis. The main class is `FileArchive`, which keep track of all the files associated to an analysis. The `FileHandle` helper class encapsulates information on a particular file. """ from...
# import logging # logging.basicConfig(level=logging.DEBUG) import numpy as np import pandas from statsmodels.formula.api import ols import os,sys from numpy import nanmean from scipy.stats import distributions as D from numpy import * from pylab import * import pylab as py from .utilities import time,time2str,timeit...
# -*- coding: utf-8 -*- """ @Time : 2020/05/06 21:09 @Author : Tianxiaomo @File : dataset.py @Noice : @Modificattion : @Author : @Time : @Detail : """ import os import random import sys from typing import Tuple import cv2 import numpy as np from numpy.lib.financ...
# -*- coding: utf-8 -*- """ S3 Person Registry @author: nursix @see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA} """ module = "pr" # ***************************************************************************** # Settings # resource = "setting" tablename = "%s_%s" % (module, resource) table = db...
import copy from dataclasses import dataclass import dataclasses import functools import traceback from typing import Any, Dict, List, Optional, Tuple, Union from async_timeout import enum from attr import field from concurrent.futures import ProcessPoolExecutor from transformers import AutoConfig, T5ForConditionalGen...
# # Copyright (c) 2018 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...
# coding: utf-8 # # Brain Tumor Detection Using a Convolutional Neural Network # **About the Brain MRI Images dataset:**<br> # The dataset contains 2 folders: yes and no which contains 253 Brain MRI Images. The folder yes contains 155 Brain MRI Images that are tumorous and the folder no contains 98 Brain MRI Images ...
# -*- coding: utf-8 -*- """ Created on Sun Nov 15 10:59:14 2020 @author: <NAME> """ #reproducability from numpy.random import seed seed(1+347823) import tensorflow as tf tf.random.set_seed(1+63493) import numpy as np from bayes_opt import BayesianOptimization from bayes_opt.logger import JSONLogger from bayes_opt.eve...
"""This file implements RPN and baselines for the minigrid environment.""" import torch import torch.nn as nn from rpn.utils.torch_wrapper import MLP, time_distributed from rpn.utils.torch_graph_utils import construct_full_graph import rpn.utils.torch_utils as tu import rpn.utils.np_utils as npu from rpn.utils.eval_u...
#!/usr/bin/env python import random import pytest import networkx as nx from networkx.testing.utils import * class TestFunction(object): def setup_method(self): self.G = nx.Graph({0: [1, 2, 3], 1: [1, 2, 0], 4: []}, name='Test') self.Gdegree = {0: 3, 1: 2, 2: 2, 3: 1, 4: 0} self.Gnodes = l...
#!/usr/bin/env python # # Copyright 2012 <NAME> # based on the original Tornado by Facebook # # 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 ...
import argparse import time import csv import numpy as np import torch import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import custom_transforms import models from utils import tensor2array, save_checkpoint, save_path_formatter, log_output_tensorboard from inverse_warp import inverse_war...
# -*- coding: UTF-8 -*- """ Title: Dumpscript management command Project: Hardytools (queryset-refactor version) Author: <NAME> (http://willhardy.com.au) Date: June 2008 Usage: python manage.py dumpscript appname > scripts/scriptname.py $Revision: 217 $ Description: Generates a Python...
# coding: UTF-8 import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import warnings warnings.filterwarnings("ignore") import argparse import numpy as np import shutil import PIL import time from imageio import imread, imsave from googletrans import Translator import torch import torchvision import torch.nn.functional as ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 26 20:14:52 2019 @author: xjc """ import math import numpy as np import fire import os import time import torch import torch.nn as nn import torch.nn.functional as F from torchvision import models, transforms from Dataset_folder import Dataset_fl...
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Tests for concurrency libraries.""" import glob import os import random import re import sys import threading import time from flaky import flaky import pytest...
# Copyright 2013-2021 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
import torch import torch.distributed as dist from torch.nn.modules import Module from torch.autograd import Variable from collections import OrderedDict from itertools import chain import copy import importlib from ..multi_tensor_apply import multi_tensor_applier imported_flatten_impl = False def import_flatten_impl...
# Copyright 2019-present MongoDB, 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 wri...
#!/usr/bin/env python3 # # Copyright (c) 2016 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
#!/usr/bin/env python import re from collections import namedtuple from collections import OrderedDict import json Point = namedtuple('Point', ['x', 'y']) Rect = namedtuple('Rect', ['ll', 'ur']) Port = namedtuple('Port', ['port_nm', 'layer', 'rect']) Blockage = namedtuple('Blockage', ['layer', 'rect']) Terminal = nam...
from psychopy import core, visual, event, gui, data, sound from random import randint, sample, choice, shuffle from itertools import chain import numpy as np import math import os, csv import pandas import time import random #------ Define some utility functions ------ def display_instructions(window, message, size=1)...
import warnings from functools import partial import onnx from onnx import numpy_helper import tensorflow as tf from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE import numpy as np from tensorflow.python.ops.image_ops_impl import ResizeMethodV1 class Operations: def make_op(self, op_type, inputs, attrs): #...
""" # Wiser API Facade <EMAIL> https://github.com/asantaga/wiserheatingapi This API Facade allows you to communicate with your wiserhub. This API is used by the homeassistant integration available at https://github.com/asantaga/wiserHomeAssistantPlatform """ import logging import requests import json import os im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: train.py import os import argparse import cv2 import shutil import itertools import tqdm import numpy as np import json import six import tensorflow as tf try: import horovod.tensorflow as hvd except ImportError: pass assert six.PY3, "FasterRCNN requires P...
import tensorflow as tf import tensorflow.contrib.slim as slim import logging from convlstm import ConvGRUCell, ConvLSTMCell logger = logging.getLogger('mview3d.' + __name__) def get_bias(shape, name='bias'): return tf.get_variable( name, shape=shape, initializer=tf.constant_initializer(0.0)) def get_...
import numpy as np import operator from collections import namedtuple from numba.core import types, utils from numba.core.typing.templates import (AttributeTemplate, AbstractTemplate, infer, infer_global, infer_getattr, signature, bound_...
"""Pattern checker. This file is conceptually part of TypeChecker.""" from collections import defaultdict from typing import List, Optional, Tuple, Dict, NamedTuple, Set, Union from typing_extensions import Final import mypy.checker from mypy.checkmember import analyze_member_access from mypy.expandtype import expand...
# Copyright (c) 2020, 2021, Oracle and/or its affiliates. # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. """Provide Module Description """ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# __author__ = ["<NAME> (Oracle ...
from __future__ import annotations from dataclasses import dataclass from logging import Logger, getLogger from pathlib import PosixPath from typing import Optional, Union import h5py import numpy as np from .application_info import get_application_info from .fast5s import ( FAST5_ROOT, KEY, BaseFile, ...
import matplotlib.pyplot as plt import seaborn as sn import json import ast import os import numpy as np import xarray as xr import pickle as pkl import itertools from timeit import default_timer as timer from json import JSONEncoder import rsabias.core.dataset as dataset import rsabias.core.features as features cla...
#!/usr/bin/env python # coding: utf-8 # <h1><center> Training of a closure for the uncertainty ropagation in the Burgers equation</center></h1> # <center> # <NAME> <br> # </center> # <div class="math abstract"> # <p style="text-align:center"><b>Abstract</b></p> # <p> # Estimation of the closure for th...
#!/usr/bin/env python3 # Copyright 2017-2018 <NAME>, <NAME> import os import sys import argparse import json import uuid import re from pprint import pprint from html.parser import HTMLParser from html.entities import name2codepoint # NOTE: This script is standalone does not include any libraries DLG_JSON_HUMAN_EXT...
# 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, software...
""" Transport Velocity Formulation ############################## References ---------- .. [Adami2012] <NAME> et. al "A generalized wall boundary condition for smoothed particle hydrodynamics", Journal of Computational Physics (2012), pp. 7057--7075. .. [Adami2013] <NAME> et. al "A transport-v...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 from collections import OrderedDict from functools import partial import numpy as np from numpy.testing import assert_allclose import pytest from jax import random import jax.numpy as jnp from funsor import Tensor, bint, reals impor...
from __future__ import absolute_import, division, print_function import csv import logging import os import sys from collections import OrderedDict from io import open import numpy as np from nltk import word_tokenize logger = logging.getLogger(__name__) class ExplaGraphInputExample(object): def __init__(self,...
# Copyright 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
#encoding = utf-8 import sys import os import torch import torch.nn as nn import math import torch.utils.model_zoo as model_zoo from Losses.Mask_bce_loss import Attention_loss, LevelAttention_loss import numpy as np import cv2 import torch.nn.functional as F from config_mask import config from Losses.Mask_bce_loss imp...
""" MODFLOW 6 Autotest Test the advection schemes in the gwt advection package for a one-dimensional model grid of square cells. """ import os import sys import numpy as np try: import flopy except: msg = 'Error. FloPy package is not available.\n' msg += 'Try installing using the following command:\n' ...
import warnings from collections import namedtuple import numpy as np import h5py from ecogdata.channel_map import ChannelMap from ecogdata.trigger_fun import process_trigger from .file2data import FileLoader gain = { '2t-as daq v1' : 10, '2t-as daq v2' : 10 } pitch_lookup = { 'actv_64' : 0.4, '...
import datetime import io import os import textwrap from enum import Enum # keep below as absolute imports from flopy.mf6.data import mfdatautil, mfstructure from flopy.utils import datautil """ createpackages.py is a utility script that reads in the file definition metadata in the .dfn files to create the package cl...
import shlex import subprocess import cv2 import pybullet_data from gym import error import numpy as np from inspect import currentframe, getframeinfo import gibson from gibson.core.physics.robot_locomotors import Fetch from gibson.core.render.pcrender import PCRenderer from gibson.data.datasets import ViewDataSet3D ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Compiler for keymap.c files This scrip will generate a keymap.c file from a simple markdown file with a specific layout. Usage: python compile_keymap.py INPUT_PATH [OUTPUT_PATH] """ from __future__ import division from __future__ import print_function from __future...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ This provides a small set of effect handlers in NumPyro that are modeled after Pyro's `poutine <http://docs.pyro.ai/en/stable/poutine.html>`_ module. For a tutorial on effect handlers more generally, readers are encouraged to read ...
import os import json import functools import logging import platform import copy from .exceptions import ( SaveWarningExc ) from .constants import ( M_OVERRIDEN_KEY, M_ENVIRONMENT_KEY, METADATA_KEYS, SYSTEM_SETTINGS_KEY, PROJECT_SETTINGS_KEY, PROJECT_ANATOMY_KEY, DEFAULT_PROJECT_KEY )...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ILI9341 lib: # Copyright (c) 2014 Adafruit Industries # Author: <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, ...