<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tmpdir(suffix='', prefix='tmp', dir=None):
 # type: (str, str, str) -> None """Create a temporary directory with a context manager. The file is deleted when the context exits. The prefix, suffix, and dir arguments are the same as for mkstemp(). Args: suffix (str):
 If suffix is specified, the file name will end with that suffix, otherwise there will be no suffix. prefix (str):
 If prefix is specified, the file name will begin with that prefix; otherwise, a default prefix is used. dir (str):
 If dir is specified, the file will be created in that directory; otherwise, a default directory is used. Returns: str: path to the directory """

    tmp = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=dir)
    yield tmp
    shutil.rmtree(tmp)