code: def pad(x, pad_width, mode, **keywords):
      """Pad an input variable.
  
      Args:
          x (:class:`~chainer.Variable` or :ref:`ndarray`):
              Input data.
          pad_width (int or array-like):
              Number of values padded to the edges of each axis.
          mode (str):
              Specifies how the function fills the periphery of the array.
              The mode is passed to :func:`numpy.pad` or :func:`cupy.pad`.
              If it is ``'constant'``, the input is padded by a constant value
              specified by ``constant_values``.
          constant_values (int or array-like):
              Constant values to fill the periphery in the ``'constant'`` mode.
  
      Returns:
          ~chainer.Variable: Output variable.
  
      """
      return Pad(pad_width, mode, **keywords).apply((x,))[0]
  
file_path: chainer/chainer/functions/array/pad.py
imports: import numpy
  from chainer import backend
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: pad(x, pad_width, mode) and returns: Pad