code: def laf_is_inside_image(
      laf: Tensor, images: Tensor, border: int = 0
  ) -> Tensor:
      """Check if the LAF is touching or partly outside the image boundary.
  
      Returns the mask of LAFs, which are fully inside the image, i.e. valid.
  
      Args:
          laf:  :math:`(B, N, 2, 3)`.
          images: images, lafs are detected in :math:`(B, CH, H, W)`.
          border: additional border.
  
      Returns:
          mask with shape :math:`(B, N)`.
      """
      KORNIA_CHECK_LAF(laf)
      _, _, h, w = images.size()
      pts = laf_to_boundary_points(laf, 12)
      good_lafs_mask = (
          (pts[..., 0] >= border)
          * (pts[..., 0] <= w - border)
          * (pts[..., 1] >= border)
          * (pts[..., 1] <= h - border)
      )
      good_lafs_mask = good_lafs_mask.min(dim=2)[0]
      return good_lafs_mask
  
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 17 for calling a global function with example usage: laf_is_inside_image(laf, images, border) and returns: good_lafs_mask