docs: def validate(self):
          """
          Validate attributes by running all self._validate_*() methods.
  
          :raises TypeError: if an attribute has invalid type
          :raises ValueError: if an attribute contains invalid value
          """
          method_names = sorted([i for i in dir(self) if i.startswith("_validate") and callable(getattr(self, i))])
          for method_name in method_names:
              method = getattr(self, method_name)
              method()