code: def test_partially_linear_sensitivity_given_strength_of_confounding(
      self,
      mock_fig,
      estimator_method,
      effect_fraction_on_outcome,
      benchmark_common_causes,
      simulation_method,
  ):
      np.random.seed(100)
      data = dowhy.datasets.linear_dataset(
          beta=10,
          num_common_causes=7,
          num_samples=500,
          num_treatments=1,
          stddev_treatment_noise=5,
          stddev_outcome_noise=5,
      )
      data["df"] = data["df"].drop("W4", axis=1)
      graph_str = 'graph[directed 1node[ id "y" label "y"]node[ id "W0" label "W0"] node[ id "W1" label "W1"] node[ id "W2" label "W2"] node[ id "W3" label "W3"]  node[ id "W5" label "W5"] node[ id "W6" label "W6"]node[ id "v0" label "v0"]edge[source "v0" target "y"]edge[ source "W0" target "v0"] edge[ source "W1" target "v0"] edge[ source "W2" target "v0"] edge[ source "W3" target "v0"] edge[ source "W5" target "v0"] edge[ source "W6" target "v0"]edge[ source "W0" target "y"] edge[ source "W1" target "y"] edge[ source "W2" target "y"] edge[ source "W3" target "y"] edge[ source "W5" target "y"] edge[ source "W6" target "y"]]'
      model = CausalModel(
          data=data["df"],
          treatment=data["treatment_name"],
          outcome=data["outcome_name"],
          graph=graph_str,
          test_significance=None,
      )
      target_estimand = model.identify_effect(
          proceed_when_unidentifiable=True
      )
      estimate = model.estimate_effect(
          target_estimand,
          method_name=estimator_method,
          method_params={
              "init_params": {
                  "model_y": GradientBoostingRegressor(),
                  "model_t": GradientBoostingRegressor(),
                  "linear_first_stages": False,
              },
              "fit_params": {
                  "cache_values": True,
              },
          },
      )
      ate_estimate = data["ate"]
      refute = model.refute_estimate(
          target_estimand,
          estimate,
          method_name="add_unobserved_common_cause",
          simulation_method=simulation_method,
          benchmark_common_causes=benchmark_common_causes,
          effect_fraction_on_outcome=effect_fraction_on_outcome,
      )
  
      assert refute.r2yu_tw >= 0 and refute.r2yu_tw <= 1
      assert refute.r2tu_w >= 0 and refute.r2tu_w <= 1
  
      # We calculate adjusted estimates for two sets of partial R^2 values.
      benchmarking_results_u1 = refute.perform_benchmarking(
          r2yu_tw=0.9, r2tu_w=0.7, significance_level=0.05
      )
      benchmarking_results_u2 = refute.perform_benchmarking(
          r2yu_tw=0.3, r2tu_w=0.2, significance_level=0.05
      )
      # adjusted lower ate bound for confounder u1 where r2tu_w = 0.7 and r2yu_tw = 0.9
      lower_ate_bound_u1 = benchmarking_results_u1["lower_ate_bound"]
      # adjusted lower ate bound for confounder u2 where r2tu_w = 0.2 and r2yu_tw = 0.3
      lower_ate_bound_u2 = benchmarking_results_u2["lower_ate_bound"]
  
      # adjusted upper ate bound for confounder u1 where r2tu_w = 0.7 and r2yu_tw = 0.9
      upper_ate_bound_u1 = benchmarking_results_u1["upper_ate_bound"]
      # adjusted upper ate bound for confounder u2 where r2tu_w = 0.2 and r2yu_tw = 0.3
      upper_ate_bound_u2 = benchmarking_results_u2["upper_ate_bound"]
  
      # adjusted lower confidence bound for confounder u1 where r2tu_w = 0.7 and r2yu_tw = 0.9
      lower_confidence_bound_u1 = benchmarking_results_u1[
          "lower_confidence_bound"
      ]
      # adjusted lower confidence bound for confounder u2 where r2tu_w = 0.2 and r2yu_tw = 0.3
      lower_confidence_bound_u2 = benchmarking_results_u2[
          "lower_confidence_bound"
      ]
  
      # adjusted upper confidence bound for confounder u1 where r2tu_w = 0.7 and r2yu_tw = 0.9
      upper_confidence_bound_u1 = benchmarking_results_u1[
          "upper_confidence_bound"
      ]
      # adjusted upper confidence bound for confounder u2 where r2tu_w = 0.2 and r2yu_tw = 0.3
      upper_confidence_bound_u2 = benchmarking_results_u2[
          "upper_confidence_bound"
      ]
  
      original_estimate = refute.theta_s
      # Test if hypothetical confounding by unobserved confounder u1 leads to an adjusted effect that is farther from the original estimate as compared to u2
      assert abs(original_estimate - lower_ate_bound_u1) > abs(
          original_estimate - lower_ate_bound_u2
      )
      assert abs(original_estimate - upper_ate_bound_u1) > abs(
          original_estimate - upper_ate_bound_u2
      )
      assert abs(original_estimate - lower_confidence_bound_u1) > abs(
          original_estimate - lower_confidence_bound_u2
      )
      assert abs(original_estimate - upper_confidence_bound_u1) > abs(
          original_estimate - upper_confidence_bound_u2
      )
      # we patched figure plotting call to avoid drawing plots during tests
      assert mock_fig.call_count > 0
  
imports: from unittest.mock import patch
  import numpy
  import pytest
  import statsmodels.api
  from pytest import mark
  from sklearn.ensemble import GradientBoostingRegressor
  import dowhy.datasets
  from dowhy import CausalModel
  from dowhy.causal_refuters.evalue_sensitivity_analyzer import EValueSensitivityAnalyzer
  from .base import SimpleRefuter
label_desc: Use image node_id 10 for calling the TestAddUnobservedCommonCauseRefuter obj's underlying member method code with example usage: obj.test_partially_linear_sensitivity_given_strength_of_confounding(mock_fig, estimator_method, effect_fraction_on_outcome, benchmark_common_causes, simulation_method) without return types