def set_identities(self,identities):
for identity in self.identities:<EOL><INDENT>identity.remove()<EOL><DEDENT>for identity in identities:<EOL><INDENT>try:<EOL><INDENT>self.add_identity(identity.name,identity.category,identity.type)<EOL><DEDENT>except AttributeError:<EOL><INDENT>self.add_identity(*identity)<EOL><DEDENT><DEDENT>
Set identities in the disco#info object.

        Remove all existing identities from `self`.

        :Parameters:
            - `identities`: list of identities or identity properties
              (jid,node,category,type,name).
        :Types:
            - `identities`: sequence of `DiscoIdentity` or sequence of sequences