import time, os, random


def get_random_temp_dir_name(basedir="/tmp"):
    """
    Creates a directory path with a unique random name as a subdirectory of
    the given directory.
    The directory name is derived from
    - the current time
    - the process id and
    - some random numbers
    """
    return "%s/%s-%s-%s" % (basedir,
                            time.time(),
                            os.getpid(),
                            random.randrange(1000000, 10000000))