code: def polygons_to_bitmask(
      polygons: List[np.ndarray], height: int, width: int
  ) -> np.ndarray:
      """
      Args:
          polygons (list[ndarray]): each array has shape (Nx2,)
          height, width (int)
  
      Returns:
          ndarray: a bool mask of shape (height, width)
      """
      try_import_pycocotools()
      import pycocotools.mask as mask_util
  
      assert (
          len(polygons) > 0
      ), "COCOAPI does not support empty polygons"
      rles = mask_util.frPyObjects(polygons, height, width)
      rle = mask_util.merge(rles)
      return mask_util.decode(rle).astype(np.bool)
  
imports: import copy
  import itertools
  from typing import Any, Iterator, List, Union
  import numpy
  import torch
  import torchvision
  from .boxes import Boxes
label_desc: Use image node_id 2 for calling a global function with example usage: polygons_to_bitmask(polygons, height, width) and returns: mask_util