def find_next_template_no_rules(self, state, templates_no_fields, interactive):
        try:
            id_list = self.state_id[state[0]]
        except KeyError:
            return None
        templates = []
        fuzz_templates = []
        # find templates with fields
        for template_id in id_list:
            templates += [self.template_dic[template_id]]
        for t in templates:
            if t.has_fields():
                fuzz_templates += [t]
        if not fuzz_templates or templates_no_fields:
            fuzz_templates = templates
        fuzz_templates_ids = [t.ID for t in fuzz_templates]
        if interactive:
            choice = ""
            while fuzz_templates_ids not in choice:
                print "Manually selecting from templates: {}".format(fuzz_templates_ids)
                if len(fuzz_templates_ids) == 1:
                    choice = fuzz_templates_ids[0]
                else:
                    choice = raw_input('Selection: ')
            ind = fuzz_templates_ids.index(choice)
        else:
            print "Probability-based selection from templates: {}".format(fuzz_templates_ids)
            ind = pickIndex([t.count for t in fuzz_templates])
        return fuzz_templates[ind]
dataset/ETHPy150Open hgascon/pulsar/pulsar/core/lens.py/TemplateList.find_next_template_no_rules/swapped operands of `not in`