<commit_before>"""List of Lists sparse matrix class
"""

__docformat__ = "restructuredtext en"

__all__ = ['lil_matrix', 'isspmatrix_lil']

from bisect import bisect_left

import numpy as np

from ._base import spmatrix, isspmatrix
from ._index import IndexMixin, INT_TYPES, _broadcast_arrays
from ._sputils import (getdtype, isshape, isscalarlike, upcast_scalar,
                       get_index_dtype, check_shape, check_reshape_kwargs)
from . import _csparsetools


class lil_matrix(spmatrix, IndexMixin):
    """Row-based list of lists (LInked List) sparse matrix

    This is a structure for constructing sparse matrices incrementally.
    Note that inserting a single item can take linear time in the worst case;
    to construct a matrix efficiently, make sure the items are pre-sorted by
    index, per row.
<commit_msg>Fix explanation of LIst of List sparse matrix<commit_after>"""List of Lists sparse matrix class
"""

__docformat__ = "restructuredtext en"

__all__ = ['lil_matrix', 'isspmatrix_lil']

from bisect import bisect_left

import numpy as np

from ._base import spmatrix, isspmatrix
from ._index import IndexMixin, INT_TYPES, _broadcast_arrays
from ._sputils import (getdtype, isshape, isscalarlike, upcast_scalar,
                       get_index_dtype, check_shape, check_reshape_kwargs)
from . import _csparsetools


class lil_matrix(spmatrix, IndexMixin):
    """Row-based LIst of Lists sparse matrix

    This is a structure for constructing sparse matrices incrementally.
    Note that inserting a single item can take linear time in the worst case;
    to construct a matrix efficiently, make sure the items are pre-sorted by
    index, per row.

{'fraction_non_alphanumeric': 0.05973715651135006, 'fraction_numerical': 0.0, 'mean_word_length': 4.267295597484277, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6160246', 'n_tokens_mistral': 506, 'n_tokens_neox': 490, 'n_words': 191}