code: def _include_confounders_effect(
      data: pd.DataFrame,
      new_data: pd.DataFrame,
      effect_on_t: str,
      treatment_name: str,
      kappa_t: float,
      effect_on_y: str,
      outcome_name: str,
      kappa_y: float,
  ):
      """
      This function deals with the change in the value of the data due to the effect of the unobserved confounder.
      In the case of a binary flip, we flip only if the random number is greater than the threshold set.
      In the case of a linear effect, we use the variable as the linear regression constant.
  
      :param new_data: pandas.DataFrame: The data to be changed due to the effects of the unobserved confounder.
      :param kappa_t: numpy.float64: The value of the threshold for binary_flip or the value of the regression coefficient for linear effect.
      :param kappa_y: numpy.float64: The value of the threshold for binary_flip or the value of the regression coefficient for linear effect.
  
      :return: pandas.DataFrame: The DataFrame that includes the effects of the unobserved confounder.
      """
      num_rows = data.shape[0]
      stdnorm = scipy.stats.norm()
      w_random = stdnorm.rvs(num_rows)
  
      if effect_on_t == "binary_flip":
          alpha = 2 * kappa_t - 1 if kappa_t >= 0.5 else 1 - 2 * kappa_t
          interval = stdnorm.interval(alpha)
          rel_interval = interval[0] if kappa_t >= 0.5 else interval[1]
          new_data.loc[rel_interval <= w_random, treatment_name] = (
              1 - new_data.loc[rel_interval <= w_random, treatment_name]
          )
          for tname in treatment_name:
              if pd.api.types.is_bool_dtype(data[tname]):
                  new_data = new_data.astype(
                      {tname: "bool"}, copy=False
                  )
      elif effect_on_t == "linear":
          confounder_t_effect = kappa_t * w_random
          # By default, we add the effect of simulated confounder for treatment.
          # But subtract it from outcome to create a negative correlation
          # assuming that the original confounder's effect was positive on both.
          # This is to remove the effect of the original confounder.
          new_data[treatment_name] = new_data[
              treatment_name
          ].values + np.ndarray(
              shape=(num_rows, 1), buffer=confounder_t_effect
          )
      else:
          raise NotImplementedError(
              "'"
              + effect_on_t
              + "' method not supported for confounders' effect on treatment"
          )
  
      if effect_on_y == "binary_flip":
          alpha = 2 * kappa_y - 1 if kappa_y >= 0.5 else 1 - 2 * kappa_y
          interval = stdnorm.interval(alpha)
          rel_interval = interval[0] if kappa_y >= 0.5 else interval[1]
          new_data.loc[rel_interval <= w_random, outcome_name] = (
              1 - new_data.loc[rel_interval <= w_random, outcome_name]
          )
          for yname in outcome_name:
              if pd.api.types.is_bool_dtype(data[yname]):
                  new_data = new_data.astype(
                      {yname: "bool"}, copy=False
                  )
      elif effect_on_y == "linear":
          confounder_y_effect = (-1) * kappa_y * w_random
          # By default, we add the effect of simulated confounder for treatment.
          # But subtract it from outcome to create a negative correlation
          # assuming that the original confounder's effect was positive on both.
          # This is to remove the effect of the original confounder.
          new_data[outcome_name] = new_data[
              outcome_name
          ].values + np.ndarray(
              shape=(num_rows, 1), buffer=confounder_y_effect
          )
      else:
          raise NotImplementedError(
              "'"
              + effect_on_y
              + "' method not supported for confounders' effect on outcome"
          )
      return new_data
  
imports: import copy
  import logging
  import math
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  import scipy.stats
  import statsmodels.api
  from sklearn.linear_model import LogisticRegression
  from sklearn.preprocessing import StandardScaler
  from tqdm.auto import tqdm
  from dowhy.causal_estimator import CausalEstimate
  from dowhy.causal_estimators.econml import Econml
  from dowhy.causal_estimators.linear_regression_estimator import LinearRegressionEstimator
  from dowhy.causal_estimators.regression_estimator import RegressionEstimator
  from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
  from dowhy.causal_refuter import CausalRefutation, CausalRefuter, choose_variables
  from dowhy.causal_refuters.evalue_sensitivity_analyzer import EValueSensitivityAnalyzer
  from dowhy.causal_refuters.linear_sensitivity_analyzer import LinearSensitivityAnalyzer
label_desc: Use image node_id 4 for calling a global function with example usage: _include_confounders_effect(data, new_data, effect_on_t, treatment_name, kappa_t, effect_on_y, outcome_name, kappa_y) and returns: new_data