code: def create_cs_manifest(
      data_lang_0: list,
      data_lang_1: list,
      lid_lang_0: str,
      lid_lang_1: str,
      max_sample_duration_sec: int,
      min_sample_duration_sec: int,
      data_requirement_hrs: int,
  ):
      """
      Args:
          data_lang_0: Manifest entries from first langauge
          data_lang_1: Manifest entries from second langauge
          lid_lang_0: Language ID marker for first langauge
          lid_lang_1: Language ID marker for second langauge
          max_sample_duration_sec: Maximum permissible duration of generated CS sample in sec
          min_sample_duration_sec: Minimum permissible duration of generated CS sample in sec
          data_requirement_hrs: Required size of generated corpus
  
      Returns:
          Created synthetic CS manifest as list
  
      """
  
      total_duration = 0
      constructed_data = []
      sample_id = 0
  
      num_samples_lang0 = len(data_lang_0)
      num_samples_lang1 = len(data_lang_1)
  
      while total_duration < (data_requirement_hrs * 3600):
          created_sample_duration_sec = 0
          created_sample_dict = {}
          created_sample_dict["lang_ids"] = []
          created_sample_dict["texts"] = []
          created_sample_dict["paths"] = []
          created_sample_dict["durations"] = []
  
          while created_sample_duration_sec < min_sample_duration_sec:
              lang_selection = random.randint(0, 1)
  
              if lang_selection == 0:
                  index = random.randint(0, num_samples_lang0 - 1)
                  sample = data_lang_0[index]
                  lang_id = lid_lang_0
              else:
                  index = random.randint(0, num_samples_lang1 - 1)
                  sample = data_lang_1[index]
                  lang_id = lid_lang_1
  
              if (
                  created_sample_duration_sec + sample["duration"]
              ) > max_sample_duration_sec:
                  continue
              else:
                  created_sample_duration_sec += sample["duration"]
                  created_sample_dict["lang_ids"].append(lang_id)
                  created_sample_dict["texts"].append(sample["text"])
                  created_sample_dict["paths"].append(
                      sample["audio_filepath"]
                  )
                  created_sample_dict["durations"].append(
                      sample["duration"]
                  )
  
          created_sample_dict[
              "total_duration"
          ] = created_sample_duration_sec
  
          # adding a uid which will be used to save the generated audio file later
          created_sample_dict["uid"] = sample_id
          sample_id += 1
  
          constructed_data.append(created_sample_dict)
          total_duration += created_sample_duration_sec
  
      return constructed_data
  
imports: import argparse
  import logging
  import os
  import random
  from nemo.collections.asr.parts.utils.manifest_utils import read_manifest, write_manifest
label_desc: Use image node_id 1 for calling a global function with example usage: create_cs_manifest(data_lang_0, data_lang_1, lid_lang_0, lid_lang_1, max_sample_duration_sec, min_sample_duration_sec, data_requirement_hrs) and returns: constructed_data