text
stringlengths
3.07k
12.6k
# -*- coding: utf-8 -*- """Cloud Function Utilities.""" import os import json import requests from firecloud.errors import FireCloudServerError from google.cloud.secretmanager_v1 import SecretManagerServiceClient from oauth2client.client import GoogleCredentials from oauth2client.service_account import ServiceAccoun...
# -*- coding: utf-8 -*- import os import pwd import time import traceback import requests from amplify.agent.common.context import context from amplify.agent.common.util.loader import import_class __author__ = "<NAME>" __copyright__ = "Copyright (C) Nginx, Inc. All rights reserved." __license__ = "" __maintainer__ =...
""" ============================== 3D ploting using PyQt5 for GUI ============================== Brief: ------ A **matplotlib** widget displays a 3D graph inside a **PyQt5** widget window. Important --------- This project is published under **MIT License** """ import argparse import sys import numpy as ...
import torch import torch.nn as nn import numpy as np from torch.utils.data import Dataset, DataLoader import torch.nn.functional as F from torch.nn import init from tqdm import tqdm from collections import OrderedDict # Utility def backbone_extractor(model, target_layer='avgpool'): backbone = [] for name, pa...
from __future__ import division import itertools from sympy.matrices.dense import zeros, MutableDenseMatrix from BasisMatricesHelper import * from MatricesHelper import * import bisect class DualSimplexMethod(object): def __init__(self, A_matrix, b_matrix, c_matrix, d_lower, d_upper, eps=0.000001): """ ...
import asyncio import logging import os from uuid import uuid4 from concurrent.futures import ProcessPoolExecutor from pathlib import Path from typing import Any, Iterable, Set import click from .db_admin import click_main from .. import local_database, protocol logger = logging.getLogger(__name__) @click_main.com...
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017-2018 <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 u...
import itertools from collections import defaultdict import torch from torch.distributed import get_rank from tqdm import tqdm import masker import utils from masker import gen_pointing_text_mask_locs def accuracy(output, target, topk=(1,), tok_groups=None, tok_group_labels=None, as_list=False): """Computes the...
# -*- coding: utf-8 -*- import http.client import logging import os import re import urllib.error import urllib.parse from functools import wraps from http.cookiejar import CookieJar from tempfile import NamedTemporaryFile from django.conf import settings from mapproxy.client import http as mapproxy_http from requests...
import os import re import click import difflib from ._version import * def diff_theme(theme=None): r''' Return dictionary of colors. .. code-block:: python { 'equal' : '...', 'insert' : '...', 'delete': '...', 'replace' : '...', } :param str theme: Select color-theme. ...
import collections import copy import functools import itertools import logging from celery.task import task import ckanclient from django.conf import settings from django_hosts.reverse import reverse_full import rdflib from humfrey.signals import graphs_updated from humfrey.sparql.endpoint import Endpoint from humfr...
""" show_isis.py IOSXR parsers for the following show commands: * show isis adjacency * show isis neighbors """ # Python import re from netaddr import IPAddress, IPNetwork # Metaparser from genie.metaparser import MetaParser from genie.metaparser.util.schemaengine import Schema, Any, Or, Optional from genie...
# TODO: resurrect the tests with plotting, commented out below, in a civilized fashion # import dill import pickle import numpy as np from mathx.sft import FTD, trans def test_FTD_0(): for iter in range(10): N = np.random.randint(2, 101) ft = FTD(N=N, Dx=np.random.rand(), x_0=np.random.rand(), k_0...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved. # Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries. # Other trademarks may be trademarks of their respective owners. # # Licensed under the Apache License, Ver...
import tkinter as tk, re from tkinter import ttk from dataclasses import dataclass, field from typing import List, Pattern, Iterable from copy import deepcopy Char: Pattern = re.compile('[a-z0-9]', re.I) ''' FormEntryFormat_dc this serves as a configuration for the behavior of FormEntry ''' @dataclass class Form...
""" Logging TreeViews is complicated because there are several ways to set them up and little direct support for extracting information from them. So they get their own module. """ import gtk, logging from images import ImageDescriber from ..treeviewextract import getAllExtractors class ColourSpecMap(dict): def ...
import pytest from django.urls import reverse from pytest_django.asserts import assertContains from ..models import Champion from ..views import ( ChampionCreateView, ChampionDeleteView, ChampionDetailView, ChampionListView, ChampionUpdateView, ) from .factories import ChampionFactory pytestmark =...
from .common import * from partname_resolver.components.resistor import Resistor from partname_resolver.units.resistanceTolerance import Tolerance from ..units.temperature import TemperatureRange import re from decimal import Decimal series = {'CAT16': 'Concave Terminations', 'CAY16': 'Convex Terminations', ...
# many code from http://d.hatena.ne.jp/yatt/20100129/1264791420 from logging import getLogger from reversi_zero.agent.player import ReversiPlayer from reversi_zero.config import Config, PlayWithHumanConfig from reversi_zero.env.reversi_env import ReversiEnv, Player from reversi_zero.lib.ggf import convert_move_to_act...
# Procedures of script process-photos.py # # Author: <NAME> # Date : Jan 01, 2018 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ########################################### # !!! IMPLEMENT THE PROCEDURES HERE !!! # ########################################### import flickrapi import api_crede...
"""Configuration file for the Sphinx documentation builder.""" # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If...
# To change this license header, choose License Headers in Project Properties. # To change this template file, choose Tools | Templates # and open the template in the editor. import json import os import os.path import tempfile import time import logging from concurrent.futures import thread from threading import Threa...
# coding: utf-8 import json import yaml import yaml.nodes from urllib import request as urllib2 from collections import OrderedDict class TestCase(object): def __init__(self, q, _in, out, v=None, failing=None): self.q = q self._in = _in self.out = out self.v = v self.faili...
import numpy as np import torch import torch.nn.functional as F import matplotlib.pyplot as plt def unpack_dqn_batch(batch): """ Definition: unpack_dqn_batch(batch) Unpack a batch of observations Parameters ---------- batch : a list contains a namedtuples of (state,action,reward,last_state)...
import numpy as np from activations import relu_backward, sigmoid_backward def linear_backward(dZ, cache, lambd): """ Implement the linear portion of backward propagation for a single layer (layer l) Arguments: dZ -- Gradient of the cost with respect to the linear output (of current layer l) cache -- tu...
import datetime import logging import logging.handlers import math import os import random import sys from bisect import bisect_right import colorlog import numpy as np import torch import yaml class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler): def __init__( self, optimizer, m...
""" Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. The Universal Permissive License (UPL), Version 1.0 """ import unittest # python classes from weblogic-deploy-tooling-ct from wlsdeploy.testing.common import testing_helper, testing_constants from wlsdeploy.testing.define.test_def_stage i...
#INSTRUCTIONS #This file is an application that runs a simple DSR test #It runs a number of simulation steps #At every step a number of simulated DSR nodes are updated #The CAN_TALK matrix defines which nodes can talk after a given time step #Run using "python3 testnet.py > logs/log_file_name" #=======================...
import cairosvg import svgwrite as svg import sys def split(line): L1=line.replace(';','|') L2=L1.split('|') L3=[L.split(',') for L in L2] return L3,['#FFFFFF' for i in L3] def drawStack(ofnamePrefix,stack,cols,prms): if len(stack)==0: return ofname='{}-{}.svg'.format(ofnamePrefix,prms['ofsuffix']) dwg=svg....
''' This program the Amazon results for each food to determine the prices ''' from pint import UnitRegistry ureg = UnitRegistry() # Need to define fluid ounces ureg.define('fl = 29.5735 * milliliter') import numpy as np import pprint import operator import os, fnmatch def reject_outliers(points, thresh=3...
# -*- coding: utf-8 -*- ################################################################################### # Added to enable code completion in IDE's. if 0: from gluon import * # @UnusedWildImport from gluon import request,db from task_scheduler import vm_scheduler from applications.baadal.models impo...
# # PySNMP MIB module TRAPEZE-NETWORKS-CLIENT-SESSION-TC (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRAPEZE-NETWORKS-CLIENT-SESSION-TC # Produced by pysmi-0.3.4 at Mon Apr 29 21:19:50 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using...
# standart modules import os # blender modules import bpy import bpy_extras # addon modules from . import version_utils def clear_bpy_collection(bpy_collection): for prop in bpy_collection: bpy_collection.remove(prop) def remove_bpy_data(): data = bpy.data clear_bpy_collection(data.objects) ...
"""Import and set up the imports_map.""" # The imports_map is special for some build systems, such as Bazel. Each entry # consists of a short name and a full name; this allows handling build targets # in a uniform way, with freedom to put the actual file in a different place # (e.g., if the source tree is read-only ...
#!/usr/bin/env python from __future__ import absolute_import, division, print_function from mpi4py import MPI import os, sys, glob, time import numpy as np import fitsio def merge_table_data(infiles, ext=1): ''' Merge the tables in HDU 1 of a set of input files ''' data = [fitsio.read(x, ext) for x ...
import logging from django.db.models import Q from django.http import HttpResponse from django.utils import timezone from zentral.contrib.mdm.models import (ArtifactType, ArtifactVersion, Channel, CommandStatus, DeviceCommand, UserCommand) ...
import os import pathlib _OS = int() def __init__(): get_os() def get_os(): global _OS os_choice = {"nt": 0, "posix": 1} for o in os_choice: print(o) if o == os.name: _OS = os_choice[o] print("OS is {} setting _OS to {}".format(str(os.name), _OS)) r...
"""ResNet PyTorch Utils Contains some functions that are useful towards the implementation and/or usage of all the available ResNet v1 variants trained both on ImageNet and CIFAR10. Some of this functions include: - Porting the weights from timm - Changing the memory format Contiguous / Channels Last - Normalization ...
import unittest import communication_tests import os from time import sleep import threading file_name_to_slave = "signal_to_slave.dat" file_name_from_slave = "signal_from_slave.dat" # map signal - [size, case-Id] # NOTE needs to be consistent with C++ signal_map = { "data_0" : 25, "data_1" : 25, "data_2"...
import os.path import vcr import ujson import tempfile import zipfile from contentpacks.khanacademy import retrieve_kalite_data from contentpacks.models import Item from contentpacks.utils import NODE_FIELDS_TO_TRANSLATE, \ download_and_cache_file, translate_nodes, \ translate_assessment_item_text, NodeType, ...
import unittest import pickle from tracker import Tracker, TrackerEvent from client import Client, ClientError from message import MessageParser, MessageType, _strip_message from peer import Peer from torrent import Torrent, TorrentError class ClientTests(unittest.TestCase): def setUp(self): self.client =...
import numpy as np import matplotlib.pyplot as plt import cv2 import gin import typing import torch import imutils from scipy.stats import multivariate_normal import xml.etree.ElementTree as ET from soccer_robot_perception.utils.constants import CLASS_MAPPING_DETECTION from soccer_robot_perception.utils.metrics import...
''' Created 06/03/2018 @author: <NAME> ''' import numpy as np class FilterBank(object): """ Based on Josh McDermott's Matlab filterbank code: http://mcdermottlab.mit.edu/Sound_Texture_Synthesis_Toolbox_v1.7.zip leny = filter bank length in samples fs = sample rate N = number of frequency cha...
from netmiko.cisco_base_connection import CiscoBaseConnection import re import time from telnetlib import IAC, DO, DONT, WILL, WONT, SB, SE, ECHO, SGA, NAWS from netmiko.ssh_exception import NetmikoAuthenticationException class H3CBase(CiscoBaseConnection): def session_preparation(self): """Prepa...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict from block_zoo.BaseLayer import BaseLayer, BaseConf from utils.DocInherit import DocInherit class ConvPoolingConf(BaseC...
import functools import itertools from numbers import Number import logbook from .._compat import itervalues, OrderedDict from ..ctx import context from .error import Error _logger = logbook.Logger(__name__) class Result(object): def __init__(self, test_metadata=None): super(Result, self).__init__() ...
""" CREATED: 3-JUN-2021 LAST EDIT: 11-JUN-2021 AUTHOR: <NAME>, MBA (<EMAIL>) READS blotter.xlsx (SYMBOL, SHARES, UNITARY, EXTENDED, DATE, BROKER, EXIT_TARGET) COMPARES holding period to SP500 performance ($, days) using PME (Public Market Equivalent) ref: https://docs.preqin.com/reports/Preqin-Special-Report-PME-July-...
import os import argparse import torch from torch import nn from torch.utils.data import Dataset, DataLoader from torchvision import transforms, datasets, models import torch.optim as optim from tensorboardX import SummaryWriter import tqdm from torch.autograd import Variable from pytorch_classifier.net_utils import Ne...
from abc import ABC import tensorflow as tf import numpy as np from engines.utils.mask import create_padding_mask class PositionalEncoding(tf.keras.layers.Layer): def __init__(self, embedding_dim, sequence_length): super(PositionalEncoding, self).__init__() self.embedding_dim = embedding_dim ...
from math import sqrt, ceil, factorial def generate_primes(n: int): primes = [] for num in range(0, n + 1): if num > 1: for i in range(2, num): if (num % i) == 0: break else: primes.append(num) return primes # takes a po...
import random import os import pickle import click import yaml import numpy as np from lifegate import LifeGate # from lifegate_utils import Font from q_networks import Q_Network, QNetCount, Experiment # np.set_printoptions(suppress=True, linewidth=200, precision=3) floatX = 'float32' class Font: purple = '\033[...
import json from arq import Worker from atoolbox.test_utils import DummyServer from pytest_toolbox.comparison import AnyInt, CloseToNow, RegexStr from em2.core import Action, ActionTypes from em2.protocol.core import get_signing_key from em2.settings import Settings from .conftest import Factory async def test_pub...
import base64 import binascii import calendar import hashlib import hmac import json import logging import os import re import sys import time from dataclasses import dataclass from datetime import datetime, timedelta from html import unescape from typing import List, Union, Optional import asyncpg from tornado.web im...
import os import json from dotenv import load_dotenv import tweepy import pandas as pd class Politician: def __init__(self, name, username, party, state): self.name = name self.username = username self.party = party self.state = state self.tweets = [] def __str__(self):...
import torch.nn as nn import torch import numpy as np import torch.nn.functional as F from lib.lightrfb import LightRFB from lib.Res2Net_v1b import res2net50_v1b_26w_4s from lib.PNS_Module import NS_Block class conbine_feature(nn.Module): def __init__(self): super(conbine_feature, self).__init__() ...
import re from collections import defaultdict from hamper.interfaces import ChatCommandPlugin, Command from hamper.utils import ude, uen from sqlalchemy import Column, Integer, String from sqlalchemy.ext.declarative import declarative_base SQLAlchemyBase = declarative_base() class Karma(ChatCommandPlugin): '''...
from os import path from collections import defaultdict import src.datahandlers.obo as obo import src.datahandlers.reactome as reactome import src.datahandlers.rhea as rhea import src.datahandlers.ec as ec from src.prefixes import GO, REACT, WIKIPATHWAYS, RHEA, SMPDB, EC, PANTHERPATHWAY, TCDB from src.categories impo...
# MIT License # # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
from __future__ import print_function, absolute_import, division import datetime import os import os.path as path import random import numpy as np import torch import torch.backends.cudnn as cudnn import torch.nn as nn from function_baseline.config import get_parse_args from function_baseline.data_preparation_custom...
#!/opt/software/miniconda3/bin/python # -*- coding: UTF-8 -*- import os,sys import numpy as np from datetime import datetime, timedelta import matplotlib.pyplot as plt import matplotlib.ticker as mticker import xarray as xr import cartopy as cart import cartopy.crs as ccrs import cartopy.feature as cfeature from cartop...
#!/usr/bin/python kbNormal = [ list("a"), list("b"), list("c"), list("d"), list("e"), list("f"), list("g"), list("h"), list("i"), list("j"), list("k"), list("l"), ...
######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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 sys import toml import typer from rich import print from rich.console import Console from linkace_cli import models from linkace_cli.api.links import Links from linkace_cli.cli.helpers import interactive_editor, shared_ctx links_cli = typer.Typer() console = Console() def print_links(links: list): """ ...
from unittest import TestCase from tempfile import mkdtemp from shutil import rmtree from pathlib import Path import numpy as np from pynwb import NWBHDF5IO from pynwb.image import ImageSeries from nwbinspector import ( InspectorMessage, Importance, check_image_series_external_file_valid, check_image_...
""" Copyright MIT and Harvey Mudd College MIT License Summer 2020 Lab 2A - Color Image Line Following """ ######################################################################################## # Imports ######################################################################################## import sys import cv2 a...
import os import time import yaml import torch import argparse import random import numpy as np import cv2 from prettytable import PrettyTable from easydict import EasyDict from tqdm import tqdm from microscopy.data import build_val_loader from microscopy.models import build_model from microscopy.util import AverageMet...
# To add a new cell, type '' # To add a new markdown cell, type ' [markdown]' import pandas as pd import numpy as np from matplotlib import pyplot as plt from sklearn.metrics.pairwise import cosine_similarity from sklearn.metrics import pairwise_distances from app.models import db def find_n_neighbours(df,n): ...
# Data logging at high frequencies # Author - <NAME> # - https://github/rhubarbdog # License - MIT 2019 see file LICENSE in this repository # Published - March 2019 import pyb import time import array import ustruct import gc import micropython micropython.alloc_emergency_exception_buf(200) SHORT_CHAR...
import re import fastjsonschema from src.utils.errors import ErtisError SCHEMA_NAME_PATTERN = "^[A-Za-z0-9_]{3,100}$" CREATE_SCHEMA = { '$schema': 'http://json-schema.org/schema#', 'type': 'object', 'additionalProperties': True, 'properties': { 'name': { 'type': 'string', ...
import subprocess import re import time class dhcpcdManager: def __init__(self): self._filePath = '/etc/dhcpcd.conf' with open(self._filePath, 'r') as fp: self._lines = fp.readlines() def find_interface_line(self, interface: str) -> int: index = 0 for line in self...
""" Plotting a graph with bad gradient nodes marked in red. Mostly copy-paste from https://github.com/t-vi/pytorch-tvmisc/tree/master/visualize """ from graphviz import Digraph import numpy as np import tvm def collect_ops(node): ops = set() def visitor(e): if isinstance(e, tvm.ir.Op): op...
"""Python script to classify the image.""" # Import the necessary libraries from sklearn.decomposition import PCA import os import scipy.io as sio import numpy as np from keras.models import load_model from keras.utils import np_utils from sklearn.metrics import classification_report, confusion_matrix import spectral ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# -*- coding: utf-8 -*- """.. moduleauthor:: <NAME>""" from dataclasses import dataclass from enum import Enum from typing import final, Type, Dict, Tuple, Callable, Final, List from bann.b_container.states.framework.general.prepare.local_prepare import LocalPrepTState, \ get_local_prepare_state_types from bann.b_...
import asyncio import os from typing import OrderedDict from .query import query, runQuerySingleKey, runQueryMultiKey import inc.cache import config # init all relevant caches cacheLiteralsTop = inc.cache.Cache('literalstop', ['base']) cacheLiteralsFull = inc.cache.Cache('literalsfull', ['base']) cacheObjectsTop = inc...
#! python3 #import os #os.environ["R_HOME"] = r"" #os.environ["path"] = r"C:\Users\localadmin\Anaconda3;C:\Users\localadmin\Anaconda3\Scripts;C:\Users\localadmin\Anaconda3\Library\bin;C:\Users\localadmin\Anaconda3\Library\mingw-w64\lib;C:\Users\localadmin\Anaconda3\Library\mingw-w64\bin;" + os.environ["path"] import o...
#!/usr/bin/env python3 from termcolor import colored import argparse import shlex import regex mem = [] class commands: def input_(self, mem, c): if c[0][-1] == "#": mem[int(c[1])] = input(c[2]) return mem[int(c[1])] else: mem.append(input(c[1])) re...
#!/usr/bin/env python3 import numpy as np import os import time import gym import json import sys import functools from tqdm import tqdm, tnrange from drlnd.core.common.util import is_notebook, count_boundaries from drlnd.core.agents.base_agent import AgentBase from drlnd.core.common.ring_buffer import ContiguousRing...
""" Copyright (c) 2018, <NAME>. Distributed under the terms of the MIT License. The full license is in the file LICENSE, distributed with this software. Created on Mar 17, 2018 @author: jrm """ from atom.api import Typed, Bool, set_default from enamlnative.android.bridge import ( JavaBridgeObject, JavaMethod, J...
"""wxadamodeltree.py - customized version of wxPython's TreeCtrl for the ADA Toolkit <NAME> (TRI/Austin, Inc.) """ __author__ = '<NAME>' from views import wxmodeltree import wx class ModelTree(wxmodeltree.ModelTree): """ADAModel customized version of wxPython's TreeCtrl, adds extra functionality...
import tensorflow as tf from tensorflow.keras import backend as K from tensorflow.python.ops.linalg.sparse import sparse as tfsp from . import ops def dot(a, b): """ Computes a @ b, for a, b of the same rank (both 2 or both 3). If the rank is 2, then the innermost dimension of `a` must match the out...
import requests import pandas as pd import time import datetime import dateutil.parser pd.set_option('display.max_columns', None) class CoinMarketCap: PRODUCTION_BASE_URL = 'https://pro-api.coinmarketcap.com' SANDBOX_BASE_URL = 'https://sandbox-api.coinmarketcap.com' API_TYPE_MAP = { ...
# Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distri...
#!/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. import os import shlex import shutil import subprocess import random from parlai.core.params import ParlaiParser from p...
# -*- coding: utf-8 -*- import struct from collections import OrderedDict from graphenebase.objects import GrapheneObject from graphenebase.objects import Operation as GrapheneOperation from graphenebase.objects import isArgsThisClass from graphenebase.types import ( Bytes, Int16, Map, Optional, Po...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Single image resize perf-test. """ import argparse import http.client import io import logging import statistics import sys import time from PIL import Image PLT = None NP = None try: import matplotlib.pyplot import numpy PLT = matplotlib.pyplot NP = ...
import asyncio import logging import inspect from copy import copy from enum import Enum from uuid import uuid4 from datetime import datetime, timezone from tukio.event import EventSource, Event from tukio.utils import FutureState, SkipTask from tukio.broker import get_broker, workflow_exec_topics from .task import T...
""" The model library """ import torch import numpy as np class Model(object): """ Docstring for Model. The basic model. """ def __init__(self) -> None: """init the model with preferences""" # Use Adam as the default optimizer self.optimizer = torch.optim.Adam self.pa...
import numpy as np # import Layer from scipy.stats import norm from matplotlib import pyplot as plt from scipy.stats import rv_continuous from qiskit.circuit import Parameter, ParameterVector from qiskit import * from sklearn.metrics.cluster import adjusted_mutual_info_score as mi class PQC: def __init__(self,na...
# ----------------------------------------------------------- # demonstrates how to normalize data within each operating regime with multi-layer perceptron # # (C) 2020 <NAME>, Lisbon, Portugal # Released under GNU Public License (GPL) # email <EMAIL> # ----------------------------------------------------------- import...
import pytest import os from dotenv import load_dotenv, find_dotenv import json from os import listdir import csv load_dotenv(find_dotenv()) def find_csv_filenames( path_to_dir, suffix=".csv" ): filenames = listdir(path_to_dir) return [ filename for filename in filenames if filename.endswith( suffix ) ] def...
# this project is licensed under the WTFPLv2, see COPYING.txt for details from .. import connector from ..app import qApp from ..widgets.helpers import parentTabWidget __all__ = ('findEditor', 'openEditor', 'listEditors', 'newEditorOpen', 'newEditorShare', 'newEditorTryShare') def findEditor(path): """G...
# Copyright 2019 Hitachi, Ltd. (author: <NAME>) # Modified by: <NAME> # Licensed under the MIT license. import numpy as np import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import TransformerEncoder, TransformerEncoderLayer from torch.optim.lr_scheduler import _LRScheduler ...
# Copyright 2020 Adap GmbH. 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 or ag...
#!/usr/bin/env python """ Measures the response time of the evgp car by moving a box in front of the car then measuring how long it takes the lidar scan, map, and planned path to reflect the update. @author <NAME> """ from __future__ import print_function import time import itertools import signal import sys impor...
import pandas as pd import numpy as np import re import tensorflow as tf from keras import layers from sklearn.model_selection import train_test_split from keras.layers.recurrent import LSTM from keras.layers.core import Dense, Dropout, Activation from keras.models import Sequential from keras.layers import Dense from ...
import os import sys OMP_THREADS_ENV = 'OMP_NUM_THREADS' if len(sys.argv) < 2: print('No outfile') quit() out_file = sys.argv[1] cli_app = '' if len(sys.argv) >= 3: cli_app = sys.argv[2] if sys.argv[2] != '-t' else '' test_en = False for arg in sys.argv: if arg == '-t': test_en = True gra...
# source: https://github.com/dido1998/Recurrent-Independent-Mechanisms import torch import torch.nn as nn import torch.nn.functional as F import math import numpy as np import torch.multiprocessing as mp import random from numpy.random import default_rng rng = default_rng() class blocked_grad(torch.autograd.Functi...
#Bedirhan Karakaya 180401057 from sympy import Symbol from sympy import pprint """kaca_kadar=600 satir_sayisi=1 asallar = [2] for i in range(3,kaca_kadar,2): bolundu = False limit = (i ** 0.5) + 1 for j in asallar: if i % j == 0: bolundu=True break i...