code: def test_argnum():
      def f_with_mode(a, b, mode):
          if mode:
              return a + b
          else:
              return a * b
  
      a = nd.uniform(shape=(3, 2))
      b = nd.uniform(shape=(3, 2))
      f_add_grad = lambda x, y, mode: [
          nd.ones(x.shape),
          nd.ones(y.shape),
      ]
      f_mul_grad = lambda x, y, mode: [y, x]
      autograd_assert(
          a,
          b,
          True,
          argnum=[0, 1],
          func=f_with_mode,
          grad_func=f_add_grad,
      )
      autograd_assert(
          a,
          b,
          False,
          argnum=[0, 1],
          func=f_with_mode,
          grad_func=f_mul_grad,
      )
  
imports: import functools
  import mxnet.ndarray
  from mxnet.ndarray import zeros_like
  from mxnet.autograd import *
  from mxnet.test_utils import *
  from common import xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import environment
  import pytest
label_desc: Use image node_id 7 for calling a global function with example usage: test_argnum() and returns: unknown, unknown