import re


def version_keys(s):
    """
    `key` function enabling python's `sort` function to sort version strings.
    """

    keys = []
    for u in s.split("."):
        for v in re.split(r"(\d+)", u):
            try:
                val = int(v)
            except:
                val = str(v)
            keys.append(val)
    return keys