code: def extract_patches_simple(
      img: Tensor,
      laf: Tensor,
      PS: int = 32,
      normalize_lafs_before_extraction: bool = True,
  ) -> Tensor:
      """Extract patches defined by LAFs from image tensor.
  
      No smoothing applied, huge aliasing (better use extract_patches_from_pyramid).
  
      Args:
          img: images, LAFs are detected in  :math:`(B, CH, H, W)`.
          laf: :math:`(B, N, 2, 3)`.
          PS: patch size.
          normalize_lafs_before_extraction: if True, lafs are normalized to image size.
  
      Returns:
          patches with shape :math:`(B, N, CH, PS,PS)`.
      """
      KORNIA_CHECK_LAF(laf)
      if normalize_lafs_before_extraction:
          nlaf = normalize_laf(laf, img)
      else:
          nlaf = laf
      _, ch, h, w = img.size()
      B, N, _, _ = laf.size()
      out = []
      # for loop temporarily, to be refactored
      for i in range(B):
          grid = generate_patch_grid_from_normalized_LAF(
              img[i : i + 1], nlaf[i : i + 1], PS
          ).to(img.device)
          out.append(
              F.grid_sample(
                  img[i : i + 1].expand(grid.size(0), ch, h, w),
                  grid,
                  padding_mode="border",
                  align_corners=False,
              )
          )
      return concatenate(out, dim=0).view(B, N, ch, PS, PS)
  
imports: import math
  from typing import List, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from kornia.core import Tensor, concatenate, cos, sin, stack, tensor, zeros
  from kornia.core.check import KORNIA_CHECK_LAF, KORNIA_CHECK_SHAPE
  from kornia.geometry.conversions import angle_to_rotation_matrix, convert_points_from_homogeneous, rad2deg
  from kornia.geometry.linalg import transform_points
  from kornia.geometry.transform import pyrdown
label_desc: Use image node_id 15 for calling a global function with example usage: extract_patches_simple(img, laf, PS, normalize_lafs_before_extraction) and returns: concatenate