code: def test_normalize():
      # 3D Input
      data_in_3d = np.random.uniform(0, 1, (3, 300, 300))
      out_nd_3d = transforms.Normalize(mean=(0, 1, 2), std=(3, 2, 1))(
          data_in_3d
      )
      data_expected_3d = data_in_3d.asnumpy()
      data_expected_3d[:][:][0] = data_expected_3d[:][:][0] / 3.0
      data_expected_3d[:][:][1] = (
          data_expected_3d[:][:][1] - 1.0
      ) / 2.0
      data_expected_3d[:][:][2] = data_expected_3d[:][:][2] - 2.0
      assert_almost_equal(data_expected_3d, out_nd_3d.asnumpy())
  
      # 4D Input
      data_in_4d = np.random.uniform(0, 1, (2, 3, 300, 300))
      out_nd_4d = transforms.Normalize(mean=(0, 1, 2), std=(3, 2, 1))(
          data_in_4d
      )
      data_expected_4d = data_in_4d.asnumpy()
      data_expected_4d[0][:][:][0] = data_expected_4d[0][:][:][0] / 3.0
      data_expected_4d[0][:][:][1] = (
          data_expected_4d[0][:][:][1] - 1.0
      ) / 2.0
      data_expected_4d[0][:][:][2] = data_expected_4d[0][:][:][2] - 2.0
      data_expected_4d[1][:][:][0] = data_expected_4d[1][:][:][0] / 3.0
      data_expected_4d[1][:][:][1] = (
          data_expected_4d[1][:][:][1] - 1.0
      ) / 2.0
      data_expected_4d[1][:][:][2] = data_expected_4d[1][:][:][2] - 2.0
      assert_almost_equal(data_expected_4d, out_nd_4d.asnumpy())
  
      # Invalid Input - Neither 3D or 4D input
      invalid_data_in = np.random.uniform(0, 1, (5, 5, 3, 300, 300))
      normalize_transformer = transforms.Normalize(
          mean=(0, 1, 2), std=(3, 2, 1)
      )
      assertRaises(MXNetError, normalize_transformer, invalid_data_in)
  
      # Invalid Input - Channel neither 1 or 3
      invalid_data_in = np.random.uniform(0, 1, (5, 4, 300, 300))
      normalize_transformer = transforms.Normalize(
          mean=(0, 1, 2), std=(3, 2, 1)
      )
      assertRaises(MXNetError, normalize_transformer, invalid_data_in)
  
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 2 for calling a global function with example usage: test_normalize() without return types