code: def test_end_newlines():
      """
      The Python grammar explicitly needs a newline at the end. Jedi though still
      wants to be able, to return the exact same code without the additional new
      line the parser needs.
      """
  
      def test(source, end_pos):
          module = parse(source)
          assert module.get_code() == source
          assert module.end_pos == end_pos
  
      test("a", (1, 1))
      test("a\n", (2, 0))
      test("a\nb", (2, 1))
      test("a\n#comment\n", (3, 0))
      test("a\n#comment", (2, 8))
      test("a#comment", (1, 9))
      test("def a():\n pass", (2, 5))
  
      test("def a(", (1, 6))
  
file_path: catboost/contrib/python/parso/py3/tests/test_get_code.py
imports: import difflib
  import pytest
  from parso import parse
label_desc: Use image node_id 5 for calling a global function with example usage: test_end_newlines() without return types