class_docstr: Initialize an instance of UAI writer class
  
  Parameters
  ----------
  model: A Bayesian or Markov model
      The model to write
  
  round_values: int (default: None)
      The number to decimals to which to round the probability values. If None, keeps all decimals points.
  
  Examples
  --------
  >>> from pgmpy.readwrite import UAIWriter
  >>> from pgmpy.utils import get_example_model
  >>> model = get_example_model('asia')
  >>> writer = UAIWriter(asia)
  >>> writer.write_uai('asia.uai')
docstr: Returns the UAI file as a string.
docstr_tok: ["Returns","the","UAI","file","as","a","string","."]
code: def __str__(self):
      """
      Returns the UAI file as a string.
      """
      self.network += self.no_nodes + "\n"
      domain = sorted(self.domain.items(), key=lambda x: (x[1], x[0]))
      self.network += " ".join([var[1] for var in domain]) + "\n"
      self.network += str(len(self.functions)) + "\n"
      for fun in self.functions:
          self.network += str(len(fun)) + " "
          self.network += " ".join(fun) + "\n"
      self.network += "\n"
      for table in self.tables:
          self.network += str(len(table)) + "\n"
          self.network += " ".join(table) + "\n"
      return self.network[:-1]
  
imports: from itertools import combinations
  import numpy
  from pyparsing import Combine, Literal, Optional, Regex, Word, alphas, nums
  from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
  from pgmpy.models import BayesianNetwork, MarkovNetwork
  from pgmpy.utils import compat_fns
label_desc: Use image node_id 2 for calling the UAIWriter obj's underlying member method code with example usage: obj.__str__() and returns: self