code: def transform(self, X):
          r
          if isinstance(X, np.ndarray):
              if X.ndim == 2:
                  mapped = self._transform_array(X)
                  return mapped
              else:
                  raise TypeError('Input has the wrong shape: %s with %i'
                                  ' dimensions. Expecting a matrix (2 dimensions)'
                                  % (str(X.shape), X.ndim))
          elif isinstance(X, (list, tuple)):
              out = []
              for x in X:
                  mapped = self._transform_array(x)
                  out.append(mapped)
              return out
          else:
              raise TypeError('Input has the wrong type: %s '
                              '. Either accepting numpy arrays of dimension 2 '
                              'or lists of such arrays' % (str(type(X))))
docs: r"""Maps the input data through the transformer to correspondingly
          shaped output data array/list.
  
          Parameters
          ----------
          X : ndarray(T, n) or list of ndarray(T_i, n)
              The input data, where T is the number of time steps and n is the
              number of dimensions.
              If a list is provided, the number of time steps is allowed to vary,
              but the number of dimensions are required to be to be consistent.
  
          Returns
          -------
          Y : ndarray(T, d) or list of ndarray(T_i, d)
              The mapped data, where T is the number of time steps of the input
              data and d is the output dimension of this transformer. If called
              with a list of trajectories, Y will also be a corresponding list of
              trajectories