





'''simple docstring'''


lowerCAmelCase_   :   Optional[Any]       =					"Input must be a string of 8 numbers plus letter"
lowerCAmelCase_   :   Tuple       =					"TRWAGMYFPDXBNJZSQVHLCKE"







def    _lowerCamelCase  (__lowerCamelCase  :     str     )   ->    bool:

			if not isinstance(__lowerCamelCase					,  __lowerCamelCase     ):
						a__     = f'''Expected string as input, found {type(__lowerCamelCase     ).__name__}'''
						raise TypeError(__lowerCamelCase     )

			a__     = spanish_id.replace("-"					,  ""     ).upper()
			if len(__lowerCamelCase     ) != 9:
						raise ValueError(__lowerCamelCase     )

			try:
						a__     = int(spanish_id_clean[0:8]     )
						a__     = spanish_id_clean[8]
			except ValueError as ex:
						raise ValueError(__lowerCamelCase     ) from ex

			if letter.isdigit():
						raise ValueError(__lowerCamelCase     )

			return letter == LOOKUP_LETTERS[number % 23]


if __name__ == "__main__":
		import doctest

		doctest.testmod()










'''simple docstring'''


import os
import time

import numpy as np
import onnxruntime as ort


lowerCAmelCase_   :   Optional[int]       =					"1"
lowerCAmelCase_   :   List[str]       =					"0"
lowerCAmelCase_   :   Tuple       =					"1"

lowerCAmelCase_   :   str       =					ort.SessionOptions()
lowerCAmelCase_   :   Tuple       =					ort.GraphOptimizationLevel.ORT_DISABLE_ALL
print("Create inference session...")
lowerCAmelCase_   :   Any       =					["TensorrtExecutionProvider", "CUDAExecutionProvider"]
lowerCAmelCase_   :   str       =					ort.InferenceSession("model.onnx", sess_options=sess_opt, providers=execution_provider)
lowerCAmelCase_   :   Tuple       =					ort.RunOptions()

lowerCAmelCase_   :   Optional[int]       =					128
lowerCAmelCase_   :   Union[str, Any]       =					1
lowerCAmelCase_   :   List[str]       =					np.ones((batch, sequence), dtype=np.intaa)
lowerCAmelCase_   :   Optional[Any]       =					np.ones((batch, sequence), dtype=np.intaa)
lowerCAmelCase_   :   str       =					np.ones((batch, sequence), dtype=np.intaa)

print("Warm up phase...")
sess.run(
    None,
    {
        sess.get_inputs()[0].name: input_ids,
        sess.get_inputs()[1].name: attention_mask,
        sess.get_inputs()[2].name: token_type_ids,
    },
    run_options=run_opt,
)

print("Start inference...")
lowerCAmelCase_   :   Tuple       =					time.time()
lowerCAmelCase_   :   int       =					2000
lowerCAmelCase_   :   Optional[Any]       =					{}
for iter in range(max_iters):
		lowerCAmelCase_   :   List[str]       =					sess.run(
		    None,
		    {
		        sess.get_inputs()[0].name: input_ids,
		        sess.get_inputs()[1].name: attention_mask,
		        sess.get_inputs()[2].name: token_type_ids,
		    },
		    run_options=run_opt,
		)
print("Average Inference Time = {:.3f} ms".format((time.time() - start_time) * 1000 / max_iters))



