import re


def natural_sort_key(sort_key, _nsre=re.compile('([0-9]+)')):
    """
    Pass to ``key`` for ``str.sort`` to achieve natural sorting.
    For example, ``["2", "11", "1"]`` will be
    sorted to ``["1", "2", "11"]`` instead of ``["1", "11", "2"]``
    :param sort_key: Original key to be processed
    :return: A list of string and integers.
    """
    keys = []
    for text in _nsre.split(sort_key):
        if text.isdigit():
            keys.append(int(text))
        else:
            keys.append(text)
    return keys