code: def test_k2Speech2Text(asr_config_file, lm_config_file):
      from espnet2.bin.asr_inference_k2 import k2Speech2Text
  
      k2speech2text = k2Speech2Text(
          asr_train_config=asr_config_file,
          lm_train_config=lm_config_file,
          beam_size=1,
      )
      batch_size = 5
      num_samples = 100000
      speech = np.random.randn(batch_size, num_samples).astype("f")
      speech_lengths = np.repeat(num_samples, batch_size).astype(
          np.int_
      )
      batch = {"speech": speech, "speech_lengths": speech_lengths}
      results = k2speech2text(batch)
      for text, token, token_int, score in results:
          assert isinstance(text, str)
          assert isinstance(token[0], str)
          assert isinstance(token_int[0], int)
          assert isinstance(score, float)
  
file_path: espnet/test/espnet2/bin/test_asr_inference_k2.py
imports: import string
  from argparse import ArgumentParser
  from pathlib import Path
  import numpy
  import pytest
  from espnet2.tasks.asr import ASRTask
  from espnet2.tasks.lm import LMTask
label_desc: Use image node_id 7 for calling a global function with example usage: test_k2Speech2Text(asr_config_file, lm_config_file) without return types