def METHOD_NAME(tm, probs=True):
    # If symmetric dataframe, then surely a transition matrix
    if isinstance(tm, pd.DataFrame) and tm.shape[1] == tm.shape[0]:
        if tm.values.max() > 1:
            if probs is True:
                raise ValueError(
                    "Transition matrix must be a probability matrix (all probabilities must be"
                    " < 1)."
                )
            else:
                return tm
        else:
            if probs is True:
                return tm
            else:
                raise ValueError(
                    "Transition matrix must be a frequency matrix containing counts and not"
                    " probabilities. Please pass the `info['Occurrences']` object instead of"
                    " the transition matrix."
                )
    # Otherwise, conver to TM
    else:
        return transition_matrix(tm)