def var_str(name, shape):
 size = np.prod(shape)
 ind = (np.indices(shape) + 1).reshape((-1), size)
 names = [(('[' + ','.join(map(str, i))) + ']') for i in zip(*ind)]
 names[0] = ('%s %s' % (name, names[0]))
 return names

def var_str ( name , shape ) : size = np . prod ( shape ) ind = ( np . indices ( shape ) + 1 ) . reshape ( ( - 1 ) , size ) names = [ ( ( '[' + ',' . join ( map ( str , i ) ) ) + ']' ) for i in zip ( * ind ) ] names [ 0 ] = ( '%s %s' % ( name , names [ 0 ] ) ) return names
return a sequence of strings naming the element of the tallyable object .