code: def test_format_only(self):
      # create dummy data
      fake_json_file = osp.join(self.tmp_dir.name, "fake_data.json")
      self._create_dummy_lvis_json(fake_json_file)
      dummy_pred = self._create_dummy_results()
  
      with self.assertRaises(AssertionError):
          LVISMetric(
              ann_file=fake_json_file,
              classwise=False,
              format_only=True,
              outfile_prefix=None,
          )
  
      lvis_metric = LVISMetric(
          ann_file=fake_json_file,
          metric="bbox",
          classwise=False,
          format_only=True,
          outfile_prefix=f"{self.tmp_dir.name}/test",
      )
      lvis_metric.dataset_meta = dict(
          classes=["aerosol_can", "air_conditioner"]
      )
      lvis_metric.process(
          {},
          [
              dict(
                  pred_instances=dummy_pred,
                  img_id=0,
                  ori_shape=(640, 640),
              )
          ],
      )
      eval_results = lvis_metric.evaluate(size=1)
      self.assertDictEqual(eval_results, dict())
      self.assertTrue(osp.exists(f"{self.tmp_dir.name}/test.bbox.json"))
  
imports: import os.path
  import tempfile
  import unittest
  import numpy
  import pycocotools.mask
  import torch
  from mmdet.evaluation.metrics import LVISMetric
  from mmengine.fileio import dump
label_desc: Use image node_id 12 for calling the TestLVISMetric obj's underlying member method code with example usage: obj.test_format_only() without return types