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: sort(name1, name2, name3, ...)
  
  Sort the formats based on zero or more given names; a format with
  a name that matches one of the given names will take precedence
  over other formats. A match means an equal name, or ending with
  that name (though the former counts higher). Case insensitive.
  
  Format preference will match the order of the given names: using
  ``sort('TIFF', '-FI', '-PIL')`` would prefer the FreeImage formats
  over the Pillow formats, but prefer TIFF even more. Each time
  this is called, the starting point is the default format order,
  and calling ``sort()`` with no arguments will reset the order.
  
  Be aware that using the function can affect the behavior of
  other code that makes use of imageio.
  
  Also see the ``IMAGEIO_FORMAT_ORDER`` environment variable.
docstr_tok: ["sort","(","name1",",","name2",",","name3",",","...",")","Sort","the","formats","based","on","zero","or","more","given","names",";","a","format","with","a","name","that","matches","one","of","the","given","names","will","take","precedence","over","other","formats",".","A","match","means","an","equal","name",",","or","ending","with","that","name","(","though","the","former","counts","higher",")",".","Case","insensitive",".","Format","preference","will","match","the","order","of","the","given","names",":","using","``","sort","(","'TIFF","'",",","'-FI","'",",","'-PIL","'",")","``","would","prefer","the","FreeImage","formats","over","the","Pillow","formats",",","but","prefer","TIFF","even","more",".","Each","time","this","is","called",",","the","starting","point","is","the","default","format","order",",","and","calling","``","sort","(",")","``","with","no","arguments","will","reset","the","order",".","Be","aware","that","using","the","function","can","affect","the","behavior","of","other","code","that","makes","use","of","imageio",".","Also","see","the","``","IMAGEIO_FORMAT_ORDER","``","environment","variable","."]
code: def sort(self, *names):
      """sort(name1, name2, name3, ...)
  
      Sort the formats based on zero or more given names; a format with
      a name that matches one of the given names will take precedence
      over other formats. A match means an equal name, or ending with
      that name (though the former counts higher). Case insensitive.
  
      Format preference will match the order of the given names: using
      ``sort('TIFF', '-FI', '-PIL')`` would prefer the FreeImage formats
      over the Pillow formats, but prefer TIFF even more. Each time
      this is called, the starting point is the default format order,
      and calling ``sort()`` with no arguments will reset the order.
  
      Be aware that using the function can affect the behavior of
      other code that makes use of imageio.
  
      Also see the ``IMAGEIO_FORMAT_ORDER`` environment variable.
      """
  
      warnings.warn(
          "`FormatManager` is deprecated and it will be removed in ImageIO v3."
          " Migrating `FormatManager.sort` depends on your use-case:\n"
          "\t- modify `iio.config.known_plugins` to specify the search order for "
          "unrecognized formats.\n"
          "\t- modify `iio.config.known_extensions[<extension>].priority`"
          " to control a specific extension.",
          DeprecationWarning,
          stacklevel=2,
      )
  
      # Check and sanitize input
      for name in names:
          if not isinstance(name, str):
              raise TypeError(
                  "formats.sort() accepts only string names."
              )
          if any(c in name for c in ".,"):
              raise ValueError(
                  "Names given to formats.sort() should not "
                  "contain dots `.` or commas `,`."
              )
  
      should_reset = len(names) == 0
      if should_reset:
          names = _original_order
  
      sane_names = [
          name.strip().upper() for name in names if name != ""
      ]
  
      # enforce order for every extension that uses it
      flat_extensions = [
          ext
          for ext_list in known_extensions.values()
          for ext in ext_list
      ]
      for extension in flat_extensions:
          if should_reset:
              extension.reset()
              continue
  
          for name in reversed(sane_names):
              for plugin in [x for x in extension.default_priority]:
                  if plugin.endswith(name):
                      extension.priority.remove(plugin)
                      extension.priority.insert(0, plugin)
  
      old_order = known_plugins.copy()
      known_plugins.clear()
  
      for name in sane_names:
          plugin = old_order.pop(name, None)
          if plugin is not None:
              known_plugins[name] = plugin
  
      known_plugins.update(old_order)
  
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 7 for calling the FormatManager obj's underlying member method code with example usage: obj.sort() without return types