def METHOD_NAME(sequence, order=1, adjust=True, show=False):
    """**Transition Matrix**
    A **Transition Matrix** (also known as a stochastic matrix or a **Markov matrix**) is a
    convenient way of representing and describing a sequence of (discrete) states, also known as
    **discrete Markov chains**. Each of its entries is a probability of transitioning from one
    state to the other.
    .. note::
        This function is fairly new and hasn't be tested extensively. Please help us by
        double-checking the code and letting us know if everything is correct.
    Parameters
    ----------
    sequence : Union[list, np.array, pd.Series]
        A list of discrete states.
    order : int
        The order of the Markov chain.
    adjust : bool
        If ``True``, the transition matrix will be adjusted to ensure that the sum of each row is
        equal to 1. This is useful when the transition matrix is used to represent a probability
        distribution.
    show : bool
        Displays the transition matrix heatmap.
    See Also
    --------
    markov_simulate, markov_test_random, markov_test_symmetry
    Returns
    -------
    pd.DataFrame
        The empirical (observed) transition matrix.
    dict
        A dictionnary containing additional information, such as the Frequency Matrix (**fm**;
        accessible via the key ``"Occurrences"``), useful for some tests.
    Examples
    --------
    .. ipython:: python
      import neurokit2 as nk
      sequence = ["A", "A", "C", "B", "B", "B", "C", "A", "A", "D"]
      @savefig p_transition_matrix1.png scale=100%
      tm, _ = nk.transition_matrix(sequence, show=True)
      @suppress
      plt.close()
    .. ipython:: python
      tm
    In this example, the transition from D is unknown (it is the last element), resulting in an
    absence of transitioning probability. As this can cause issues, unknown probabilities are
    replaced by a uniform distribution, but this can be turned off using the ``adjust`` argument.
    .. ipython:: python
      tm, _ = nk.transition_matrix(sequence, adjust=False)
      tm
    Transition matrix of higher order
    .. ipython:: python
      sequence = ["A", "A", "A", "B", "A", "A", "B", "A", "A", "B"]
      tm, _ = nk.transition_matrix(sequence, order=2)
      tm
    """
    sequence = as_vector(sequence)
    # Observed transition matrix
    states = np.unique(sequence)
    n_states = len(states)
    # Get observed transition matrix
    freqs = np.zeros((n_states,) * (order + 1))
    for idx in zip(*[sequence[i:] for i in range(order + 1)]):
        idx = tuple([np.argwhere(states == k)[0][0] for k in idx])
        freqs[idx] += 1
    freqs
    # Find rows containing zeros (unknown transition)
    idx = freqs.sum(axis=-1) == 0
    # Fillit with uniform probability to avoid problem in division
    freqs[idx, :] = 1
    # Convert to probabilities
    tm = (freqs.T / freqs.sum(axis=-1)).T
    # If no adjustment, revert to 0
    freqs[idx, :] = 0
    if adjust is False:
        tm[idx, :] = 0
    # Convert to DataFrame
    if order == 1:
        tm = pd.DataFrame(tm, index=states, columns=states)
        freqs = pd.DataFrame(freqs, index=states, columns=states)
    if show is True:
        if order > 1:
            raise ValueError(
                "Visualization of order > 1 not supported yet. "
                "Consider helping us to implement it!"
            )
        fig, ax = plt.subplots()
        ax.imshow(tm, cmap="Reds", interpolation="nearest")
        ax.set_xticks(np.arange(len(tm)))
        ax.set_yticks(np.arange(len(tm)))
        ax.set_xticklabels(tm.columns)
        ax.set_yticklabels(tm.index)
        # Loop over data dimensions and create text annotations.
        for i, row in enumerate(tm.index):
            for j, col in enumerate(tm.columns):
                if tm.loc[row, col] > 0.5:
                    color = "white"
                else:
                    color = "black"
                ax.text(j, i, f"{tm.loc[row, col]:.2f}", ha="center", va="center", color=color)
        ax.set_title("Transition Matrix")
        fig.tight_layout()
    return tm, {"Occurrences": freqs, "States": states}