code: def ensure_traj(traj):
      r
      if is_float_matrix(traj) or is_bool_matrix(traj):
          return traj
      elif is_float_vector(traj):
          return traj[:,None]
      else:
          try:
              arr = np.array(traj)
              arr = ensure_dtype_float(arr)
              if is_float_matrix(arr):
                  return arr
              if is_float_vector(arr):
                  return arr[:,None]
              else:
                  raise TypeError('Argument traj cannot be cast into a two-dimensional array. Check type.')
          except:
              raise TypeError('Argument traj is not a trajectory - only float-arrays or list of float-arrays are allowed. Types is %s' % type(traj))
docs: r"""Makes sure that traj is a trajectory (array of float)