code: def find_hal(self, atoms):
          
          data = namedtuple('hal_acceptor', 'o o_orig_idx y y_orig_idx')
          a_set = []
          # All oxygens, nitrogen, sulfurs with neighboring carbon, phosphor, nitrogen or sulfur
          for a in [at for at in atoms if at.atomicnum in [8, 7, 16]]:
              n_atoms = [na for na in pybel.ob.OBAtomAtomIter(a.OBAtom) if na.GetAtomicNum() in [6, 7, 15, 16]]
              if len(n_atoms) == 1:  # Proximal atom
                  o_orig_idx = self.Mapper.mapid(a.idx, mtype=self.mtype, bsid=self.bsid)
                  y_orig_idx = self.Mapper.mapid(n_atoms[0].GetIdx(), mtype=self.mtype, bsid=self.bsid)
                  a_set.append(data(o=a, o_orig_idx=o_orig_idx, y=pybel.Atom(n_atoms[0]), y_orig_idx=y_orig_idx))
          return a_set
docs: Look for halogen bond acceptors (Y-{O|P|N|S}, with Y=C,P,S)