code: def _reshape(self, array, dry=False):
          
          import functools, numpy as np
          if array.ndim == 1:
              shape = (array.shape[0], 1)
          else:
              # hold first dimension, multiply the rest
              shape = (array.shape[0], functools.reduce(lambda x, y: x * y, array.shape[1:]))
          if not dry:
              array = np.reshape(array, shape)
          return array, shape
docs: reshape given array to 2d. If dry is True, the actual reshaping is not performed.
          returns tuple (array, shape_2d)