Sort the given list in the way that humans expect (using natural order sorting).

    :param l: An iterable of strings to sort.
    :param key: An optional sort key similar to the one accepted by Python's
                built in :func:`sorted()` function. Expected to produce
                strings.
    :param reverse: Whether to reverse the resulting sorted list.
    :returns: A sorted list of strings.

def natsort(l, key=None, reverse=False):
    """
    Sort the given list in the way that humans expect (using natural order sorting).

    :param l: An iterable of strings to sort.
    :param key: An optional sort key similar to the one accepted by Python's
                built in :func:`sorted()` function. Expected to produce
                strings.
    :param reverse: Whether to reverse the resulting sorted list.
    :returns: A sorted list of strings.
    """
    return sorted(l, key=lambda v: NaturalOrderKey(key and key(v) or v), reverse=reverse)