def _same_atom_different_altloc(atom1, atom2):
  """
  Determines whether atom1 and atom2 differ only by their alternate location.

  Parameters
  ----------
  atom1 : iotbx.pdb.hierarchy.atom
  atom2 : iotbx.pdb.hierarchy.atom

  Returns
  -------
  bool
  """

  label1, label2 = [i.fetch_labels() for i in [atom1, atom2]]
  name1, name2 = atom1.name.strip(), atom2.name.strip()
  chain1, chain2 = label1.chain_id, label2.chain_id
  res1, res2 = label1.resid(), label2.resid()
  return name1 == name2 and chain1 == chain2 and res1 == res2