def METHOD_NAME(dvc, config, env, result, monkeypatch, tmp_global_dir):
    # reset DVC_TEST env var, which affects `is_enabled()`
    monkeypatch.delenv("DVC_TEST")
    monkeypatch.delenv("DVC_NO_ANALYTICS", raising=False)
    with dvc.config.edit() as conf:
        conf["core"] = {}
    assert analytics.is_enabled()
    if config is not None:
        with dvc.config.edit() as conf:
            conf["core"] = {"analytics": config}
    if env is not None:
        monkeypatch.setenv("DVC_NO_ANALYTICS", env)
    assert result == analytics.is_enabled()