<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_versions_dir_exists(tfenv_path):
 """Ensure versions directory is available."""

    versions_dir = os.path.join(tfenv_path, 'versions')
    if not os.path.isdir(tfenv_path):
        os.mkdir(tfenv_path)
    if not os.path.isdir(versions_dir):
        os.mkdir(versions_dir)
    return versions_dir