import re


def natural_sort_key(s):
    """
    Key suitable for alphanumeric sort, but sorts numbers contained in the
    string as numbers.
    """
    def parse_int(s):
        try:
            return int(s)
        except ValueError:
            return s
    return tuple(parse_int(x) for x in re.split(r'(\d+)', s))