def validate(self):
attributes = []<EOL>validates = []<EOL>for attr in dir(self):<EOL><INDENT>if not attr.startswith("<STR_LIT:_>"):<EOL><INDENT>attr_type = type(getattr(self, attr))<EOL>if attr_type != "<STR_LIT>":<EOL><INDENT>if getattr(self, "<STR_LIT>".format(attr=attr), None):<EOL><INDENT>validates.append(getattr(self, "<STR_LIT>".format(attr=attr)))<EOL><DEDENT>attributes.append(attr)<EOL><DEDENT><DEDENT><DEDENT>self._validate_empty_attributes(attributes)<EOL>self._validate_required(attributes)<EOL>self._validate_attributes(validates)<EOL>self._validate_children()<EOL>self._validate_signatures()<EOL>
Do validation.

        1) Check `_required` have been given
        2) Make sure all attrs in required have a non-empty value
        3) Loop through attributes and call their `validate_<attr>` methods, if any.
        4) Validate allowed children
        5) Validate signatures