code: def encode_mask_results(mask_results):
      """Encode bitmap mask to RLE code.
  
      Args:
          mask_results (list): bitmap mask results.
  
      Returns:
          list | tuple: RLE encoded mask.
      """
      encoded_mask_results = []
      for mask in mask_results:
          encoded_mask_results.append(
              mask_util.encode(
                  np.array(
                      mask[:, :, np.newaxis], order="F", dtype="uint8"
                  )
              )[0]
          )  # encoded with RLE
      return encoded_mask_results
  
imports: import numpy
  import pycocotools.mask
  import torch
  from mmengine.utils import slice_list
label_desc: Use image node_id 2 for calling a global function with example usage: encode_mask_results(mask_results) and returns: encoded_mask_results