code: def test_iv_transformations_demo(self):
      scale = {"eta1": "y1", "eta2": "y5", "xi1": "x1"}
  
      self.assertRaises(
          ValueError, self.demo._iv_transformations, "x1", "y1", scale
      )
  
      for y in ["y2", "y3", "y4"]:
          full_graph, dependent_var = self.demo._iv_transformations(
              X="eta1", Y=y, scaling_indicators=scale
          )
          self.assertEqual(dependent_var, y)
          self.assertTrue((".y1", y) in full_graph.edges)
          self.assertFalse(("eta1", y) in full_graph.edges)
  
      for y in ["y6", "y7", "y8"]:
          full_graph, dependent_var = self.demo._iv_transformations(
              X="eta2", Y=y, scaling_indicators=scale
          )
          self.assertEqual(dependent_var, y)
          self.assertTrue((".y5", y) in full_graph.edges)
          self.assertFalse(("eta2", y) in full_graph.edges)
  
      full_graph, dependent_var = self.demo._iv_transformations(
          X="xi1", Y="eta1", scaling_indicators=scale
      )
      self.assertEqual(dependent_var, "y1")
      self.assertTrue((".eta1", "y1") in full_graph.edges())
      self.assertTrue((".x1", "y1") in full_graph.edges())
      self.assertFalse(("xi1", "eta1") in full_graph.edges())
  
      full_graph, dependent_var = self.demo._iv_transformations(
          X="xi1", Y="eta2", scaling_indicators=scale
      )
      self.assertEqual(dependent_var, "y5")
      self.assertTrue((".y1", "y5") in full_graph.edges())
      self.assertTrue((".eta2", "y5") in full_graph.edges())
      self.assertTrue((".x1", "y5") in full_graph.edges())
      self.assertFalse(("eta1", "eta2") in full_graph.edges())
      self.assertFalse(("xi1", "eta2") in full_graph.edges())
  
      full_graph, dependent_var = self.demo._iv_transformations(
          X="eta1", Y="eta2", scaling_indicators=scale
      )
      self.assertEqual(dependent_var, "y5")
      self.assertTrue((".y1", "y5") in full_graph.edges())
      self.assertTrue((".eta2", "y5") in full_graph.edges())
      self.assertTrue((".x1", "y5") in full_graph.edges())
      self.assertFalse(("eta1", "eta2") in full_graph.edges())
      self.assertFalse(("xi1", "eta2") in full_graph.edges())
  
imports: import os
  import unittest
  import networkx
  import numpy
  import numpy.testing
  from pgmpy.models import SEM, SEMAlg, SEMGraph
label_desc: Use image node_id 10 for calling the TestSEMGraph obj's underlying member method code with example usage: obj.test_iv_transformations_demo() without return types