code: def is_prefix(x: List[int], pref: List[int]) -> bool:
      """
      Obtained from https://github.com/espnet/espnet.
  
      Check if pref is a prefix of x.
  
      Args:
          x: Label ID sequence.
          pref: Prefix label ID sequence.
  
      Returns:
          : Whether pref is a prefix of x.
      """
      if len(pref) >= len(x):
          return False
  
      for i in range(len(pref)):
          if pref[i] != x[i]:
              return False
  
      return True
  
file_path: NeMo/nemo/collections/asr/parts/utils/rnnt_utils.py
imports: from dataclasses import dataclass, field
  from typing import Any, Dict, List, Optional, Tuple, Union
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: is_prefix(x, pref) and returns: True, False, False