<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_tempdir(suffix='', prefix='tmp', directory=None, delete=True):
 """Create a tempdir and return the path. This function registers the new temporary directory for deletion with the atexit module. """

    tempd = tempfile.mkdtemp(suffix=suffix, prefix=prefix, dir=directory)
    if delete:
        atexit.register(_cleanup_tempdir, tempd)
    return tempd