class_docstr: Iterate over all spanning arborescences of a graph in either increasing or
  decreasing cost.
  
  Notes
  -----
  This iterator uses the partition scheme from [1]_ (included edges,
  excluded edges and open edges). It generates minimum spanning
  arborescences using a modified Edmonds' Algorithm which respects the
  partition of edges. For arborescences with the same weight, ties are
  broken arbitrarily.
  
  References
  ----------
  .. [1] G.K. Janssens, K. Sörensen, An algorithm to generate all spanning
         trees in order of increasing cost, Pesquisa Operacional, 2005-08,
         Vol. 25 (2), p. 219-229,
         https://www.scielo.br/j/pope/a/XHswBwRwJyrfL88dmMwYNWp/?lang=en
docstr: Returns
  -------
  ArborescenceIterator
      The iterator object for this graph
code: def __iter__(self):
      """
      Returns
      -------
      ArborescenceIterator
          The iterator object for this graph
      """
      self.partition_queue = PriorityQueue()
      self._clear_partition(self.G)
  
      # Write the initial partition if it exists.
      if self.init_partition is not None:
          self._write_partition(self.init_partition)
  
      mst_weight = self.method(
          self.G,
          self.weight,
          partition=self.partition_key,
          preserve_attrs=True,
      ).size(weight=self.weight)
  
      self.partition_queue.put(
          self.Partition(
              mst_weight if self.minimum else -mst_weight,
              {}
              if self.init_partition is None
              else self.init_partition.partition_dict,
          )
      )
  
      return self
  
imports: import string
  from dataclasses import dataclass, field
  from enum import Enum
  from operator import itemgetter
  from queue import PriorityQueue
  import networkx
  from networkx.utils import py_random_state
  from .recognition import is_arborescence, is_branching
label_desc: Use image node_id 2 for calling the ArborescenceIterator obj's underlying member method code with example usage: obj.__iter__() and returns: self