<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _validate_magic_line(line):
 """For NRRD files, the first four characters are always "NRRD", and remaining characters give information about the file format version 8 Traceback (most recent call last):
 NrrdError: NRRD file version too new for this library. Traceback (most recent call last):
 NrrdError: Invalid NRRD magic line: NRRD """


    if not line.startswith('NRRD'):
        raise NRRDError('Invalid NRRD magic line. Is this an NRRD file?')

    try:
        version = int(line[4:])
        if version > 5:
            raise NRRDError('Unsupported NRRD file version (version: %i). This library only supports v%i and below.'
                            % (version, 5))
    except ValueError:
        raise NRRDError('Invalid NRRD magic line: %s' % line)

    return len(line)