<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_missing_model(self, model_list_or_dict, core_elements_dict, model_name, model_class, model_key):
 """Adds one missing model The method will search for the first core-object out of core_object_dict not represented in the list or dict of models handed by model_list_or_dict, adds it and returns without continue to search for more objects which maybe are missing in model_list_or_dict with respect to the core_object_dict. :param model_list_or_dict: could be a list or dictionary of one model type :param core_elements_dict: dictionary of one type of core-elements (rafcon.core) :param model_name: prop_name for the core-element hold by the model, this core-element is covered by the model :param model_class: model-class of the elements that should be insert :param model_key: if model_list_or_dict is a dictionary the key is the id of the respective element (e.g. 'state_id') :return: True, is a new model was added, False else :rtype: bool """

        def core_element_has_model(core_object):
            for model_or_key in model_list_or_dict:
                model = model_or_key if model_key is None else model_list_or_dict[model_or_key]
                if core_object is getattr(model, model_name):
                    return True
            return False

        if model_name == "income":
            self._add_model(self.income, self.state.income, IncomeModel)
            return
            
        for core_element in core_elements_dict.values():
            if core_element_has_model(core_element):
                continue

            # get expected model and connect it to self or create a new model
            new_model = self._get_future_expected_model(core_element)
            if new_model:
                new_model.parent = self
            else:
                if type_helpers.type_inherits_of_type(model_class, StateModel):
                    new_model = model_class(core_element, self, expected_future_models=self.expected_future_models)
                    self.expected_future_models = new_model.expected_future_models  # update reused models
                    new_model.expected_future_models = set()  # clean the field because should not be used further
                else:
                    new_model = model_class(core_element, self)

            # insert new model into list or dict
            if model_key is None:
                model_list_or_dict.append(new_model)
            else:
                model_list_or_dict[getattr(core_element, model_key)] = new_model
            return True
        return False