code: def ref_pad_constant(x, pad_width, mode, constant_value):
      pad_width = list(zip(pad_width[::2], pad_width[1::2]))
      pad_width = (x.ndim - len(pad_width)) * [(0, 0)] + pad_width
      return np.pad(x, pad_width, mode, constant_values=constant_value)
  
file_path: nnabla/python/test/function/test_pad.py
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context, function_tester
label_desc: Use image node_id 1 for calling a global function with example usage: ref_pad_constant(x, pad_width, mode, constant_value) and returns: np