def genslices(n):
 return product(range((- n), (n + 1)), range((- n), (n + 1)), range((- n), (n + 1)))

def genslices ( n ) : return product ( range ( ( - n ) , ( n + 1 ) ) , range ( ( - n ) , ( n + 1 ) ) , range ( ( - n ) , ( n + 1 ) ) )
generate all possible slices for a single dimension .