code: def _one_line_summary_from_text(
      text, length=78, escapes={"\n": "\\n", "\r": "\\r", "\t": "\\t"}
  ):
      r"""Summarize the given text with one line of the given length.
  
      "text" is the text to summarize
      "length" (default 78) is the max length for the summary
      "escapes" is a mapping of chars in the source text to
          replacement text for each such char. By default '\r', '\n'
          and '\t' are escaped with their '\'-escaped repr.
      """
      if len(text) > length:
          head = text[: length - 3]
      else:
          head = text
      escaped = _escaped_text_from_text(head, escapes)
      if len(text) > length:
          summary = escaped[: length - 3] + "..."
      else:
          summary = escaped
      return summary
  
imports: import os
  import sys
  from os.path import join, dirname, abspath, exists, splitext, basename
  import re
  from glob import glob
  import unittest
  import codecs
  import difflib
  import doctest
  from json import loads
label_desc: Use image node_id 10 for calling a global function with example usage: _one_line_summary_from_text(text, length, escapes) and returns: summary