code: def test_0_default(self):
      self.assertTrue(len(resolve_writer(".png")) > 0, "has png writer")
      self.assertTrue(
          len(resolve_writer(".nrrd")) > 0, "has nrrd writer"
      )
      self.assertTrue(len(resolve_writer("unknown")) > 0, "has writer")
      register_writer(
          "unknown1", lambda: (_ for _ in ()).throw(OptionalImportError)
      )
      with self.assertRaises(OptionalImportError):
          resolve_writer("unknown1")
  
imports: from __future__ import annotations
  import itertools
  import os
  import shutil
  import tempfile
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.data.image_reader import ITKReader, NibabelReader, NrrdReader, PILReader
  from monai.data.image_writer import ITKWriter, NibabelWriter, PILWriter, register_writer, resolve_writer
  from monai.data.meta_tensor import MetaTensor
  from monai.transforms import LoadImage, SaveImage, moveaxis
  from monai.utils import MetaKeys, OptionalImportError, optional_import
  from tests.utils import TEST_NDARRAYS, assert_allclose
label_desc: Use image node_id 1 for calling the TestRegRes obj's underlying member method code with example usage: obj.test_0_default() without return types