code: def coco_encode_rle(
      uncompressed_rle: Dict[str, Any]
  ) -> Dict[str, Any]:
      from pycocotools import mask as mask_utils  # type: ignore
  
      h, w = uncompressed_rle["size"]
      rle = mask_utils.frPyObjects(uncompressed_rle, h, w)
      rle["counts"] = rle["counts"].decode(
          "utf-8"
      )  # Necessary to serialize with json
      return rle
  
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 15 for calling a global function with example usage: coco_encode_rle(uncompressed_rle) and returns: rle