<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_tmpdir():
 """ On first invocation, creates a temporary directory and returns its path. Subsequent invocations uses the same directory. :returns: A temporary directory created for this run of glerbl. :rtype: :class:`str` """

    global __tmpdir
    if __tmpdir is not None:
        return __tmpdir

    __tmpdir = tempfile.mkdtemp(prefix='.tmp.glerbl.', dir=".")
    atexit.register(__clean_tmpdir)

    return __tmpdir