import re


class ChildSetupVerify:
    """hold onto method to verify ChildSubset or SingleChild setup
    arguments
    """

    @staticmethod
    def _verify_identifier_args(identifier):
        """verify that identifier dict keys contain valid (and only
        valid) identifiers. tag and tag_regex must contain string
        identifiers, while attrib_regex must be a dict with string
        identifiers. In the case of tag_regex and attrib_regex, the
        strings will be used for regex matching
        """
        expected = {'tag': str, 'tag_regex': str, 'attrib_regex': dict}
        keys_expected = set(expected.keys())
        keys_got = set(identifier.keys())
        unexpected_keys = keys_got.difference(keys_expected)
        if not keys_got:
            raise KeyError('Expected either tag/tag_regex and/or attrib_regex')
        if unexpected_keys: