def attach_index(self, name, pmap, fkey, nullable=False, unique=True):
assert type(name) == str<EOL>assert callable(fkey)<EOL>assert isinstance(pmap, PersistentMap)<EOL>assert type(nullable) == bool<EOL>assert type(unique) == bool<EOL>if name in self._indexes:<EOL><INDENT>raise Exception('<STR_LIT>'.format(name))<EOL><DEDENT>self._indexes[name] = Index(name, fkey, pmap, nullable, unique)<EOL>
:param name:
:param pmap:
:param fkey:
:param nullable:
:param unique:
:return: