code: def listen_print_loop(
      responses, nmt_stub, target_language, asr_only=False
  ):
      num_chars_printed = 0
      prev_utterances = []
      for response in responses:
          if not response.results:
              continue
          result = response.results[0]
          if not result.alternatives:
              continue
          transcript = result.alternatives[0].transcript
          original_transcript = transcript
          if not asr_only:
              req = nmt.TranslateTextRequest(
                  texts=[transcript],
                  source_language="en",
                  target_language=target_language,
              )
              translation = (
                  nmt_stub.TranslateText(req)
                  .translations[0]
                  .translation
              )
              transcript = translation
          overwrite_chars = " " * (num_chars_printed - len(transcript))
          if not result.is_final:
              sys.stdout.write(
                  ">> " + transcript + overwrite_chars + "\r"
              )
              sys.stdout.flush()
              num_chars_printed = len(transcript) + 3
          else:
              print("## " + transcript + overwrite_chars + "\n")
              num_chars_printed = 0
              prev_utterances.append(original_transcript)
  
file_path: NeMo/tools/nmt_grpc_service/asr_nmt_client.py
imports: import argparse
  import sys
  import wave
  import api.nmt_pb2
  import api.nmt_pb2_grpc
  import grpc
  import pyaudio
  import riva_api.audio_pb2
  import riva_api.riva_asr_pb2
  import riva_api.riva_asr_pb2_grpc
label_desc: Use image node_id 2 for calling a global function with example usage: listen_print_loop(responses, nmt_stub, target_language, asr_only) without return types