def sort_rows(rows, key):
    """
    # python3, cmp is deprecated, but in python2, cmp
    >>> func = lambda a, b: cmp(a.get(key), b.get(key))
    >>> ds = sort(rows, cmp=func)
    :param rows: array of dict, eg : mysql.proxy rows
    :param key:  sorted_key
    :return: new array
    """
    func = lambda x: x.get(key)
    ds = sorted(rows, key=func)
    return ds
