code: def validate(self):
          
          # it is important to have the validator applied in a fixed order
          valids = [getattr(self, valid)
                    for valid in sorted(dir(self.__class__))
                    if valid.startswith('is_valid_')]
          for is_valid in valids:
              if not is_valid():
                  docstring = '\n'.join(
                      line.strip() for line in is_valid.__doc__.splitlines())
                  doc = docstring.format(**vars(self))
                  raise ValueError(doc)
docs: Apply the `is_valid` methods to self and possibly raise a ValueError.