code: def check_connections(gd):
      """
      Given a graph, checks that all
       - inputs/outputs are symmetric
       - control_inputs/control_outputs are symmetric
       - The graph does not reference vertices outside of the graph
  
      Takes a graph in "dict{str, ParsedNode}" form. Does not return,
      asserts false on failure.
      """
      # check that inputs and outputs line up
      for k, v in gd.items():
          for i in v.inputs:
              if isinstance(i, six.string_types):
                  assert k in gd[i].outputs
              else:
                  assert k in gd[i.name].outputs
          for i in v.outputs:
              inputs = [
                  inp if isinstance(inp, six.string_types) else inp.name
                  for inp in gd[i].inputs
              ]
              assert k in inputs
          for i in v.control_inputs:
              if isinstance(i, six.string_types):
                  assert k in gd[i].control_outputs
              else:
                  assert k in gd[i.name].control_outputs
          for i in v.control_outputs:
              control_inputs = [
                  inp if isinstance(inp, six.string_types) else inp.name
                  for inp in gd[i].control_inputs
              ]
              assert k in control_inputs
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import six
label_desc: Use image node_id 18 for calling a global function with example usage: check_connections(gd) without return types