def create_flat_names(varname, shape):
 if (not shape):
  return [varname]
 labels = (np.ravel(xs).tolist() for xs in np.indices(shape))
 labels = (map(str, xs) for xs in labels)
 return ['{}__{}'.format(varname, '_'.join(idxs)) for idxs in zip(*labels)]

def create_flat_names ( varname , shape ) : if ( not shape ) : return [ varname ] labels = ( np . ravel ( xs ) . tolist ( ) for xs in np . indices ( shape ) ) labels = ( map ( str , xs ) for xs in labels ) return [ '{}__{}' . format ( varname , '_' . join ( idxs ) ) for idxs in zip ( * labels ) ]
return flat variable names for varname of shape .