code: def test_numpy_mgrid(
      range,
      class_,
      method_name,
      backend_fw,
      frontend,
  ):
      start, stop, step = range
      if start and stop and step:
          ret = mgrid[start:stop:step]
          ret_np = np_mgrid[start:stop:step]
      elif start and step:
          ret = mgrid[start::step]
          ret_np = np_mgrid[start::step]
      elif stop and step:
          ret = mgrid[:stop:step]
          ret_np = np_mgrid[:stop:step]
      elif start and stop:
          ret = mgrid[start:stop]
          ret_np = np_mgrid[start:stop]
      elif start:
          ret = mgrid[start:]
          ret_np = np_mgrid[start:]
      else:
          ret = mgrid[:stop]
          ret_np = np_mgrid[:stop]
      ret = helpers.flatten_and_to_np(ret=ret, backend=backend_fw)
      ret_np = helpers.flatten_and_to_np(ret=ret_np, backend=frontend)
      helpers.value_test(
          ret_np_flat=ret,
          ret_np_from_gt_flat=ret_np,
          rtol=1e-03,
          backend=backend_fw,
          ground_truth_backend=frontend,
      )
  
file_path: ivy/ivy_tests/test_ivy/test_frontends/test_numpy/test_creation_routines/test_numerical_ranges.py
imports: from numpy import mgrid, ogrid
  from hypothesis import strategies
  import ivy
  from ivy.functional.frontends.numpy import mgrid, ogrid
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import handle_frontend_test, handle_frontend_method
label_desc: Use image node_id 8 for calling a global function with example usage: test_numpy_mgrid(range, class_, method_name, backend_fw, frontend) without return types