code: def AddSpecification(self, specification):
      
      if specification.identifier in self._format_specifications:
        raise KeyError(
            'Format specification {0:s} is already defined in store.'.format(
                specification.identifier))
  
      self._format_specifications[specification.identifier] = specification
  
      for signature in specification.signatures:
        signature_index = len(self._signature_map)
  
        signature_identifier = '{0:s}:{1:d}'.format(
            specification.identifier, signature_index)
  
        if signature_identifier in self._signature_map:
          raise KeyError('Signature {0:s} is already defined in map.'.format(
              signature_identifier))
  
        signature.SetIdentifier(signature_identifier)
        self._signature_map[signature_identifier] = specification
docs: Adds a format specification.
  
      Args:
        specification (FormatSpecification): format specification.
  
      Raises:
        KeyError: if the store already contains a specification with
                  the same identifier.