code: def test_argmin_argmax_get_last_elements():
      def get_test_case(shape, gt_func, test_argmin=False):
          total_ele = np.product(shape)
          arr = np.zeros(total_ele)
          target_value = -1 if test_argmin else 1
          arr[: total_ele // 3] = target_value
          np.random.shuffle(arr)
          arr = arr.reshape(shape)
          ans = gt_func(np.flip(arr))
          return arr, len(arr) - ans - 1
  
      funcs_and_gt_funcs = [
          (relay.argmax, np.argmax),
          (relay.argmin, np.argmin),
      ]
      lengths = [5, 10, 15]
      for func, gt_func in funcs_and_gt_funcs:
          for shape in lengths:
              x_in = relay.var("x_in", shape=[shape])
              output = func(x_in, select_last_index=True)
              arr, ans = get_test_case(
                  shape, gt_func, test_argmin=func == relay.argmin
              )
  
              mod = tvm.IRModule.from_expr(output)
              for target, dev in tvm.testing.enabled_targets():
                  op_res = relay.create_executor(
                      "graph", mod=mod, device=dev, target=target
                  ).evaluate()(arr)
                  assert op_res.numpy().item() == ans
  
imports: import sys
  import numpy
  import numpy.random
  import pytest
  import tvm
  import tvm.testing
  import tvm.topi.testing
  from tvm import relay, te
  from tvm.relay import transform
  from tvm.relay.testing import run_infer_type
label_desc: Use image node_id 11 for calling a global function with example usage: test_argmin_argmax_get_last_elements() and returns: arr,  unknown