code: def test_random_transforms():
      from mxnet.gluon.data.vision import transforms
  
      tmp_t = transforms.Compose(
          [transforms.Resize(300), transforms.RandomResizedCrop(224)]
      )
      counter = 0
  
      def transform_fn(x):
          nonlocal counter
          counter += 1
          return x
  
      transform = transforms.Compose(
          [transforms.RandomApply(transform_fn, 0.5)]
      )
  
      img = mx.np.ones((10, 10, 3), dtype="uint8")
      iteration = 10000
      num_apply = 0
      for _ in range(iteration):
          out = transform(img)
      assert counter == pytest.approx(5000, 1e-1)
  
imports: import os
  from collections import namedtuple
  from uuid import uuid4
  import numpy
  import mxnet
  from mxnet import gluon, autograd, np, npx
  from mxnet.test_utils import use_np, assert_almost_equal, check_gluon_hybridize_consistency, same, check_symbolic_backward
  from common import assertRaises, xfail_when_nonstandard_decimal_separator
  import random
  from mxnet.base import MXNetError
  from mxnet.gluon.data.vision import transforms
  from mxnet import image
  import pytest
label_desc: Use image node_id 13 for calling a global function with example usage: test_random_transforms() and returns: x