<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend_variables(raw_variables, override_variables):
 """ extend raw_variables with override_variables. override_variables will merge and override raw_variables. Args: raw_variables (list):
 override_variables (list):
 Returns: dict: extended variables mapping Examples: { 'var1', 'val111', 'var2', 'val2', 'var3', 'val3' } """

    if not raw_variables:
        override_variables_mapping = ensure_mapping_format(override_variables)
        return override_variables_mapping

    elif not override_variables:
        raw_variables_mapping = ensure_mapping_format(raw_variables)
        return raw_variables_mapping

    else:
        raw_variables_mapping = ensure_mapping_format(raw_variables)
        override_variables_mapping = ensure_mapping_format(override_variables)
        raw_variables_mapping.update(override_variables_mapping)
        return raw_variables_mapping