code: def fasta_verifier(entries, ambiguous=False):
      
  
      if ambiguous:
          regex = r'^>.+{0}[ACGTURYKMSWBDHVNX]+{0}$'.format(os.linesep)
      else:
          regex = r'^>.+{0}[ACGTU]+{0}$'.format(os.linesep)
      delimiter = r'{0}'.format(os.linesep)
  
      for entry in entries:
          try:
              entry_verifier([entry.write()], regex, delimiter)
          except FormatError as error:
              if error.part == 0:
                  msg = 'Unknown Header Error with {0}'.format(entry.id)
                  raise FormatError(message=msg)
              elif error.part == 1 and ambiguous:
                  msg = '{0} contains a base not in ' \
                        '[ACGTURYKMSWBDHVNX]'.format(entry.id)
                  raise FormatError(message=msg)
              elif error.part == 1 and not ambiguous:
                  msg = '{0} contains a base not in ' \
                        '[ACGTU]'.format(entry.id)
                  raise FormatError(message=msg)
              else:
                  msg = '{0}: Unknown Error: Likely a Bug'.format(entry.id)
                  raise FormatError(message=msg)
docs: Raises error if invalid FASTA format detected
  
      Args:
          entries (list): A list of FastaEntry instances
  
          ambiguous (bool): Permit ambiguous bases, i.e. permit non-ACGTU bases
  
      Raises:
          FormatError: Error when FASTA format incorrect with descriptive message
  
      Example:
          >>> from bio_utils.iterators import fasta_iter
          >>> import os
          >>> entries = r'>entry1{0}AAGGATTCG{0}' \
          ...           r'>entry{0}AGGTCCCCCG{0}' \
          ...           r'>entry3{0}GCCTAGC{0}'.format(os.linesep)
          >>> fasta_entries = fasta_iter(iter(entries.split(os.linesep)))
          >>> fasta_verifier(fasta_entries)