code: def _refute_once(
      data: pd.DataFrame,
      target_estimand: IdentifiedEstimand,
      estimate: CausalEstimate,
      treatment_names: List[str],
      type_dict: Dict,
      placebo_type: PlaceboType = PlaceboType.DEFAULT,
      random_state: Optional[np.random.RandomState] = None,
  ):
      if placebo_type == PlaceboType.PERMUTE:
          permuted_idx = None
          if random_state is None:
              permuted_idx = np.random.choice(
                  data.shape[0], size=data.shape[0], replace=False
              )
  
          else:
              permuted_idx = random_state.choice(
                  data.shape[0], size=data.shape[0], replace=False
              )
          new_treatment = (
              data[treatment_names].iloc[permuted_idx].values
          )
          if target_estimand.identifier_method.startswith("iv"):
              new_instruments_values = (
                  data[estimate.estimator.estimating_instrument_names]
                  .iloc[permuted_idx]
                  .values
              )
              new_instruments_df = pd.DataFrame(
                  new_instruments_values,
                  columns=[
                      "placebo_" + s
                      for s in data[
                          estimate.estimator.estimating_instrument_names
                      ].columns
                  ],
              )
      else:
          if "float" in type_dict[treatment_names[0]].name:
              logger.info(
                  "Using a Normal Distribution with Mean:{} and Variance:{}".format(
                      DEFAULT_MEAN_OF_NORMAL,
                      DEFAULT_STD_DEV_OF_NORMAL,
                  )
              )
              new_treatment = (
                  np.random.randn(data.shape[0])
                  * DEFAULT_STD_DEV_OF_NORMAL
                  + DEFAULT_MEAN_OF_NORMAL
              )
  
          elif "bool" in type_dict[treatment_names[0]].name:
              logger.info(
                  "Using a Binomial Distribution with {} trials and {} probability of success".format(
                      DEFAULT_NUMBER_OF_TRIALS,
                      DEFAULT_PROBABILITY_OF_BINOMIAL,
                  )
              )
              new_treatment = np.random.binomial(
                  DEFAULT_NUMBER_OF_TRIALS,
                  DEFAULT_PROBABILITY_OF_BINOMIAL,
                  data.shape[0],
              ).astype(bool)
  
          elif "int" in type_dict[treatment_names[0]].name:
              logger.info(
                  "Using a Discrete Uniform Distribution lying between {} and {}".format(
                      data[treatment_names[0]].min(),
                      data[treatment_names[0]].max(),
                  )
              )
              new_treatment = np.random.randint(
                  low=data[treatment_names[0]].min(),
                  high=data[treatment_names[0]].max() + 1,
                  size=data.shape[0],
              )
  
          elif "category" in type_dict[treatment_names[0]].name:
              categories = data[treatment_names[0]].unique()
              logger.info(
                  "Using a Discrete Uniform Distribution with the following categories:{}".format(
                      categories
                  )
              )
              sample = np.random.choice(categories, size=data.shape[0])
              new_treatment = pd.Series(
                  sample, index=data.index
              ).astype("category")
  
      # Create a new column in the data by the name of placebo
      new_data = data.assign(placebo=new_treatment)
      if target_estimand.identifier_method.startswith("iv"):
          new_data = pd.concat((new_data, new_instruments_df), axis=1)
      # Sanity check the data
      logger.debug(new_data[0:10])
      new_estimator = estimate.estimator.get_new_estimator_object(
          target_estimand
      )
      new_estimator.fit(
          new_data,
          estimate.estimator._effect_modifier_names,
          **new_estimator._econml_fit_params
          if isinstance(new_estimator, Econml)
          else {},
      )
      new_effect = new_estimator.estimate_effect(
          new_data,
          control_value=estimate.control_value,
          treatment_value=estimate.treatment_value,
          target_units=estimate.estimator._target_units,
      )
      return new_effect.value
  
imports: import copy
  import logging
  from enum import Enum
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from tqdm.auto import tqdm
  from dowhy.causal_estimator import CausalEstimate
  from dowhy.causal_estimators.econml import Econml
  from dowhy.causal_estimators.instrumental_variable_estimator import InstrumentalVariableEstimator
  from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
  from dowhy.causal_refuter import CausalRefutation, CausalRefuter, test_significance
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 1 for calling a global function with example usage: _refute_once(data, target_estimand, estimate, treatment_names, type_dict, placebo_type, random_state) and returns: new_effect