code: def _skip_variable(nodes, edges):
      func_edges = []
      for edge_i, edge in enumerate(edges):
          head, tail = edge
          if isinstance(head, variable.VariableNode):
              if head.creator_node is not None:
                  head = head.creator_node
              else:
                  continue
          if isinstance(tail, variable.VariableNode):
              for node in nodes:
                  if isinstance(node, function_node.FunctionNode):
                      for input_var in node.inputs:
                          if input_var is tail:
                              tail = node
                              break
                      if isinstance(tail, function_node.FunctionNode):
                          break
              else:
                  continue
          func_edges.append((head, tail))
      return nodes, func_edges
  
file_path: chainer/chainer/computational_graph.py
imports: import heapq
  from chainer import function_node
  from chainer import variable
label_desc: Use image node_id 1 for calling a global function with example usage: _skip_variable(nodes, edges) and returns: nodes,  func_edges