class_docstr: This is an inference class for performing Causal Inference over Bayesian
  Networks or Structural Equation Models.
  
  Parameters
  ----------
  model: pgmpy.base.DAG | pgmpy.models.BayesianNetwork
      The model that we'll perform inference over.
  
  set_nodes: list[node:str] or None
      A list (or set/tuple) of nodes in the Bayesian Network which have been
      set to a specific value per the do-operator.
  
  Examples
  --------
  Create a small Bayesian Network.
  
  >>> from pgmpy.models import BayesianNetwork
  >>> game = BayesianNetwork([('X', 'A'),
  ...                         ('A', 'Y'),
  ...                         ('A', 'B')])
  
  Load the graph into the CausalInference object to make causal queries.
  
  >>> from pgmpy.inference.CausalInference import CausalInference
  >>> inference = CausalInference(game)
  >>> inference.get_all_backdoor_adjustment_sets(X="X", Y="Y")
  >>> inference.get_all_frontdoor_adjustment_sets(X="X", Y="Y")
  
  References
  ----------
  'Causality: Models, Reasoning, and Inference' - Judea Pearl (2000)
class_docstr_tok: ["This","is","an","inference","class","for","performing","Causal","Inference","over","Bayesian","Networks","or","Structural","Equation","Models",".","Parameters","--","--","--","--","--","model",":","pgmpy.base.DAG","|","pgmpy.models.BayesianNetwork","The","model","that","we","'ll","perform","inference","over",".","set_nodes",":","list","[","node",":","str","]","or","None","A","list","(","or","set\/tuple",")","of","nodes","in","the","Bayesian","Network","which","have","been","set","to","a","specific","value","per","the","do-operator",".","Examples","--","--","--","--","Create","a","small","Bayesian","Network",".",">",">",">","from","pgmpy.models","import","BayesianNetwork",">",">",">","game","=","BayesianNetwork","(","[","(","'","X","'",",","'","A","'",")",",","...","(","'","A","'",",","'","Y","'",")",",","...","(","'","A","'",",","'","B","'",")","]",")","Load","the","graph","into","the","CausalInference","object","to","make","causal","queries",".",">",">",">","from","pgmpy.inference.CausalInference","import","CausalInference",">",">",">","inference","=","CausalInference","(","game",")",">",">",">","inference.get_all_backdoor_adjustment_sets","(","X=","''","X","''",",","Y=","''","Y","''",")",">",">",">","inference.get_all_frontdoor_adjustment_sets","(","X=","''","X","''",",","Y=","''","Y","''",")","References","--","--","--","--","--","'Causality",":","Models",",","Reasoning",",","and","Inference","'","-","Judea","Pearl","(","2000",")"]
docstr: Method to test whether `adjustment_set` is a valid adjustment set for
  identifying the causal effect of `X` on `Y`.
  
  Parameters
  ----------
  X: list (array-like)
      The set of cause variables.
  
  Y: list (array-like)
      The set of predictor variables.
  
  adjustment_set: list (array-like)
      The set of variables for which to test whether they satisfy the
      adjustment set criteria.
  
  Returns
  -------
  Is valid adjustment set: bool
      Returns True if `adjustment_set` is a valid adjustment set for
      identifying the effect of `X` on `Y`. Else returns False.
  
  Examples
  --------
  >>> from pgmpy.models import BayesianNetwork
  >>> from pgmpy.inference import CausalInference
  >>> model = BayesianNetwork([("x1", "y1"), ("x1", "z1"), ("z1", "z2"),
  ...                        ("z2", "x2"), ("y2", "z2")])
  >>> c_infer = CausalInference(model)
  >>> c_infer.is_valid_adjustment_set(X=['x1', 'x2'], Y=['y1', 'y2'], adjustment_set=['z1', 'z2'])
  True
  
  References
  ----------
  [1] Perkovic, Emilija, et al. "Complete graphical characterization and construction of adjustment sets in Markov equivalence classes of ancestral graphs." The Journal of Machine Learning Research 18.1 (2017): 8132-8193.
docstr_tok: ["Method","to","test","whether","`","adjustment_set","`","is","a","valid","adjustment","set","for","identifying","the","causal","effect","of","`","X","`","on","`","Y","`",".","Parameters","--","--","--","--","--","X",":","list","(","array-like",")","The","set","of","cause","variables",".","Y",":","list","(","array-like",")","The","set","of","predictor","variables",".","adjustment_set",":","list","(","array-like",")","The","set","of","variables","for","which","to","test","whether","they","satisfy","the","adjustment","set","criteria",".","Returns","--","--","--","-","Is","valid","adjustment","set",":","bool","Returns","True","if","`","adjustment_set","`","is","a","valid","adjustment","set","for","identifying","the","effect","of","`","X","`","on","`","Y","`",".","Else","returns","False",".","Examples","--","--","--","--",">",">",">","from","pgmpy.models","import","BayesianNetwork",">",">",">","from","pgmpy.inference","import","CausalInference",">",">",">","model","=","BayesianNetwork","(","[","(","``","x1","''",",","``","y1","''",")",",","(","``","x1","''",",","``","z1","''",")",",","(","``","z1","''",",","``","z2","''",")",",","...","(","``","z2","''",",","``","x2","''",")",",","(","``","y2","''",",","``","z2","''",")","]",")",">",">",">","c_infer","=","CausalInference","(","model",")",">",">",">","c_infer.is_valid_adjustment_set","(","X=","[","'x1","'",",","'x2","'","]",",","Y=","[","'y1","'",",","'y2","'","]",",","adjustment_set=","[","'z1","'",",","'z2","'","]",")","True","References","--","--","--","--","--","[","1","]","Perkovic",",","Emilija",",","et","al",".","``","Complete","graphical","characterization","and","construction","of","adjustment","sets","in","Markov","equivalence","classes","of","ancestral","graphs",".","''","The","Journal","of","Machine","Learning","Research","18.1","(","2017",")",":","8132-8193","."]
code: def is_valid_adjustment_set(self, X, Y, adjustment_set):
      """
      Method to test whether `adjustment_set` is a valid adjustment set for
      identifying the causal effect of `X` on `Y`.
  
      Parameters
      ----------
      X: list (array-like)
          The set of cause variables.
  
      Y: list (array-like)
          The set of predictor variables.
  
      adjustment_set: list (array-like)
          The set of variables for which to test whether they satisfy the
          adjustment set criteria.
  
      Returns
      -------
      Is valid adjustment set: bool
          Returns True if `adjustment_set` is a valid adjustment set for
          identifying the effect of `X` on `Y`. Else returns False.
  
      Examples
      --------
      >>> from pgmpy.models import BayesianNetwork
      >>> from pgmpy.inference import CausalInference
      >>> model = BayesianNetwork([("x1", "y1"), ("x1", "z1"), ("z1", "z2"),
      ...                        ("z2", "x2"), ("y2", "z2")])
      >>> c_infer = CausalInference(model)
      >>> c_infer.is_valid_adjustment_set(X=['x1', 'x2'], Y=['y1', 'y2'], adjustment_set=['z1', 'z2'])
      True
  
      References
      ----------
      [1] Perkovic, Emilija, et al. "Complete graphical characterization and construction of adjustment sets in Markov equivalence classes of ancestral graphs." The Journal of Machine Learning Research 18.1 (2017): 8132-8193.
      """
      backdoor_graph = self.get_proper_backdoor_graph(
          X, Y, inplace=False
      )
      for x, y in zip(X, Y):
          if backdoor_graph.is_dconnected(
              start=x, end=y, observed=adjustment_set
          ):
              return False
      return True
  
imports: from collections.abc import Iterable
  from itertools import chain, product
  import networkx
  import numpy
  from tqdm.auto import tqdm
  from pgmpy import config
  from pgmpy.estimators.LinearModel import LinearEstimator
  from pgmpy.factors.discrete import DiscreteFactor
  from pgmpy.models import BayesianNetwork
  from pgmpy.utils.sets import _powerset, _variable_or_iterable_to_set
label_desc: Use image node_id 10 for calling the CausalInference obj's underlying member method code with example usage: obj.is_valid_adjustment_set(X, Y, adjustment_set) and returns: True, False