def METHOD_NAME(
    matrix: Union[np.ndarray, spmatrix],
    degree_vector=None,
    normalization: str = None,
) -> Union[np.ndarray, spmatrix]:
    r"""
    Normalize a given matrix using its degree vector
    Parameters
    ---------------
        matrix: torch.tensor(N, N) or scipy.sparse.spmatrix(N, N)
            A square matrix representing either an Adjacency matrix or a Laplacian.
        degree_vector: torch.tensor(N) or np.ndarray(N) or None
            A vector representing the degree of ``matrix``.
            ``None`` is only accepted if ``normalization==None``
        normalization: str or None, Default='none'
            Normalization to use on the eig_matrix
            - 'none' or ``None``: no normalization
            - 'sym': Symmetric normalization ``D^-0.5 L D^-0.5``
            - 'inv': Inverse normalization ``D^-1 L``
    Returns
    -----------
        matrix: torch.tensor(N, N) or scipy.sparse.spmatrix(N, N)
            The normalized matrix
    """
    # Transform the degree vector into a matrix
    if degree_vector is None:
        if not ((normalization is None) or (normalization.lower() == "none")):
            raise ValueError("`degree_vector` cannot be `None` if `normalization` is not `None`")
    else:
        if is_dtype_numpy_array(matrix.dtype):
            with np.errstate(divide="ignore", invalid="ignore"):
                degree_inv = np.expand_dims(degree_vector**-0.5, axis=1)
                degree_inv[np.isinf(degree_inv)] = 0
        elif is_dtype_torch_tensor(matrix.dtype):
            degree_inv = torch.unsqueeze(degree_vector**-0.5, dim=1)
            degree_inv[torch.isinf(degree_inv)] = 0
    # Compute the normalized matrix
    if (normalization is None) or (normalization.lower() == "none"):
        pass
    elif normalization.lower() == "sym":
        matrix = degree_inv * matrix * degree_inv.T
    elif normalization.lower() == "inv":
        matrix = (degree_inv**2) * matrix
    else:
        raise ValueError(
            f'`normalization` should be `None`, `"None"`, `"sym"` or `"inv"`, but `{normalization}` was provided'
        )
    return matrix