class_docstr: A class that can read notebook cells from their text representation
class_docstr_tok: ["A","class","that","can","read","notebook","cells","from","their","text","representation"]
docstr: Read one cell from the given lines, and return the cell,
  plus the position of the next cell
docstr_tok: ["Read","one","cell","from","the","given","lines",",","and","return","the","cell",",","plus","the","position","of","the","next","cell"]
code: def read(self, lines):
      """Read one cell from the given lines, and return the cell,
      plus the position of the next cell
      """
  
      # Do we have an explicit code marker on the first line?
      self.metadata_and_language_from_option_line(lines[0])
  
      if self.metadata and "language" in self.metadata:
          self.language = self.metadata.pop("language")
  
      # Parse cell till its end and set content, lines_to_next_cell
      pos_next_cell = self.find_cell_content(lines)
  
      if self.cell_type == "code":
          new_cell = new_code_cell
      elif self.cell_type == "markdown":
          new_cell = new_markdown_cell
      else:
          new_cell = new_raw_cell
  
      if not self.metadata:
          self.metadata = {}
  
      if self.ext == ".py":
          expected_blank_lines = pep8_lines_between_cells(
              self.org_content or [""], lines[pos_next_cell:], self.ext
          )
      else:
          expected_blank_lines = 1
  
      if self.lines_to_next_cell != expected_blank_lines:
          self.metadata["lines_to_next_cell"] = self.lines_to_next_cell
  
      if self.language:
          self.metadata["language"] = self.language
  
      return (
          new_cell(
              source="\n".join(self.content), metadata=self.metadata
          ),
          pos_next_cell,
      )
  
imports: import re
  import warnings
  from copy import copy
  from nbformat.v4.nbbase import new_code_cell, new_markdown_cell, new_raw_cell
  from packaging.version import parse
  from .doxygen import doxygen_to_markdown
  from .languages import _SCRIPT_EXTENSIONS
  from .cell_metadata import is_active, is_json_metadata, rmd_options_to_metadata, text_to_metadata
  from .languages import _JUPYTER_LANGUAGES_LOWER_AND_UPPER
  from .magics import is_magic, need_explicit_marker, uncomment_magic, unescape_code_start
  from .pep8 import pep8_lines_between_cells
  from .stringparser import StringParser
label_desc: Use image node_id 2 for calling the BaseCellReader obj's underlying member method code with example usage: obj.read(lines) and returns: new_cell,  pos_next_cell