class_docstr: Singleton to maintain the relation between figures and their managers, and
  keep track of and "active" figure and manager.
  
  The canvas of a figure created through pyplot is associated with a figure
  manager, which handles the interaction between the figure and the backend.
  pyplot keeps track of figure managers using an identifier, the "figure
  number" or "manager number" (which can actually be any hashable value);
  this number is available as the :attr:`number` attribute of the manager.
  
  This class is never instantiated; it consists of an `OrderedDict` mapping
  figure/manager numbers to managers, and a set of class methods that
  manipulate this `OrderedDict`.
  
  Attributes
  ----------
  figs : OrderedDict
      `OrderedDict` mapping numbers to managers; the active manager is at the
      end.
class_docstr_tok: ["Singleton","to","maintain","the","relation","between","figures","and","their","managers",",","and","keep","track","of","and","``","active","''","figure","and","manager",".","The","canvas","of","a","figure","created","through","pyplot","is","associated","with","a","figure","manager",",","which","handles","the","interaction","between","the","figure","and","the","backend",".","pyplot","keeps","track","of","figure","managers","using","an","identifier",",","the","``","figure","number","''","or","``","manager","number","''","(","which","can","actually","be","any","hashable","value",")",";","this","number","is","available","as","the",":","attr",":","`","number","`","attribute","of","the","manager",".","This","class","is","never","instantiated",";","it","consists","of","an","`","OrderedDict","`","mapping","figure\/manager","numbers","to","managers",",","and","a","set","of","class","methods","that","manipulate","this","`","OrderedDict","`",".","Attributes","--","--","--","--","--","figs",":","OrderedDict","`","OrderedDict","`","mapping","numbers","to","managers",";","the","active","manager","is","at","the","end","."]
docstr: Destroy manager *num* -- either a manager instance or a manager number.
  
  In the interactive backends, this is bound to the window "destroy" and
  "delete" events.
  
  It is recommended to pass a manager instance, to avoid confusion when
  two managers share the same number.
docstr_tok: ["Destroy","manager","*","num","*","--","either","a","manager","instance","or","a","manager","number",".","In","the","interactive","backends",",","this","is","bound","to","the","window","``","destroy","''","and","''","delete","''","events",".","It","is","recommended","to","pass","a","manager","instance",",","to","avoid","confusion","when","two","managers","share","the","same","number","."]
code: def destroy(cls, num):
      """
      Destroy manager *num* -- either a manager instance or a manager number.
  
      In the interactive backends, this is bound to the window "destroy" and
      "delete" events.
  
      It is recommended to pass a manager instance, to avoid confusion when
      two managers share the same number.
      """
      if all(hasattr(num, attr) for attr in ["num", "destroy"]):
          manager = num
          if cls.figs.get(manager.num) is manager:
              cls.figs.pop(manager.num)
      else:
          try:
              manager = cls.figs.pop(num)
          except KeyError:
              return
      if hasattr(manager, "_cidgcf"):
          manager.canvas.mpl_disconnect(manager._cidgcf)
      manager.destroy()
      del manager, num
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/_pylab_helpers.py
imports: import atexit
  from collections import OrderedDict
label_desc: Use image node_id 2 for calling the Gcf obj's underlying member method code with example usage: obj.destroy(cls, num) without return types