docs: def pad_to_size(data, shape, value=0.0):
      """
      This is similar to `pad`, except you specify the final shape of the array.
  
      Parameters
      ----------
      data : ndarray
          Numpy array of any dimension and type.
      shape : tuple
          Final shape of padded array. Should be tuple of length ``data.ndim``.
          If it has to pad unevenly, it will pad one more at the end of the axis
          than at the beginning. If a dimension is specified as ``-1``, then it
          will remain its current size along that dimension.
      value : data.dtype
          The value with which to pad. Default is ``0.0``. This can even be an
          array, as long as ``pdata[:] = value`` is valid, where ``pdata`` is the
          size of the padded array.
  
      Examples
      --------
      >>> import deepdish as dd
      >>> import numpy as np
  
      Pad an array with zeros.
  
      >>> x = np.ones((4, 2))
      >>> dd.util.pad_to_size(x, (5, 5))
      array([[ 0.,  1.,  1.,  0.,  0.],
             [ 0.,  1.,  1.,  0.,  0.],
             [ 0.,  1.,  1.,  0.,  0.],
             [ 0.,  1.,  1.,  0.,  0.],
             [ 0.,  0.,  0.,  0.,  0.]])
  
  
      """
      shape = [data.shape[i] if shape[i] == -1 else shape[i]
               for i in range(len(shape))]
      new_data = np.empty(shape)
      new_data[:] = value
      II = [slice((shape[i] - data.shape[i])//2,
                  (shape[i] - data.shape[i])//2 + data.shape[i])
            for i in range(len(shape))]
      new_data[II] = data
      return new_data