class_docstr: Implementation of the adversarial patch attack for square and rectangular images and videos in PyTorch.
  
  | Paper link: https://arxiv.org/abs/1712.09665
docstr: Insert patch to image based on given or selected coordinates.
  
  :param x: The image to insert the patch.
  :param patch: The patch to be transformed and inserted.
  :param image_coords: The coordinates of the 4 corners of the transformed, inserted patch of shape
      [[x1, y1], [x2, y2], [x3, y3], [x4, y4]] in pixel units going in clockwise direction, starting with upper
      left corner.
  :return: The input `x` with the patch inserted.
docstr_tok: ["Insert","patch","to","image","based","on","given","or","selected","coordinates",".",":","param","x",":","The","image","to","insert","the","patch",".",":","param","patch",":","The","patch","to","be","transformed","and","inserted",".",":","param","image_coords",":","The","coordinates","of","the","4","corners","of","the","transformed",",","inserted","patch","of","shape","[","[","x1",",","y1","]",",","[","x2",",","y2","]",",","[","x3",",","y3","]",",","[","x4",",","y4","]","]","in","pixel","units","going","in","clockwise","direction",",","starting","with","upper","left","corner",".",":","return",":","The","input","`","x","`","with","the","patch","inserted","."]
code: def insert_transformed_patch(
      x: np.ndarray, patch: np.ndarray, image_coords: np.ndarray
  ):
      """
      Insert patch to image based on given or selected coordinates.
  
      :param x: The image to insert the patch.
      :param patch: The patch to be transformed and inserted.
      :param image_coords: The coordinates of the 4 corners of the transformed, inserted patch of shape
          [[x1, y1], [x2, y2], [x3, y3], [x4, y4]] in pixel units going in clockwise direction, starting with upper
          left corner.
      :return: The input `x` with the patch inserted.
      """
      return insert_transformed_patch(x, patch, image_coords)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import math
  from typing import Any, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.attacks.attack import EvasionAttack
  from art.attacks.evasion.adversarial_patch.utils import insert_transformed_patch
  from art.estimators.estimator import BaseEstimator, NeuralNetworkMixin
  from art.utils import check_and_transform_label_format, is_probability, to_categorical
  from art.summary_writer import SummaryWriter
label_desc: Use image node_id 11 for calling the AdversarialPatchPyTorch obj's underlying member method code with example usage: obj.insert_transformed_patch(x, patch, image_coords) and returns: insert_transformed_patch