def _new_order_result(result, eq):
    first_priority = []
    second_priority = []
    for res in result:
        if (not any((isinstance(val, ImageSet) for val in res.values()))):
            if (eq.subs(res) == 0):
                first_priority.append(res)
            else:
                second_priority.append(res)
    if (first_priority or second_priority):
        return (first_priority + second_priority)
    return result
def _new_order_result(result, eq):
    first_priority = []
    second_priority = []
    for res in result:
        if (not any((isinstance(val, ImageSet) for val in res.values()))):
            if (eq.subs(res) == 0):
                first_priority.append(res)
            else:
                second_priority.append(res)
    if (first_priority or second_priority):
        return (first_priority + second_priority)
    return result