class_docstr: Builds target formats from the reST sources.
class_docstr_tok: ["Builds","target","formats","from","the","reST","sources","."]
docstr: Pick the best candidate for all image URIs.
code: def post_process_images(self, doctree: Node) -> None:
      """Pick the best candidate for all image URIs."""
      images = ImageAdapter(self.env)
      for node in doctree.findall(nodes.image):
          if "?" in node["candidates"]:
              # don't rewrite nonlocal image URIs
              continue
          if "*" not in node["candidates"]:
              for imgtype in self.supported_image_types:
                  candidate = node["candidates"].get(imgtype, None)
                  if candidate:
                      break
              else:
                  mimetypes = sorted(node["candidates"])
                  image_uri = images.get_original_image_uri(node["uri"])
                  if mimetypes:
                      logger.warning(
                          __(
                              "a suitable image for %s builder not found: "
                              "%s (%s)"
                          ),
                          self.name,
                          mimetypes,
                          image_uri,
                          location=node,
                      )
                  else:
                      logger.warning(
                          __(
                              "a suitable image for %s builder not found: %s"
                          ),
                          self.name,
                          image_uri,
                          location=node,
                      )
                  continue
              node["uri"] = candidate
          else:
              candidate = node["uri"]
          if candidate not in self.env.images:
              # non-existing URI; let it alone
              continue
          self.images[candidate] = self.env.images[candidate][1]
  
imports: from __future__ import annotations
  import codecs
  import pickle
  import time
  from os import path
  from typing import TYPE_CHECKING, Any
  from docutils import nodes
  from docutils.utils import DependencyList
  from sphinx.environment import CONFIG_CHANGED_REASON, CONFIG_OK, BuildEnvironment
  from sphinx.environment.adapters.asset import ImageAdapter
  from sphinx.errors import SphinxError
  from sphinx.locale import __
  from sphinx.util import UnicodeDecodeErrorHandler, get_filetype, import_object, logging, rst
  from sphinx.util.build_phase import BuildPhase
  from sphinx.util.console import bold
  from sphinx.util.display import progress_message, status_iterator
  from sphinx.util.docutils import sphinx_domains
  from sphinx.util.i18n import CatalogInfo, CatalogRepository, docname_to_domain
  from sphinx.util.osutil import SEP, ensuredir, relative_uri, relpath
  from sphinx.util.parallel import ParallelTasks, SerialTasks, make_chunks, parallel_available
  from sphinx import directives
  from sphinx import roles
label_desc: Use image node_id 10 for calling the Builder obj's underlying member method code with example usage: obj.post_process_images(doctree) without return types