code: def test_returned(self, xp, dtype, axis, weights):
      a = testing.shaped_arange((2, 3), numpy, dtype)
      if weights:
          w = testing.shaped_arange((2, 3), numpy, dtype)
      else:
          w = None
      return xp.average(a, axis=axis, weights=w, returned=True)
  
imports: import math
  import numpy
  import pytest
  import cupy
  from cupy import testing
label_desc: Use image node_id 4 for calling the TestAverage obj's underlying member method code with example usage: obj.test_returned(xp, dtype, axis, weights) and returns: xp