class_docstr: The FormatManager is a singleton plugin factory.
  
  The format manager supports getting a format object using indexing (by
  format name or extension). When used as an iterator, this object
  yields all registered format objects.
  
  See also :func:`.help`.
class_docstr_tok: ["The","FormatManager","is","a","singleton","plugin","factory",".","The","format","manager","supports","getting","a","format","object","using","indexing","(","by","format","name","or","extension",")",".","When","used","as","an","iterator",",","this","object","yields","all","registered","format","objects",".","See","also",":","func",":","`",".help","`","."]
docstr: add_format(format, overwrite=False)
  
  Register a format, so that imageio can use it. If a format with the
  same name already exists, an error is raised, unless overwrite is True,
  in which case the current format is replaced.
docstr_tok: ["add_format","(","format",",","overwrite=False",")","Register","a","format",",","so","that","imageio","can","use","it",".","If","a","format","with","the","same","name","already","exists",",","an","error","is","raised",",","unless","overwrite","is","True",",","in","which","case","the","current","format","is","replaced","."]
code: def add_format(self, iio_format, overwrite=False):
      """add_format(format, overwrite=False)
  
      Register a format, so that imageio can use it. If a format with the
      same name already exists, an error is raised, unless overwrite is True,
      in which case the current format is replaced.
      """
  
      warnings.warn(
          "`FormatManager` is deprecated and it will be removed in ImageIO v3."
          "To migrate `FormatManager.add_format` add the plugin directly to "
          "`iio.config.known_plugins`.",
          DeprecationWarning,
          stacklevel=2,
      )
  
      if not isinstance(iio_format, Format):
          raise ValueError(
              "add_format needs argument to be a Format object"
          )
      elif not overwrite and iio_format.name in self.get_format_names():
          raise ValueError(
              f"A Format named {iio_format.name} is already registered, use"
              " `overwrite=True` to replace."
          )
  
      config = PluginConfig(
          name=iio_format.name.upper(),
          class_name=iio_format.__class__.__name__,
          module_name=iio_format.__class__.__module__,
          is_legacy=True,
          install_name="unknown",
          legacy_args={
              "name": iio_format.name,
              "description": iio_format.description,
              "extensions": " ".join(iio_format.extensions),
              "modes": iio_format.modes,
          },
      )
  
      known_plugins[config.name] = config
  
      for extension in iio_format.extensions:
          # be conservative and always treat it as a unique file format
          ext = FileExtension(
              extension=extension,
              priority=[config.name],
              name="Unique Format",
              description="A format inserted at runtime."
              f" It is being read by the `{config.name}` plugin.",
          )
          known_extensions.setdefault(extension, list()).append(ext)
  
imports: import sys
  import warnings
  import contextlib
  import numpy
  from pathlib import Path
  from .None import Array, asarray
  from .request import ImageMode
  from ..config import known_plugins, known_extensions, PluginConfig, FileExtension
  from ..config.plugins import _original_order
  from .imopen import imopen
label_desc: Use image node_id 8 for calling the FormatManager obj's underlying member method code with example usage: obj.add_format(iio_format, overwrite) without return types