<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def id(self, obj):
 """ 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 1 2 11 19 20 In some cases, it makes sense to create an external function for accessing IDPool, e.g.: .. code-block:: python 20 21 """


        vid = self.obj2id[obj]

        if vid not in self.id2obj:
            self.id2obj[vid] = obj

        return vid