text
stringlengths
6.04k
39.5k
# encoding=utf-8 #or gbk 这样才能使用中文 __author__ = 'Zhangjie' import cv2 import numpy as np import datetime import os #车辆识别依赖模块 from aip import AipImageClassify #车牌识别依赖模块 import sys import ssl import urllib.request import json import string import base64 #文件选择对话框对话框依赖模块 import time import json import csv import random ...
from astropy.coordinates import match_coordinates_sky, SkyCoord from astropy import units as u from astropy import table from astropy import io from astropy import wcs import os import numpy as np from . import utilities def symmetric_match(table_1, table_2, ra_col_1="ra", ra_col_2="ra", dec_col_1="dec", d...
# coding=utf-8 # Copyright (c) 2015 EMC Corporation. # 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 # #...
"""Settings manager.""" import json from logging import _levelToName import os from pathlib import Path from tempfile import gettempdir from typing import Any, Dict, List from urllib.parse import urljoin from click.exceptions import ClickException from ruamel.yaml import YAML from .core.exceptions import ( Alrea...
# ============================================================================== # Copyright 2019 - <NAME> # # NOTICE: Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, ...
#!/usr/bin/env python # # Author: <NAME> <<EMAIL>> # from functools import reduce import numpy from pyscf import lib from pyscf.lib import logger from pyscf.ao2mo import _ao2mo from pyscf.tddft import rhf from pyscf.scf import uhf_symm from pyscf.scf.newton_ah import _gen_uhf_response def gen_tda_hop(mf, fock_ao=Non...
import collections import time import requests from alm_session_factory import ALMSessionFactory from alm_urls import ALMUrls # TODO proper logging , capture events in a file # logging.basicConfig(level=logging.DEBUG) class ALMSession(ALMUrls, ALMSessionFactory): """ sets the session for ALM REST API and...
import collections import numpy as np import networkx as nx import itertools import logging from networkx.algorithms.flow import shortest_augmenting_path, edmonds_karp, preflow_push from networkx.algorithms.connectivity import minimum_st_edge_cut import time import graph_tool.flow from typing import Any, Dict, Iterabl...
import json import datetime import pytz from cwm_worker_operator import updater from cwm_worker_operator import config from cwm_worker_operator import common from cwm_worker_operator.common import bytes_to_gib, now, get_namespace_name_from_worker_id def test_send_agg_metrics(domains_config, updater_metrics, cwm_api...
import numpy as np import os, tqdm from skimage.io import imread, imsave from skimage import img_as_bool import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib.colors import LinearSegmentedColormap from textwrap import wrap from matplotlib import rc rc('font', size=17) rc('font', family='Arial') # rc(...
""" run shell or python command(s) """ import asyncio import io import keyword import os import re import shlex import sys import threading import traceback from contextlib import contextmanager from enum import Enum from getpass import getuser from typing import Awaitable, Any, Callable, Dict, Optional, Tuple, Itera...
# 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...
import json import discord from discord.ext import commands with open('./cogs/cog_resources/primary.json') as json_file: primary = json.load(json_file) with open('./cogs/cog_resources/melee.json') as json_file: secondary = json.load(json_file) with open('./cogs/cog_resources/secondary.json') as json_file: ...
''' Copyright 2017 The Regents of the University of Colorado Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appl...
#!/usr/bin/env python3 #----------------------------------------------------------------------- # # gt1dump.py -- Tool to dump GT1 files to ASCII # # 2019-05-04 (marcelk) Initial version # 2019-05-05 (marcelk) Added disassembly option -d # 2019-05-19 (marcelk) Check for bad segment size; Small numbers in decimal # 201...
import argparse import time import math import sys import numpy as np import torch as t import torch.nn as nn from torch.optim import SGD from torch.autograd import Variable sys.path.append("..") import rrnn from semiring import * SOS, EOS = "<s>", "</s>" def read_corpus(path, sos=None, eos="</s>", shuffle=False): ...
from django.db import models from django.core.exceptions import ValidationError from .colours import colours import datetime # Create your models here. class Tag(models.Model): tag = models.CharField(max_length=200) def bg_colour(self): return colours[str(self.id%20)][0] def text_colour(self): return colours[s...
import re from collections import defaultdict from typing import Any, DefaultDict, Dict, Iterable, List, Mapping, NamedTuple, Optional, Set, Tuple, Union from frozendict import frozendict from tsutils.enums import Server from tsutils.formatting import rmdiacritics from tsutils.query_settings.query_settings import Quer...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy import errno import json import logging import os import shutil import sys import time from time import gmtime, strftime from tensorkit.base import * import tensorflow as tf TFP_RUN_DIR = 'RUNS' ...
readMe = ''' This script generates a Python module that can be used to interact with the Meraki Dashboard API. *** THIS IS NOT THE OFFICIAL MERAKI DASHBOARD API PYTHON SDK *** The intent of the generated module is to provide an easy and reliable way to interact with endpoints that are not part of the latest rel...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2017 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This file contains original code relating to the paper: # Language-Driven Region Pointer Advancement for Controllable Image Captioning # (<NAME> and Kelleher, 2020) # For LICENSE notes and further details, please visit: # https://github.c...
import gc import os import cv2 # %matplotlib inline import tensorflow as tf from tensorflow import keras from tensorflow.keras import layers import tensorflow_addons as tfa import matplotlib.pyplot as plt import pickle # from keras.callbacks import ModelCheckpoint from tensorflow.keras.callbacks import ModelCheckpoint...
# <Source: https://github.com/rtqichen/ffjord/blob/master/lib/toy_data.py > import numpy as np import sklearn import torch import sklearn.datasets from PIL import Image import os # Dataset iterator def inf_train_gen(data, rng=None, batch_size=200): if rng is None: rng = np.random.RandomState() #rn...
# -*- coding: utf-8 -*- import pandas as pd import numpy as np from pathlib import Path from argparse import ArgumentParser from datetime import datetime import requests import itertools from fpl.fpl import FPL from fpl.player import Player from fpl.user import User from fpl.h2h_league import H2HLeague from fpl.class...
# ptext module: place this in your import directory. # ptext.draw(text, pos=None, **options) # Please see README.md for explanation of options. # https://github.com/cosmologicon/pygame-text from __future__ import division from math import ceil, sin, cos, radians import pygame DEFAULT_FONT_SIZE = 24 REFERENCE_FONT_...
#! /usr/bin/env python """ Configuration object loader and storage component for AutoPyFactory. """ import copy import logging import os import traceback import urllib2 from urllib import urlopen from ConfigParser import SafeConfigParser, NoSectionError, InterpolationMissingOptionError from autopyfactory.apfexce...
import xml.etree.ElementTree as ET import glob import os import json import csv from PIL import Image from PIL import ImageOps import numpy as np def getAnnotationDict(annotationPath): """ getAnnotationDict reads an annotation file, parses the XML, and returns the labeled dog breed and image file di...
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. ''' Imports ''' import os import sys import cv2 import math import glob import time import signal import logging import argparse import operator import collections import numpy as np import tensorflow as tf import tf_pose.pafprocess as pafprocess from Var...
import random def d_roll(dice_size): return random.randint(1,dice_size) def round_down(dice_rolled): if '.5' in str(dice_rolled): dice_rolled -= 0.5 return int(dice_rolled) def ability_score_to_bonus(ability): return round_down((ability - 10)/2) def format_coins(wealth_value): try: float(wealth_valu...
""" Logic for wavefunction optimization. """ import time from jax.flatten_util import ravel_pytree import jax.profiler from deeperwin.bfgs import build_bfgs_optimizer, calculate_metrics_bfgs from deeperwin.configuration import OptimizationConfig, EvaluationConfig, ClippingConfig, LoggingConfig, PreTrainingConfig, DeepE...
from django.shortcuts import render,redirect from bfxhfindicators import Stochastic from django.contrib.auth.decorators import login_required from django.conf import settings from accounts.forms import UserProfileUpdate from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth.views import Passw...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ synbioParts (c) University of Manchester 2019 synbioParts is licensed under the MIT License. To view a copy of this license, visit <http://opensource.org/licenses/MIT/>. Created on Fri May 31 13:38:19 2019 @author: <NAME>, SYNBIOCHEM @description: Routines to inte...
import os os.system('pip install -q efficientnet --quiet') os.system('pip install -q image-classifiers --quiet') from classification_models.tfkeras import Classifiers import tensorflow as tf from tensorflow.keras import layers,models from efficientnet.tfkeras import EfficientNetB0, EfficientNetB3, EfficientNetB5 from...
import collections import re import string import ujson from pathlib import Path import numpy as np import pandas as pd from nltk.stem import PorterStemmer import spacy from sklearn.base import BaseEstimator, TransformerMixin from sklearn.pipeline import Pipeline import torch from transformers import BertTokenizer, Ber...
import csv import numpy as np import aljpy from . import simulator, common, arrdict import scipy as sp import scipy.special from pkg_resources import resource_filename from datetime import date # TODO: verify if this can be changed. N_AGES = 101 D_END = date(2020, 5, 20) # stop # If lockdown, by how much do divide c...
''' Projeto final: Uso de Segmentação de Imagens para Identificação de Bifurcações em Vasos Sanguíneos em Imagens de Retina Alunos: <NAME> (10734706) -SCC0251- BCC 2018 (4º ano/7º semestre) <NAME> (10374344) -SCC0251- BCC 2018 (4º ano/7º semestre) ''' import imageio import numpy as np from scipy.ndimage.filters...
__copyright__ = "Copyright (C) 2019 <NAME>" __license__ = """ 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, modif...
import rospy import smach import random import tf from tf import transformations as tft import numpy as np import scipy.misc from scipy import ndimage from std_msgs.msg import Int32 from sensor_msgs.msg import PointCloud2 from geometry_msgs.msg import Pose from apc_msgs.srv import DetectGraspCandidates from apc_msgs...
import numpy as np import matplotlib as mpl from matplotlib import pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 from matplotlib.colors import ListedColormap from basic_units import radians from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes from mpl_toolkits.axes_grid1.inset_locator import ...
# coding: utf-8 import requests import re from bs4 import BeautifulSoup from src.Chapters import * class Novel: def __init__(self, codeNovel, titreNovel, keep_text_format=False): self.code = codeNovel self.titre = titreNovel self.keep_text_format = keep_text_format ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Train the siamese network for product description similarity Application : product description similarity Architecture : Embeddings Pre-Trained Loss : Quadruplet loss Created on Thu Jun 10 2021 @author: jeremylhour, milena-git """ import os from datetime import datet...
import os import random import sys import time import imageio import numpy as np import skimage import torch import torchvision from torch import optim from torch import nn from torchvision import datasets, transforms import matplotlib.pyplot as plt from distributions import RatNormal from cspn import CSPN, CspnConfi...
# -*- coding: utf-8 -*- """ @author: <NAME> <<EMAIL>> """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import math, copy, time from torch.autograd import Variable from torch.nn import CrossEntropyLoss def clones(module, N): "Produce N identical layers." return nn.Modu...
"""Username Scanner - Based on https://github.com/sherlock-project.""" import json from configparser import ConfigParser from typing import Dict, List, Optional, Tuple, Union from time import monotonic import logging import re import requests from urllib3.exceptions import InsecureRequestWarning from requests_futures...
from __future__ import annotations import re from typing import Callable, Dict, List from .logger import LOG from .codegen import CodeGenerator, NodeCodeGenerator, PredicateCodeGenerator from .datatype import ActorMarker, AnyType, BoolType, Type, Argument, infer_type from .indent import indent from .nodes import * f...
#!/usr/bin/env python3 # coding: utf-8 import argparse import os import sys import math import matplotlib.pyplot as plt import matplotlib.patches as patches import numba import numpy as np import torch from collections import OrderedDict from torchvision import transforms import feature_generator_pb as fgpb from BCN...
# _ __ _ ___ _ ___ _ _ # | |/ /_ _ __ _| |_ ___ __/ __| __ _| |___ _ __ ___| _ \ |_ _ __ _(_)_ _ # | ' <| '_/ _` | _/ _ (_-<__ \/ _` | / _ \ ' \/ -_) _/ | || / _` | | ' \ # |_|\_\_| \__,_|\__\___/__/___/\__,_|_\___/_|_|_\___|_| |_|\_,_\__, |_|_||_| # ...
import docker import os import subprocess from tkinter import * from tkinter.filedialog import askopenfile from tkinter.filedialog import askdirectory from tkinter.colorchooser import askcolor root = Tk() root.title("Brainpainter") # icon = os.path.abspath(os.getcwd()) + "/cort.png" # app logo # icon_tk = PhotoImage(f...
""" Tools for building differentially private models. Thanks to https://github.com/cybertronai/autograd-hacks for demonstrating gradient hacks. A, activations: inputs into current module B, backprops: backprop values (aka Jacobian-vector product) observed at current module """ import copy from functools import partia...
"""Contains Tabular Transformer Model definition.""" from itertools import cycle import torch import torch.nn as nn from npt.model.image_patcher import LinearImagePatcher from npt.model.npt_modules import MHSA from npt.utils.config_utils import Args from npt.utils.encode_utils import torch_cast_to_dtype IMAGE_PATCHE...
#!/usr/bin/env python3 # -*-encoding: utf-8-*- # created: 28.11.2019 # by <NAME> # 3 course, comp math # Taras Shevchenko National University of Kyiv # email: <EMAIL> """ TODO: 0. Implement all the commands of interaction with user's socket 1. Implement client. Complete the protocol of data transferring. ...
import logging import voluptuous as vol import json from datetime import timedelta import time from homeassistant.components import sensor from custom_components.smartthinq import ( DOMAIN, LGE_DEVICES, LGEDevice) import homeassistant.helpers.config_validation as cv from homeassistant.const import ( ATTR_ENTITY_I...
import collections import re import warnings from numbers import Integral import numpy as np from random import randint from functools import partial try: from mmgroup import mat24 from mmgroup.mat24 import ploop_theta, pow_ploop, MAT24_ORDER except: w = "Extension mmgroup.mat24 not found, package not func...
import re as regex import pandas as pd from owlready2 import * from quantulum3 import parser from fuzzywuzzy import fuzz from fuzzywuzzy import process import os # variables dont_parse_specs = ['name', 'Name', 'NAME', 'description', 'Description', 'DESCRIPTION'] cc_sim_thr = 91 pp_sim_thr = 96 cc_output_columns = ['Re...
"""Classes for a Client that understands JSON home pages.""" import base64 import collections import http import json import re import socket import ssl import urllib.error import urllib.parse import urllib.request from typing import Any, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Union, cast import pk...
# buildlogparse.py: Proxy and rendering layer for build.chromium.org. # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import jinja2 import json import logging import os import re import time import url...
# coding=utf-8 # Copyright 2018 Google LLC & <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 o...
from sympy import symbols, diff, integrate, Matrix, cos, sin, simplify, Interval, exp, sqrt, log, pi, series, limit, E, acos, asin, tan, atan from sympy.plotting import plot, plot3d #from mpl_toolkits import Axes3D #the common operation of R and all the polinomial and non linear function are those of sympy #the operati...
'''Copyright (C) 2019 AS <<EMAIL>>''' # https://github.com/swook/GazeML ''' Below part of code add to GazeML/src/core/model.py inference_generator to export the GazeML frozen graph: print('fetches:', fetches) # to get output tensors' name sess = self._tensorflow_session from tensorflow.python.framework i...
# -*- coding: utf-8 -*- import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State import dash_table import plotly.graph_objs as go import pandas as pd import numpy as np import urllib import requests import zstandard as zstd import orjson impor...
# from pyoptsparse import History # !!! inlcude optional history file of optimizations? import numpy as np import pickle import pandas as pd import time from ..utils.convenience_utils import write_timing_info from .cycle_optimizer import OptimizerCycle from ..wind_profile_clustering.read_requested_data import get_wi...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import struct # This script is based on modified version of binwalk extraction script # https://github.com/ReFirmLabs/binwalk/blob/ff34b1219e9b34bcd47251f63ba99e12d01bfc74/src/binwalk/plugins/dlromfsextract.py import time import subprocess import tempfile from dlink_...
from collections import Counter from functools import wraps import math import warnings import weakref import torch from torch.optim.optimizer import Optimizer from mcquic.utils import LrSchedulerRegistry @LrSchedulerRegistry.register class MultiStepLRWithWarmUp(torch.optim.lr_scheduler._LRScheduler): """Decay...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import models.module_cnflow_utils as utils from math import log, pi class Conv2d(nn.Conv2d): pad_dict = { "same": lambda kernel, stride: [((k - 1) * s + 1) // 2 for k, s in zip(kernel, stride)], "valid": lambda k...
''' Created on Apr 15, 2015 Description: This will help to plot SV using Genome Diagram from bio python @author: <NAME> ''' from Bio.SeqFeature import SeqFeature, FeatureLocation from Bio.Graphics import GenomeDiagram from reportlab.lib.colors import red, grey, orange, green, brown, blue, lightblue, purple import sys i...
""" This file implements a DQNAgent. """ import collections import pickle from functools import partial from typing import Tuple, List from os.path import join as join_path import numpy as onp import haiku as hk import jax import optax import jax.numpy as jnp import rlax import chex from .experience_buffer import Ex...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Module that contains generic color functionality """ from __future__ import print_function, division, absolute_import import math import colorsys def clamp(number, min_value=0.0, max_value=1.0): """ Clamps a number between two values :param number: num...
# Graphical interface for signal visualization and interaction with ELEMYO sensors # 2020-06-15 by ELEMYO (https://github.com/ELEMYO/ELEMYO GUI) # # Changelog: # 2021-03-23 - added data recording to a file, changed the scale of the plot # 2020-06-15 - initial release # Code is placed under the MIT license # C...
#importing required modules import csv, os, datetime, time #Function for clearing screen... def clr_scr(): if os.name == 'posix': _ = os.system('clear') else: _ = os.system('cls') #################INSTALLING PAKAGES#################### os.system("pip install prettytable") os.system ("pip install...
# Packages are imported. import pandas as pd import requests as req import numpy as np import datetime as dt import time import multiprocessing as mp import os import random import sys import matplotlib.pyplot as plt import seaborn as sns from scipy import stats import statsmodels.stats.multitest as statsmodels import ...
import pytest import actions.utils import actions.trigger import layers.packet import layers.layer import layers.tcp_layer import layers.dns_layer import layers.dnsqr_layer import layers.udp_layer import layers.ip_layer import evolve from scapy.all import IP, TCP, UDP, DNS, DNSQR, Raw, DNSRR def test_parse_layers()...
# -*- coding: utf-8 -*- from __future__ import division import numpy as N import logging from scipy.sparse import bsr_matrix from scipy.linalg import lu from scipy.sparse.linalg import svds from scipy.integrate import quad from itertools import chain from ..coordinates import centered from .base import BaseOrientation,...
import os import sys import operator import numpy as np import pandas as pd from shutil import copyfile import torch import torch.nn as nn from torch.autograd import Variable from torch.nn.modules.loss import _Loss from itertools import combinations from pymongo.errors import CursorNotFound from pymongo import Mong...
# -*- coding: utf-8 -*- """ :Author: <NAME> """ import numpy as np import copy import re import collections from model.decision.discrete import weightProb import utils class Stimulus(object): """ Stimulus processor class. This acts as an interface between an observation and . Does nothing....
""" Commands definition for DANDI command line interface """ import datetime import os import os.path as op import sys import time import click from click_didyoumean import DYMGroup import logging from .. import get_logger, set_logger_level from collections import OrderedDict from .. import __version__ # Delay im...
import cv2 import numpy as np from queue import Queue #脊波变换-->用于图像增强 #def ridgelet_transform(img): #截取矩形兴趣域 def get_ROI(img): #去除部分无关区域 img=img[30:226,50:380] # cv2.imshow('quchu',img) #提取边缘 bimg1=cv2.Canny(img,20,240) # cv2.imshow('canny提取边缘', bimg1) h,w=bimg1.shape y1=0 y2=0 fo...
#!/usr/bin/env python import numpy as np import logging import modest.solvers as solvers import modest.timing as timing from modest.tikhonov import Perturb from modest.tikhonov import tikhonov_matrix from modest.timing import funtime import scipy.sparse logger = logging.getLogger(__name__) ##-------------------------...
""" =============================================================================== Created on Feb 15, 2020 @author: <NAME> This code is written in Python 3.7.4 , Spyder 3.3.6 =============================================================================== """ #=====================================...
import rasterio import pyproj import matplotlib.pyplot as plt import mpl_toolkits.mplot3d as Axes3D from shapely.ops import transform from shapely.geometry import shape, LineString, Polygon, MultiPolygon from shapely.strtree import STRtree from shapely.wkb import dumps from pathplan.utils import read_init_path, dista...
"""Class for monitoring a COM port using pyserial on a separate thread so that that the main UI thread is not blocked or slowed. Code adapted from https://github.com/mba7/SerialPort-RealTime-Data-Plotter/blob/master/com_monitor.py """ import threading, serial try: from Queue import Empty except ImportError: # pragm...
""" Functions for calculating mean orbital parameters from a given list of orbits. Functions courtesy of <NAME> and <NAME>. """ from __future__ import print_function, division, absolute_import import numpy as np # Predefined standard epochs JDE_B1900 = 2415020.3135 JDE_B1950 = 2433282.4235 JDE_J2000 = 245154...
# -*- coding: utf-8 -*- """ Created on Fri Dec 7 18:02:07 2018 @author: ron Imaging Module: containts the camera and imaging system classes that handle the transformation from camera space coordinates to lab coordinates. For the 3D-model we use a pin-hole camera model. Each camera has an imaging center (O) ...
from __future__ import unicode_literals import argparse from codecs import open as codecs_open from functools import lru_cache # codecs_open = open from os.path import isabs import sys from typing import Dict, Type, Union, Tuple, List, Optional from urllib.parse import urlsplit, SplitResult from .base import BaseTLDS...
#!/usr/bin/env python # # Copyright (c) 2015 <NAME> pavel.lazar (at) gmail.com # # The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. ##################################################################### import json import capabilities import re from collections import OrderedDict from configuration_b...
from __future__ import print_function, absolute_import, division from warnings import warn from six import iteritems, string_types from numpy import bool_, float_ from sympy import Basic, sympify, Symbol import cobrame _REQUIRED_REACTION_ATTRIBUTES = {"id", "name", "metabolites", "lower_bound", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013-2014 DNAnexus, Inc. # # This file is part of dx-toolkit (DNAnexus platform client libraries). # # 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 c...
#!/usr/bin/env python3 # Copyright (c) 2017-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoin-cli""" from decimal import Decimal import re from test_framework.blocktools import COINB...
"""QR decomposition functions.""" import numpy # Local imports from .lapack import get_lapack_funcs from .misc import _datacopied __all__ = ['qr', 'qr_multiply', 'rq'] def safecall(f, name, *args, **kwargs): """Call a LAPACK routine, determining lwork automatically and handling error return values""" lw...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import contextlib import itertools import os import platform import re import shutil import tempfile from typing import Li...
""" (Adversarially) Train multi-exit architectures """ import os, json, sys import argparse import platform from datetime import datetime # torch libs import torch # custom libs import datasets, models, utils from scenarios import scenario_1_split, scenario_2_split """ Training functions (for CNNs and SDNs...
""" Copyright (c) 2020, Oracle Corporation and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. """ import java.lang.Boolean as Boolean import java.lang.Exception as JException import java.util.logging.Level as Level from wlsdeploy.logging.plat...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn def get_coord_maps(size=128): xx_ones = torch.ones([1, size], dtype=torch.int32) xx_ones = xx_ones.unsqueeze(-1) xx_range = torch.arange(size, dtype=torch.int32)...
# python 2 # encoding: utf-8 import os import sys import subprocess from datetime import datetime from workflow import Workflow, MATCH_SUBSTRING from workflow.background import run_in_background import mullvad_actions import helpers GITHUB_SLUG = 'atticusmatticus/alfred-mullvad' ############################# #####...
""" Certbot Integration Test Tool - Configures (canned) boulder server - Launches EC2 instances with a given list of AMIs for different distros - Copies certbot repo and puts it on the instances - Runs certbot tests (bash scripts) on all of these - Logs execution and success/fail for debugging Notes: - Some AWS ima...
from icolos.core.containers.generic import GenericContainer, GenericData import json import pandas as pd from rdkit import Chem from icolos.loggers.base_logger import BaseLogger from icolos.utils.enums.input_enums import InputEnum from icolos.utils.enums.logging_enums import LoggingConfigEnum from icolos.utils.enums.w...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os import time import inspect from dockerfile_parse import DockerfileParser from...
#################################################################################################### ## IMPORTS ## # Numpy first! (required to force an Intel OpenMP threading layer) import numpy as np # Matplotlib second, to be compatible with headless setups import matplotlib matplotlib.use('Agg') import matplotlib...
import json import os import torch import random import torchvision.transforms.functional as FT import pandas as pd import argparse import numpy as np device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # Label map visdrone_labels = ('people', 'vehicle') label_map = {k: v + 1 for v, k in enumerate(v...