docstr: Format the results to txt (standard format for Cityscapes
  evaluation).
  
  Args:
      results (list): Testing results of the dataset.
      txtfile_prefix (str | None): The prefix of txt files. It includes
          the file path and the prefix of filename, e.g., "a/b/prefix".
          If not specified, a temp file will be created. Default: None.
  
  Returns:
      tuple: (result_files, tmp_dir), result_files is a dict containing                 the json filepaths, tmp_dir is the temporal directory created                 for saving txt/png files when txtfile_prefix is not specified.
docstr_tok: ["Format","the","results","to","txt","(","standard","format","for","Cityscapes","evaluation",")",".","Args",":","results","(","list",")",":","Testing","results","of","the","dataset",".","txtfile_prefix","(","str","|","None",")",":","The","prefix","of","txt","files",".","It","includes","the","file","path","and","the","prefix","of","filename",",","e.g.",",","``","a\/b\/prefix","''",".","If","not","specified",",","a","temp","file","will","be","created",".","Default",":","None",".","Returns",":","tuple",":","(","result_files",",","tmp_dir",")",",","result_files","is","a","dict","containing","the","json","filepaths",",","tmp_dir","is","the","temporal","directory","created","for","saving","txt\/png","files","when","txtfile_prefix","is","not","specified","."]
code: def format_results(self, results, txtfile_prefix=None):
      """Format the results to txt (standard format for Cityscapes
          evaluation).
  
          Args:
              results (list): Testing results of the dataset.
              txtfile_prefix (str | None): The prefix of txt files. It includes
                  the file path and the prefix of filename, e.g., "a/b/prefix".
                  If not specified, a temp file will be created. Default: None.
  
          Returns:
              tuple: (result_files, tmp_dir), result_files is a dict containing \
                  the json filepaths, tmp_dir is the temporal directory created \
                  for saving txt/png files when txtfile_prefix is not specified.
          """
      assert isinstance(results, list), "results must be a list"
      assert len(results) == len(
          self
      ), "The length of results is not equal to the dataset len: {} != {}".format(
          len(results), len(self)
      )
  
      assert isinstance(results, list), "results must be a list"
      assert len(results) == len(
          self
      ), "The length of results is not equal to the dataset len: {} != {}".format(
          len(results), len(self)
      )
  
      if txtfile_prefix is None:
          tmp_dir = tempfile.TemporaryDirectory()
          txtfile_prefix = osp.join(tmp_dir.name, "results")
      else:
          tmp_dir = None
      result_files = self.results2txt(results, txtfile_prefix)
  
      return result_files, tmp_dir
  
file_path: insightface/detection/scrfd/mmdet/datasets/cityscapes.py
imports: import glob
  import os
  import os.path
  import tempfile
  from collections import OrderedDict
  import mmcv
  import numpy
  import pycocotools.mask
  from mmcv.utils import print_log
  from .builder import DATASETS
  from .coco import CocoDataset
label_desc: Use image node_id 4 for calling the CityscapesDataset obj's underlying member method code with example usage: obj.format_results(results, txtfile_prefix) and returns: result_files,  tmp_dir