class_docstr: Initialisation of XMLBIFReader object.
  
  Parameters
  ----------
  path : file or str
      File of XMLBIF data
      File of XMLBIF data
  
  string : str
      String of XMLBIF data
  
  Examples
  --------
  # xmlbif_test.xml is the file present in
  # http://www.cs.cmu.edu/~fgcozman/Research/InterchangeFormat/
  >>> from pgmpy.readwrite import XMLBIFReader
  >>> reader = XMLBIFReader("xmlbif_test.xml")
  >>> model = reader.get_model()
  
  Reference
  ---------
  [1] https://www.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat/
docstr: Returns a Bayesian Network instance from the file/string.
  
  Parameters
  ----------
  state_name_type: int, str, or bool (default: str)
      The data type to which to convert the state names of the variables.
  
  Returns
  -------
  BayesianNetwork instance: The read model.
  
  Examples
  --------
  >>> from pgmpy.readwrite import XMLBIFReader
  >>> reader = XMLBIFReader("xmlbif_test.xml")
  >>> model = reader.get_model()
docstr_tok: ["Returns","a","Bayesian","Network","instance","from","the","file\/string",".","Parameters","--","--","--","--","--","state_name_type",":","int",",","str",",","or","bool","(","default",":","str",")","The","data","type","to","which","to","convert","the","state","names","of","the","variables",".","Returns","--","--","--","-","BayesianNetwork","instance",":","The","read","model",".","Examples","--","--","--","--",">",">",">","from","pgmpy.readwrite","import","XMLBIFReader",">",">",">","reader","=","XMLBIFReader","(","``","xmlbif_test.xml","''",")",">",">",">","model","=","reader.get_model","(",")"]
code: def get_model(self, state_name_type=str):
      """
      Returns a Bayesian Network instance from the file/string.
  
      Parameters
      ----------
      state_name_type: int, str, or bool (default: str)
          The data type to which to convert the state names of the variables.
  
      Returns
      -------
      BayesianNetwork instance: The read model.
  
      Examples
      --------
      >>> from pgmpy.readwrite import XMLBIFReader
      >>> reader = XMLBIFReader("xmlbif_test.xml")
      >>> model = reader.get_model()
      """
      model = BayesianNetwork()
      model.add_nodes_from(self.variables)
      model.add_edges_from(self.edge_list)
      model.name = self.network_name
  
      tabular_cpds = []
      for var, values in self.variable_CPD.items():
          evidence_card = [
              len(self.variable_states[evidence_var])
              for evidence_var in self.variable_parents[var]
          ]
          cpd = TabularCPD(
              var,
              len(self.variable_states[var]),
              values,
              evidence=self.variable_parents[var],
              evidence_card=evidence_card,
              state_names={
                  var: list(map(state_name_type, self.state_names[var]))
                  for var in chain([var], self.variable_parents[var])
              },
          )
          tabular_cpds.append(cpd)
  
      model.add_cpds(*tabular_cpds)
  
      for node, properties in self.variable_property.items():
          for prop in properties:
              if prop is not None:
                  prop_name, prop_value = map(
                      lambda t: t.strip(), prop.split("=")
                  )
                  model.nodes[node][prop_name] = prop_value
  
      return model
  
imports: import xml.etree.ElementTree
  from io import BytesIO
  from itertools import chain
  import numpy
  import pyparsing
  from pgmpy.factors.discrete import State, TabularCPD
  from pgmpy.models import BayesianNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 8 for calling the XMLBIFReader obj's underlying member method code with example usage: obj.get_model(state_name_type) and returns: model