code: def find_inputs_and_outputs(self):
      # solve for input and output vars
      sorted_keys = sorted(self.graph.keys())
  
      # we use function entry and exit points if available
      # otherwise we find graph entry and exit points
      enters = [
          n.name
          for n in self.graph.values()
          if ("entry" in n.op or "Entry" in n.op)
      ]
      exits = [
          n.name
          for n in self.graph.values()
          if n.op in ("Return", "return")
      ]
      if len(enters) > 0 or len(exits) > 0:
          assert len(enters) > 0
          assert len(exits) > 0
          self.inputs = enters
          self.input_types = [
              self.graph[v].datatype for v in self.inputs
          ]
          self.outputs = exits
          self.output_types = [
              self.graph[v].datatype for v in self.outputs
          ]
      else:
          for k in sorted_keys:
              v = self.graph[k]
              if len(v.inputs) == 0 and v.op not in [
                  "Const",
                  "get_global",
                  "NoOp",
              ]:
                  self.inputs.append(k)
                  self.input_types.append(v.datatype)
              elif len(v.inputs) != 0 and v.op == "Placeholder":
                  assert (
                      len(v.inputs) == 1
                  ), "This is not a PlaceholderWithDefault!"
                  self.inputs.append(k)
                  self.input_types.append(v.datatype)
              if (
                  len(v.outputs) == 0
                  and len(v.control_outputs) == 0
                  and v.op != "set_global"
              ):
                  self.outputs.append(k)
                  self.output_types.append(v.datatype)
  
imports: import copy
  from coremltools import _logger
  from coremltools.converters.mil.mil import types
  from .basic_graph_ops import check_connections, const_determined_nodes
  from .dot_visitor import DotVisitor
  from .naming_utils import escape_fn_name
label_desc: Use image node_id 2 for calling the SSAFunction obj's underlying member method code with example usage: obj.find_inputs_and_outputs() without return types