<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ttm(self, V, mode=None, transp=False, without=False):
 """ Tensor times matrix product Parameters V : M x N array_like or list of M_i x N_i array_likes Matrix or list of matrices for which the tensor times matrix products should be performed mode : int or list of int's, optional Modes along which the tensor times matrix products should be performed transp: boolean, optional If True, tensor times matrix products are computed with transpositions of matrices without: boolean, optional It True, tensor times matrix products are performed along all modes **except** the modes specified via parameter ``mode`` Examples -------- Create dense tensor Create matrix Multiply tensor with matrix along mode 0 array([[ 22., 49., 76., 103.], [ 28., 64., 100., 136.]]) array([[ 130., 157., 184., 211.], [ 172., 208., 244., 280.]]) """

        if mode is None:
            mode = range(self.ndim)
        if isinstance(V, np.ndarray):
            Y = self._ttm_compute(V, mode, transp)
        elif is_sequence(V):
            dims, vidx = check_multiplication_dims(mode, self.ndim, len(V), vidx=True, without=without)
            Y = self._ttm_compute(V[vidx[0]], dims[0], transp)
            for i in xrange(1, len(dims)):
                Y = Y._ttm_compute(V[vidx[i]], dims[i], transp)
        return Y