def get_path_atoms(atom_1, atom_2, paths_dict, pointer_dict, max_path_length,
                   truncate=True, self_attn=False):
    """Given a pair of atom indices, returns the list of atoms on the path.
    Args:
        atom_1: The start atom on the path.
        atom_2: The end atom on the path.
        paths_dict: A mapping from atom pairs to paths.
        pointer_dict: A mapping from atom pairs to truncated paths. The values
            of the dict is the atom ending the truncated path
        max_path_length: The maximum path length to return.
        truncate: Boolean determining whether or not paths above the max length
            should be truncated (returned as no path)
    """
    path_start, path_end = atom_1, atom_2
    path_greater_max = False  # Indicator for path length exceeding max

    # pointer dict contains atom pairs that are longer than max path length
    if (atom_1, atom_2) in pointer_dict:
        path_greater_max = True
        if not truncate:
            path_start, path_end = atom_1, pointer_dict[(atom_1, atom_2)]

    path_atoms = []
    if (path_start, path_end) in paths_dict:
        path_atoms = paths_dict[(path_start, path_end)]
    elif (path_end, path_start) in paths_dict:
        path_atoms = paths_dict[(path_end, path_start)][::-1]  # Reverse list

    # Because the path lengths when computing shortest paths can be different
    # than the ones required for training, truncate if necessary
    if len(path_atoms) - 1 > max_path_length:
        path_atoms = [] if truncate else path_atoms[:max_path_length+1]
        path_greater_max = True

    mask_ind = 1
    path_length = 0 if path_atoms == [] else len(path_atoms) - 1
    if path_greater_max:
        path_length = max_path_length + 1
        mask_ind = 0
    if not self_attn:
        if atom_1 == atom_2:
            mask_ind = 0  # Get rid of self atom

    return list(path_atoms), path_length, mask_ind