<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_walk_after(filename, optimize_after=None):
 """ Figure out the which mtime to check against. If we have to look up the path return that. """

    if Settings.optimize_after is not None:
        return Settings.optimize_after

    dirname = os.path.dirname(filename)
    if optimize_after is None:
        optimize_after = _get_parent_timestamp(dirname, optimize_after)
    return _max_timestamps(dirname, True, optimize_after)