code: def validate(self):
          
          attributes = []
          validates = []
          # Collect attributes and validation methods
          for attr in dir(self):
              if not attr.startswith("_"):
                  attr_type = type(getattr(self, attr))
                  if attr_type != "method":
                      if getattr(self, "validate_{attr}".format(attr=attr), None):
                          validates.append(getattr(self, "validate_{attr}".format(attr=attr)))
                      attributes.append(attr)
          self._validate_empty_attributes(attributes)
          self._validate_required(attributes)
          self._validate_attributes(validates)
          self._validate_children()
          self._validate_signatures()
docs: 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