def _check(self, id):
if id in self._dict:<EOL><INDENT>raise ValueError("<STR_LIT>" % str(id))<EOL><DEDENT>
make sure duplicate id's are not added.
        This function is called before adding in elements.