code: def _ensure_cr(text: str) -> str:
      """Remove trailing whitespace and add carriage return
  
      Ensures that `text` always ends with a carriage return
      """
      return text.rstrip() + "\n"
  
file_path: nibabel/nibabel/deprecator.py
imports: from __future__ import annotations
  import functools
  import re
  import typing
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: _ensure_cr(text) and returns: unknown