<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_cwd():
 """ Use workdir.options.path as a temporary working directory """

    _set_log_level()
    owd = os.getcwd()
    logger.debug('entering working directory: ' + options.path)
    os.chdir(os.path.expanduser(options.path))
    yield
    logger.debug('returning to original directory: ' + owd)
    os.chdir(owd)