text
stringlengths
6.04k
39.5k
import numpy as np import numpy.linalg as LA import scipy.sparse as sp from scipy.stats.mstats import gmean from time import time from multiprocessing import Process, Pipe import sys, os, warnings from a2dr.precondition import precondition from a2dr.acceleration import aa_weights from a2dr.utilities import get_version...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_django-modelqueryform ------------ Tests for `django-modelqueryform` forms module. """ from collections import OrderedDict from django.core.exceptions import ImproperlyConfigured from django.db.models.query_utils import Q from django.forms.fields import Multiple...
#!/usr/bin/env python # coding: utf-8 # Load dependencies from utils import * from dataset import * from network import * import numpy as np import pandas as pd import h5py import os import gc import argparse import torch import torch.nn as nn from torch.nn import functional as F from torch.optim import SGD, Adam ...
import pandas as pd import numpy as np import geopandas as gpd import math import fiona import rasterio import glob import os import pickle import affine6p import matplotlib import time import datetime from matplotlib import pyplot as plt import rasterio.mask as rmask from rasterio.merge import merge from rasterio.plo...
# -*- coding: utf-8 -*- # @Time : 2018/8/6 13:09 # @Author : <NAME> # @File : wrapper_model.py import torch import torch.nn as nn from torch.autograd import Variable import numpy as np class Flatten(nn.Module): def __init__(self, shape): super(Flatten, self).__init__() self.shape = shape ...
#!/usr/bin/env python3 from datetime import datetime import pitches import tabs form_feed = False def new_page(): if form_feed: print("",end="\f") return print() print("-"*67) # courier new 10pt = 75 (78) chars per line; 53 (57) lines per page; so it prints on both A4 and letter prin...
# See "notes/how.to.group.arguments.txt" for an explanation # of what problem this library solves and how it works. # # We keep it as a standalone library instead of folding it # in to Appeal proper just to ensure it remains easy to test. # please leave this copyright notice in binary distributions. license = """ appe...
# from mininet import Topo from collections import defaultdict import itertools import sys sys.path.append('../') import logging import logger as logger log = logging.getLogger(__name__) log.setLevel(level = logging.INFO) handler = logging.FileHandler("/root/ez-segway/testbyxcj/front/static/schedule.log") handler.set...
bl_info = { 'name': 'BakeMeshFlipbook', 'author': '<NAME>', 'version': (0, 1), 'blender': (2, 80, 0), 'category': 'Animation', 'location': 'Object > Animation > Bake Mesh Flipbook', 'wiki_url': ''} import bpy from math import * from mathutils import * from bpy.p...
import os import argparse import hashlib import struct import re import traces import binary from errors import InputError, FatalError PARTITION_HEADER_SIZE = 32 PARTITION_TABLE_ENTRY_SIZE = 32 MAX_PARTITION_TABLE_ENTRIES = 31 MAX_PARTITION_TABLE_SIZE = MAX_PARTITION_TABLE_ENTRIES * PARTITION_TABLE_ENT...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Dec 18 10:46:43 2019 @author: tcandela """ # ============================================================================= # IMPORTS # ============================================================================= import numpy as np import netCDF_lib as ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """Relational graph modules""" import math import torch import torch.nn as nn from torch.nn.parameter import Paramete...
#!/usr/bin/env python from __future__ import print_function from __future__ import division from builtins import zip from builtins import input from builtins import map from builtins import next from builtins import str from builtins import range from past.utils import old_div from builtins import object import sys imp...
# coding:utf-8 import os import json import time import pickle import random import warnings import numpy as np from torch.optim import Optimizer from collections import defaultdict import torch import torch.nn as nn from torch.optim import AdamW from torch.backends import cudnn from torch.optim.lr_scheduler import ...
import sys sys.path.append('../../Pronoun/e2e_coref') import numpy as np import pandas as pd from tqdm import tqdm tqdm.pandas() import tensorflow as tf import coref_model as cm import util import nltk nltk.download("punkt") from nltk.tokenize import sent_tokenize, word_tokenize def create_example(text): raw_s...
import argparse import os import random import shutil import time import warnings import sys import torch import torch.nn as nn import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.optim as optim import torch.multiprocessing as mp import torch.utils...
# Project hiatus # script used to do the training # 16/11/2020 # <NAME> import torch import torchnet as tnt import numpy as np from torch.optim.lr_scheduler import MultiStepLR from sklearn import metrics import datetime from torch.utils.tensorboard import SummaryWriter import os # importing our functions import loss ...
from __future__ import annotations import json import tempfile from enum import Enum from pathlib import Path from typing import Any, Dict, List, Optional, Union import python_on_whales.components.image.cli_wrapper from python_on_whales.client_config import ( ClientConfig, DockerCLICaller, ReloadableObjec...
import ast import datetime import importlib import json import os import six import time import tornado.gen import yaml from functools import wraps from types import GeneratorType from orderedattrdict import AttrDict from gramex.config import app_log, locate, variables, CustomJSONEncoder def identity(x): return x...
# -*- coding: utf-8 -*- """ Created on Fri Nov 10 13:31:55 2017 @author: Astrid """ import math as m import pandas as pd def auto_disc_calc_grid(steps, min_grid, max_grid, detail, stretch_factor): new_grid = list() total_width = sum(steps) ideal_min_width = total_width/(20+2*detail) # detail == 1 ...
""" Contains functionalities for generating views related to intent parser """ from intent_parser.accessor.catalog_accessor import CatalogAccessor from intent_parser.utils.html_builder import AddHtmlBuilder, AnalyzeHtmlBuilder, ControlsTableHtmlBuilder, MeasurementTableHtmlBuilder, ParameterTableHtmlBuilder import logg...
# ----------------------------------------------------------------------------------- # from itertools import islice def nth(iterable, n, default=None): temp = iterable return next(islice(temp, n, None), default) # ----------------------------------------------------------------------------------- # import ...
import datetime import gettext import json import logging import os import shutil import subprocess import sys import time import webbrowser try: from urllib2 import urlopen, URLError except ModuleNotFoundError: from urllib.error import URLError from urllib.request import urlopen class LoggerWriter(objec...
# calculate magnetic fields arising from electrical current through wires of an # arbitrary shape with the law of Biot-Savart import numpy as np import wire from joblib import Parallel, delayed import multiprocessing as mp import time import hibplib as hb import hibpplotlib as hbplot import os import sys # %% define...
#!/usr/bin/python3 from names import Names from addresses import Addresses from emails import Emails from rand import Rand from dates import Dates from words import Words import sys import json import datetime tenantId = "WFU" cut_date = datetime.datetime.strptime("2018-09-01", "%Y-%m-%d") subjectCode = "ECO" n_facult...
# convert csv(original) to remi events (.csv format) import pandas as pd import numpy as np import pickle, os from glob import glob from functools import cmp_to_key import matplotlib.pyplot as plt from chord_processor import ChordProcessor from mlu_processor import MLUProcessor from build_vocab import Vocab ...
import time import pickle import idc import idaapi import idautils import ida_funcs import ida_auto import ida_bytes import ida_offset import ida_segment from idautils import XrefsTo from .utils import get_string, check_string, create_string from .utils import check_funcname, set_funcname def n...
""" Script for reconstructing particles RELION compatible from full reconstructed tomograms Input: - STAR file with next columns: '_rlnMicrographName': tomogram that will be used for reconstruction '_rlnImageName': tomograms used for picking '_rlnCtfImage': (op...
from argparse import ArgumentError import re import locale from base64 import b64encode, b64decode from abc import ABC from dataclasses import dataclass from datetime import datetime from typing import Any, Callable, Iterable, Match, NoReturn, Optional, Pattern, Union, TypeVar, overload, List from enum import Enum fro...
#!/usr/bin/env python import subprocess from itertools import product import os.path import os import sys import glob import time from shutil import copyfile import datetime as dtm FBASE_5_6 = ["schout.nc"] SCHISM_INCOMPLETE_COMBINE = 36 # error code for incomplete file #combine_exe = "D:/Delta/BayDeltaSCHISM/bin/...
from __future__ import print_function import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data import torch.utils.data from torch.autograd import Variable from dvmvs.utils import freeze_batchnorm pixel_coords = None def set_id_grid(depth): globa...
""" This module contains the class definitions for ``BaseChainLadder``.- """ import functools import pandas as pd import numpy as np class BaseChainLadder: """ From the Casualty Actuarial Society's "Estimating Unpaid Claims Using Basic Techniques" Version 3 (Friedland, Jacqueline - 2010), the develop...
from __future__ import absolute_import, division, print_function import itertools import inspect from functools import wraps, partial import numpy as np import scipy.interpolate import scipy.linalg from future.builtins import zip, range from future.backports import OrderedDict import torch from matplotlib.colors impo...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ emha-koeln, SkyEmie, bbb0 """ import time #from flashbootlib import test import os from os import path import math import subprocess from subprocess import PIPE, run import platform import configparser import argparse #import time ################################...
""" Loss function implementations. """ import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from kornia.geometry import warp_perspective from ..misc.geometry_utils import (keypoints_to_grid, get_dist_mask, get_common_line_mask) def get_loss_and_weig...
#!/usr/bin/env python import sys import argparse import time import asyncio import logging import uuid from bleak import BleakClient, BleakScanner from colorlog import ColoredFormatter import hashlib import os import keyboard import subprocess #import toga class Commands: SHELL_VERSION = 0x80 SHELL_S...
"""Main optimisation functions. """ from .data_fetcher import get_oa_centroids, get_oa_stats from .utils import coverage_matrix, make_job_dict from spineq.greedy import greedy_opt import numpy as np import pandas as pd import rq from flask_socketio import SocketIO import os import datetime import json def optimise...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/5/15 20:08 # @Author : gao # @File : xadmin.py from django.db.models import ManyToManyField from pure_pagination import Paginator, EmptyPage, PageNotAnInteger from django.forms import modelform_factory from django.http import HttpResponse from django.s...
"""ASR test.""" import os import matplotlib.pyplot as plt import numpy as np import pytest from meegkit.asr import ASR, asr_calibrate, asr_process, clean_windows from meegkit.utils.asr import yulewalk, yulewalk_filter from meegkit.utils.matrix import sliding_window from scipy import signal np.random.seed(9) # Data f...
import argparse import os, sys import os.path as osp import torchvision import numpy as np import torch import torch.nn as nn import torch.optim as optim from torchvision import transforms import network import loss from torch.utils.data import DataLoader from data_list import ImageList, ImageList_idx import random, pd...
#!/usr/bin/env python # encoding: utf-8 # The MIT License (MIT) # Copyright (c) 2019 CNRS # 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 ...
#!/usr/bin/env python from future.standard_library import install_aliases install_aliases() import json import jwt import requests import time import os import sys import re from urllib3._collections import HTTPHeaderDict use_environment_variables = None try: from django.conf import settings except ImportError...
# -*- coding: utf-8 -*- import tkinter as tk import numpy as np import tkinter.colorchooser import math as m import pandas as pd from PIL import Image, ImageTk ECHELLE_DIST = 150*10**9/300 # 1px <-> ECHELLE_DIST m ECHELLE_TPS = (3.154e+7)/100 # 1 frame <-> ECHELLE_TPS s class SpacialObject: def __init__(self,...
import copy import json import time import http.client import urllib from io import BytesIO from types import SimpleNamespace from typing import Dict import socket import pytest import urllib3 import requests import lumigo_tracer from lumigo_tracer import lumigo_utils from lumigo_tracer.auto_tag import auto_tag_event...
#!/usr/bin/env python """ vmclone.py ---------- Re-Identify a cloned Linux Virtual Machine (Hostname & Networking) See README.md for usage and more information """ __author__ = '<NAME>' __date__ = '2014-01-29' __version__ = '1.2.0' from time import sleep import subprocess import datetime import shutil import json imp...
# -*- coding: utf-8 -*- ############################################################################# ## ## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ## Contact: http://www.qt-project.org/legal ## ## This file is part of the Qt Solutions component. ## ## $QT_BEGIN_LICENSE:BSD$ ## You may use this file u...
from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import pytest from random import randint from mmgroup import mat24 mat24fast = mat24 from mmgroup.bitfunctions import bit_mat_mul, v2 from mmgroup.dev.mat24.mat24theta import theta_to_basis_vector from mmgr...
#!/usr/bin/env python3 import os import sys import copy import re import importlib import numpy as np import rclpy from rclpy.qos import qos_profile_sensor_data from rclpy.node import Node import sensor_msgs.msg import px4_msgs.msg from cv_bridge import CvBridge from rclpy.qos import QoSProfile import cv2 if cv2.__vers...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals import warnings import numpy as np import matplotlib.pyplot as mpl from matplotlib.font_manager import FontProperties from . import wcs_util from . import angle_util as au from .decorators import auto_refresh,...
# Copyright (c) 2017-2019, <NAME> # Copyright (c) 2014-2018, iocage # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted providing that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # noti...
from discord.ext import commands, tasks import discord import asyncio import timeago import datetime class logs(commands.Cog): def __init__(self, bot): self.bot = bot self.invites = {} # self.crawler = self.bot.loop.create_task(self.crawl_invites()) self.valid_channels = [ "vc_log_channel", "ban_log_ch...
import copy import quantities as pq import scipy as sp import scipy.signal import scipy.special import tools default_kernel_area_fraction = 0.99999 class Kernel(object): """ Base class for kernels. """ def __init__(self, kernel_size, normalize): """ :param kernel_size: Parameter controlling...
# # This file is part of pyasn1-modules software. # # Created by <NAME> with assistance from asn1ate v.0.6.0. # # Copyright (c) 2019, Vigil Security, LLC # License: http://snmplabs.com/pyasn1/license.html # # PKCS#9: Selected Attribute Types (Version 2.0) # # ASN.1 source from: # https://www.rfc-editor.org/r...
import hashlib from datetime import datetime, timedelta import logging import copy from opcua.ua.ua_binary import struct_from_binary, struct_to_binary, header_from_binary, header_to_binary from opcua import ua logger = logging.getLogger('opcua.uaprotocol') class MessageChunk(ua.FrozenClass): """ Message Chu...
from Whittler.classes.NestedObjectPointer import NestedObjectPointer from Whittler.config import Config import textwrap import random from collections import Counter actions = { "general" : { "exit" : "Gracefully exit the program", "shell" : "Drop into an IPython shell to interact with the dataset...
'''Creates Principle Layers out of gen-file and further information in partition.inp. Principle layers are used for transport calculation input in the dftb+ software. A principle layer is a contigous group of atoms only interacting with adjacent layers. Every principle layer has exactly one following neighbour, therefo...
from django.shortcuts import render, redirect from django.contrib.auth import login, authenticate from dashboard.forms import EditProfileForm from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth import update_session_auth_hash from django.db.models import Q from account.models import Accoun...
import torch import models import utils from transformers import BertTokenizerFast from torch.utils.data import DataLoader import torch.optim as optim import pickle as pk import numpy as np #performance metrics from sklearn.metrics import classification_report import datasets device = torch.device('cuda') if torch...
import maya.cmds as mc from PySide import QtGui from PySide import QtCore import maya.OpenMayaUI as mui import shiboken from functools import partial from math import sqrt, ceil import shape_mirror from tbx import get_shape def getMayaWin(): pointer = mui.MQtUtil.mainWindow() return shiboken.wrapInstance(lon...
"""Module containing sample classes for approach definitions.""" import itertools import numpy as np from scipy import optimize from ..wrappers.mytypes import doublenp from ..wrappers.mytypes import complexnp from .kernel_handler import KernelHandler from .kernel_handler import KernelHandlerMatrixFree class Appro...
__all__=("WDDecoder",) import re import warnings from .interfaces import * vendors={ "WD":"Western Digital" } rpmBufferSizeTypeFamily={ "2": {"capacity":16, "type":"NAND"}, "6": {"capacity":128, "type":"NAND"}, "A": { "rpm": 5400, "buffer_size": 2, # 256 "type":"HDD" }, "B": { "rpm": 7200, "buffer_siz...
#!/usr/bin/python # Copyright 2021 Intel, 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 agr...
import os import argparse import json import psutil import numpy from onnx import TensorProto """ This profiler tool could run a transformer model and print out the kernel time spent on each Node of the model. Example of profiling of longformer model: python profiler.py --model longformer-base-4096_fp32.onnx --batc...
# Script to predict minimal heterologous reaction sets for value-added compound production # Created: 23 June 2019 # Author:<NAME> (script based on *OptCouple* supplementary material) # Contact: <EMAIL> # Loading dependencies import os,pickle,sys from multiprocessing import Pool os.environ["OPTLANG_USE_SYMENGINE"] = ...
from __future__ import print_function """ Copied from redisrwlock """ import redis import asyncio import logging import logging.config import os import re import time logger = logging.getLogger(__name__) # (1) Primary data structure for resource, owner, lock # # name = resource name # mode = R|W # owner = node/...
import constants as const import utils as mu import socket import struct import settings from threading import Lock, Thread # for python2 compatibility try: from socketserver import BaseRequestHandler, ThreadingTCPServer except ImportError: from SocketServer import BaseRequestHandler, ThreadingTCPServer clas...
import datetime from django.contrib.auth.models import User from django.db import models from django.db.models import Q from employees.models import EmployeeGrade, UserData from projects.models import ProfitLossAccount, Project from .utils import ValidateOnSaveMixin, render_markdown class HolidayPrefills(models.Mo...
""" Copyright (C) 2022 <NAME> This work is released under the MIT License. See the file LICENSE for details This script visualizes user generated tracks alongside the ground truth in both pixel and world coordinates (top-down) as videos. Can also be used to only visualize the ground truth ""...
""" Copyright 2019 <NAME>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribut...
import torch import torch.nn as nn from models.misc.resnet_3D import r3d_18, Conv_3d, upConv3D from models.misc import Identity import cupy_module.adacof as adacof from cupy_module.softsplat import ModuleSoftsplat import sys from torch.nn import functional as F from utility import moduleNormalize, gaussian_kernel from ...
import os import numpy as np import math from math import pi import scipy.ndimage.morphology from scipy import ndimage import skimage.morphology from typing import Sequence, Tuple, Union, Optional, List def angle_2_da_vector(angles: np.ndarray) -> np.ndarray: """ Angles in radians to double-angle vector spac...
#!/usr/bin/env python import csv import json from os.path import isfile from os.path import basename from os.path import join as pjoin from pprint import pprint as pp from typing import Dict, Tuple, List, Union, Any, Optional, IO import datagristle.common as comm from datagristle.common import abort import datagrist...
from io import FileIO import re import sqlite3 import argparse import os.path from enum import Enum, auto from sqlite3 import Error from locale import atof from datetime import datetime import subprocess import sys try: from openpyxl import Workbook except ImportError: subprocess.check_call([sys.executable, "...
# -*- coding: utf-8 -*- """ Utils for working with grammatical tags. """ from __future__ import absolute_import, unicode_literals import collections try: from sys import intern except ImportError: # python 2.x has builtin ``intern`` function pass # a bit of *heavy* magic... class _select_grammeme_from(obj...
from collections import OrderedDict import torch import torch.nn as nn from src.models.layers import MultitaskClassifiers, BN_AC_CONV3D, MF_UNIT from src.utils.initializer import xavier class Modality_Block(nn.Module): def __init__(self, mod_name, input_channels, g, k_sec, conv_num_mid, conv_num_out): supe...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import getopt import os import subprocess import sys import time import json import configs as constant_configs from configs import Config as packaging_config import tools import platform def clean(): print("") tools.notice_print("------ clean ------") start...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2020 # <NAME> <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by # the Free Soft...
# -*- encoding: utf-8 -*- from flask import jsonify, render_template, redirect, url_for, flash, request from werkzeug.utils import secure_filename from flask_login import ( current_user, login_required, login_user, logout_user ) from app import db, login_manager, configs from app.base import blueprint...
from flask import Flask, session, render_template, make_response from flask import redirect, request, url_for, send_file from google.oauth2.credentials import Credentials from googleapiclient.discovery import build from google_auth_oauthlib.flow import Flow from email.mime.text import MIMEText from email.mime.multipart...
import pytest import re import json from copy import deepcopy from pkg_resources import resource_listdir from snovault import COLLECTIONS, TYPES from snovault.schema_utils import load_schema from ..commands.order_schema_columns_and_facets import order_schema_columns_and_facets pytestmark = [pytest.mark.setone, pytes...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ run - a script used for launching the PoC. See README.md and help (./run -h) for details on usage. Part of D&C-Clustering-POC Copyright (c) 2020 <NAME> """ import argparse import configparser import multiprocessing import os import pickle import queue import time fr...
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for pyvo.dal.ssa """ from __future__ import print_function, division import os, sys, shutil, re, imp, glob, tempfile, random, time import unittest, pdb import pyvo.dal.query as dalq import pyvo.dal.ssa as ssa import pyvo.d...
# The backbone of our LIGA model. # including 2D feature extraction, stereo volume construction, stereo network, stereo space -> 3D space conversion import math import torch import torch.nn as nn import torch.utils.data import torch.nn.functional as F from mmdet.models.builder import build_backbone, build_neck from ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys import json import cv2 import numpy as np import math import tensorflow as tf import multiprocessing from Architecture import Architecture from Architecture import Feature...
#!/usr/bin/env python3 from runner.manager import manager from runner.hpc import hpc from multiprocessing import Process, Pool import sys, os, json import argparse # utilities def checkf(p): return os.path.isfile(p) def checkd(p): return os.path.isdir(p) def mkdir(d): if not checkd(d): os.makedi...
import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import tensorflow as tf import sys import os import pickle as pickle from six.moves import urllib import tarfile import scipy.stats.mstats from load_cifar10 import load_data10 # training parameters initial_learning_rate = 0.001 ...
#!/usr/bin/env python3 # Copyright 2019 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
import numpy as np import pdb from utils import tensor_mult from scipy.sparse.csgraph import minimum_spanning_tree from scipy.sparse import csr_matrix class Inference(): """ superclass of inference procedures for an Ising model. the model is represented using an adjacency matrix adj: n x n ...
## test_attack.py -- sample code to test attack procedure ## ## Copyright (C) 2017, <NAME> <<EMAIL>>. ## Copyright (C) 2016, <NAME> <<EMAIL>>. ## ## This program is licenced under the BSD 2-Clause licence, ## contained in the LICENCE file in this directory. import tensorflow as tf import numpy as np import time import...
__all__ = ['generate_default_args', 'generate_default_params', 'prepare_inputs', 'create_f_encoder', 'make_f_variational', 'create_z_encoder', 'make_z_variational', 'get_z_prior'] import numpy as np import tensorflow as tf import tensorflow.keras.layers as tfkl from tensorflow.keras import backe...
from __future__ import absolute_import from __future__ import print_function from __future__ import division import functools import math import numpy as np from collections import OrderedDict import veriloggen as vg import nngen.basic_types as bt import nngen.util as util class slice_(bt._Operator): """ C...
import os import sys import time from PyQt5.QtCore import QRect, QThread, pyqtSignal, Qt from PyQt5.QtGui import QColor, QPainter from PyQt5.QtWidgets import (QApplication, QCheckBox, QFileDialog, QLabel, QLineEdit, QProgressBar, QPushButton, QSpinBox, QStatusB...
from enum import Enum from ply.yacc import errok from astDDL import Instruccion from useDB.instanciaDB import DB_ACTUAL from storageManager.jsonMode import extractTable from typeChecker.typeReference import getColumns from prettytable import PrettyTable from astExpresion import ExpresionID, Expresion , TuplaCompleta ...
#!/usr/bin/env python # # Copyright 2016 - The Android Open Source Project # # 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 requir...
from datetime import date, datetime, time, timedelta from decimal import Decimal from enum import Enum from json import JSONEncoder from re import sub from typing import Any, List, Optional, Tuple, Union from .array_helper import ArrayHelper class DateTimeEncoder(JSONEncoder): def default(self, o): if isinstance(...
from __future__ import print_function import random import os from time import sleep def generate_nodes(n, m, filename): with open(filename, 'w') as f_nodes: print('<?xml version="1.0" encoding="UTF-8"?>', file = f_nodes) print('<nodes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLo...
# Created by rahman at 11:06 2020-02-22 using PyCharm import tensorflow as tf tf.random.set_seed(3) #if tf.test.is_built_with_cuda or tf.__version__ == '2.1.0': from tensorflow import keras k_init = tf.keras.initializers.Constant(value=0.1) b_init = keras.initializers.Constant(value=0) r_init = keras.initializers.Con...
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ...
import operator import argparse from collections import defaultdict from math import log from nltk import bigrams from numpy import zeros kSTART = "___START___" kNEG_INF = float("-inf") class ToyDataset: def __init__(self): self._sents = ["answer the question".split(), "question ...
import logging import os import os.path as osp from typing import Dict import random from tqdm import tqdm import numpy as np import torch from torch.nn import functional as F from torch.cuda.amp import autocast from torch import nn from torch.utils.data import DataLoader from lib.mcae.spatial import full_pose from l...