code: def test_bayes_model(self):
      self.expected_bayes_file = """BAYES
  6
  2 2 2 2 2 2
  6
  1 0
  3 2 0 1
  1 2
  2 1 3
  1 4
  2 2 5
  
  2
  0.01 0.99
  8
  0.99 0.01 0.97 0.03 0.9 0.1 0.3 0.7
  2
  0.15 0.85
  4
  0.7 0.3 0.01 0.99
  2
  0.3 0.7
  4
  0.6 0.4 0.05 0.95"""
      self.assertEqual(
          str(self.bayeswriter.__str__()), str(self.expected_bayes_file)
      )
  
imports: import unittest
  import networkx
  import numpy
  from pgmpy import config
  from pgmpy.factors.discrete import DiscreteFactor, TabularCPD
  from pgmpy.models import BayesianNetwork, MarkovNetwork
  from pgmpy.readwrite import UAIReader, UAIWriter
label_desc: Use image node_id 2 for calling the TestUAIWriterTorch obj's underlying member method code with example usage: obj.test_bayes_model() without return types