docs: def add_tags(self, dic, prefix):
          """
          :param dic: a dictionary tagname -> tagvalue
          :returns: a list of tag indices, one per tagname
          """
          # fill missing tagvalues with "?", raise an error for unknown tagnames
          idxs = []
          for tagname in self.tagnames:
              if tagname in ('exposure', 'country'):
                  idxs.append(self.add(tagname, prefix))
                  continue
              try:
                  tagvalue = dic.pop(tagname)
              except KeyError:
                  tagvalue = '?'
              else:
                  if tagvalue in '?*':
                      raise ValueError(
                          'Invalid tagvalue="%s"' % tagvalue)
              idxs.append(self.add(tagname, tagvalue))
          if dic:
              raise ValueError(
                  'Unknown tagname %s or <tagNames> not '
                  'specified in the exposure' % ', '.join(dic))
          return idxs