text
stringlengths
3.07k
22.1k
import re, errno, subprocess, os from twisted.trial import unittest from .. import ipaddrs DOTTED_QUAD_RE=re.compile("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$") MOCK_IPADDR_OUTPUT = """\ 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN \n\ link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet...
# Copyright 2018 Adobe. All rights reserved. """ Takes in a TrueType font and looks for a UFO font stored in the same folder. Uses the UFO's components data to componentize matching TrueType glyphs. The script only supports components that are not scaled, rotated nor flipped. """ import argparse import os import sys ...
""" Module to contain Base Host functionality """ import calendar import re import sys __author__ = '<NAME>' import logging log = logging.getLogger(__name__) # stdlib import time import os import socket import platform import subprocess import ipaddress from pathlib import Path # PyPi from retry import retry import...
from dataclasses import dataclass from datetime import datetime from dataclass_csv import accept_whitespaces from sqlalchemy import Column, Float, ForeignKey, Integer, String from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import relationship import vigorish.database as db from vigorish.util.dt_...
# WZN: Note here we unify all LIDAR points to camera frame!!! import numpy as np import yaml from fast_rcnn.config import cfg from rpn_msr.anchor_target_layer_voxel_tf import clip_anchors_voxel from fast_rcnn.nms_wrapper import nms from utils.transform import lidar_cnr_to_img from utils.util_voxels import bbox...
# Libs import machine import utime # Local libs from ssd1306 import Segment from ssd1306 import SSD1306_I2C import consts as const # import uasyncio as asyncio class Screen_Handler: def __init__(self): # Constants print("Init screen Screen_Handler") self.screen_columns = 16 self....
import subprocess import jpype import pandas as pd import pytest from numpy import testing as npt import ixmp from ixmp.testing import make_dantzig test_args = ('<NAME>', 'Hitchhiker') can_args = ('canning problem', 'standard') launch_log_msg = "launching ixmp.Platform using config file at '{}'" def test_default_...
import json import logging import os import shutil import socket import tempfile from autouri import AbsPath, AutoURI from .cromwell_metadata import CromwellMetadata from .cromwell_workflow_monitor import CromwellWorkflowMonitor from .nb_subproc_thread import NBSubprocThread, is_fileobj_open logger = logging.getLogg...
import argparse import torch import codecs import os import math from torch.autograd import Variable from itertools import count import itertools import onmt.ModelConstructor import onmt.translate.Beam import onmt.io import onmt.opts import onmt.modules.Ensemble from onmt.io.E2EDataset import SimpleAudioShardIterator...
##-- This module is to handle all the print screens for the menus --## from Map_Gen import Biome from script import Items ##-- All Imports --## import os import sys import textwrap import time from colorama import Back, Fore, Style, init ##-- Font Colors --## init(convert=True) white = Fore.WHITE red = Fore.RED g...
#!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import sys, os import sqlite3 # For compressed input files import gzip import re CLINVAR_TABLE_DEFS = [ """ CREATE TABLE IF NOT EXISTS gene ( gene_id INTEGER NOT NULL, gene_symbol VARCHAR(64) NOT NULL, HGNC_ID VARCHAR(64) NOT NULL, PRIMARY KEY (gene_symbol) ) ""...
from __future__ import annotations import logging from generic.event import Event from gi.repository import Gtk from gaphor.abc import ActionProvider from gaphor.core import action, event_handler from gaphor.core.modeling import AttributeUpdated, Diagram, ModelFlushed, ModelReady from gaphor.event import ActionEnabl...
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 noet: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the duecredit package for the # copyright and license terms. Originate...
import numpy as np import math from sklearn.preprocessing import LabelEncoder from anndata import AnnData from typing import Optional from time import time from FlowGrid._functions import * def calinski_harabasz_score(X, labels): """Compute the Calinski and Harabasz score. It is also known as the Var...
"""CheckingProxy derived from jsonrpc.proxy due to subclassing problems w/getattr. Converts service errors into ServiceError exceptions, otherwise call returns the jsonrpc "result" field. """ import sys import uuid import json import time import os from urllib import request import html # import crds from crds.cor...
# coding=utf-8 # Copyright (C) 2020 NumS 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...
import smart_imports smart_imports.all() class Mob(object): __slots__ = ('record_id', 'level', 'abilities', 'initiative', 'health_cooficient', 'damage_modifier', 'max_health', 'health', ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** from enum import Enum __all__ = [ 'AlertDetail', 'AlertRuleKind', 'AlertSeverity', 'AttackTactic', 'ConnectivityType', 'Conten...
# coding=utf-8 # Copyright 2019 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import time import os import json from importlib import import_module import pymongo as pm import numpy as np from six.moves import xrange import tensorflow as tf from curiosity.utils import ...
import superimport import numpy as np import matplotlib.pyplot as plt from scipy.stats import multivariate_normal from jax import vmap class BinaryFA: def __init__(self, input_dim, latent, max_iter, conv_tol=1e-4, compute_ll=True): self.W = 0.1 * np.random.randn(latent, input_dim) # 2x16 self.b = 0.01 * n...
""" This module handles the user interactions in the maze program. The module expects the modules 'fileIO' and 'solver' (from own package) It implements several functions to display information and get information from the terminal. Most output is normed to a width of 80 characters. """ import os from . import fileIO...
from functools import partial import tensorflow as tf import tensorflow.contrib.layers as layers import tensorflow.contrib.rnn as rnn from utils.model_utils import get_initializer, extract_axis_1 class NGramModel(object): def __init__(self, data, oracle): self.data = data if oracle: ...
from django.http import JsonResponse, HttpResponse, HttpResponseBadRequest, HttpResponseForbidden, Http404 from django.utils.crypto import get_random_string from django.contrib.auth.decorators import login_required from django.dispatch import Signal from django.dispatch import receiver from core.signals import sig...
import matplotlib.pyplot as plt import cv2 import numpy as np import copy def contrast_stretching(one_channel_image): flat = np.ndarray.flatten(one_channel_image) min_i = np.min(flat) max_i = np.max(flat) min_0 = 0 max_0 = 255 flat = (flat-min_i) * ((max_0 - min_0) / (max_i - min_i) + min_0)...
# -*- coding: utf-8 -*- # This code is part of the nevergrad package (https://github.com/facebookresearch/nevergrad) # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # # (C) Copyright 2020 Enthought, Inc., Austin, TX # All rights reserved. # # This work is implemented under the Formulations and C...
import numpy as np from scipy.ndimage import label import torch from torch.nn import functional as F from torch.nn import ReLU def create_gbackprop(model, device, target_class, dataloader=None, id_series=None, array_series=None, clip = 0): """ Create class activation map either by providing a series id and lo...
import mock from chroma_agent.action_plugins.manage_pacemaker import configure_fencing, set_node_standby, set_node_online from chroma_agent.action_plugins import manage_corosync from chroma_agent.lib.pacemaker import PacemakerNode from iml_common.test.command_capture_testcase import CommandCaptureTestCase, CommandCapt...
#!/usr/bin/python3 # python3 train.py -i /home/jtan/gpu/jtan/data/pivot_Mbc_train.h5 -test /home/jtan/gpu/jtan/data/pivot_Mbc_test.h5 -n penalty_alt -lambda 10 -MI -JSD import tensorflow as tf import numpy as np import pandas as pd import time, os, sys import argparse # User-defined from network import Network from ut...
## # Copyright (c) 2006-2016 Apple Inc. 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 l...
import warnings import numpy as np from numba import jit """ This code is from scipy project with following license: SciPy license Copyright © 2001, 2002 Enthought, Inc. All rights reserved. Copyright © 2003-2019 SciPy Developers. All rights reserved. Redistribution and use in source and binary forms, with or wi...
import sys from PySide2.QtCore import SIGNAL, Slot from PySide2.QtGui import QIcon from PySide2.QtWidgets import QWidget, QTextEdit, QStatusBar, QGridLayout, QShortcut, QAction, QMainWindow, QLabel from PySide2.QtWidgets import QApplication, QPushButton, QLineEdit, QMessageBox, QToolButton, QToolBar, QCompleter f...
""" Copyright (c) 2018 <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 without limitation the rights to use, copy, modify, merge, publish, distribut...
# ----------------------------------------------------------------- # Project: MNIST Hand-Written Digit Classifier # Description: Classifies hand-written digits from the MNIST dataset with ~86% accuracy # Author: <NAME> - <EMAIL> # Dependencies: mnist, numpy, matplotlib # License: None # -------------------------------...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import Http404, HttpResponse, HttpResponseRedirect from django.urls import reverse from django.views.decorators.csrf import csrf_exempt from django.shortcuts import get_object_or_404, render, redirect from dashboard.models import Order, No...
import util from operator import add, mul, gt, lt, eq hex_binary = { '0' :'0000', '1' : '0001', '2' : '0010', '3' : '0011', '4' : '0100', '5' : '0101', '6' : '0110', '7' : '0111', '8' : '1000', '9' : '1001', 'A' : '1010', 'B' : '1011', 'C' : '1100', 'D' : '1101', 'E' : '1110', 'F' : '1111', } def get_packet_version(...
# Copyright 2017 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from .box_head.box_head import build_roi_box_head from .mask_head.mask_head import build_roi_mask_head from .keypoint_head.keypoint_head import build_roi_keypoint_head from .depth_head.depth_head import build_roi_depth_head from .box3...
from abc import abstractmethod import functools import posixpath import socket import threading import zookeeper try: from twitter.common import log except ImportError: import logging as log from twitter.common.concurrent import Future from twitter.common.exceptions import ExceptionalThread from twitter.common.la...
"""emoDB dataset.""" import collections import os import numpy as np import tensorflow as tf import tensorflow_datasets.public_api as tfds # Markdown description that will appear on the catalog page. _DESCRIPTION = """ Berlin Database of Emotional Speech. It contains about 500 utterances spoken by actors in a happy...
# Copyright 2020 The SQLFlow 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 applicable law o...
""" @author: <NAME> """ from __future__ import print_function from abc import abstractmethod from collections import OrderedDict from copy import deepcopy import numpy as np import six from numpy.random import randint, rand from pyDOE import lhs # TODO: fix bugs in bounds when calling __mul__ # TODO: implementa sam...
import os import gym import pylab import time import itertools import numpy as np from statistics import mean from tensorflow.keras.optimizers import Adam from tensorflow.keras.models import Sequential, load_model, Model from tensorflow.keras.layers import Dense, Input, Flatten, MaxPooling2D, Conv2D, Dropout from ker...
import torch import torch.nn as nn import numpy as np import gym from torch.utils.tensorboard import SummaryWriter import copy class Dueling_Net(nn.Module): def __init__(self, state_dim, action_dim, hidden_width): super(Dueling_Net, self).__init__() self.l1 = nn.Linear(state_dim, hidden...
import configparser import datetime import os import time from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait def getWebDriver(broswer_...
from vergeml import ModelPlugin, model, train, predict, option, VergeMLError from vergeml.display import DISPLAY import numpy as np import os import os.path import random import csv _TEMPLATE = """\ model: imagenet # Uncomment for better ml list output: # list: # columns: # - model # - status # - num-samples...
# Copyright (c) 2019, Xilinx, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law ...
import copy import igraph import cairo import numpy as np from collections import OrderedDict from igraph import Layout from igraph.drawing.colors import color_to_html_format from igraph.drawing.text import TextDrawer from psychsim.agent import Agent from psychsim.probability import Distribution from psychsim.pwl impor...
#Copyright 2021, XinruiZhan from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torchvision.transforms as transforms from hdn.datasets.custom_transforms import Normalize, ToTensor import orjson as json import loggi...
# Author: <NAME>, <EMAIL> # Sep 8, 2018 # Copyright 2018 <NAME> import numpy as np from matplotlib import pyplot as plt from scipy.spatial import distance as dist from scipy.optimize import linear_sum_assignment import scipy.io import pickle import collections import itertools from networkx.algorithms.bipartite...
import os import numpy as np import copy import motmetrics as mm mm.lap.default_solver = 'lap' import argparse from read import read_results, unzip_objs class Evaluator(object): def __init__(self, data_root, seq_name, data_type): self.data_root = data_root self.seq_name = seq_name self.d...
import logging import threading from contextlib import closing, contextmanager from datetime import datetime from io import BytesIO import dropbox import six from dropbox import Dropbox from dropbox.exceptions import ApiError from dropbox.files import (DownloadError, FileMetadata, FolderMetadata, ...
#-*- coding:utf-8 -*- import tensorflow as tf import math class batch_norm(object): def __init__(self, epsilon=1e-5, momentum = 0.9, name="batch_norm"): with tf.variable_scope(name): self.epsilon = epsilon self.momentum = momentum self.name = name def __call__(self,x...
# Copyright 2021 Sony Corporation. # # 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...
from datetime import date import matplotlib.pyplot as plt import networkx as nx import numpy as np import os import pandas as pd from path_plots import dmdb_plots as dp import re import shutil from yaml import safe_load def generate_md_header(output, title, permalink, datatable=False): output.write("---\n") o...
''' Train Train your nerual network Author: <NAME> To fix missing .jpeg files, see utils/ ''' from __future__ import print_function import argparse import fnmatch import json import os import pickle import random from datetime import datetime from time import strftime import numpy as np from PIL import Image from tens...
"""Define your models in this module. Models are standard Python classes which inherits from :class:`django.db.models.Model`. A model represents a SQL table. Documentation can be found at . """ from heapq import heappop, heappush import os import uuid from django.conf import settings from django.contrib.auth.models ...
#!/usr/bin/env python import pymysql, string, sys, random, binascii, os, configparser from flask import Flask, abort, flash, g, jsonify, render_template, redirect, url_for, session, request from flask_seasurf import SeaSurf from flask_mail import Mail, Message from functools import wraps from passlib.hash import bcr...
''' Runs unit tests of functions associated with the ENVI file format. To run the unit tests, type the following from the system command line: # python -m spectral.tests.envi ''' from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from numpy.testing import asser...
import cv2 import csv import PySimpleGUI as sg import datetime import sys import numpy as np #TODO Move this to a config file # Frames not moving before fly is considered asleep, change if environment of camera is noisy TIMEOUT = 300 # Frequency of progress updates in frames FRAMES_TO_OUTPUT_PROGRESS = 600 def Parti...
import json, os from kivy.lang import Builder from kivy import properties as p from kivy.utils import get_hex_from_color, get_color_from_hex from kivy.uix.behaviors import ButtonBehavior from kivymd.uix.picker import BaseDialogPicker from kivymd.uix.boxlayout import MDBoxLayout from kivymd.uix.behaviors import ( ...
import os import re import urllib import uuid from datetime import datetime from cgi import FieldStorage from ofs import get_impl from pylons import request, response from pylons.controllers.util import abort, redirect_to from pylons import config from paste.fileapp import FileApp from paste.deploy.converters import a...
import random import re import sys import unittest from typing import * import z3 # type: ignore from crosshair.libimpl.builtinslib import SeqBasedSymbolicStr from crosshair.libimpl.builtinslib import LazyIntSymbolicStr from crosshair.libimpl.relib import _match_pattern from crosshair.libimpl.relib import ReUnhandle...
from __future__ import annotations from functools import partial from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Tuple, Type from hique.base import FieldExpr, Model from hique.builder import QueryBuilder from hique.expr import CallExpr, Expr from hique.query import BaseSelectQuery, DeleteQuery,...
from client import client from collections import Counter from modules import __common__ from typing import List, Dict, Union import asyncio import datetime import discord import log import os import re # wish me luck import time try: from matplotlib import pyplot as plot except ImportError: use_mpl = False else: ...
"""Unit tests for the robot module.""" import pytest from .robot import Robot, Dir, Location from .api import robotapi_pb2 from .blocktypes import BlockType class MockContextHandler(object): """A mock for the context handler, simply returns pre-prepared responses straight away.""" def __init__(self): ...
import json from typing import ForwardRef from ..cmd import Cmd, LongOpt, Opt, Subcommand __all__ = ['RabbitmqCtl', 'RabbitmqAdmin'] class ListUsers(Subcommand): def __init__(self, ctl): super(ListUsers, self).__init__('list_users', ctl) class ChangePassword(Subcommand): __slots__ = ['_user_nam...
#!/usr/bin/env python """ Translator Class and builder """ from __future__ import print_function import codecs import os import math import torch from itertools import count from tensorboardX import SummaryWriter from abstractive.beam import GNMTGlobalScorer from abstractive.cal_rouge import test_rouge, rouge_resul...
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import unittest from make_chainparams import main as GenerateChainParams class MockRPC: def __init__(self, t...
import os, re, sys from cupcake.io import GFF from Bio import SeqIO from collections import defaultdict from bx.intervals.cluster import ClusterTree from Cogent import BioReaders """ # BLASTN 2.6.0+ # Query: Domino_testis_i0_HQ_sampled07afe|c338324/f2p10/426 # Database: /pbi/dept/secondary/siv/gconcepcion/db/ncbi/nt #...
''' Deep Deterministic Policy Gradient (DDPG) method is from the Actor-Critic family but it is slightly different in the way it uses Critic network. In A2C the critic is used to get a baseline for our discounted rewards, while in DDPG it returns Q(s,a) value which represents the total discounted rewards of action "a" ...
#!/usr/bin/env python from scipy.io import netcdf import matplotlib.pyplot as plt import numpy as np import os import argparse def get_data(file,vars=[]): try: f=netcdf.netcdf_file(file,'r') except IOError: print('Error: Cannot open file'+file) return 0 if vars == []: vars=f.varia...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import logging from PyQt5.QtCore import QThread from PyQt5.QtCore import QUrl from PyQt5.QtCore import pyqtSignal from PyQt5.QtGui import QDesktopServices from PyQt5.QtGui import QFont from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QFrame from PyQt5...
import numpy as np from matplotlib import pyplot as plt import matplotlib #numpy计算复利 # periodic_payment = -np.pmt(rate=0.056/12, nper=300, pv=35 *10000) # print("每月的按揭还款额: " + str(round(periodic_payment, 2))) # 参考: [[Python]等额本息房贷计算器 - Fia - 博客园](https://www.cnblogs.com/FiaFia/p/8580414.html) # [等额本息法_百度百科](htt...
import copy import json import logging import random import time from argparse import ArgumentParser from itertools import chain from pprint import pformat import numpy as np import torch import torch.nn.functional as F from transformers import * from dataset import (SPECIAL_TOKENS, SPECIAL_TOKENS_DICT, ...
# -*- coding: utf-8 -*- """ Created on Thu Mar 18 13:20:25 2021 @author: <NAME> """ import math import numpy as np import evaporation as ev import weathering_utils as wu def interp(val, array_value, array_ref): """ Interpolate the array_value from the array_ref with val. The array_ref must...
from model import SampleRNN, Predictor, Generator import torch import re import sys import numpy as np import argparse from librosa.output import write_wav import os from interpolate import interpolation import random default_params = { # model parameters 'n_rnn': 1, 'dim': 1024, 'learn_h0': True, ...
# %% [markdown] # ## import os import time import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy import seaborn as sns from graspy.match import GraphMatch from graspy.plot import heatmap from graspy.simulations import sbm from src.data import load_metagraph from src.graph import pre...
import unittest import numpy as np import logging from lib.buffer_utils import BufferUtils log = logging.getLogger('firemix.lib.command') class Command: """ Base class for all commands """ def __init__(self): self._color = (0, 0, 0) self._priority = 0 self._strand = -1 ...
# -*- coding: utf-8 -*- """ Helper classes. """ """ Pynu - Python Node Utilities Copyright (c) 2014 <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 li...
#!/usr/bin/env python import os import sys import unittest from setuptools import Command, find_packages, setup from setuptools.command import egg_info from distutils import log from fnmatch import fnmatch fp = open("README.rst") try: LONG_DESCRIPTION = fp.read() finally: fp.close() fp = open("doc/changelo...
from django.shortcuts import render from django.http import HttpResponse from django.http import JsonResponse from django.core.files.storage import FileSystemStorage from django.conf import settings from .models import Files from django.core import serializers import json import pandas as pd import os from django.core....
""" Copyright 2017-present, Airbnb 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, sof...
import socket import random as ran import string import selectors import json from os import read, system selector=selectors.DefaultSelector() BUFFER=65000 #Las funciones leeralgo leen en un archivo de texto las categorias y con quitar salto de linea les quitamos los \n para meterlas a una lista def quitarsaltodelinea(...
""" The oet.procedure.domain module holds domain entities from the script execution domain. Entities in this domain are things like scripts, OS processes, process supervisors, signal handlers, etc. """ import dataclasses import enum import importlib.machinery import logging import multiprocessing import signal import t...
import contextlib import errno import resource import time import ws.auth import ws.cgi import ws.http.parser import ws.http.structs import ws.http.utils import ws.ratelimit import ws.serve import ws.sockets from ws.config import config from ws.err import * from ws.http.utils import request_is_persistent, response_is_...
import inspect import numpy as np import pytest from ansys.mapdl.core import examples from ansys.mapdl.core.commands import ( CMD_BC_LISTING, CMD_LISTING, BoundaryConditionsListingOutput, CommandListingOutput, CommandOutput, Commands, ) try: import pandas as pd HAS_PANDAS = True exc...
""" Code to apply non-linearity correction. """ from __future__ import print_function import copy import numpy as np import scipy.optimize from scipy.interpolate import UnivariateSpline import astropy.io.fits as fits from lsst.eotest.fitsTools import fitsTableFactory, fitsWriteto def lin_func(pars, xvals): "...
# -*- coding: utf-8 -*- import requests from datetime import date from exam.decorators import fixture from mangopay import APIRequest from mangopay.utils import Address, ReportTransactionsFilters from . import settings from .mocks import RegisteredMocks from .resources import (NaturalUser, LegalUser, Wallet, ...
from src import utils from src.dataset import ImageData from src.model import EfficientNetClassifier from evaluate import evaluate import pandas as pd import torch from torch.optim import SGD from torch.optim.lr_scheduler import StepLR from torch.nn import functional as F from sklearn.model_selection import train_test_...
from __future__ import unicode_literals import frappe from frappe.utils import flt, comma_or, nowdate, getdate from frappe import _ from frappe.model.document import Document def validate_status(status, options): if status not in options: frappe.throw(_("Status must be one of {0}").format(comma_or(options))) # st...
import gym from collections import deque from copy import deepcopy from tqdm import tqdm import os import gym import shutil import numpy as np import matplotlib.pyplot as plt from agent import Agent class EnvManager: def __init__(self, env_class, agent_class): self.environment = env_class() self.a...
"""Class :py:class:`FSTree` is a QWTree for filesystem tree presentation ======================================================================== Usage :: # Test: python lcls2/psana/psana/graphqt/FSTree.py # Import from psana.graphqt.FSTree import ... # See test at the EOF See: - :class:`CMWMain`...
#-*- coding: utf-8 -*- from __future__ import print_function from gensim.models import KeyedVectors import data_parser import config from model import Seq2Seq_chatbot import tensorflow as tf import numpy as np import re import os import sys import time #===================================================== # Glob...
import cv2 import numpy as np from scipy.spatial.transform import Rotation as R # Dictionary that maps from joint names to keypoint indices. KEYPOINT_DICT = { 'nose': 0, 'left_eye': 1, 'right_eye': 2, 'left_ear': 3, 'right_ear': 4, 'left_shoulder': 5, 'right_shoulder': 6, 'left_elbow': ...
""" State definition, and specific puzzle state definition for 8-Puzzle articularly. Definition of heuristics for 8-puzzle. """ import math class State(object): """ Base state, that defines heuristic use and the method that a State need to implement. """ def __init__(self, values, parent, heurist...
import os.path from shutil import rmtree import sys import time import tensorflow as tf import helper import warnings from distutils.version import LooseVersion import project_tests as tests # Check TensorFlow Version assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or ne...
# Copyright (c) 2018, NVIDIA CORPORATION. from collections import OrderedDict, defaultdict, namedtuple from itertools import chain import numpy as np from numba import cuda import rmm import cudf import cudf._lib as libcudf from cudf.core.series import Series def _auto_generate_grouper_agg(members): def make_...
# Copyright The PyTorch Lightning 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 agreed to i...
from __future__ import print_function import numpy as np import os, sys, imageio, time from llff.inference.mpi_tester import DeepIBR def savempi(mpi, pose, dvals, basedir, txt_only=False, binary=False): pose = pose + 0. pose_ = pose + 0. pose[:, 0] = pose_[:, 1] pose[:, 1] = -pose_[:, 0] ...