code: def _get_input_vars(op, only_nonconst_vars=False):
      """
      Return type : List[Var]
      """
      input_vars = []
      for name, val in op.inputs.items():
          if isinstance(val, Var):
              if only_nonconst_vars:
                  if val.op and val.op.op_type == "const":
                      continue
              input_vars.append(val)
          elif isinstance(val, (list, tuple)):
              for var in val:
                  if not isinstance(var, Var):
                      msg = "unrecognized input type of op='{}', input='{}'"
                      raise ValueError(msg.format(op.name, name))
                  if only_nonconst_vars:
                      if var.op and var.op.op_type == "const":
                          continue
                  input_vars.append(var)
          else:
              msg = "unrecognized input type of op='{}', input='{}'"
              raise ValueError(msg.format(op.name, name))
      return input_vars
  
file_path: coremltools/coremltools/converters/mil/mil/visitors/dot_visitor.py
imports: from ..var import Var
label_desc: Use image node_id 1 for calling a global function with example usage: _get_input_vars(op, only_nonconst_vars) and returns: input_vars