<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cleanup_tmpdir(dirname):
 """Removes the given temporary directory if it exists."""

    if dirname is not None and os.path.exists(dirname):
        shutil.rmtree(dirname)