code: def get_target_sequences(manifest, ground_truth, to_take=1000):
      import json
      import pathlib
  
      with open(ground_truth, "r") as fin:
          original_continuations = json.loads(fin.read())
  
      sequence2length = [
          (k, v[0]) for k, v in original_continuations.items()
      ]
      assert all(
          float(v) >= 6.0 for (_, v) in sequence2length
      )  # 6 seconds
  
      sequence2length.sort(key=lambda x: x[1])
      to_take_sequences = set(v[0] for v in sequence2length[:to_take])
      to_take_ids = []
  
      with open(manifest, "r") as f:
          f.readline()
  
          for i, line in enumerate(f.readlines()):
              seq_id = line.split()[0]
              seq_id = pathlib.Path(seq_id).name.split("__")[0]
  
              if seq_id in to_take_sequences:
                  to_take_ids.append(i)
  
      print(f"Took {len(to_take_ids)} ids")
      return set(to_take_ids)
  
file_path: fairseq/examples/textless_nlp/gslm/metrics/asr_metrics/self_auto_bleu.py
imports: import numpy
  import nltk
  from misc.bleu_utils import sentence_bleu
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: get_target_sequences(manifest, ground_truth, to_take) and returns: set