code: def test_cell_ends_with_function_or_class():
      text = """class A:
      __init__():
      '''A docstring
  with two lines or more'''
          self.a = 0
  """
      assert cell_ends_with_function_or_class(text.splitlines())
  
      lines = ["#", "#"]
      assert not cell_ends_with_function_or_class(lines)
  
      text = """# two blank line after this class
  class A:
      pass
  
  
  # so we do not need to insert two blank lines below this cell
      """
      assert not cell_ends_with_function_or_class(text.splitlines())
  
      text = """# All lines
  # are commented"""
      assert not cell_ends_with_function_or_class(text.splitlines())
  
      text = """# Two blank lines after function
  def f(x):
      return x
  
  
  # And a comment here"""
      assert not cell_ends_with_function_or_class(text.splitlines())
  
      assert not cell_ends_with_function_or_class(["", "#"])
  
file_path: jupytext/tests/unit/test_pep8.py
imports: from nbformat.v4.nbbase import new_code_cell, new_notebook
  from jupytext import read, reads, writes
  from jupytext.compare import compare
  from jupytext.pep8 import cell_ends_with_code, cell_ends_with_function_or_class, cell_has_code, next_instruction_is_function_or_class, pep8_lines_between_cells
label_desc: Use image node_id 3 for calling a global function with example usage: test_cell_ends_with_function_or_class() without return types