code: def encode_id(tbl):
      tbl = (
          tbl.rename({"engaged_with_user_id": "user_id"})
          .encode_string("user_id", user_index, broadcast=False)
          .rename({"user_id": "engaged_with_user_id"})
          .fillna(0, "engaged_with_user_id")
      )
      tbl = (
          tbl.rename({"enaging_user_id": "user_id"})
          .encode_string("user_id", user_index, broadcast=False)
          .rename({"user_id": "enaging_user_id"})
          .fillna(0, "enaging_user_id")
      )
      tbl = tbl.encode_string(
          "tweet_id", item_index, broadcast=False
      ).fillna(0, "tweet_id")
      return tbl
  
file_path: BigDL/python/friesian/example/wnd/recsys2021/wnd_preprocess_recsys.py
imports: import os
  from argparse import ArgumentParser
  import tempfile
  import pickle
  from time import time
  from bigdl.orca import init_orca_context, stop_orca_context
  from bigdl.orca.data.file import makedirs, exists
  from bigdl.dllib.utils.file_utils import put_local_file_to_remote
  from bigdl.friesian.feature import FeatureTable
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 3 for calling a global function with example usage: encode_id(tbl) and returns: tbl