def METHOD_NAME(string):
    """
    Gets the absolute path of the given file and confirms the directory exists
    Parameters
    ----------
    string : str
        Path to a file
    Returns
    --------
    str
        Absolute path of input path
    Raises
    -------
    NotADirectoryError
        If the target directory for the file does not exist.
    """
    if os.path.isfile(string) or os.path.isdir(os.path.dirname(string)):
        return os.path.abspath(string)
    else:
        raise NotADirectoryError(string)