def belong_to(self, pos):
        """
        given a cursor position, return the deeper header
        that contains it
        """
        match = []
        for h in self.headers:
            start, end = self.region(h)
            if start <= pos <= end:
                match.append(h)
        try:
            return sorted(match, key=lambda h: h.level, reverse=True)[0]
        except __HOLE__:
            return None
dataset/ETHPy150Open mgaitan/sublime-rst-completion/headers.py/RstHeaderTree.belong_to