human
Complete this python program:
def _pick_error(log_interpretation):
assistant
#Here is the Python program you requested.

    """Pick most recent error from a dictionary possibly containing
    step, history, and task interpretations. Returns None if there
    are no errors.
    """
    def yield_errors():
        for log_type in ('step', 'history', 'task'):
            errors = log_interpretation.get(log_type, {}).get('errors')
            for error in (errors or ()):
                (yield error)
    errors = _merge_and_sort_errors(yield_errors())
    if errors:
        return errors[0]
    else:
        return None