code: def resolve_writer(ext_name, error_if_not_found=True) -> Sequence:
      """
      Resolves to a tuple of available ``ImageWriter`` in ``SUPPORTED_WRITERS``
      according to the filename extension key ``ext_name``.
  
      Args:
          ext_name: the filename extension of the image.
              As an indexing key it will be converted to a lower case string.
          error_if_not_found: whether to raise an error if no suitable image writer is found.
              if True , raise an ``OptionalImportError``, otherwise return an empty tuple. Default is ``True``.
      """
      if not SUPPORTED_WRITERS:
          init()
      fmt = f"{ext_name}".lower()
      if fmt.startswith("."):
          fmt = fmt[1:]
      avail_writers = []
      default_writers = SUPPORTED_WRITERS.get(EXT_WILDCARD, ())
      for _writer in look_up_option(
          fmt, SUPPORTED_WRITERS, default=default_writers
      ):
          try:
              _writer()  # this triggers `monai.utils.module.require_pkg` to check the system availability
              avail_writers.append(_writer)
          except OptionalImportError:
              continue
          except (
              Exception
          ):  # other writer init errors indicating it exists
              avail_writers.append(_writer)
      if not avail_writers and error_if_not_found:
          raise OptionalImportError(
              f"No ImageWriter backend found for {fmt}."
          )
      writer_tuple = ensure_tuple(avail_writers)
      SUPPORTED_WRITERS[fmt] = writer_tuple
      return writer_tuple
  
imports: from __future__ import annotations
  from collections.abc import Mapping, Sequence
  from typing import TYPE_CHECKING, Any, cast
  import numpy
  from monai.apps.utils import get_logger
  from monai.config import DtypeLike, NdarrayOrTensor, PathLike
  from monai.data.meta_tensor import MetaTensor
  from monai.data.utils import affine_to_spacing, ensure_tuple, ensure_tuple_rep, orientation_ras_lps, to_affine_nd
  from monai.transforms.spatial.array import Resize, SpatialResample
  from monai.transforms.utils_pytorch_numpy_unification import ascontiguousarray, moveaxis
  from monai.utils import GridSampleMode, GridSamplePadMode, InterpolateMode, MetaKeys, OptionalImportError, SpaceKeys, convert_data_type, convert_to_tensor, get_equivalent_dtype, look_up_option, optional_import, require_pkg
label_desc: Use image node_id 2 for calling a global function with example usage: resolve_writer(ext_name, error_if_not_found) and returns: writer_tuple