import re


def natural_sort_key(s, _nsre=re.compile('([0-9]+)')):
    """
    Allows natural sorting, e.g. 2.xml is before 16.xml
    """
    return [int(text) if text.isdigit() else text.lower() for text in _nsre.split(s)]