code: def is_poly_inside_rect(poly: ArrayLike, rect: np.ndarray) -> bool:
      """Check if the polygon is inside the target region.
      Args:
          poly (ArrayLike): Polygon in shape (N, ).
          rect (ndarray): Target region [x1, y1, x2, y2].
  
      Returns:
          bool: Whether the polygon is inside the cropping region.
      """
  
      poly = poly2shapely(poly)
      rect = poly2shapely(bbox2poly(rect))
      return rect.contains(poly)
  
imports: import math
  import operator
  from functools import reduce
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import pyclipper
  import shapely
  from mmengine.utils import is_list_of
  from shapely.geometry import MultiPolygon, Polygon
  from mmocr.utils import bbox2poly, valid_boundary
  from mmocr.utils.check_argument import is_2dlist
  from mmocr.utils.typing_utils import ArrayLike
label_desc: Use image node_id 12 for calling a global function with example usage: is_poly_inside_rect(poly, rect) and returns: rect