<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cd_to(path, mkdir=False):
 """make a generator like cd, but use it for function Usage:: / """

    def cd_to_decorator(func):
        @functools.wraps(func)
        def _cd_and_exec(*args, **kwargs):
            with cd(path, mkdir):
                return func(*args, **kwargs)
        return _cd_and_exec
    return cd_to_decorator