<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_mapping_format(variables):
 """ ensure variables are in mapping format. Args: variables (list/dict):
 original variables Returns: dict: ensured variables in dict format Examples: {"a": 1}, {"b": 2} ] { "a": 1, "b": 2 } """

    if isinstance(variables, list):
        variables_dict = {}
        for map_dict in variables:
            variables_dict.update(map_dict)

        return variables_dict

    elif isinstance(variables, dict):
        return variables

    else:
        raise exceptions.ParamsError("variables format error!")