code: def forward(self, inputs, device):
      x, w = inputs
      if not self.use_weights:
          w = None
      if self.use_variable_method:
          y = x.mean(axis=self.axis, weights=w, keepdims=self.keepdims)
      else:
          y = functions.average(
              x, axis=self.axis, weights=w, keepdims=self.keepdims
          )
      return (y,)
  
imports: import unittest
  import numpy
  import six
  from chainer import functions
  from chainer import testing
  from chainer.testing import attr
  from chainer import utils
label_desc: Use image node_id 4 for calling the TestAverage obj's underlying member method code with example usage: obj.forward(inputs, device) and returns: y