text
stringlengths
3.07k
22.1k
import sys sys.path.append('.') from models.script.kernels import GaussianKernel from models.script.multikernel import MultipleKernelMaximumMeanDiscrepancy import copy import torch import os import os.path as osp from torch import optim from torch.utils.data import DataLoader import torch.nn as nn import numpy as np im...
from __future__ import print_function import os import sys import serial import xml.etree.cElementTree as et import ntpath import re import struct import glob import datetime as dt import pandas as pd import mbed_lstools import subprocess import json import shutil from bunch import Bunch, unbunchify from pyOCD.board i...
#-*- coding: utf-8 -*- """ @author:<NAME> """ from __future__ import print_function #--------------------------------------------------------------- # imports #--------------------------------------------------------------- from termcolor import colored import os import numpy as np import cv2 #----------------------...
################################################################################ ## Import packages. ## ################################################################################ import json import ipdb import time import copy ############################...
# -*- coding: utf-8 -*- """ test_reading_third_party_data.py """ from __future__ import absolute_import, print_function import unittest try: from unittest import mock except ImportError: import mock import pandas as pd from hydropy import reading_third_party_data as r3p from hydropy import exceptions good_j...
import torch import torch.nn as nn from torch.autograd import Variable import numpy as np import settings from scipy.spatial import distance class ActiveQuery(object): def update(self, unlabeled_set, labeled_set, drawn, weights): update_data, update_label = labeled_set.update( unlabeled_set....
import re from Levenshtein import distance from Bio import SeqIO from tqdm import tqdm from datetime import datetime import pprint from utils import cycle_motif,expand_repeat import sys REPEAT_CLASSES = {} repeat_track = {} debug = False motif_size = 6 percent_mutations = 0.2 pp = pprint.PrettyPrinter(depth=2) st...
#IMPORTANT: Change path to wkhtmltopdf for windows to .exe and backslash; #There may be margin errors with the windows version, works best on MAC #Import necessary modules from flask import Flask, render_template, make_response, flash, redirect, url_for, request, logging import pdfkit from wtforms import Form, String...
import argparse import os import numpy as np import torch import torch.nn as nn import torch.optim as optim import visdom from torch.utils.data import DataLoader, TensorDataset from neuralsea import NeuralSEA ############################################################################### # Train Settings parser = ar...
from omspy.brokers.fyers import Fyers from unittest.mock import patch, call import pytest import json from copy import deepcopy with open("tests/data/fyers.json") as f: mock_data = json.load(f) @pytest.fixture def mock_fyers(): broker = Fyers("app_id", "secret", "user_id", "password", "<PASSWORD>") with ...
# SPDX-License-Identifier: Apache-2.0 from behave_rest.steps import * from behave import * import time import os import sys import uuid import compose_util import common_util import config_util import shutil import subprocess import requests FNULL = open(os.devnull, 'w') @when(u'I start explorer') def start_explorer...
# -*- encoding: utf-8 -*- """ @File : /detectron2/detectron2/modeling/flow/flownets.py @Time : 2020-11-24 14:39:31 @Author : Facebook, Inc. and its affiliates. @Last Modified: 2020-11-25 00:00:03 @Modified By : Chen-Jianhu (<EMAIL>) @License : Copyright(C), USTC @Desc : None """ imp...
""" Copyright (c) 2010-2018 CNRS / Centre de Recherche Astrophysique de Lyon Copyright (c) 2016-2019 <NAME> <<EMAIL>> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code m...
from collections import OrderedDict import cerberus import netCDF4 as nc import numpy as np from .attributes import AttributeHandler def validate(schema, config): # type: (dict, dict) -> dict """ Validate a config dict against a cerberus schema. Raise ValueError if there is a problem, otherwise retu...
from keras.callbacks import Callback from keras import backend as K from math import ceil from time import ctime import logging import tensorflow as tf def jaccard_coef(y_true, y_pred): intersection = K.sum(y_true * y_pred, axis=[0, -1, -2]) sum_ = K.sum(y_true + y_pred, axis=[0, -1, -2]) jac = (intersecti...
"""_common.py: Resqml polyline common functions module.""" version = '23rd November 2021' import logging log = logging.getLogger(__name__) import math as maths import numpy as np import resqpy.olio.uuid as bu import resqpy.olio.vector_utilities as vu import resqpy.olio.xml_et as rqet import resqpy.organize as rqo ...
# Code generated by lark_sdk_gen. DO NOT EDIT. from pylark.lark_request import RawRequestReq, _new_method_option from pylark import lark_type, lark_type_sheet, lark_type_approval import attr import typing import io @attr.s class GetHelpdeskTicketListReq(object): ticket_id: str = attr.ib( default="", meta...
#import pika import csv import datetime import hashlib import sys import logging from uuid import uuid4 from . import FILE_NAME, RABBITMQ_URL, EXCHANGE, UAC_ROUTING_KEY, CASE_ROUTING_KEY, DATA_PUBLISH, INSTANCE_NUM, MAX_INSTANCES case_ref = 84000000 cases = [] next_case_index = 0 logger = logging.getLogger('perform...
#!/usr/bin/env python3 # Map this file to /tftpboot/ for vrnet vr-sros VMs to access via tftp import sys, ipaddress, re from pysros.management import connect import pynetbox, requests # Helper method def get_ips_by_dns_lookup(target, port=22): ''' this function takes the passed target and optional port an...
import logging import json import time from pathlib import Path from argparse import ArgumentParser from functools import wraps from flask import Flask, Response, render_template from gqlalchemy import Match, Memgraph from gqlalchemy.models import MemgraphIndex from enum import Enum log = logging.getLogger(__name__) ...
import importlib as il import os.path import inspect import re import logging import json from .ParserData import Struct from .ParserData import ParseContainer from .ParserData import StructEncoder from .QCBase import GenFormatter, VarNames as V class Parser(object): FIND_MAX_LINES = 100 def __init__(self, o...
import threading import unicodedata from collections import namedtuple import linguistics Entry = namedtuple('Entry', ['hymmnos', 'word_class', 'pronunciation', 'meaning_ja', 'meaning_en', 'dialect']) hymmnos_lexicon = [] hymmnos_lexicon_by_hymmnos = {} hymmnos_lexicon_lock = threading.Lock() Emotion = namedtuple('E...
"""Implement a directed graph in Python.""" from collections import defaultdict import random def get_key_ordered_dictionary_repr(dictionary, delimiter=': ', decorator_in='{', decorator_out='}'): """Get a string representation of a dictionary ordered by keys. Parameters ...
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014 <NAME> # All rights reserved. # ----------------------------------------------------------------------------- """ Braitenberg vehicles simulation using the pyafai framework. Implementation of ve...
# -*- coding: utf-8 -*- """ ========================= Generic Serial Controller ========================= This is a generic controller for Serial devices (like Arduino). It includes serial write and query methods. Higher level stuff could (should?) be done at Instrument level. Extra methods could however also be added...
def isprime(n): """ Test if n is a prime number (True) or not (False). For n < 2^64 the answer is definitive; larger n values have a small probability of actually being pseudoprimes. Negative numbers (e.g. -2) are not considered prime. The first step is looking for trivial factors, which if foun...
from functools import lru_cache from itertools import chain from pathlib import Path from time import sleep from typing import Iterable, Optional, Sequence, Set, Tuple, Union import numpy as np import pandas as pd from tqdm import tqdm from ._database import Database, require_write_access from ._dataframe import iter...
import cv2 as cv import numpy as np import os import time def get_alpha_W_black(): video = "videos/clipcanvas-black.mp4" cap = cv.VideoCapture(video) res, waterpic = cap.read() print(waterpic.max(),waterpic[:,:,0].mean(),waterpic[:,:,1].mean(),waterpic[:,:,2].mean(),) # waterpic = cv.cvtColor(waterpic, cv.COLOR_B...
import copy from user_interface import GUI from pieces import Pawn, Bishop, Knight, Rook, Queen, King class Board(object): def __init__(self, _rows: int, _columns: int): self.rows = _rows self.columns = _columns self.chessboard = [] self.gui = GUI(800, 800) self.check = Fal...
import pandas as pd import nltk, json, os from nltk import word_tokenize import numpy as np from textblob import TextBlob import itertools def nltk_featurize(transcript): #alphabetical features a=transcript.count('a') b=transcript.count('b') c=transcript.count('c') d=transcript.count('d') e=transcript.count...
# -*- coding: UTF-8 -*- """ @author: eritpchy @file : reformat.py @time : 2021/12/17 15:43 @desc : 将连起来的英文单词切分 """ import json import os import pysrt import sys import wordsegment import re import os import spacy nlp = spacy.load("en_core_web_sm") NLP_MAP_KEY_WORD_SEGMENT = "wordsegment" NLP_M...
from copy import copy import numpy as np from paderwasn.geometry_calibration.utils import map2ref def approximate_mds(dists): """Approximate multidimensional scaling (MDS) Estimate the inter-node distance matrix from source node distances as described in "Iterative Geometry Calibration from Distance Esti...
import datetime import glob import time import dask import numpy as np import pandas as pd import xarray import xclim from xclim.core.calendar import percentile_doy import ecad_functions import icclim import xarray as xr from distributed import Client from icclim.icclim_logger import Verbosity from models.ecad_indic...
import os import sys from os.path import join, isfile, splitext import argparse import re from shutil import rmtree, copy2 from PIL import Image, ImageOps, ImageEnhance from distutils.dir_util import copy_tree import math import numpy as np def main(): args = parse_args() datasets_path = args.datasets_path if...
import time import hashlib import requests import logging from pathlib import Path import util.clash_control as clash_control STANDARD_HEADERS = { 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96...
from __future__ import absolute_import import torch as t from torch import nn # from torchvision.models import vgg16 from pretrainedmodels import pnasnet5large from model.region_proposal_network import RegionProposalNetwork from model.faster_rcnn import FasterRCNN from model.roi_module import RoIPooling2D from utils im...
import cPickle as pickle import logging import multiprocessing as mp import os import subprocess import timeit import pandas as pd import parallel as par import atom3.database as db import atom3.sequence as sequ def add_conservation_parser(subparsers, pp): """Add parser.""" def map_all_pssms_main(args): ...
""" Wrapper module for the Pyte terminal emulator """ from collections import deque, namedtuple from itertools import islice import math from . import pyte from .pyte import modes class PyteTerminalEmulator(): """ Adapter for the pyte terminal emulator """ def __init__(self, cols, lines, history, rat...
# solutions.py """Volume II Lab 4: Data Structures 1 (Linked Lists). Solutions file.""" # Problem 1: Modify the constructor of the Node class. class Node(object): """A basic node class for storing data.""" def __init__(self, data): """Store 'data' in the 'value' attribute. Raises: ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ @Author: <NAME> @License: Apache Licence @Time: 2019.11.06 : 下午 8:24 @File Name: track_demo.py @Software: PyCharm ----------------- """ import cvlib as cv from dataset_utils import normalize, denormalize from prepareDataset import ReIDDataset import cv2 import os imp...
from collections import UserDict from Skoarcery.SkoarPyon import toke_inspector, skoarmantics from Skoarcery.SkoarPyon.lex import Toke_Whitespace, Toke_EOF, SkoarToke class Toker: def __init__(I, code): I.skoarse = code I.am_here = 0 I.saw = None def see(I, want): if I.saw: ...
# -*- coding: utf-8 -*- # # Copyright (C) 2016-2018 # Author: <NAME> (<EMAIL>) # file: io_xml_format.py """ Reading and writing graphs in GEXF format. GEXF (Graph Exchange XML Format) is a language for describing complex network structures, their associated data and dynamics. Reference and specification: - http...
import argparse import csv import os from collections import defaultdict import pandas as pd import numpy as np from mll.analyse import reduce_common include_architectures = set([ 'RNNAutoReg:dgsend+RNN:dgrecv', 'RNNAutoReg:GRU+RNN:GRU', 'HierZero:GRU+Hier:GRU', 'RNNZero2L:RNN+RNN2L:RNN', 'RNNZe...
import sqlite3 from sqlite3 import Error import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import matplotlib.patches as mpatches import plotly.graph_objects as go def create_connection(db_file): """ create a database connection to the SQLite database specified by...
import os, sys, re, copy import pandas as pd import rdkit from rdkit import Chem, RDLogger from rdkit.Chem import rdChemReactions RDLogger.DisableLog('rdApp.*') sys.path.append('../') from Extract_from_train_data import build_template_extractor, get_reaction_template, get_full_template def get_edit_site_re...
from copier import * from replacment import * from tkinter import Tk, Text, TOP, BOTH, X, Y, N, LEFT, RIGHT from tkinter.ttk import Frame, Label, Entry rowPos = 0 replacementsGui = [] replacementsFrame = NONE txtTarget = NONE txtSrc = NONE operationSrc = NONE operationRes = NONE rootMain = NONE app = ...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
from flask import Flask from flask import jsonify,request, make_response import webauthn import util from flask_cors import CORS import database from app import app import base64 import math import json import os import binascii from flask_jwt_extended import ( JWTManager, jwt_required, create_access_token, get_jwt...
"""Get output of fits into a format for UNITY""" import os import copy import click import pickle import sncosmo import numpy as np import pandas as pd from collections import defaultdict from astropy import units as u from astropy.io import ascii from astropy.coordinates import SkyCoord from scipy.linalg import block...
import os import warnings import matplotlib.pyplot as plt import missingno as msno import numpy as np import pandas as pd import seaborn as sns from plotnine import * # Author: <NAME> # CSS 490 Machine Learning # Date 8/17/2018 warnings.simplefilter(action='ignore', category=FutureWarning) def plot_...
# model script for SCSM classes and functions import math import random import sqlite3 import tkinter from datetime import datetime from datetime import timedelta from pandas import read_csv from pandas import errors class StatModel: _df_schedules = None _sqlite3_database = None _ignore_data_quality = F...
from torchvision import models import torch.nn as nn import torch import torch.optim as optim import json import numpy as np from dataset import Drive360Loader import sys import math test = False class CONV_LSTM(nn.Module): def __init__(self): super(CONV_LSTM, self).__init__() final_concat_size = ...
from __future__ import absolute_import from .feature_set import FeatureSet from scipy.optimize import fmin_l_bfgs_b from math import exp, log from sklearn.model_selection import train_test_split from .utils.parameters import * from .utils.utils import create_status from .data_processing import load_data, preprocess ...
################################################################################ # File Name: models.py # # File Author: <NAME> # # File Description: # This file defines models used # in our database # # File History: # 2020-11-05: Result model added by Rohit # 2020-11-02: Created by Rohit # #####...
# # Copyright 2020 by 0x7c2, <NAME>. # All rights reserved. # This file is part of the Report/Analytic Tool - CPme, # and is released under the "Apache License 2.0". Please see the LICENSE # file that should have been included as part of this package. # import func import sys, time import threading from datetime impor...
""" Copyright 2021 <NAME> - <EMAIL> 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 ...
import tensorflow as tf from tensorflow.keras.layers import BatchNormalization, LeakyReLU, Activation from . import layer as lay class UpSamplingLayer: def __init__(self, channel_out, kernel_size = 5, stride = 1): self.seq = tf.keras.Sequential() self.seq.add( tf.keras.layers.Conv1D( ...
# -*- coding: utf-8 -*- helpstr = ''' get_avgs v1.0.0 2/20/2018 This program calculates the 12 hour averages in both the Oregon and Washington methods and also combines the two methods for the most restrictive of the two methods. POC: <NAME> FORMATTING ========== configuration file example -------------------------- ...
from datetime import timezone, datetime from random import randint import hikari from PIL import Image from lightbulb import plugins, commands, cooldowns, converters, checks, Bot from lightbulb.context import Context class Inspect(plugins.Plugin): def __init__(self, bot: Bot): super().__init__() ...
#! /usr/bin/python3 import numpy as np import matplotlib.pyplot as plt from scipy import special as sc from nuclide import Nuclide, reducedh2m_fm2 from scipy.special import genlaguerre as Lag """ This module numerically solves the radial Schroedinger's Equation in an arbitrary central potential using a finite differe...
import logging from collections import OrderedDict from pathlib import Path from typing import Union, Tuple, Set from lxml import etree from lxml.etree import Element, iterparse from spacy.language import Language from spacy.tokens.span import Span from .base_reader import BaseDocReader, BaseDirReader class EhostDo...
import torch def bbox_overlaps_nd_pytorch(anchors: torch.Tensor, targets: torch.Tensor, dim=None, mode='iou', aligned=False, eps=1e-6) -> torch.Tensor: """ :param an...
# This code is copied from [pysignald](https://pypi.org/project/pysignald/) and modified to run locally with payments import os import json import random import re import socket from typing import Iterator, List # noqa from .types import Attachment, Message # We'll need to know the compiled RE object later. RE_TYPE...
# ----------------------------------------------------------------------------- # IMPORTS # ----------------------------------------------------------------------------- from collections import OrderedDict import pandas as pd import os from abc import ABC, abstractclassmethod from nettoolkit import JSet, STR, ...
import os from re import match from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate database_name = "ufcfan" # Here we connect to Heroku database database_path = os.environ.get('DATABASE_URL') db = SQLAlchemy() migrate = Migrate() ''' setup_db(app) binds a f...
""" Tests for L{klein.plating}. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) import json from klein import Plating from twisted.web.template import tags, slot from twisted.web.error import FlattenerError, MissingRenderMethod from klein.test.test_resource import requ...
#!/usr/bin/env python3 """This is an implementation of the classic alpha mining algorithm [1]_. .. [1] <NAME>, Wil, <NAME>, and <NAME>. "Workflow mining: Discovering process models from event logs." IEEE Transactions on Knowledge & Data Engineering 9 (2004): 1128-1142. """ import pandas as pd import logging imp...
# src # https://medium.com/lyfepedia/sending-emails-with-gmail-api-and-python-49474e32c81f # https://stackoverflow.com/a/41407166/3154274 # source = https://developers.google.com/gmail/api/quickstart/python?authuser=2 # credential from __future__ import print_function import pickle from googleapiclient.discovery i...
# -*- coding: utf-8 -*- # Copyright (c) 2020-2021 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ OpenSCENARIO Generator - Add Pedestrians """ import math import os import random # pylint: disable=no-name-in-module, no-member ...
import warnings import numpy as np import pandas as pd import torch import torch.nn.functional as F import os import torch.utils.data as torchdata from torch.utils.data import DataLoader import time from pathlib import Path from tqdm import tqdm import soundfile as sf import argparse parser = argparse.ArgumentParser(...
import numpy as np import os import json from matplotlib import pyplot as plt from matplotlib import colors from matplotlib.patches import Rectangle import gym from gym.spaces import Discrete from gym import utils from gym.utils import seeding # As described in Smith and Simons (2004): https://arxiv.org/pdf/1207.416...
"""Contains the building blocks of RegNetY models.""" import tensorflow as tf from tensorflow.keras import layers from regnety.models.utils import ConvInitializer, DenseInitializer # Contains: # 0. PreStem # 1. Stem # 2. Body # 2.1 Block # 2.1.1 SE # 3. Head # 4. RegNetY # Reference: https://arxiv.org/p...
#MIT License # #Copyright (c) 2021 ASReview hackathon for Follow the Money # #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,...
import numpy as np import xarray as xr from . import physconstants # Must have: # 1. extract_grid (returns an xarray Dataset) # 2. grid_area (returns a 6xNxN array) # 3. gen_grid (returns an xarray Dataset) def find_idx(targ_val,bound_vec_full,allow_loop=False): # Find the index, assuming evenly-spaced bounds (an...
from .blueprint import restbp @restbp.errorhandler(400) def ierror_400(error): #pylint: disable = unused-argument """Error handler for HTTP error 400""" return error_400() @restbp.errorhandler(401) def ierror_401(error): #pylint: disable = unused-argument """Error handler for HTTP error 401"...
#!/usr/bin/env python ''' Affine invariant feature-based image matching sample. This sample is similar to find_obj.py, but uses the affine transformation space sampling technique, called ASIFT [1]. While the original implementation is based on SIFT, you can try to use SURF or ORB detectors instead. Homography RANSAC ...
"""Automatic generation of law knowledge graph""" import json import logging import time from pathlib import Path import pandas as pd from sklearn.utils import shuffle from tqdm import tqdm from config import KGGConfig from nere.kgg.neo4j_module import ImportNeo4j from nere.kgg.ner import EntityRecognition from nere...
import numpy as np import pandas as pd import scipy as sp import matplotlib import math from math import e import mne import tensorflow as tf from tensorflow import keras import os import sys # IMPORTANT NOTES: # Labels: 0-Hot, 1-Warm, 2-EO, 3-EC, 4-S # Function for reading a dataset from the EEG dataset and creat...
import abc import geopandas as gpd import logging import os import pandas as pd from enum import Enum from pydantic import BaseModel, validator from pyquadkey2 import quadkey from typing import Dict, List, Optional, Union import pyarrow.parquet as pq logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ...
from random import choice from typing import List, Union from fedot.core.data.data import InputData from fedot.core.data.data_preprocessing import data_has_categorical_features, data_has_missing_values from fedot.core.data.multi_modal import MultiModalData from fedot.core.pipelines.node import PrimaryNode, SecondaryNo...
import datetime import dateutil import h5py import numpy as np import pytest from dxtbx.nexus import nxmx def test_nxentry(nxmx_example): nxentry = nxmx.NXentry(nxmx_example["/entry"]) assert nxentry.definition == "NXmx" assert len(nxentry.samples) == 1 assert isinstance(nxentry.samples[0], nxmx.NX...
#!/usr/bin/env python ############################################################################## # # genrandommods - Generate random road network modifications # # File: genrandommods.py # Author: <NAME> # Created: July 2011 # # $Id: genrandommods.py 643 2011-09-01 05:47:35Z astivala $ # # #####################...
import pytest from knowledge_base import inference, utils from knowledge_base.grammar import parse, parse_substitution caesar_model = [ 'man(Marcus)', 'roman(Marcus)', '*x: man(x) => person(x)', 'ruler(Caesar)', '*x: roman(x) => loyal(x, Caesar) | hate(x, Caesar)', '*x, ?y: loyal(x, y)', '...
import copy import logging import os import shutil import subprocess import pysam import pysam.bcftools from cluster_vcf_records import variant_tracking, vcf_file_read from varifier import global_align, dnadiff, probe_mapping, utils def _check_dependencies_in_path(): programs = ["minimap2", "paftools.js", "k8"...
import argparse import os from scipy import stats import deepfake from figures import profiles_viz from CellData import CellData import numpy as np import pandas as pd import random from shutil import copyfile def get_options(): parser = argparse.ArgumentParser(description='Version: 1.0') parser.add_argument('...
import os import time import string import random import requests import threading import mysql.connector from mysql.connector import Error class Apk: def __init__(self, name, method): self.downloadedDir = "/var/www/catchmeifyoucan.tech/malwareHidingSystem/necessaryFiles/apk/" sel...
import pygame from Grid import bot from Tiles import listOfTiles from SHIT import GenerateAll side = 40 class Button: def __init__(self, x, y, width, height, func, color, name): self.func = func self.rect = pygame.Rect(x, y, width, height) self.color = color self.ogColor = color ...
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from enum import Enum, auto import struct class Success(Exception): pass class Fail(Exception): pass # RV32I Base Instruction Set class Ops(Enum): NOP = 0x0 LUI = 0b0110111 # load upper immediate AUIPC = 0b0010111 # add upper immediate to pc JAL = 0b1101111 JALR = 0b1100111 ...
"""pytest configuration.""" import asyncio import os from itertools import chain import aioboto3 import aiobotocore import pytest from aiobotocore.config import AioConfig from aioradio.aws.dynamodb import DYNAMO from aioradio.aws.moto_server import MotoService from aioradio.aws.s3 import S3 from aioradio.aws.secrets...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pytest import sys sys.path.insert(0, '.') from src.commands import * def test_range(): r = range_builder('./test/test.agda', 6, 8, 6, 12) assert r() == '(intervalsToRange (Just (mkAbsolute "./test/test.agda")) [Interval (Pn () 49 6 8 ) (Pn () 73 6 12 ) ])' ...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # Markdown cells are embedded in comments, so the file is a valid `python` script. # <codecell> from pyspark.sql import SparkSession import yaml import great_expectations as ge import json # Use s3a for accessing the parquet file in case it exceeds 5G...
# Copyright (c) 2009-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 ...
''' Contains functions for extracting the thumbnail from fullchip data ''' from .datfile import DatFile from . import chiptype as ctm import numpy as np tn_valid = ( '550_3525', '530v1', '540v1', '541v2_250', 'Val541v2_250' ) spa_valid = () def get_thumbnail( data, chiptype=None, spa=False ): ''' Function for get...
import argparse import os import random from typing import List import matplotlib.pyplot as plt import numpy as np import pandas as pd import torch import yaml from addict import Dict from sklearn.metrics import auc, roc_curve from torch.utils.data import DataLoader from libs.checkpoint import resume from libs.datase...
from flask import Flask, session, jsonify, request, render_template, redirect, Response from flask.helpers import flash, url_for from werkzeug.wrappers import response from forms import LoginForm from flask_wtf.csrf import CSRFProtect from flask_mysqldb import MySQL import MySQLdb.cursors import json import mysql.conne...
import os import aid import conf import spew _prefix2csvs = {} _reversed_sex = {'1': '2', '2': '1'} _max_age = 88 _age_group2age = { '1': aid.str_cycle(range(0, 5)), '2': aid.str_cycle(range(5, 7)), '3': aid.str_cycle(range(7, 10)), '4': aid.str_cycle(range(10, 12)), '5': aid.str_cycle(range(12, 1...
import useroracle import utility import sys import random import mcts from state import State, MenuState, UserState import argparse import numpy as np import time parser = argparse.ArgumentParser() parser.add_argument("--menu", "-m", help="Input menu name", default="menu_5items.txt") parser.add_argument("--history", ...
#!/usr/bin/env python import sys import math import numpy as np import logging from CodeEntropy.poseidon.extractData.generalFunctions import angle from datetime import datetime def UALevelRAD(all_data, dimensions): ''' UA level RAD algorithm implementation. Iterate through the 20 closest UAs and find w...
#!/usr/bin/env python3 import csv import gzip import json import re import sys import utils from argparse import ArgumentParser # # DEPRECATED: See extract_in_conv_to_lcn.py # class Options: def __init__(self): self._init_parser() def _init_parser(self): usage = 'extract_in_conv.py -i twee...