code: def write_file(name: str, lines: List[dict], idx: int):
      """
      Write json lines to file.
  
      Args:
          name (str): Output file path
          lines (list): List of json lines
          idx (int): Indices to dump to the file
      """
      with open(name, "w") as fout:
          for i in idx:
              dic = lines[i]
              json.dump(dic, fout)
              fout.write("\n")
  
imports: import json
  import os
  from collections import Counter
  from collections import OrderedDict
  from pathlib import Path
  from typing import Dict, List, Union
  import librosa
  import numpy
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_subsegments, get_uniqname_from_filepath, rttm_to_labels, segments_manifest_to_subsegments_manifest, write_rttm2manifest
  from nemo.utils.data_utils import DataStoreObject
label_desc: Use image node_id 8 for calling a global function with example usage: write_file(name, lines, idx) without return types