code: def test_given_two_mechanisms_when_evaluate_unit_change_then_returns_correct_attributions_to_both_mechanism_and_input():
      num_rows = 100
      A1 = np.random.normal(size=num_rows)
      B1 = np.random.normal(size=num_rows)
      C1 = 2 * A1 + 3 * B1
  
      A2 = np.random.normal(size=num_rows)
      B2 = np.random.normal(size=num_rows)
      C2 = 3 * A2 + 2 * B2
  
      background_df = pd.DataFrame(data=dict(A=A1, B=B1))
      foreground_df = pd.DataFrame(data=dict(A=A2, B=B2))
  
      background_mechanism = SklearnLinearRegressionModel(
          LinearRegression(fit_intercept=False).fit(
              np.column_stack((A1, B1)), C1
          )
      )
      foreground_mechanism = SklearnLinearRegressionModel(
          LinearRegression(fit_intercept=False).fit(
              np.column_stack((A2, B2)), C2
          )
      )
  
      actual_contributions = unit_change(
          background_df,
          foreground_df,
          ["A", "B"],
          background_mechanism,
          foreground_mechanism,
      )
      expected_contributions = unit_change_linear(
          background_mechanism,
          background_df,
          foreground_mechanism,
          foreground_df,
          ["A", "B"],
      )
  
      np.testing.assert_array_almost_equal(
          actual_contributions, expected_contributions, decimal=1
      )
  
      background_mechanism = SklearnRegressionModel(
          RFR(n_jobs=1).fit(np.column_stack((A1, B1)), C1)
      )
      foreground_mechanism = SklearnRegressionModel(
          RFR(n_jobs=1).fit(np.column_stack((A2, B2)), C2)
      )
  
      actual_contributions = unit_change(
          background_df,
          foreground_df,
          ["A", "B"],
          background_mechanism,
          foreground_mechanism,
      )
      expected_contributions = unit_change_nonlinear(
          background_mechanism,
          background_df,
          foreground_mechanism,
          foreground_df,
          ["A", "B"],
          shapley_config=ShapleyConfig(n_jobs=1),
      )
  
      np.testing.assert_array_almost_equal(
          actual_contributions, expected_contributions, decimal=1
      )
  
imports: import numpy
  import pandas
  import pytest
  from flaky import flaky
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.exceptions import NotFittedError
  from sklearn.linear_model import LinearRegression
  from dowhy.gcm.ml.regression import SklearnRegressionModel
  from dowhy.gcm.shapley import ShapleyConfig
  from dowhy.gcm.unit_change import SklearnLinearRegressionModel, unit_change, unit_change_linear, unit_change_linear_input_only, unit_change_nonlinear, unit_change_nonlinear_input_only
label_desc: Use image node_id 11 for calling a global function with example usage: test_given_two_mechanisms_when_evaluate_unit_change_then_returns_correct_attributions_to_both_mechanism_and_input() without return types