code: def truncate_text(
      text: str, max_length: int, with_ellipsis: bool = True
  ) -> str:
      if with_ellipsis and len(text) > max_length:
          return text[: max_length - 1] + ELLIPSIS
  
      return text[:max_length]
  
imports: from funcy import is_seq
label_desc: Use image node_id 3 for calling a global function with example usage: truncate_text(text, max_length, with_ellipsis) and returns: text, unknown