code: def expected_unpooling_nd(x_data, outs, ksize, stride, pad):
      N, c = x_data.shape[:2]
      dims = x_data.shape[2:]
      y_expected_shape = (N, c) + outs
      y_expected = numpy.zeros(y_expected_shape, dtype=x_data.dtype)
      for i in six.moves.range(N):
          for _c in six.moves.range(c):
              for x in xs_iter(dims):
                  x_idx = (i, _c) + x
                  for kx in kxs_iter(x, outs, ksize, stride, pad):
                      y_idx = (i, _c) + kx
                      y_expected[y_idx] += x_data[x_idx]
      return y_expected
  
imports: import itertools
  import unittest
  import numpy
  import six
  import chainer
  from chainer import backend
  from chainer import functions
  from chainer import testing
  from chainer.utils import conv
  from chainer.utils import type_check
label_desc: Use image node_id 3 for calling a global function with example usage: expected_unpooling_nd(x_data, outs, ksize, stride, pad) and returns: y_expected