def complete_path(curr_dir, last_dir):
    """
    Return the path to complete that matches the last entered component.
    If the last entered component is ~, expanded path would not
    match, so return all of the available paths.
    :param curr_dir: string
    :param last_dir: string
    :return: string
    """
    if not last_dir or curr_dir.startswith(last_dir):
        return curr_dir
    elif last_dir == '~':
        return os.path.join(last_dir, curr_dir)
dataset/ETHPy150Open j-bennet/wharfee/wharfee/helpers.py/complete_path/original