code: def pad(l, fill_value, width):
      if len(l) >= width:
          return l[0:width]
      else:
          l.extend([fill_value] * (width - len(l)))
          return l
  
file_path: BigDL/python/dllib/src/bigdl/dllib/models/textclassifier/textclassifier.py
imports: import itertools
  import re
  from optparse import OptionParser
  from bigdl.dllib.feature.dataset import news20
  from bigdl.dllib.nn.layer import *
  from bigdl.dllib.nn.criterion import *
  from bigdl.dllib.optim.optimizer import *
  from bigdl.dllib.utils.common import *
  from bigdl.dllib.nncontext import *
  from bigdl.dllib.utils.utils import detect_conda_env_name
  import os
  import datetime
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 3 for calling a global function with example usage: pad(l, fill_value, width) and returns: l, l