class_docstr: A Python notebook reader.
docstr: Create a new cell.
docstr_tok: ["Create","a","new","cell","."]
code: def new_cell(self, state, lines):
      """Create a new cell."""
      if state == "codecell":
          input_ = "\n".join(lines)
          input_ = input_.strip("\n")
          if input_:
              return new_code_cell(input=input_)
      elif state == "htmlcell":
          text = self._remove_comments(lines)
          if text:
              return new_text_cell("html", source=text)
      elif state == "markdowncell":
          text = self._remove_comments(lines)
          if text:
              return new_text_cell("markdown", source=text)
  
file_path: nbformat/nbformat/v2/nbpy.py
imports: from __future__ import annotations
  import re
  from .nbbase import new_code_cell, new_notebook, new_text_cell, new_worksheet
  from .rwbase import NotebookReader, NotebookWriter
label_desc: Use image node_id 3 for calling the PyReader obj's underlying member method code with example usage: obj.new_cell(state, lines) and returns: new_code_cell, new_text_cell, new_text_cell