def generate_indices(self, f, values=False):
axes = f.axes<EOL>if values:<EOL><INDENT>axes = [lrange(len(a)) for a in axes]<EOL><DEDENT>return itertools.product(*axes)<EOL>
generate the indices
        if values is True , use the axis values
        is False, use the range