code: def test_create_control_grid(self):
      with self.assertRaisesRegex(TypeError, ""):
          create_control_grid(None, None)
      with self.assertRaisesRegex(TypeError, ""):
          create_control_grid((1, 1), 2.0)
  
      test_assert(
          create_control_grid,
          ((1.0, 1.0), (1.0, 1.0)),
          np.array(
              [
                  [
                      [-1.0, -1.0, -1.0],
                      [0.0, 0.0, 0.0],
                      [1.0, 1.0, 1.0],
                  ],
                  [
                      [-1.0, 0.0, 1.0],
                      [-1.0, 0.0, 1.0],
                      [-1.0, 0.0, 1.0],
                  ],
                  [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
              ]
          ),
      )
  
      test_assert(
          create_control_grid,
          ((1.0, 1.0), (2.0, 2.0)),
          np.array(
              [
                  [
                      [-2.0, -2.0, -2.0],
                      [0.0, 0.0, 0.0],
                      [2.0, 2.0, 2.0],
                  ],
                  [
                      [-2.0, 0.0, 2.0],
                      [-2.0, 0.0, 2.0],
                      [-2.0, 0.0, 2.0],
                  ],
                  [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
              ]
          ),
      )
  
      test_assert(
          create_control_grid,
          ((2.0, 2.0), (1.0, 1.0)),
          np.array(
              [
                  [
                      [-1.5, -1.5, -1.5, -1.5],
                      [-0.5, -0.5, -0.5, -0.5],
                      [0.5, 0.5, 0.5, 0.5],
                      [1.5, 1.5, 1.5, 1.5],
                  ],
                  [
                      [-1.5, -0.5, 0.5, 1.5],
                      [-1.5, -0.5, 0.5, 1.5],
                      [-1.5, -0.5, 0.5, 1.5],
                      [-1.5, -0.5, 0.5, 1.5],
                  ],
                  [
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                  ],
              ]
          ),
      )
  
      test_assert(
          create_control_grid,
          ((2.0, 2.0), (2.0, 2.0)),
          np.array(
              [
                  [
                      [-3.0, -3.0, -3.0, -3.0],
                      [-1.0, -1.0, -1.0, -1.0],
                      [1.0, 1.0, 1.0, 1.0],
                      [3.0, 3.0, 3.0, 3.0],
                  ],
                  [
                      [-3.0, -1.0, 1.0, 3.0],
                      [-3.0, -1.0, 1.0, 3.0],
                      [-3.0, -1.0, 1.0, 3.0],
                      [-3.0, -1.0, 1.0, 3.0],
                  ],
                  [
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                      [1.0, 1.0, 1.0, 1.0],
                  ],
              ]
          ),
      )
  
      test_assert(
          create_control_grid,
          ((1.0, 1.0, 1.0), (2.0, 2.0, 2.0), False),
          np.array(
              [
                  [
                      [
                          [-2.0, -2.0, -2.0],
                          [-2.0, -2.0, -2.0],
                          [-2.0, -2.0, -2.0],
                      ],
                      [
                          [0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0],
                          [0.0, 0.0, 0.0],
                      ],
                      [
                          [2.0, 2.0, 2.0],
                          [2.0, 2.0, 2.0],
                          [2.0, 2.0, 2.0],
                      ],
                  ],
                  [
                      [
                          [-2.0, -2.0, -2.0],
                          [0.0, 0.0, 0.0],
                          [2.0, 2.0, 2.0],
                      ],
                      [
                          [-2.0, -2.0, -2.0],
                          [0.0, 0.0, 0.0],
                          [2.0, 2.0, 2.0],
                      ],
                      [
                          [-2.0, -2.0, -2.0],
                          [0.0, 0.0, 0.0],
                          [2.0, 2.0, 2.0],
                      ],
                  ],
                  [
                      [
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                      ],
                      [
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                      ],
                      [
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                          [-2.0, 0.0, 2.0],
                      ],
                  ],
              ]
          ),
      )
  
file_path: MONAI/tests/test_create_grid_and_affine.py
imports: from __future__ import annotations
  import unittest
  import numpy
  import torch
  from monai.transforms import create_control_grid, create_grid, create_rotate, create_scale, create_shear, create_translate
  from tests.utils import assert_allclose, is_tf32_env
label_desc: Use image node_id 2 for calling the TestCreateGrid obj's underlying member method code with example usage: obj.test_create_control_grid() without return types