human
Here's a good function header given the following:
I wrote the below code

    comparers = [(operator.itemgetter(key.strip()), multiplier) for (key, multiplier) in zip(sort_keys, sort_dirs)]
    def comparer(left, right):
        for (fn, d) in comparers:
            left_val = fn(left)
            right_val = fn(right)
            if isinstance(left_val, dict):
                left_val = sorted(left_val.values())[0]
            if isinstance(right_val, dict):
                right_val = sorted(right_val.values())[0]
            if (left_val == right_val):
                continue
            if (d == 'asc'):
                return ((-1) if (left_val < right_val) else 1)
            else:
                return ((-1) if (left_val > right_val) else 1)
        else:
            return 0
    sorted_entries = sorted(entries, key=functools.cmp_to_key(comparer))
    start_index = 0
    if (offset is None):
        offset = 0
    if marker:
        if (not isinstance(marker, dict)):
            try:
                marker = json.loads(marker)
            except ValueError:
                msg = (_('marker    %s    can    not    be    analysed,    please    use    json    like    format') % marker)
                raise exception.InvalidInput(reason=msg)
        start_index = (-1)
        for (i, entry) in enumerate(sorted_entries):
            if (entry['reference'] == marker):
                start_index = (i + 1)
                break
        if (start_index < 0):
            msg = (_('marker    not    found:    %s') % marker)
            raise exception.InvalidInput(reason=msg)
    range_end = (start_index + limit)
    return sorted_entries[(start_index + offset):(range_end + offset)]

What's a good function header?
assistant
#Here's a good function header.

def paginate_entries_list(entries, marker, limit, offset, sort_keys, sort_dirs):