def set_keys(*indices):
    """Returns a function that returns a tuple of key values"""
    def get_keys(seq, indices=indices):
        keys = []
        for i in indices:
            keys.append(seq[i])
        return tuple(keys)
    return get_keys
Returns a function that returns a tuple of key values
recipes/Python/496726_Summary_reports_using_itertoolsgroup_extended/recipe-496726.py