code: def _join_lines(lines):
      """join lines that have been written by splitlines()
  
      Has logic to protect against `splitlines()`, which
      should have been `splitlines(True)`
      """
      if lines and lines[0].endswith(("\n", "\r")):
          # created by splitlines(True)
          return "".join(lines)
      # created by splitlines()
      return "\n".join(lines)
  
file_path: nbformat/nbformat/v3/rwbase.py
imports: from __future__ import annotations
  from base64 import decodebytes, encodebytes
label_desc: Use image node_id 2 for calling a global function with example usage: _join_lines(lines) and returns: str, str