code: def encode(self, item: str) -> List[int]:
      if self.hasnan and item == self.NA_token:
          return self.NA_token_id
      elif not self.hasnan and item == self.NA_token:
          raise ValueError(
              f"colum {self.name} cannot handle nan, please set hasnan=True"
          )
      val = float(item)
      val_int = self.convert_to_int(val)
      digits = []
      for i in range(self.code_len):
          digit = (val_int // self.base**i) % self.base
          digits.append(str(digit))
      if (val_int // self.base**self.code_len) != 0:
          raise ValueError("not right length")
      codes = []
      for i in reversed(range(self.code_len)):
          digit_str = digits[i]
          if digit_str in self.digits_item_to_id[i]:
              codes.append(self.digits_item_to_id[i][digit_str])
          else:
              # find the nearest encode id
              allowed_digits = np.array(
                  [int(d) for d in self.digits_item_to_id[i].keys()]
              )
              near_id = np.argmin(
                  np.abs(allowed_digits - int(digit_str))
              )
              digit_str = str(allowed_digits[near_id])
              codes.append(self.digits_item_to_id[i][digit_str])
              logging.warning(
                  "out of domain num is encounterd, use nearest code"
              )
      return codes
  
imports: import math
  from typing import Dict, List, Tuple
  import numpy
  from numpy import ndarray
  from sklearn.preprocessing import PowerTransformer, QuantileTransformer, RobustScaler
  from nemo.utils import logging
label_desc: Use image node_id 7 for calling the IntCode obj's underlying member method code with example usage: obj.encode(item) and returns: codes, self