<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fasta_verifier(entries, ambiguous=False):
 """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: """


    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)