def _experimental_method_override(
        flag: Feature, enabled: T, freeze: bool = False
    ) -> T:
        """Decorator to replace the decorated method with the given one if the
        specified feature is enabled.

        Freezes the flag if the `frozen` parameter is set.

        Example:
            ```python
            class MyClass(_WithExperimentalSettings, ...):

                def my_method_experimental(self, ...): ...

                @MyClass._experimental_method_override(
                    flag=Feature.OTEL_TRACING,
                    enabled=my_method_experimental
                )
                def my_method(self, ...): ...
            ```
        """

        def wrapper(func: T) -> T:
            @functools.wraps(func)
            def wrapped(self: _WithExperimentalSettings, *args, **kwargs):
                if self.experimental_feature(flag, freeze=freeze):
                    return enabled(*args, **kwargs)

                return func(self, *args, **kwargs)

            return wrapped

        return wrapper
Decorator to replace the decorated method with the given one if the
        specified feature is enabled.

        Freezes the flag if the `frozen` parameter is set.

        Example:
            ```python
            class MyClass(_WithExperimentalSettings, ...):

                def my_method_experimental(self, ...): ...

                @MyClass._experimental_method_override(
                    flag=Feature.OTEL_TRACING,
                    enabled=my_method_experimental
                )
                def my_method(self, ...): ...
            ```
        
src/core/trulens/core/experimental/__init__.py