<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mkdtemp(*args, **kwargs):
 """Create a temporary directory in a with-context keyword remove: Remove the directory when leaving the context if True. Default is True. other keywords arguments are given to the tempfile.mkdtemp function. """

    remove = kwargs.pop('remove', True)
    path = tempfile.mkdtemp(*args, **kwargs)
    try:
        yield path
    finally:
        if remove:
            shutil.rmtree(path)