code: def id(self, obj):
          
  
          vid = self.obj2id[obj]
  
          if vid not in self.id2obj:
              self.id2obj[vid] = obj
  
          return vid
docs: The method is to be used to assign an integer variable ID for a
              given new object. If the object already has an ID, no new ID is
              created and the old one is returned instead.
  
              An object can be anything. In some cases it is convenient to use
              string variable names.
  
              :param obj: an object to assign an ID to.
  
              :rtype: int.
  
              Example:
  
              .. code-block:: python
  
                  >>> from pysat.formula import IDPool
                  >>> vpool = IDPool(occupied=[[12, 18], [3, 10]])
                  >>>
                  >>> # creating 5 unique variables for the following strings
                  >>> for i in range(5):
                  ...    print vpool.id('v{0}'.format(i + 1))
                  1
                  2
                  11
                  19
                  20
  
              In some cases, it makes sense to create an external function for
              accessing IDPool, e.g.:
  
              .. code-block:: python
  
                  >>> # continuing the previous example
                  >>> var = lambda i: vpool.id('var{0}'.format(i))
                  >>> var(5)
                  20
                  >>> var('hello_world!')
                  21