code: def encode(self, s: str, bos: bool, eos: bool) -> List[int]:
      t = self.sp_model.encode(s)  # pyre-ignore[16]
      if bos:
          t = [self.bos_id] + t
      if eos:
          t = t + [self.eos_id]
      return t
  
imports: from logging import getLogger
  from typing import List
label_desc: Use image node_id 2 for calling the Tokenizer obj's underlying member method code with example usage: obj.encode(s, bos, eos) and returns: t