def METHOD_NAME(self, elt):
    if elt not in self.node_to_handle:
        handle = len(self.node_to_handle)
        self.node_to_handle[elt] = handle
        self.handle_to_node[handle] = elt
    else:
        handle = self.node_to_handle[elt]
    return handle