def find_template(self, next_possible_states, message):
        """ Get matching template and fields of message
        for next possible states.
        """

        # Set matching template and its fields as current template
        for state in next_possible_states:
            try:
                id_list = self.state_id[state[0]]
            except __HOLE__:
                continue
            for id in id_list:
                template = self.template_dic[id]
                matcher = TemplateMessageMatcher(template, message,
                                                 self.lexerStyle)
                fields = matcher.match()
                if fields is not None:
                    return (template, fields)
        return (None, None)
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/lens.py/TemplateList.find_template