class_docstr: Main class for storing the causal model state.
docstr: Check if the dependencies in input graph matches with the dataset -
  ( X ⫫ Y ) | Z
  where X and Y are considered as singleton sets currently
  Z can have multiple variables
  :param k: number of covariates in set Z
  :param independence_test: dictionary containing methods to test conditional independece in data
  :param independence_constraints: list of implications to be test input by the user in the format
      [(x,y,(z1,z2)),
      (x,y, (z3,))
      ]
  : returns: an instance of GraphRefuter class
docstr_tok: ["Check","if","the","dependencies","in","input","graph","matches","with","the","dataset","-","(","X","\u2aeb","Y",")","|","Z","where","X","and","Y","are","considered","as","singleton","sets","currently","Z","can","have","multiple","variables",":","param","k",":","number","of","covariates","in","set","Z",":","param","independence_test",":","dictionary","containing","methods","to","test","conditional","independece","in","data",":","param","independence_constraints",":","list","of","implications","to","be","test","input","by","the","user","in","the","format","[","(","x",",","y",",","(","z1",",","z2",")",")",",","(","x",",","y",",","(","z3",",",")",")","]",":","returns",":","an","instance","of","GraphRefuter","class"]
code: def refute_graph(
      self, k=1, independence_test=None, independence_constraints=None
  ):
      """
      Check if the dependencies in input graph matches with the dataset -
      ( X ⫫ Y ) | Z
      where X and Y are considered as singleton sets currently
      Z can have multiple variables
      :param k: number of covariates in set Z
      :param independence_test: dictionary containing methods to test conditional independece in data
      :param independence_constraints: list of implications to be test input by the user in the format
          [(x,y,(z1,z2)),
          (x,y, (z3,))
          ]
      : returns: an instance of GraphRefuter class
      """
      if independence_test is not None:
          test_for_continuous = independence_test["test_for_continuous"]
          test_for_discrete = independence_test["test_for_discrete"]
          refuter = GraphRefuter(
              data=self._data,
              method_name_continuous=test_for_continuous,
              method_name_discrete=test_for_discrete,
          )
  
      else:
          refuter = GraphRefuter(data=self._data)
  
      if independence_constraints is None:
          all_nodes = list(
              self._graph.get_all_nodes(include_unobserved=False)
          )
          num_nodes = len(all_nodes)
          array_indices = list(range(0, num_nodes))
          all_possible_combinations = list(
              combinations(array_indices, 2)
          )  # Generating sets of indices of size 2 for different x and y
          conditional_independences = []
          self.logger.info(
              "The followed conditional independences are true for the input graph"
          )
          for (
              combination
          ) in (
              all_possible_combinations
          ):  # Iterate over the unique 2-sized sets [x,y]
              i = combination[0]
              j = combination[1]
              a = all_nodes[i]
              b = all_nodes[j]
              if i < j:
                  temp_arr = (
                      all_nodes[:i]
                      + all_nodes[i + 1 : j]
                      + all_nodes[j + 1 :]
                  )
              else:
                  temp_arr = (
                      all_nodes[:j]
                      + all_nodes[j + 1 : i]
                      + all_nodes[i + 1 :]
                  )
              k_sized_lists = list(combinations(temp_arr, k))
              for k_list in k_sized_lists:
                  if (
                      self._graph.check_dseparation(
                          [str(a)], [str(b)], k_list
                      )
                      == True
                  ):
                      self.logger.info(
                          " %s and %s are CI given %s ", a, b, k_list
                      )
                      conditional_independences.append([a, b, k_list])
  
          independence_constraints = conditional_independences
  
      res = refuter.refute_model(
          independence_constraints=independence_constraints
      )
  
      self.logger.info(refuter._refutation_passed)
  
      return res
  
imports: import logging
  import typing
  import warnings
  from itertools import combinations
  from sympy import init_printing
  import dowhy.causal_estimators
  import dowhy.causal_refuters
  import dowhy.graph_learners
  from dowhy.causal_estimator import CausalEstimate, estimate_effect
  from dowhy.causal_graph import CausalGraph
  from dowhy.causal_identifier import AutoIdentifier, BackdoorAdjustment, IDIdentifier
  from dowhy.causal_identifier.identify_effect import EstimandType
  from dowhy.causal_refuters.graph_refuter import GraphRefuter
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 15 for calling the CausalModel obj's underlying member method code with example usage: obj.refute_graph(k, independence_test, independence_constraints) and returns: res