<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addModel(D, models):
 """ Insert model data into a LiPD dataset Examples of model naming: chron0model0 chron0model1 chron1model0 Example of 'models' variable: { chron0model0: { }, } :param dict D: Metadata (dataset) :param dict models: Model data to add :return dict D: Metadata (dataset) """

    try:
        # Loop for each model that needs to  be added
        for _model_name, _model_data in models.items():
            # split the table name into a path that we can use
            _m = re.match(re_model_name, _model_name)
            if _m:
                D = _put_model(D, _model_name, _model_data, _m)
            else:
                print("The table name found in the given model data isn't valid for automatic placement")
                _placement_name = _prompt_placement(D, "model")
                _m = re.match(re_model_name, _placement_name)
                if _m:
                    D = _put_model(D, _placement_name, _model_data, _m)
                else:
                    print("Oops. This shouldn't happen. That table name doesn't look right. Please report this error")
                    return

    except Exception as e:
        print("addModel: Model data NOT added, {}".format(e))

    return D