code: def test_untransform_gradients(
      art_warning, fix_get_rcnn, channels_first
  ):
      try:
          crop_x = 1
          crop_y = 1
          rot90 = 3
          brightness = 1.0
  
          if channels_first:
              patch_shape = (1, 4, 4)
              gradients = np.zeros(shape=(1, 1, 10, 10))
              gradients[:, :, 2:7, 2:7] = 1
              gradients = gradients[
                  :, :, crop_x : 10 - crop_x, crop_y : 10 - crop_y
              ]
              gradients = np.rot90(gradients, rot90, (2, 3))
          else:
              patch_shape = (4, 4, 1)
              gradients = np.zeros(shape=(1, 10, 10, 1))
              gradients[:, 2:7, 2:7, :] = 1
              gradients = gradients[
                  :, crop_x : 10 - crop_x, crop_y : 10 - crop_y, :
              ]
              gradients = np.rot90(gradients, rot90, (1, 2))
  
          frcnn = fix_get_rcnn
          attack = RobustDPatch(
              frcnn,
              patch_shape=patch_shape,
              patch_location=(2, 2),
              crop_range=(0, 0),
              brightness_range=(1.0, 1.0),
              rotation_weights=(1, 0, 0, 0),
              sample_size=1,
              learning_rate=1.0,
              max_iter=1,
              batch_size=1,
              verbose=False,
          )
  
          transforms = {
              "crop_x": crop_x,
              "crop_y": crop_y,
              "rot90": rot90,
              "brightness": brightness,
          }
  
          gradients = attack._untransform_gradients(
              gradients=gradients,
              transforms=transforms,
              channels_first=channels_first,
          )
  
          gradients_sum = np.sum(gradients[0])
          gradients_sum_expected = 16.0
  
          assert gradients_sum == gradients_sum_expected
  
      except ARTTestException as e:
          art_warning(e)
  
file_path: adversarial-robustness-toolbox/tests/attacks/evasion/test_dpatch_robust.py
imports: import logging
  import numpy
  import pytest
  from art.attacks.evasion import RobustDPatch
  from art.estimators.estimator import BaseEstimator, LossGradientsMixin
  from art.estimators.object_detection.object_detector import ObjectDetectorMixin
  from tests.attacks.utils import backend_test_classifier_type_check_fail
  from tests.utils import ARTTestException
label_desc: Use image node_id 6 for calling a global function with example usage: test_untransform_gradients(art_warning, fix_get_rcnn, channels_first) without return types