code: def de_rep(fastas, append_index, return_original = False):
      
      ids = []
      for fasta in fastas:
          for seq in parse_fasta(fasta):
              header = seq[0].split('>')[1].split()
              id = header[0]
              if id not in ids:
                  ids.append(id)
                  if return_original is True:
                      yield [header, seq]
                  else:
                      yield seq
              elif append_index == True:
                  new, ids = append_index_id(id, ids) 
                  if return_original is True:
                      yield [header, ['>%s %s' % (new, ' '.join(header[1::])), seq[1]]]
                  else:
                      yield ['>%s %s' % (new, ' '.join(header[1::])), seq[1]]
docs: de-replicate fastas based on sequence names