from functools import cmp_to_key


def customized_sort(list_like, compare_func, reverse=False):
    """

    :param reverse:
    :param list_like: iterative object
    :param compare_func: takes two element, a, b as input, return -1 or 1.
    if a > b return 1 and reverse is False, the sort is Increasing.
    :return:
    """

    list_like.sort(key=cmp_to_key(compare_func), reverse=reverse)
    return list_like