code: def fit_causal_model(
      self, g, df, data_types, initialization_trace=None
  ):
      if nx.is_directed_acyclic_graph(g):
          with pm.Model() as model:
              g = self.apply_data_types(g, data_types)
              g = self.apply_parents(g)
              g = self.apply_parameters(
                  g, df, initialization_trace=initialization_trace
              )
              g = self.build_bayesian_network(g, df)
              trace = pm.sample(1000, tune=1000)
      else:
          raise Exception("Graph is not a DAG!")
      return g, trace
  
file_path: dowhy/dowhy/do_samplers/mcmc_sampler.py
imports: from typing import List
  import networkx
  import numpy
  import pymc3
  from dowhy import EstimandType
  from dowhy.do_sampler import DoSampler
label_desc: Use image node_id 6 for calling the McmcSampler obj's underlying member method code with example usage: obj.fit_causal_model(g, df, data_types, initialization_trace) and returns: g,  trace