def _interpret_task_logs(fs, matches, partial=True, stderr_callback=None):
    """Look for errors in task syslog/stderr.

    If *partial* is true (the default), stop when we find the first error.

    If *stderr_callback* is set, every time we're about to parse a stderr
        file, call it with a single argument, the path of that file

    Returns a dictionary possibly containing the key 'errors', which
    is a dict containing:

    hadoop_error:
        message: string containing error message and Java exception
        num_lines: number of lines in syslog this takes up
        path: syslog we read this error from
        start_line: where in syslog exception starts (0-indexed)
    split: (optional)
        path: URI of input file task was processing
        num_lines: (optional) number of lines in split
        start_line: (optional) first line of split (0-indexed)
    task_error:
        message: command and error message from task, as a string
        num_lines: number of lines in stderr this takes up
        path: stderr we read this from
        start_line: where in stderr error message starts (0-indexed)

    In addition, if *partial* is set to true (and we found an error),
    this dictionary will contain the key *partial*, set to True.
    """
    result = {}

    for match in matches:
        syslog_path = match['path']

        # get hadoop_error and possibly split from syslog
        error = _parse_task_syslog(_cat_log(fs, syslog_path))
        if not error.get('hadoop_error'):
            continue
        error['hadoop_error']['path'] = syslog_path

        # path in IDs we learned from path
        for id_key in 'attempt_id', 'container_id', 'type_id':
            if id_key in match:
                error[id_key] = match[id_key]

        _add_implied_task_id(error)

        # look for task_error in stderr, if it exists
        stderr_path = _syslog_to_stderr_path(syslog_path)
        if fs.exists(stderr_path):
            if stderr_callback:
                stderr_callback(stderr_path)

            task_error = _parse_task_stderr(_cat_log(fs, stderr_path))

            if task_error:
                task_error['path'] = stderr_path
                error['task_error'] = task_error

        result.setdefault('errors', [])
        result['errors'].append(error)

        if partial:
            result['partial'] = True
            break

    return result
dataset/ETHPy150Open Yelp/mrjob/mrjob/logs/task.py/_interpret_task_logs/original