code: def clean_eos_bos(self, tokens):
      start_index, end_index = 0, len(tokens)
      if self.use_bos:
          start_index = 1
      if self.use_eos:
          end_index = -1
      return tokens[start_index:end_index]
  
imports: from typing import Dict, List, Optional, Set
  import numpy
  from pytext.common.constants import SpecialTokens, Token
  from pytext.config.component import Component, ComponentType
  from pytext.config.pytext_config import ConfigBase
  from pytext.data.data_structures.annotation import Annotation, Intent, Root, Slot
  from pytext.data.utils import VocabBuilder, Vocabulary
label_desc: Use image node_id 3 for calling the TreeMask obj's underlying member method code with example usage: obj.clean_eos_bos(tokens) and returns: tokens