def sqlalchemy_many_list_tuple(session, model_class, param_list,
    filter_function, object_function):
    """
    Given a list of parameter objects, this function will return a list of corresponding sqlalchemy model objects, by
    querying the database if there already exist some of the specified entries and then creating the remaining objects.
    The list of all those objects created, which are not represented in the database yet is also returned.

    :param session: The session for the database to use
    :param param_list: A list of objects, that each specify a database entry for the given model class
    :param model_class: The class of the model objects to return objects from
    :param filter_function: A function that accepts one item of the param_list as input and will return a sqlalchemy
        filter argument as return, that is used to possibly retrieve the object from the database, that was specified
        by the param item.
        function(param_item): <sqlalchemy filter argument>
    :param object_function: A function that accepts one item of the param_list as input and will return a model object
        for the given model class, that is based on the information the param item describes the object.#
        function(param_item): model_class
    :return: A tuple of two lists. The first being the list of all the model objects, that are based on the items
        given in the parameter list and the second list contains all the model objects for those model, which are not
        represented in the database yet and would still have to be added.
    """
    remaining_list = []
    object_list = []
    for list_item in param_list:
        results = list(session.query(model_class).filter(filter_function(
            list_item)))
        if len(results) != 0:
            object_list.append(results[0])
        else:
            remaining_list.append(list_item)
    to_add_list = []
    for remaining_item in remaining_list:
        obj = object_function(remaining_item)
        object_list.append(obj)
        to_add_list.append(obj)
    return object_list, to_add_list
