def METHOD_NAME(self, update, context):
    if context.matches:
        types = all(type(res) is self.SRE_TYPE for res in context.matches)
        num = len(context.matches) == 1
        self.test_flag = types and num