code: def register_identity(self, category, type_, *, names={}):
          
          key = category, type_
          if key in self._identities:
              raise ValueError("identity already claimed: {!r}".format(key))
          self._identities[key] = names
          self.on_info_changed()
docs: Register an identity with the given `category` and `type_`.
  
          If there is already a registered identity with the same `category` and
          `type_`, :class:`ValueError` is raised.
  
          `names` may be a mapping which maps :class:`.structs.LanguageTag`
          instances to strings. This mapping will be used to produce
          ``<identity/>`` declarations with the respective ``xml:lang`` and
          ``name`` attributes.