code: def encode(
      self, text: str, past_table: Dict[int, str] = {}
  ) -> Tuple[List[int], Dict[int, str]]:
      ext_table_rev: Dict[str, int] = {}
      ext_table: Dict[int, str] = {}
      for idx, val in past_table.items():
          ext_table[idx] = val
          ext_table_rev[val] = idx
      ret = []
      for x in self.tokenize(text):
          if x.is_unk or (
              x.is_special and (x.token not in self.encoder)
          ):
              if x.token not in ext_table_rev:
                  ext_table_rev[x.token] = (
                      len(ext_table_rev) + self.vocab_size
                  )
                  ext_table[ext_table_rev[x.token]] = x.token
              ret.append(ext_table_rev[x.token])
          elif x.token in self.encoder:
              ret.append(self.encoder[x.token])
          else:
              raise ValueError(
                  "Unknown token `{}` at pos {}".format(
                      x.token, x.start
                  )
              )
  
      return ret, ext_table
  
imports: import pkg_resources
  import io
  from typing import IO, Dict, List, Optional, Tuple
label_desc: Use image node_id 12 for calling the CPMBeeTokenizer obj's underlying member method code with example usage: obj.encode(text, past_table) and returns: ret,  ext_table