code: def _update_mask(self, mask: np.ndarray, polygons: Iterable, separate_instances: bool = False) -> None:
          
          for i, p in enumerate(polygons):
              if isinstance(p, geometry.MultiPolygon):
                  self._update_mask(mask=mask, polygons=p.geoms, separate_instances=True)
                  continue
              elif not isinstance(p, geometry.Polygon):
                  continue
              poly_area = Image.fromarray(np.zeros(mask.shape, dtype=np.uint8))
              holes = Image.fromarray(np.zeros(mask.shape, dtype=np.uint8))
              outline_color = 0 if separate_instances else 255
              ImageDraw.Draw(poly_area).polygon(p.exterior.coords, fill=255, outline=outline_color)
              for h in p.interiors:
                  ImageDraw.Draw(holes).polygon(h.coords, fill=255, outline=255)
              mask[np.nonzero(np.array(poly_area, dtype=np.uint8))] = 255
              mask[np.nonzero(np.array(holes, dtype=np.uint8))] = 0
docs: * The first polygon is the exterior ring. All others are treated as interior rings and will just invert
             the corresponding area of the mask.
          :param separate_instances:
          :param mask:
          :param polygons:
          :return: