<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fastq_verifier(entries, ambiguous=False):
 """Raises error if invalid FASTQ format detected Args: entries (list):
 A list of FastqEntry instances ambiguous (bool):
 Permit ambiguous bases, i.e. permit non-ACGTU bases Raises: FormatError: Error when FASTQ format incorrect with descriptive message Example: """


    if ambiguous:
        regex = r'^@.+{0}[ACGTURYKMSWBDHVNX]+{0}' \
                r'\+.*{0}[!"#$%&\'()*+,-./0123456' \
                r'789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ' \
                r'[\]^_`abcdefghijklmnopqrstuvwxyz' \
                r'{{|}}~]+{0}$'.format(os.linesep)
    else:
        regex = r'^@.+{0}[ACGTU]+{0}' \
                r'\+.*{0}[!-~]+{0}$'.format(os.linesep)
    delimiter = r'{0}'.format(os.linesep)

    for entry in entries:
        if len(entry.sequence) != len(entry.quality):
            msg = 'The number of bases in {0} does not match the number ' \
                  'of quality scores'.format(entry.id)
            raise FormatError(message=msg)
        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)
            elif error.part == 2:
                msg = 'Unknown error with line 3 of {0}'.format(entry.id)
                raise FormatError(message=msg)
            elif error.part == 3:
                msg = r'{0} contains a quality score not in ' \
                      r'[!-~]'.format(entry.id)
                raise FormatError(message=msg)
            else:
                msg = '{0}: Unknown Error: Likely a Bug'.format(entry.id)
                raise FormatError(message=msg)