code: def _get_input_models(self, task):
      # type: ("clearml.Task") -> ModelsList # noqa: F821
  
      if Session.check_min_api_version("2.13"):
          parsed_ids = list(task.input_models_id.values())
      else:
          # since we'll fall back to the new task.models.input if no parsed IDs are found, only
          #  extend this with the input model in case we're using 2.13 and have any parsed IDs or if we're using
          #  a lower API version.
          parsed_ids = [
              i[-1] for i in self._input_models_re.findall(task.comment)
          ]
          # get the last one on the Task
          parsed_ids.extend(list(task.input_models_id.values()))
  
      from clearml.model import Model
  
      def get_model(id_):
          m = Model(model_id=id_)
          # noinspection PyBroadException
          try:
              # make sure the model is is valid
              # noinspection PyProtectedMember
              m._get_model_data()
              return m
          except Exception:
              pass
  
      # noinspection PyProtectedMember
      if Session.check_min_api_version(
          "2.13"
      ) and task._get_task_property(
          "models.input", raise_on_error=False, log_on_error=False
      ):
          input_models = OrderedDict(
              (x.name, get_model(x.model))
              for x in task.data.models.input
          )
      else:
          # remove duplicates and preserve order
          input_models = OrderedDict(
              ("Input Model #{}".format(i), a_model)
              for i, a_model in enumerate(
                  filter(
                      None,
                      map(get_model, OrderedDict.fromkeys(parsed_ids)),
                  )
              )
          )
  
      return ModelsList(input_models)
  
file_path: clearml/clearml/backend_interface/task/models.py
imports: import re
  import typing
  from collections import OrderedDict
  from clearml.backend_api import Session
  from clearml.backend_api.services import models
label_desc: Use image node_id 4 for calling the TaskModels obj's underlying member method code with example usage: obj._get_input_models(task) and returns: ModelsList, m