code: def deduplicate_taxa(records):
      
      logging.info('Applying _deduplicate_taxa generator: ' + \
                   'removing any duplicate records with identical IDs.')
      taxa = set()
      for record in records:
          # Default to full ID, split if | is found.
          taxid = record.id
          if '|' in record.id:
              try:
                  taxid = int(record.id.split("|")[0])
              except:
                  # If we couldn't parse an integer from the ID, just fall back
                  # on the ID
                  logging.warn("Unable to parse integer taxid from %s",
                          taxid)
          if taxid in taxa:
              continue
          taxa.add(taxid)
          yield record
docs: Remove any duplicate records with identical IDs, keep the first
      instance seen and discard additional occurences.