code: def test_significance(
      estimate,
      simulations: List,
      test_type: SignificanceTestType = SignificanceTestType.AUTO,
      significance_level: float = 0.05,
  ):
      """Tests the statistical significance of the estimate obtained to the simulations produced by a refuter.
  
      The basis behind using the sample statistics of the refuter when we are in fact testing the estimate,
      is due to the fact that, we would ideally expect them to follow the same distribition.
  
      For refutation tests (e.g., placebo refuters), consider the null distribution as a distribution of effect
      estimates over multiple simulations with placebo treatment, and compute how likely the true estimate (e.g.,
      zero for placebo test) is under the null. If the probability of true effect estimate is lower than the
      p-value, then estimator method fails the test.
  
      For sensitivity analysis tests (e.g., bootstrap, subset or common cause refuters), the null distribution captures
      the distribution of effect estimates under the "true" dataset (e.g., with an additional confounder or different
      sampling), and we compute the probability of the obtained estimate under this distribution. If the probability is
      lower than the p-value, then the estimator method fails the test.
  
      Null Hypothesis- The estimate is a part of the distribution
      Alternative Hypothesis- The estimate does not fall in the distribution.
  
      :param 'estimate': CausalEstimate
          The estimate obtained from the estimator for the original data.
      :param 'simulations': np.array
          An array containing the result of the refuter for the simulations
      :param 'test_type': string, default 'auto'
          The type of test the user wishes to perform.
      :param 'significance_level': float, default 0.05
          The significance level for the statistical test
  
      :returns: significance_dict: Dict
          A Dict containing the p_value and a boolean that indicates if the result is statistically significant
      """
      # Initializing the p_value
      p_value = 0
  
      if test_type == SignificanceTestType.AUTO:
          num_simulations = len(simulations)
          if num_simulations >= 100:  # Bootstrapping
              logger.info(
                  "Making use of Bootstrap as we have more than 100 examples.\n \
              Note: The greater the number of examples, the more accurate are the confidence estimates"
              )
  
              # Perform Bootstrap Significance Test with the original estimate and the set of refutations
              p_value = perform_bootstrap_test(estimate, simulations)
  
          else:
              logger.warning(
                  "We assume a Normal Distribution as the sample has less than 100 examples.\n \
              Note: The underlying distribution may not be Normal. We assume that it approaches normal with the increase in sample size."
              )
  
              # Perform Normal Tests of Significance with the original estimate and the set of refutations
              p_value = perform_normal_distribution_test(
                  estimate, simulations
              )
  
      elif test_type == SignificanceTestType.BOOTSTRAP:
          logger.info(
              "Performing Bootstrap Test with {} samples\n \
          Note: The greater the number of examples, the more accurate are the confidence estimates".format(
                  len(simulations)
              )
          )
  
          # Perform Bootstrap Significance Test with the original estimate and the set of refutations
          p_value = perform_bootstrap_test(estimate, simulations)
  
      elif test_type == SignificanceTestType.NORMAL:
          logger.info(
              "Performing Normal Test with {} samples\n \
          Note: We assume that the underlying distribution is Normal.".format(
                  len(simulations)
              )
          )
  
          # Perform Normal Tests of Significance with the original estimate and the set of refutations
          p_value = perform_normal_distribution_test(
              estimate, simulations
          )
  
      significance_dict = {
          "p_value": p_value,
          "is_statistically_significant": p_value <= significance_level,
      }
  
      return significance_dict
  
imports: import logging
  import random
  from enum import Enum
  from typing import List, Union
  import numpy
  import scipy.stats
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 4 for calling a global function with example usage: test_significance(estimate, simulations, test_type, significance_level) and returns: significance_dict