class_docstr: A line splitter that handles 'streamed content' and is based
  on python's built-in splitlines().
class_docstr_tok: ["A","line","splitter","that","handles","'streamed","content","'","and","is","based","on","python","'s","built-in","splitlines","(",")","."]
docstr:         Create a line splitter that will split lines either on a given
          separator, if 'separator' is not None, or on one of the known line
          endings, if 'separator' is None, the line endings are determined by
          python, they include, for example, "
  ", and "
  ".
  
          Parameters
          ----------
          separator: Optional[str]
              If not None, the provided separator will be used to split lines.
          keep_ends: bool
              If True, the separator will be contained in the returned lines.
          
docstr_tok: ["Create","a","line","splitter","that","will","split","lines","either","on","a","given","separator",",","if","'separator","'","is","not","None",",","or","on","one","of","the","known","line","endings",",","if","'separator","'","is","None",",","the","line","endings","are","determined","by","python",",","they","include",",","for","example",",","``","''",",","and","``","''",".","Parameters","--","--","--","--","--","separator",":","Optional","[","str","]","If","not","None",",","the","provided","separator","will","be","used","to","split","lines",".","keep_ends",":","bool","If","True",",","the","separator","will","be","contained","in","the","returned","lines","."]
code: def __init__(
      self, separator: Optional[str] = None, keep_ends: bool = False
  ) -> None:
      """
      Create a line splitter that will split lines either on a given
      separator, if 'separator' is not None, or on one of the known line
      endings, if 'separator' is None, the line endings are determined by
      python, they include, for example, "\n", and "\r\n".
  
      Parameters
      ----------
      separator: Optional[str]
          If not None, the provided separator will be used to split lines.
      keep_ends: bool
          If True, the separator will be contained in the returned lines.
      """
      self.separator = separator
      self.keep_ends = keep_ends
      self.remaining_data: str | None = None
  
file_path: datalad/datalad/runner/utils.py
imports: from __future__ import annotations
  import logging
  from collections import defaultdict
  from typing import Optional
label_desc: Use image node_id 1 to create a new LineSplitter object  with example: obj = LineSplitter(separator, keep_ends)