old_contents: import cupy
  
  
  def pad(array, pad_width, mode=None, **kwargs):
      if not isinstance(pad_width, int):
          raise NotImplementedError
  
      if mode != 'constant':
          raise NotImplementedError
  
      shape = tuple(s + pad_width * 2 for s in array.shape)
      # TODO(unno): Fix fill value
      ret = cupy.full(shape, 0, dtype=array.dtype)
      index = tuple(slice(pad_width, pad_width + s) for s in array.shape)
      ret[index] = array
      return ret
  
new_contents: import cupy
  
  
  def pad(array, pad_width, mode=None, **kwargs):
      if mode != 'constant':
          raise NotImplementedError
  
      if kwargs.keys() == []:
          fill_value = 0
      elif kwargs.keys() == ['constant_values']:
          if not isinstance(kwargs['constant_values'], int):
              raise NotImplementedError
          fill_value = kwargs['constant_values']
      else:
          raise NotImplementedError
  
      if isinstance(pad_width, int):
          shape = tuple(s + pad_width * 2 for s in array.shape)
          ret = cupy.full(shape, fill_value, dtype=array.dtype)
          index = tuple(slice(pad_width, pad_width + s) for s in array.shape)
          ret[index] = array
      elif isinstance(pad_width, (list, tuple, cupy.ndarray)):
          if array.ndim == len(pad_width):
              shape = tuple(s + pad_width[i] * 2
                            for i, s in enumerate(array.shape))
              ret = cupy.full(shape, fill_value,
                              dtype=array.dtype)
              index = tuple(slice(pad_width[i], pad_width[i] + s)
                            for i, s in enumerate(array.shape))
              ret[index] = array
          elif array.ndim == 1 and len(pad_width) == 2:
              front = cupy.zeros(pad_width[0])  # fix
              end = cupy.zeros(pad_width[1])  # fix
              ret = cupy.hstack((cupy.hstack((front, array)), end))
          else:
              raise ValueError
      else:
          raise ValueError
      return ret
  
subject: implement pad