def ensure_directory_exists(dirpath):
    if not os.path.isdir(dirpath):
        os.makedirs(dirpath)
    return dirpath
A filter for directory paths to ensure they exist.
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/utils/misc.py/ensure_directory_exists