class_docstr: A dictionary-like class that can be used to assign unique IDs to
  names (say, vertex names).
  
  Usage:
  
  >>> gen = UniqueIdGenerator()
  >>> gen["A"]
  0
  >>> gen["B"]
  1
  >>> gen["C"]
  2
  >>> gen["A"]      # Retrieving already existing ID
  0
  >>> gen.add("D")  # Synonym of gen["D"]
  3
  >>> len(gen)      # Number of already used IDs
  4
  >>> "C" in gen
  True
  >>> "E" in gen
  False
class_docstr_tok: ["A","dictionary-like","class","that","can","be","used","to","assign","unique","IDs","to","names","(","say",",","vertex","names",")",".","Usage",":",">",">",">","gen","=","UniqueIdGenerator","(",")",">",">",">","gen","[","``","A","''","]","0",">",">",">","gen","[","``","B","''","]","1",">",">",">","gen","[","``","C","''","]","2",">",">",">","gen","[","``","A","''","]","#","Retrieving","already","existing","ID","0",">",">",">","gen.add","(","``","D","''",")","#","Synonym","of","gen","[","``","D","''","]","3",">",">",">","len","(","gen",")","#","Number","of","already","used","IDs","4",">",">",">","``","C","''","in","gen","True",">",">",">","``","E","''","in","gen","False"]
docstr: Creates a new unique ID generator. C{id_generator} specifies how do we
  assign new IDs to elements that do not have an ID yet. If it is C{None},
  elements will be assigned integer identifiers starting from 0. If it is
  an integer, elements will be assigned identifiers starting from the given
  integer. If it is an iterator or generator, its C{next()} method will be
  called every time a new ID is needed.
code: def __init__(self, id_generator=None, initial=None):
      """Creates a new unique ID generator. C{id_generator} specifies how do we
      assign new IDs to elements that do not have an ID yet. If it is C{None},
      elements will be assigned integer identifiers starting from 0. If it is
      an integer, elements will be assigned identifiers starting from the given
      integer. If it is an iterator or generator, its C{next()} method will be
      called every time a new ID is needed."""
      if id_generator is None:
          id_generator = 0
      if isinstance(id_generator, int):
          import itertools
  
          self._generator = itertools.count(id_generator)
      else:
          self._generator = id_generator
      self._ids = {}
      if initial:
          for value in initial:
              self.add(value)
  
label_desc: Use image node_id 1 to create a new UniqueIdGenerator object  with example: obj = UniqueIdGenerator(id_generator, initial)