code: def pad(
      df: "SparkDataFrame",
      cols: List[str],
      seq_len: int,
      mask_cols: Optional[Union[str, List[str]]],
      mask_token: Union[int, str],
  ) -> "SparkDataFrame":
      df = (
          callZooFunc("float", "mask", df, mask_cols, seq_len)
          if mask_cols
          else df
      )
      df = callZooFunc(
          "float", "postPad", df, cols, seq_len, mask_token
      )
      return df
  
imports: from bigdl.dllib.utils.file_utils import callZooFunc
  from pyspark.sql.types import IntegerType, ShortType, LongType, FloatType, DecimalType, DoubleType, BooleanType
  from pyspark.sql.functions import broadcast, udf
  from bigdl.dllib.utils.log4Error import *
  import warnings
  from bigdl.dllib.utils.log4Error import *
  from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union
label_desc: Use image node_id 16 for calling a global function with example usage: pad(df, cols, seq_len, mask_cols, mask_token) and returns: df