class_docstr: A ImageIO Plugin.
  
  This is an abstract plugin that documents the v3 plugin API interface. A
  plugin is an adapter/wrapper around a backend that converts a request from
  iio.core (e.g., read an image from file) into a sequence of instructions for
  the backend that fulfill the request.
  
  Plugin authors may choose to subclass this class when implementing a new
  plugin, but aren't obliged to do so. As long as the plugin class implements
  the interface (methods) described below the ImageIO core will treat it just
  like any other plugin.
  
  
  Parameters
  ----------
  request : iio.Request
      A request object that represents the users intent. It provides a
      standard interface to access the various ImageResources and serves them
      to the plugin as a file object (or file). Check the docs for details.
  **kwargs : Any
      Additional configuration arguments for the plugin or backend. Usually
      these match the configuration arguments available on the backend and
      are forwarded to it.
  
  
  Raises
  ------
  InitializationError
      During ``__init__`` the plugin tests if it can fulfill the request. If
      it can't, e.g., because the request points to a file in the wrong
      format, then it should raise an ``InitializationError`` and provide a
      reason for failure. This reason may be reported to the user.
  ImportError
      Plugins will be imported dynamically when listed in
      ``iio.config.known_plugins`` to fulfill requests. This way, users only
      have to load plugins/backends they actually use. If this plugin's backend
      is not installed, it should raise an ``ImportError`` either during
      module import or during class construction.
  
  Notes
  -----
  Upon successful construction the plugin takes ownership of the provided
  request. This means that it is the plugin's responsibility to call
  request.finish() to close the resource when it is no longer needed.
  
  Plugins _must_ implement a context manager that closes and cleans any
  resources held by the plugin upon exit.
class_docstr_tok: ["A","ImageIO","Plugin",".","This","is","an","abstract","plugin","that","documents","the","v3","plugin","API","interface",".","A","plugin","is","an","adapter\/wrapper","around","a","backend","that","converts","a","request","from","iio.core","(","e.g.",",","read","an","image","from","file",")","into","a","sequence","of","instructions","for","the","backend","that","fulfill","the","request",".","Plugin","authors","may","choose","to","subclass","this","class","when","implementing","a","new","plugin",",","but","are","n't","obliged","to","do","so",".","As","long","as","the","plugin","class","implements","the","interface","(","methods",")","described","below","the","ImageIO","core","will","treat","it","just","like","any","other","plugin",".","Parameters","--","--","--","--","--","request",":","iio.Request","A","request","object","that","represents","the","users","intent",".","It","provides","a","standard","interface","to","access","the","various","ImageResources","and","serves","them","to","the","plugin","as","a","file","object","(","or","file",")",".","Check","the","docs","for","details",".","*","*","kwargs",":","Any","Additional","configuration","arguments","for","the","plugin","or","backend",".","Usually","these","match","the","configuration","arguments","available","on","the","backend","and","are","forwarded","to","it",".","Raises","--","--","--","InitializationError","During","``","__init__","``","the","plugin","tests","if","it","can","fulfill","the","request",".","If","it","ca","n't",",","e.g.",",","because","the","request","points","to","a","file","in","the","wrong","format",",","then","it","should","raise","an","``","InitializationError","``","and","provide","a","reason","for","failure",".","This","reason","may","be","reported","to","the","user",".","ImportError","Plugins","will","be","imported","dynamically","when","listed","in","``","iio.config.known_plugins","``","to","fulfill","requests",".","This","way",",","users","only","have","to","load","plugins\/backends","they","actually","use",".","If","this","plugin","'s","backend","is","not","installed",",","it","should","raise","an","``","ImportError","``","either","during","module","import","or","during","class","construction",".","Notes","--","--","-","Upon","successful","construction","the","plugin","takes","ownership","of","the","provided","request",".","This","means","that","it","is","the","plugin","'s","responsibility","to","call","request.finish","(",")","to","close","the","resource","when","it","is","no","longer","needed",".","Plugins","_must_","implement","a","context","manager","that","closes","and","cleans","any","resources","held","by","the","plugin","upon","exit","."]
docstr: Format-Specific ndimage metadata.
  
  The method reads metadata stored in the ImageResource and returns it as
  a python dict. The plugin is free to choose which name to give a piece
  of metadata; however, if possible, it should match the name given by the
  format. There is no requirement regarding the fields a plugin must
  expose; however, if a plugin does expose any,``exclude_applied`` applies
  to these fields.
  
  If the plugin does return metadata items, it must check the value of
  ``exclude_applied`` before returning them. If ``exclude applied`` is
  True, then any metadata item that would be applied to an ndimage
  returned by ``read`` (or ``iter``) must not be returned. This is done to
  avoid confusion; for example, if an ImageResource defines the ExIF
  rotation tag, and the plugin applies the rotation to the data before
  returning it, then ``exclude_applied`` prevents confusion on whether the
  tag was already applied or not.
  
  The `kwarg` ``index`` behaves similar to its counterpart in ``read``
  with one exception: If the ``index`` is None, then global metadata is
  returned instead of returning a combination of all metadata items. If
  there is no global metadata, the Plugin should return an empty dict or
  raise an exception.
  
  Parameters
  ----------
  index : int
      If the ImageResource contains multiple ndimages, and index is an
      integer, select the index-th ndimage from among them and return its
      metadata. If index is an ellipsis (...), return global metadata. If
      index is None, the plugin decides the default.
  exclude_applied : bool
      If True (default), do not report metadata fields that the plugin
      would apply/consume while reading the image.
  
  Returns
  -------
  metadata : dict
      A dictionary filled with format-specific metadata fields and their
      values.
docstr_tok: ["Format-Specific","ndimage","metadata",".","The","method","reads","metadata","stored","in","the","ImageResource","and","returns","it","as","a","python","dict",".","The","plugin","is","free","to","choose","which","name","to","give","a","piece","of","metadata",";","however",",","if","possible",",","it","should","match","the","name","given","by","the","format",".","There","is","no","requirement","regarding","the","fields","a","plugin","must","expose",";","however",",","if","a","plugin","does","expose","any",",","``","exclude_applied","``","applies","to","these","fields",".","If","the","plugin","does","return","metadata","items",",","it","must","check","the","value","of","``","exclude_applied","``","before","returning","them",".","If","``","exclude","applied","``","is","True",",","then","any","metadata","item","that","would","be","applied","to","an","ndimage","returned","by","``","read","``","(","or","``","iter","``",")","must","not","be","returned",".","This","is","done","to","avoid","confusion",";","for","example",",","if","an","ImageResource","defines","the","ExIF","rotation","tag",",","and","the","plugin","applies","the","rotation","to","the","data","before","returning","it",",","then","``","exclude_applied","``","prevents","confusion","on","whether","the","tag","was","already","applied","or","not",".","The","`","kwarg","`","``","index","``","behaves","similar","to","its","counterpart","in","``","read","``","with","one","exception",":","If","the","``","index","``","is","None",",","then","global","metadata","is","returned","instead","of","returning","a","combination","of","all","metadata","items",".","If","there","is","no","global","metadata",",","the","Plugin","should","return","an","empty","dict","or","raise","an","exception",".","Parameters","--","--","--","--","--","index",":","int","If","the","ImageResource","contains","multiple","ndimages",",","and","index","is","an","integer",",","select","the","index-th","ndimage","from","among","them","and","return","its","metadata",".","If","index","is","an","ellipsis","(","...",")",",","return","global","metadata",".","If","index","is","None",",","the","plugin","decides","the","default",".","exclude_applied",":","bool","If","True","(","default",")",",","do","not","report","metadata","fields","that","the","plugin","would","apply\/consume","while","reading","the","image",".","Returns","--","--","--","-","metadata",":","dict","A","dictionary","filled","with","format-specific","metadata","fields","and","their","values","."]
code: def metadata(
      self, index: int = 0, exclude_applied: bool = True
  ) -> Dict[str, Any]:
      """Format-Specific ndimage metadata.
  
      The method reads metadata stored in the ImageResource and returns it as
      a python dict. The plugin is free to choose which name to give a piece
      of metadata; however, if possible, it should match the name given by the
      format. There is no requirement regarding the fields a plugin must
      expose; however, if a plugin does expose any,``exclude_applied`` applies
      to these fields.
  
      If the plugin does return metadata items, it must check the value of
      ``exclude_applied`` before returning them. If ``exclude applied`` is
      True, then any metadata item that would be applied to an ndimage
      returned by ``read`` (or ``iter``) must not be returned. This is done to
      avoid confusion; for example, if an ImageResource defines the ExIF
      rotation tag, and the plugin applies the rotation to the data before
      returning it, then ``exclude_applied`` prevents confusion on whether the
      tag was already applied or not.
  
      The `kwarg` ``index`` behaves similar to its counterpart in ``read``
      with one exception: If the ``index`` is None, then global metadata is
      returned instead of returning a combination of all metadata items. If
      there is no global metadata, the Plugin should return an empty dict or
      raise an exception.
  
      Parameters
      ----------
      index : int
          If the ImageResource contains multiple ndimages, and index is an
          integer, select the index-th ndimage from among them and return its
          metadata. If index is an ellipsis (...), return global metadata. If
          index is None, the plugin decides the default.
      exclude_applied : bool
          If True (default), do not report metadata fields that the plugin
          would apply/consume while reading the image.
  
      Returns
      -------
      metadata : dict
          A dictionary filled with format-specific metadata fields and their
          values.
  
      """
      raise NotImplementedError()
  
file_path: imageio/imageio/core/v3_plugin_api.py
imports: from .None import Request
  from ..typing import ArrayLike
  import numpy
  from typing import Optional, Dict, Any, Tuple, Union, List, Iterator
  from dataclasses import dataclass
label_desc: Use image node_id 6 for calling the PluginV3 obj's underlying member method code with example usage: obj.metadata(index, exclude_applied) without return types