code: def is_box_near_crop_edge(
      boxes: paddle.Tensor,
      crop_box: List[int],
      orig_box: List[int],
      atol: float = 20.0,
  ) -> paddle.Tensor:
      """Filter masks at the edge of a crop, but not at the edge of the original image."""
      crop_box_paddle = paddle.to_tensor(crop_box, dtype=paddle.float32)
      orig_box_paddle = paddle.to_tensor(orig_box, dtype=paddle.float32)
      boxes = uncrop_boxes_xyxy(boxes, crop_box).astype(paddle.float32)
      near_crop_edge = paddle.isclose(
          boxes,
          crop_box_paddle[None, :].expand_as(boxes),
          atol=atol,
          rtol=0.0,
      )
      near_image_edge = paddle.isclose(
          boxes,
          orig_box_paddle[None, :].expand_as(boxes),
          atol=atol,
          rtol=0.0,
      )
      near_crop_edge = paddle.logical_and(
          near_crop_edge, ~near_image_edge
      )
      return paddle.any(near_crop_edge, axis=1)
  
imports: import numpy
  import paddle
  import math
  from copy import deepcopy
  from itertools import product
  from typing import Any, Dict, Generator, ItemsView, List, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: is_box_near_crop_edge(boxes, crop_box, orig_box, atol) and returns: paddle