docs: def register_cleanup(cleanup):
      """Register a cleanup function to be called at the end of every validation
      task. Takes either a callable (including a class with a __call_ method),
      or a class with a `cleanup` class method."""
  
      if not callable(cleanup):
          # Allow decorating a class with a `cleanup` classm ethod.
          cleanup = cleanup.cleanup
  
      CLEANUP_FUNCTIONS.append(cleanup.cleanup)
      return cleanup