def METHOD_NAME() -> None:
    calls: list[str] = []
    class Model(BaseModel):
        inner: Union[Model, None]  # noqa
        @model_validator(mode='before')
        @classmethod
        def validate_model_before(cls, values: dict[str, Any]) -> dict[str, Any]:
            calls.append('before')
            return values
        @model_validator(mode='after')
        def validate_model_after(self) -> Model:
            calls.append('after')
            return self
    Model.model_validate({'inner': None})
    assert calls == ['before', 'after']
    calls.clear()
    Model.model_validate({'inner': {'inner': {'inner': None}}})
    assert calls == ['before'] * 3 + ['after'] * 3
    calls.clear()