def backups(destination, prefix):
    name_re = re.compile('^{}(?:\\.[0-9]+)?$'.format(prefix))

    def _key(name):
        return [(int(char) if char.isdigit() else char) for char in re.split('([0-9]+)', name)]
    paths = []
    for name in sorted(os.listdir(destination), key=_key):
        path = os.path.join(destination, name)
        if (os.path.isdir(path) and name_re.match(name)):
            paths.append(path)
    return paths
def backups(destination, prefix):
    name_re = re.compile('^{}(?:\\.[0-9]+)?$'.format(prefix))

    def _key(name):
        return [(int(char) if char.isdigit() else char) for char in re.split('([0-9]+)', name)]
    paths = []
    for name in sorted(os.listdir(destination), key=_key):
        path = os.path.join(destination, name)
        if (os.path.isdir(path) and name_re.match(name)):
            paths.append(path)
    return paths