code: def test_numpy_average(
      dtype_and_a,
      dtype_and_x,
      frontend,
      test_flags,
      fn_tree,
      backend_fw,
      keep_dims,
      returned,
      on_device,
  ):
      try:
          input_dtype, a, axis = dtype_and_a
  
          input_dtypes, xs, axiss = dtype_and_x
  
          if isinstance(axis, tuple):
              axis = axis[0]
  
          helpers.test_frontend_function(
              a=a[0],
              input_dtypes=input_dtype,
              backend_to_test=backend_fw,
              weights=xs[0],
              axis=axis,
              frontend=frontend,
              test_flags=test_flags,
              fn_tree=fn_tree,
              keepdims=keep_dims,
              returned=returned,
              on_device=on_device,
              rtol=1e-2,
              atol=1e-2,
          )
      except ZeroDivisionError:
          assume(False)
      except AssertionError:
          assume(False)
  
file_path: ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_statistics/test_averages_and_variances.py
imports: from hypothesis import strategies, assume
  import numpy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.test_functional.test_core.test_statistical import _statistical_dtype_values
  import ivy_tests.test_ivy.test_frontends.test_numpy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test
label_desc: Use image node_id 2 for calling a global function with example usage: test_numpy_average(dtype_and_a, dtype_and_x, frontend, test_flags, fn_tree, backend_fw, keep_dims, returned, on_device) without return types