def _validate_diff_res(diff_res, max_diff_values):
    to_iterate = (set(max_diff_values.keys()) & {'gen_q_mvar', 'branch_p_mw', 'branch_q_mvar', 'gen_p_mw', 'bus_va_degree', 'bus_vm_pu'})
    if (not len(to_iterate)):
        logger.warning('There are no keys to validate.')
    val = True
    for i in to_iterate:
        elm = i.split('_')[0]
        sought = (['p', 'q'] if (elm != 'bus') else ['vm', 'va'])
        col = (int(array([0, 1])[[(j in i) for j in sought]][0]) if (elm != 'branch') else list(array([[0, 2], [1, 3]])[[(j in i) for j in sought]][0]))
        val &= bool((max_(abs(diff_res[elm][:, col])) < max_diff_values[i]))
    return val
def _validate_diff_res(diff_res, max_diff_values):
    to_iterate = (set(max_diff_values.keys()) & {'gen_q_mvar', 'branch_p_mw', 'branch_q_mvar', 'gen_p_mw', 'bus_va_degree', 'bus_vm_pu'})
    if (not len(to_iterate)):
        logger.warning('There are no keys to validate.')
    val = True
    for i in to_iterate:
        elm = i.split('_')[0]
        sought = (['p', 'q'] if (elm != 'bus') else ['vm', 'va'])
        col = (int(array([0, 1])[[(j in i) for j in sought]][0]) if (elm != 'branch') else list(array([[0, 2], [1, 3]])[[(j in i) for j in sought]][0]))
        val &= bool((max_(abs(diff_res[elm][:, col])) < max_diff_values[i]))
    return val