code: def prune_hyp(hyp):
      """
      Prune a decoded hypothesis
      """
      if constant.EOS_ID in hyp:
          idx = hyp.index(constant.EOS_ID)
          return hyp[:idx]
      else:
          return hyp
  
file_path: stanza/stanza/models/common/seq2seq_utils.py
imports: from collections import Counter
  import random
  import json
  import torch
  import stanza.models.common.seq2seq_constant
label_desc: Use image node_id 9 for calling a global function with example usage: prune_hyp(hyp) and returns: hyp, hyp