def validate_with_tags(self, tags, confidence):
result = {'<STR_LIT>': self.name}<EOL>intent_confidence = <NUM_LIT:0.0><EOL>local_tags = tags[:]<EOL>used_tags = []<EOL>for require_type, attribute_name in self.requires:<EOL><INDENT>required_tag, canonical_form, confidence = find_first_tag(local_tags, require_type)<EOL>if not required_tag:<EOL><INDENT>result['<STR_LIT>'] = <NUM_LIT:0.0><EOL>return result, []<EOL><DEDENT>result[attribute_name] = canonical_form<EOL>if required_tag in local_tags:<EOL><INDENT>local_tags.remove(required_tag)<EOL><DEDENT>used_tags.append(required_tag)<EOL>intent_confidence += confidence<EOL><DEDENT>if len(self.at_least_one) > <NUM_LIT:0>:<EOL><INDENT>best_resolution = resolve_one_of(tags, self.at_least_one)<EOL>if not best_resolution:<EOL><INDENT>result['<STR_LIT>'] = <NUM_LIT:0.0><EOL>return result, []<EOL><DEDENT>else:<EOL><INDENT>for key in best_resolution:<EOL><INDENT>result[key] = best_resolution[key][<NUM_LIT:0>].get('<STR_LIT:key>') <EOL>intent_confidence += <NUM_LIT:1.0><EOL><DEDENT>used_tags.append(best_resolution)<EOL>if best_resolution in local_tags:<EOL><INDENT>local_tags.remove(best_resolution)<EOL><DEDENT><DEDENT><DEDENT>for optional_type, attribute_name in self.optional:<EOL><INDENT>optional_tag, canonical_form, conf = find_first_tag(local_tags, optional_type)<EOL>if not optional_tag or attribute_name in result:<EOL><INDENT>continue<EOL><DEDENT>result[attribute_name] = canonical_form<EOL>if optional_tag in local_tags:<EOL><INDENT>local_tags.remove(optional_tag)<EOL><DEDENT>used_tags.append(optional_tag)<EOL>intent_confidence += <NUM_LIT:1.0><EOL><DEDENT>total_confidence = intent_confidence / len(tags) * confidence<EOL>target_client, canonical_form, confidence = find_first_tag(local_tags, CLIENT_ENTITY_NAME)<EOL>result['<STR_LIT:target>'] = target_client.get('<STR_LIT:key>') if target_client else None<EOL>result['<STR_LIT>'] = total_confidence<EOL>return result, used_tags<EOL>
Validate weather tags has required entites for this intent to fire

        Args:
            tags(list): Tags and Entities used for validation
            confidence(float): ?

        Returns:
            intent, tags: Returns intent and tags used by the intent on
                falure to meat required entities then returns intent with confidence
                of 0.0 and an empty list for tags.