code: def prune_decoded_seqs(seqs):
      """
      Prune decoded sequences after EOS token.
      """
      out = []
      for s in seqs:
          if constant.EOS in s:
              idx = s.index(constant.EOS_TOKEN)
              out += [s[:idx]]
          else:
              out += [s]
      return out
  
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 8 for calling a global function with example usage: prune_decoded_seqs(seqs) and returns: out