def complete_path(curr_dir, last_dir):
    if not last_dir or curr_dir.startswith(last_dir):
        return curr_dir
    elif last_dir == '~':
        return os.path.join(last_dir, curr_dir)
Return the path to complete that matches the last entered component.
dataset/ETHPy150Open j-bennet/wharfee/wharfee/helpers.py/complete_path