code: def _assert_cycle(self, graph, cycle):
      ts = graphlib.TopologicalSorter()
      for node, dependson in graph.items():
          ts.add(node, *dependson)
      try:
          ts.prepare()
      except graphlib.CycleError as e:
          _, seq = e.args
          self.assertIn(
              " ".join(map(str, cycle)), " ".join(map(str, seq * 2))
          )
      else:
          raise
  
imports: import graphlib
  import os
  import unittest
  from test.support.script_helper import assert_python_ok
label_desc: Use image node_id 2 for calling the TestTopologicalSort obj's underlying member method code with example usage: obj._assert_cycle(graph, cycle) without return types