"""
This type stub file was generated by pyright.
"""

import scipy.sparse
from typing import Iterable, TYPE_CHECKING
from pandas._typing import IndexLabel
from pandas.core.series import Series

"""
Interaction with scipy.sparse matrices.

Currently only includes to_coo helpers.
"""
if TYPE_CHECKING:
    ...
def sparse_series_to_coo(ss: Series, row_levels: Iterable[int] = ..., column_levels: Iterable[int] = ..., sort_labels: bool = ...) -> tuple[scipy.sparse.coo_matrix, list[IndexLabel], list[IndexLabel]]:
    """
    Convert a sparse Series to a scipy.sparse.coo_matrix using index
    levels row_levels, column_levels as the row and column
    labels respectively. Returns the sparse_matrix, row and column labels.
    """
    ...

def coo_to_sparse_series(A: scipy.sparse.coo_matrix, dense_index: bool = ...) -> Series:
    """
    Convert a scipy.sparse.coo_matrix to a SparseSeries.

    Parameters
    ----------
    A : scipy.sparse.coo_matrix
    dense_index : bool, default False

    Returns
    -------
    Series

    Raises
    ------
    TypeError if A is not a coo_matrix
    """
    ...

