code: def ensure_model_and_config_inputs_match(
      model: Union["PreTrainedModel", "TFPreTrainedModel"],
      model_inputs: Iterable[str],
  ) -> Tuple[bool, List[str]]:
      """
  
      :param model_inputs: :param config_inputs: :return:
      """
      if is_torch_available() and issubclass(
          type(model), PreTrainedModel
      ):
          forward_parameters = signature(model.forward).parameters
      else:
          forward_parameters = signature(model.call).parameters
      model_inputs_set = set(model_inputs)
  
      # We are fine if config_inputs has more keys than model_inputs
      forward_inputs_set = set(forward_parameters.keys())
      is_ok = model_inputs_set.issubset(forward_inputs_set)
  
      # Make sure the input order match (VERY IMPORTANT !!!!)
      matching_inputs = forward_inputs_set.intersection(
          model_inputs_set
      )
      ordered_inputs = [
          parameter
          for parameter in forward_parameters.keys()
          if parameter in matching_inputs
      ]
      return is_ok, ordered_inputs
  
file_path: transformers/src/transformers/onnx/convert.py
imports: import warnings
  from inspect import signature
  from itertools import chain
  from pathlib import Path
  from typing import TYPE_CHECKING, Iterable, List, Tuple, Union
  import numpy
  from packaging.version import Version, parse
  from ..tokenization_utils_base import PreTrainedTokenizerBase
  from ..utils import TensorType, is_tf_available, is_torch_available, logging
  from .config import OnnxConfig
label_desc: Use image node_id 6 for calling a global function with example usage: ensure_model_and_config_inputs_match(model, model_inputs) and returns: is_ok,  ordered_inputs