def METHOD_NAME(
    env_var: str = "IDAES_ACTIVATE_V1_COMPAT",
):
    _log = logging.getLogger("idaes_v1_compat")
    found_in_env = os.environ.get(env_var, None)
    if found_in_env:
        _log.warning(
            "Found environment variable %s=%s. Activating IDAES V1 compatibility.",
            env_var,
            found_in_env,
        )
        try:
            # Only need to import this if required
            # pylint: disable=import-outside-toplevel
            from _idaes_v1_compat import activate
        except ImportError:
            _log.error("Required package _idaes_v1_compat not found")
        else:
            activate()