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