code: def test_to_jsonl_count_new_lines():
      # GH36888
      df = DataFrame([[1, 2], [1, 2]], columns=["a", "b"])
      actual_new_lines_count = df.to_json(
          orient="records", lines=True
      ).count("\n")
      expected_new_lines_count = 2
      assert actual_new_lines_count == expected_new_lines_count
  
imports: from collections.abc import Iterator
  from io import StringIO
  from pathlib import Path
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, read_json
  import pandas._testing
  from pandas.io.json._json import JsonReader
label_desc: Use image node_id 8 for calling a global function with example usage: test_to_jsonl_count_new_lines() without return types