<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _CreateTempDir(prefix, run_dir=None):
 """Context manager for creating a temporary directory. Args: prefix: string, the prefix for the temporary directory. run_dir: string, the base directory location of the temporary directory. Yields: string, the temporary directory created. """

  temp_dir = tempfile.mkdtemp(prefix=prefix + '-', dir=run_dir)
  try:
    yield temp_dir
  finally:
    shutil.rmtree(temp_dir)