code: def _find_input_and_output_nodes(nodes: List[Node]):
      """
      Find the input and output node names which are not found in the given list of nodes.
      """
      input_nodes = []
      output_nodes = []
  
      # if a node has an input node which is not in the node list
      # we treat that input node as the input of the checkpoint function
      for node in nodes:
          for input_node in node._input_nodes.keys():
              node_repr = repr(input_node)
              if (
                  input_node not in nodes
                  and node_repr not in input_nodes
              ):
                  input_nodes.append(node_repr)
  
      # if a node has a user node which is not in the node list
      # we treat that user node as the node receiving the current node output
      for node in nodes:
          for output_node in node.users.keys():
              node_repr = repr(node)
              if (
                  output_node not in nodes
                  and node_repr not in output_nodes
              ):
                  output_nodes.append(node_repr)
  
      return input_nodes, output_nodes
  
file_path: ColossalAI/colossalai/_analyzer/fx/codegen.py
imports: from typing import Any, Dict, List, Tuple
  import torch
  from torch.fx.graph import PythonCode, _custom_builtins, _format_target, _is_from_torch, _Namespace, _origin_type_map, _register_custom_builtin, inplace_methods, magic_methods
  from torch.fx.node import Argument, Node, _get_qualified_name, _type_repr, map_arg
  import colossalai
  from colossalai.fx._compatibility import compatibility
label_desc: Use image node_id 5 for calling a global function with example usage: _find_input_and_output_nodes(nodes) and returns: input_nodes,  output_nodes