text
stringlengths
6.04k
39.5k
#!/usr/bin/env python3 # coding: utf-8 # MIT License © https://github.com/scherma # contact http_<EMAIL>4<EMAIL> import logging, os, configparser, libvirt, json, arrow, pyvnc, shutil, time, victimfiles, glob, websockify, multiprocessing, signal import tempfile, evtx_dates, db_calls, psycopg2, psycopg2.extras, sys, pca...
# (C) Copyright 2017- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as an intergovernme...
#!/usr/bin/env python3 """pdoc's CLI interface and helper functions.""" import argparse import ast import importlib import inspect import os import os.path as path import json import re import sys import warnings from contextlib import contextmanager from functools import lru_cache from http.server import BaseHTTPRequ...
from flask import Flask, render_template, flash, abort, redirect, url_for, request import os import common import json import numbers import urllib.parse import pandas as pd from datetime import datetime from math import log10, floor base_dir = '/home/nick/Data/_ensembles' app = Flask(__name__) app.config['ENV'] = 'de...
from collections import deque import numpy as np import os from abc import ABCMeta, abstractmethod import random random.seed(42) from common import config, VehicleState from helper import Helper INFO = """Average merging time: {} s Traffic flow: {} vehicle/s Average speed: {} km/h Average fuel consumptio...
import os import time import random import scipy.sparse as sp import numpy as np import tensorflow as tf import argparse from models import SpHGAT from utils import process parser = argparse.ArgumentParser() parser.add_argument('--dataset', help='Dataset.', default='imdb', type=str) parser.add_argument('--epochs', he...
# Copyright 2021 The ML Collections Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# coding: utf-8 import wx import wx.lib.sized_controls as sc from dataclasses import dataclass from functools import partial from wx.adv import CommandLinkButton from bookworm import app from bookworm import config from bookworm import typehints as t from bookworm.i18n import LocaleInfo from bookworm.concurrency impor...
import logging import torch import torch.nn as nn import torch.nn.functional as F from .... import extensions as E from . import accuracy as A logger = logging.getLogger('global') def _reduce(loss, reduction, **kwargs): if reduction == 'none': ret = loss elif reduction == 'mean': normalizer...
""" This module provides classes that support observers, smart value handling and debug functions All changes to values nominate an agent, and observers nominate the agent making changes they are interested in. It supercedes the pvars module """ import logging, sys, threading, pathlib, math, json from enum import Enu...
#!venv/bin/python # coding=UTF-8 # -*- coding: UTF-8 -*- # vim: set fileencoding=UTF-8 : """ Double-deck bid euchre Implementation is similar to the rules given by <NAME> https://www.pagat.com/euchre/bideuch.html Notable differences (to match how I learned in high school calculus) include: * Minimum bid of 6 (w...
#!/usr/bin/env python # Copyright (c) 2016, 2017 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify,...
from functools import partial from typing import List, Optional, Sequence, Tuple import torch import torch.nn.functional as F from torch import nn from mmderain.models.common import sizeof from mmderain.models.registry import BACKBONES from mmderain.models.layers import SELayer_Modified class ResidualBlock(nn.Modul...
import math from KratosMultiphysics import * from KratosMultiphysics.BRepApplication import * from KratosMultiphysics.IsogeometricApplication import * ### ### This module is a factory to generate typical geometries for isogeometric analysis, e.g. circle, l-shape, ... ### nurbs_fespace_library = BSplinesFESpaceLibrary...
# Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
import os import re import csv import sys import json import yaml import time import socket import connexion import postgresql as psql from flask import current_app from urllib.parse import urlencode from hashlib import md5 from bokeh.embed import server_document from .processes import fetch_process, is_running, proce...
#!/usr/bin/python3 import os import click import sys import csv import time import pandas as pd import country_converter as coco import hashlib import phonenumbers from tqdm import tqdm from uszipcode import SearchEngine HEADER_TRANSLATIONS = { "email1": "Email", "phone1": "Phone", "person_country": "Count...
from typing import Iterable as Iterable, List, Dict, Callable, Iterator, Set, Optional from ...models.core.Unit import Unit from ...models.core.Class import Class from ...models.core.Weapon import Weapon from ...models.core.Item import Item from ...models.core.Skill import Skill from ...models.play.ActiveArena import A...
# --- # jupyter: # jupytext: # formats: jupyter_scripts//ipynb,scripts//py # text_representation: # extension: .py # format_name: light # format_version: '1.3' # jupytext_version: 1.0.0 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s...
import os import time import argparse import numpy as np import tensorflow as tf from tqdm import tqdm from config import get_config, export_config from model.textcnn import TextCNN from model.textrnn import TextRNN from sklearn.model_selection import train_test_split from dataloader import Word2VecEmbeddings, Doc2Vec...
# Copyright 2021 The T5 Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
from Interface.StudentCommandLineInterface import CLI from HelperLibrary.StorageFunctions import StorageFunctions from HelperLibrary.MarkSheet import MarkSheet from datetime import datetime class StudentController: def __init__(self, student, table_name): self.student = student self.table_name = ...
# -*- coding: UTF-8 -*- import os import sys import subprocess import argparse import re import configparser import logging import copy import psutil if sys.version_info[0] < 3: import struct import tensorflow as tf from tensorflow.core.framework import graph_pb2 # level=logging.INFO only logging.debug info,leve...
# Code modified from original by @jvfe (BSD2) # Copyright (c) 2020, jvfe # https://github.com/jvfe/wdt_contribs/tree/master/complex_portal/src import math import re from collections import defaultdict from ftplib import FTP from functools import lru_cache, reduce from time import gmtime, strftime import pandas as pd f...
from collections import deque from enum import Enum import logging from .constants.codes import CatCode from .constants.parameters import param_to_instr from .constants.specials import special_to_instr from .constants.instructions import (Instructions, if_instructions, unexpanded_c...
import math import numpy as np import cv2 import json import argparse def augment_homogeneous(V, augment): """ Augment a 3xN array of vectors into a 4xN array of homogeneous coordinates Args: v (np.array 3xN): Array of vectors augment (float): The value to fill in for the W coordinate Retu...
#!/usr/bin/env python """ Configure folder for Multicolor testing. Hazen 01/18 """ import argparse import inspect import numpy import os import pickle import subprocess import storm_analysis import storm_analysis.sa_library.parameters as parameters import storm_analysis.sa_library.sa_h5py as saH5Py import storm_anal...
# The MIT License (MIT) # # Copyright (c) 2018 PyBER # # 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, mer...
# Copyright 2016 Cisco Systems, 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...
import json import sys # import matplotlib.pyplot as plt import copy import numpy as np import tensorflow as tf from sklearn.model_selection import StratifiedShuffleSplit from sklearn.utils import class_weight from collections import Counter import random from tensorflow.keras.callbacks import Callback from sklearn.met...
# -*- coding: utf-8 -*- """ Created on 2017-8-24 @author: cheng.li """ import bisect import datetime as dt from typing import Iterable from typing import Union import numpy as np import pandas as pd from simpleutils.asserts import require from PyFin.DateUtilities import Period from PyFin.api import BizDayConventions...
""" one agent chooses an action, says it. other agent does it. both get a point if right this file was forked from mll/discrete_bottleneck_discrete_input.py """ import torch import torch.nn.functional as F from torch import nn, optim # from envs.world3c import World from ulfs import alive_sieve, rl_common from ulfs.s...
"""Simulate a Map Reduce Scenario where timeout prevention is required. In this simulation we are using an Optimizer created for map reduce scenarios. This improves the distribution of the computation no matter how the interest is formated. Scenario consists of two NFN nodes and a Client. Goal of the simulation is to ...
import logging, operator, functools, itertools, array, ptypes from ptypes import * from .headers import * from . import portable class Signature(pint.enum, uint16): # We'll just store all signature types here _values_ = [ ('IMAGE_DOS_SIGNATURE', 0x5a4d), ('IMAGE_OS2_SIGNATURE', 0x454e), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import enum import json import os import plistlib import subprocess import time import tools import requests python_script_debug_enable = False # 是否开启debug模式 用于测试脚本 pwd = os.getcwd() # 当前文件的路径 ios_project_path = os.path.abspath(os.path.dirname( pwd) + os.path.sep...
"""Transformer from 'Attention is all you need' (Vaswani et al., 2017)""" # Reference: https://www.tensorflow.org/text/tutorials/transformer # Reference: https://keras.io/examples/nlp/text_classification_with_transformer/ import numpy as np import tensorflow as tf class Transformer(tf.keras.Model): def __init__(...
#!/usr/bin/env python3 from dataknead import Knead from facetool import config, media, util from facetool.constants import * from facetool.path import Path from facetool.profiler import Profiler from facetool.errors import ArgumentError from facetool.util import message, force_mkdir, sample_remove, is_json_path from r...
#!/usr/bin/env python3 import socket import threading import logging logging.basicConfig(filename='meca.log', level=logging.DEBUG) PROGRAM_FILE = 'program_output.txt' # Dictionary of status indexes in robot status message statusDict = {'activated': 0, 'homed': 1, 'simulating': 2, '...
from numpy import zeros, ones, dot, sum, abs, max, argmax, clip, \ random, prod, asarray, set_printoptions, unravel_index # Generate a random uniform number (array) in range [0,1]. def zero(*shape): return zeros(shape) def randnorm(*shape): return random.normal(size=shape) def randuni(*shape): return random.ran...
# Copyright <NAME> 2011-2017 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) #------------------------------------------------------------------------------- # CreateVersionFileCpp #--------...
import random import torch import torch.nn as nn import torch.nn.functional as F from .layers import * PRIMITIVES = [ 'MBI_k3_e3', 'MBI_k3_e6', 'MBI_k5_e3', 'MBI_k5_e6', 'MBI_k3_e3_se', 'MBI_k3_e6_se', 'MBI_k5_e3_se', 'MBI_k5_e6_se', # 'skip', ] OPS = { 'MBI_k3_e3' : lambda ic, mc, oc, s, aff, act: MBInvert...
import numpy as np from mldftdat.pyscf_utils import * from mldftdat.workflow_utils import safe_mem_cap_mb from pyscf.dft.numint import eval_ao, make_mask from mldftdat.density import LDA_FACTOR,\ contract21_deriv, contract21, GG_AMIN def dtauw(rho_data): return - get_gradient_magnitud...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # ----------- # SPDX-License-Identifier: MIT # Copyright (c) 2021 <NAME> # uuid : 633f2088-bbe3-11eb-b9c2-33be0bb8451e # author: <NAME> # email : <EMAIL> # date : 2021-05-23 # ----------- """ The `repair` command has access to tools that can repair various problems th...
import numpy as np from myutils import * from easydict import EasyDict as edict def dcg_at_k(r, k, method=1): r = np.asfarray(r)[:k] if r.size: if method == 0: return r[0] + np.sum(r[1:] / np.log2(np.arange(2, r.size + 1))) elif method == 1: return np.sum(r / np.log2(np....
from __future__ import unicode_literals from __future__ import absolute_import, division, print_function """ This module contains (and isolates) logic used to find entities based on entity type, list selection criteria and search terms. """ __author__ = "<NAME> (<EMAIL>)" __copyright__ = "Copyright 2014, <NAME...
import json import pickle import re from copy import copy, deepcopy from functools import lru_cache from json import JSONDecodeError from os import system, walk, sep from abc import ABC, abstractmethod from pathlib import Path import time from subprocess import check_output from tempfile import NamedTemporaryFile from ...
import numpy as np from numpy.random import RandomState from numpy.testing import assert_allclose from nnlib.l_layer.backward import linear_backward, linear_backward_activation, model_backward from nnlib.utils.derivative import sigmoid_backward, relu_backward from nnlib.utils.activation import sigmoid, relu def test...
import argparse import glob import os import random import re from dataclasses import dataclass from functools import partial from math import ceil from typing import List, Optional import numpy as np import torch from torch.optim.lr_scheduler import ReduceLROnPlateau from tqdm import tqdm import util tqdm.monitor_i...
# region [Imports] # * Standard Library Imports ----------------------------------------------------------------------------> import os import asyncio from io import BytesIO from pathlib import Path from datetime import datetime from tempfile import TemporaryDirectory from textwrap import dedent # * Third Party Impo...
import collections import csv import os import sys from enum import Enum from pathlib import Path # adapt paths for jupyter module_path = os.path.abspath(os.path.join('..')) if module_path not in sys.path: sys.path.append(module_path) import face_alignment from yawn_train.src.blazeface_detector import BlazeFaceD...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import csv import getopt import io import itertools import logging import numbers import os import re import sqlite3 import string import sys import textwrap import time try: import readline except ImportError: pass try: ...
""" Copyright 2012-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 di...
# This file implements file system operations at the level of inodes. import time import secfs.crypto import secfs.tables import secfs.access import secfs.store.tree import secfs.store.block from secfs.store.inode import Inode from secfs.store.tree import Directory from cryptography.fernet import Fernet from secfs.typ...
from datetime import timezone from functools import partial, update_wrapper from django.utils.cache import get_conditional_response from django.utils.http import http_date, quote_etag from rest_framework import status from rest_framework.metadata import BaseMetadata from rest_framework.response import Response from re...
# # Copyright (c) 2021 IBM Corp. # 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 writi...
from fabric2 import Connection from fabric2 import task from fabric2 import config import os import time from xml.etree import ElementTree as ET import uuid import glob import json import urllib.parse import io workflow_components = ['input.xml', 'binding.xml', 'flow.xml', 'result.xml', 'tool.xml'] @task def release_...
# 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 (t...
import filecmp import os import sys import shutil import subprocess import time import unittest if (sys.version_info > (3, 0)): import urllib.request, urllib.parse, urllib.error else: import urllib from optparse import OptionParser from PyQt4 import QtCore,QtGui parser = OptionParser() parser.add_option("-r",...
import base64 import datetime import io import json import traceback import aiohttp import discord import pytimeparse from data.services.guild_service import guild_service from discord.commands import Option, slash_command, message_command, user_command from discord.ext import commands from discord.utils import forma...
import os import lxml.etree as et import pandas as pd import numpy as np import regex as re def get_element_text(element): """ Extract text while -skipping footnote numbers -Adding a space before and after emphasized text """ head = element.text if element.tag != 'SU' else '' child = ' '....
import re import operator from collections import namedtuple SCHEMA_TYPES = {'str', 'int', 'bool'} ROWID_KEY = '_rowid' class Literal(namedtuple('Literal', 'value')): @classmethod def eval_value(cls, value): if not isinstance(value, str): raise ValueError(f"Parameter {value} must be a str...
import numpy as np import pandas as pd import pytest from etna.datasets import TSDataset from etna.datasets import generate_ar_df from etna.datasets import generate_const_df from etna.datasets import generate_periodic_df from etna.metrics import R2 from etna.models import LinearPerSegmentModel from etna.transforms imp...
''' Micro Object Detector Net the author:Luis date : 11.25 ''' import os import torch import torch.nn as nn import torch.nn.functional as F from layers import * from models.base_models import vgg, vgg_base from ptflops import get_model_complexity_info class BasicConv(nn.Module): def __init__(self, in_planes, ou...
# Copyright 2020 <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...
from collections import namedtuple import numpy as np import scipy as sp from scipy.sparse.csgraph import minimum_spanning_tree from .. import logging as logg from ..neighbors import Neighbors from .. import utils from .. import settings def paga( adata, groups='louvain', use_rna_velocity=Fals...
from pygame import mixer import speech_recognition as sr import pyttsx3 import pyjokes import boto3 import pyglet import winsound import datetime import pywhatkit import datetime import time import os from PIL import Image import random import wikipedia import smtplib, ssl from mutagen.mp3 import MP3 import requests, ...
import json import math import re from django.urls import reverse from django.http.response import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render from django.template.defaultfilters import slugify from django.db.models import Q, F from haystack.query import SQ, SearchQuerySet from dja...
from os.path import join, splitext from uuid import uuid4 import datetime from django.db import models #from django.utils.encoding import python_2_unicode_compatible from django.utils import timezone from django.urls import reverse from django.contrib.auth.models import User # Create your models here. #@...
import re, requests, bs4, unicodedata from datetime import timedelta, date, datetime from time import time # Constants root = 'https://www.fanfiction.net' # REGEX MATCHES # STORY REGEX _STORYID_REGEX = r"var\s+storyid\s*=\s*(\d+);" _CHAPTER_REGEX = r"var\s+chapter\s*=\s*(\d+);" _CHAPTERS_REGEX = r"Chapters:\s*(\d+)\...
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" FIXME: sometimes you have to chown -R user:user ~/.theano or run with sudo the first time after roboot, otherwise you get errors CommandLineHelp: python -m wbia_cnn --tf netrun <networkmodel> --dataset, --ds = <dstag>:<subtag> dstag is the main da...
# -*- coding: utf-8 -*- """ Created on Tue Mar 9 09:42:00 2021 @author: barraly """ import sabs_pkpd import numpy as np import matplotlib.pyplot as plt import os # Select the folder in which this repo is downloaded in the line below os.chdir('The/location/of/the/root/folder/of/this/repo') # In[Loa...
# BSM Python library and command line tool # # Copyright (C) 2020 chargeIT mobility GmbH # # SPDX-License-Identifier: Apache-2.0 from . import config from . import md from . import util as butil from ..crypto import util as cutil from ..sunspec.core import client as sclient from ..sunspec.core import suns from ..suns...
import base64 import shutil import json import re from enum import Enum, auto from typing import Optional import py7zr from cachetools import TTLCache, cached from ruamel.yaml import YAML, YAMLError from logger import getLogger import os import tempfile import zipfile import requests from bs4 import BeautifulSoup l ...
# !/usr/bin/env python # Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # # Modified by <NAME> on 20 April 2020 import argparse import datetime impo...
# Copyright (c) 2014 Evalf # # 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, distribute, s...
#!/usr/bin/env python3 # # Import built in packages # import logging import platform import os import time import socket import subprocess import signal import psutil from .util import setup_logger from .util import PylinxException import re # Import 3th party modules: # - wexpect/pexpect to launch...
""" jb2.py ~~~~~~ Use JBIG2, and an external compressor, for black and white images. """ import os, sys, subprocess, struct, zipfile, random from . import pdf_image from . import pdf_write from . import pdf import PIL.Image as _PILImage _default_jbig2_exe = os.path.join(os.path.abspath(".."), "agl-jbig2enc", "jbig2....
# Copyright 2020 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 to in writing, ...
# -*- coding: utf-8 -*- import redis import os import telebot import math import random import threading from telebot import types from emoji import emojize from pymongo import MongoClient token = os.environ['TELEGRAM_TOKEN'] bot = telebot.TeleBot(token) admins=[441399484] games={} client1=os.environ['database'] clie...
import os import shutil import argparse import torch from torch import nn from torchvision.utils import save_image, make_grid import matplotlib.pyplot as plt import numpy as np import cv2 as cv import utils.utils as utils from utils.constants import * class GenerationMode(enum.Enum): SINGLE_IMAGE = 0, INT...
""" Processing data in win32 format. """ import glob import logging import math import os import subprocess import tempfile from fnmatch import fnmatch from multiprocessing import Pool, cpu_count from subprocess import DEVNULL, PIPE, Popen # Setup the logger FORMAT = "[%(asctime)s] %(levelname)s: %(message)s" logging....
# import scipy.signal from gym.spaces import Box, Discrete import numpy as np import torch from torch import nn import IPython # from torch.nn import Parameter import torch.nn.functional as F from torch.distributions import Independent, OneHotCategorical, Categorical from torch.distributions.normal import Normal # # fr...
import calendar import datetime import re import sys from dateutil.relativedelta import relativedelta import gam from gam.var import * from gam import controlflow from gam import display from gam import gapi from gam import utils from gam.gapi.directory import orgunits as gapi_directory_orgunits def build(): re...
import matplotlib.pyplot as plt import tensorflow as tf import numpy as np import time from datetime import timedelta import os # Importing a helper module for the functions of the Inception model. import inception import cifar10 from cifar10 import num_classes from inception import transfer_values_cache #Importing...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from matplotlib.colors import LinearSegmentedColormap ms_color = [0.12156863, 0.46666667, 0.70588235, 1] hc_color = [1., 0.49803922, 0.05490196, 1] SMALL_SIZE = 12 MEDIUM_SIZE = 14 BIGGER_SIZE = 16 plt.rc('font', size=SMALL_SIZE) # contr...
""" 参考自https://github.com/bojone/crf/ """ import tensorflow as tf k = tf.keras kl = tf.keras.layers K = tf.keras.backend from sklearn.model_selection import train_test_split import numpy as np import re from tqdm import tqdm import matplotlib.pyplot as plt from matplotlib.animation import FuncAnimation class CRF(kl.L...
# coding:utf-8 #!/usr/bin/python # # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # # ------------------------------------------------------------------------...
import asyncio from datetime import datetime, timedelta import functools from http import HTTPStatus import logging import os import pickle from random import random import re import struct from typing import Any, Callable, Coroutine, Dict, List, Optional, Sequence, Tuple import warnings import aiohttp.web from aiohtt...
import csv import random from functools import partial from typing import Callable, Optional from pdb import set_trace as st import os import random import pandas as pd from typing import Any, Callable, Dict, Iterable, List, Tuple, Union import numpy as np import tensorflow as tf from foolbox.attacks import ( FGSM...
""" Module to execute the simulation for a given instance. """ """ import packages """ import logging from importlib import import_module import numpy.random as rdm import copy import numpy as np """ import project configurations """ import configurations.settings_simulation as config """ import project librar...
from __future__ import annotations import os import string import random import logging import vapoursynth as vs from pathlib import Path from requests import Session from functools import partial from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor from typing import Any, Mapping, Callable, Dict, F...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange from util import log from pprint import pprint from input_ops import create_input_ops from model import Model import os import time import tensorflow as tf import tensorflow.contr...
#!/usr/bin/python import numpy as np import os import pymaster as nmt import pytest import tjpcov.main as cv from tjpcov.parser import parse import yaml import sacc root = "./tests/benchmarks/32_DES_tjpcov_bm/" input_yml = os.path.join(root, "tjpcov_conf_minimal.yaml") input_yml_no_nmtc = os.path.join(root, "tjpcov_c...
# -*- coding: utf-8 -*- """ Created on Tue Jun 11 13:46:58 2019 @author: bdgecyt """ import cv2 import math from time import time import numpy as np import wrapper from operator import itemgetter boxes = [] xCount = 0 yCount = 0 iter = 0 img = 0 def on_mouse(event, x, y, flags, params): global iter t...
# Create your views here. from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login from django.contrib.auth.models import User from django.template import loader from django.forms.utils import ErrorList from django.http import HttpResponse from .origo import Origo_Thread from .o...
import qiskit import qtm.progress_bar import qtm.constant import qtm.qfim import qtm.noise import qtm.optimizer import qtm.fubini_study import numpy as np import types, typing def measure(qc: qiskit.QuantumCircuit, qubits, cbits=[]): """Measuring the quantu circuit which fully measurement gates Args: ...
# -*- coding: utf-8 -*- import numpy as np import random import sys from collections import Counter import json from argparse import ArgumentParser from rand_utils import rand_partition def build_tree(num_leaves = 10, rootdate = 1000): """ Starting from a three-node tree, split a randomly chosen branch to in...
#coding=utf-8 import tensorflow as tf import tfop contrib_image = tf.contrib.image def blend(image1, image2, factor): """Blend image1 and image2 using 'factor'. Factor can be above 0.0. A value of 0.0 means only image1 is used. A value of 1.0 means only image2 is used. A value between 0.0 and 1.0 means we ...
#!/usr/bin/env python3 import datetime import os import warnings import numpy as np import scipy.interpolate as si import matplotlib as mpl from matplotlib.backends import backend_pdf import matplotlib.pyplot as plt from .utils import aia_raster from .utils import cli from .utils import eis from .utils import num f...
""" <NAME> <NAME> <NAME> <NAME> CISC 204 Modelling project Wed december 9th 2020 Professor Muise """ #Import from nnf import Var from nnf import Or import nnf from lib204 import Encoding from csvReader import readCSV ''' Customer class Used to create a class containing the various restrictions a person might have ...