<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def has_dir(state, fname, incorrect_msg="Did you create a directory named `{}`?"):
 """Test whether a directory exists."""

    if not Path(fname).is_dir():
        state.report(Feedback(incorrect_msg.format(fname)))

    return state