code: def test_random_gray():
      from mxnet.gluon.data.vision import transforms
  
      transform = transforms.RandomGray(0.5)
      img = mx.np.ones((4, 4, 3), dtype="uint8")
      pixel = img[0, 0, 0].asnumpy()
      iteration = 1000
      num_apply = 0
      for _ in range(iteration):
          out = transform(img)
          if out[0][0][0].asnumpy() != pixel:
              num_apply += 1
      assert_almost_equal(num_apply / float(iteration), 0.5, 0.1)
  
      transform = transforms.RandomGray(0.5)
      transform.hybridize()
      img = mx.np.ones((4, 4, 3), dtype="uint8")
      pixel = img[0, 0, 0].asnumpy()
      iteration = 1000
      num_apply = 0
      for _ in range(iteration):
          out = transform(img)
          if out[0][0][0].asnumpy() != pixel:
              num_apply += 1
      assert_almost_equal(num_apply / float(iteration), 0.5, 0.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 14 for calling a global function with example usage: test_random_gray() without return types