code: def testRational(self):
      p = Pool()
      p.add("rational", 3.145)
      p.add("rational", -0.456)
  
      YamlOutput(filename="test.yaml")(p)
  
      result = getYaml("test.yaml")
  
      # we have to check each line separately because rational numbers need
      # to be approximately compared
      lines = result.split("\n")
  
      self.assertEqual(len(lines), 7)
  
      self.assertEqual(lines[0], "")
      self.assertEqual(lines[1], "metadata:")
      self.assertEqual(lines[2], "    version:")
      self.assertEqual(
          lines[3], '        essentia: "' + version() + '"'
      )
      self.assertEqual(lines[4], "")
      # will check line 5 later
      self.assertEqual(lines[6], "")
  
      numbers = lines[5][11:-1]
      numbers = numbers.split(", ")
  
      self.assertEqual(len(numbers), 2)
      self.assertAlmostEqual(float(numbers[0]), 3.145)
      self.assertAlmostEqual(float(numbers[1]), -0.456)
  
imports: from essentia_test import *
  from essentia._essentia import version
  import os
  import json
label_desc: Use image node_id 13 for calling the TestYamlOutput obj's underlying member method code with example usage: obj.testRational() without return types