code: def _split_multiline_prompt(get_prompt_tokens):
      """
      Take a `get_prompt_tokens` function and return three new functions instead.
      One that tells whether this prompt consists of multiple lines; one that
      returns the tokens to be shown on the lines above the input; and another
      one with the tokens to be shown at the first line of the input.
      """
  
      def has_before_tokens(cli):
          for token, char in get_prompt_tokens(cli):
              if "\n" in char:
                  return True
          return False
  
      def before(cli):
          result = []
          found_nl = False
          for token, char in reversed(
              explode_tokens(get_prompt_tokens(cli))
          ):
              if found_nl:
                  result.insert(0, (token, char))
              elif char == "\n":
                  found_nl = True
          return result
  
      def first_input_line(cli):
          result = []
          for token, char in reversed(
              explode_tokens(get_prompt_tokens(cli))
          ):
              if char == "\n":
                  break
              else:
                  result.insert(0, (token, char))
          return result
  
      return has_before_tokens, before, first_input_line
  
imports: from __future__ import unicode_literals
  from .buffer import Buffer, AcceptAction
  from .document import Document
  from .enums import DEFAULT_BUFFER, SEARCH_BUFFER, EditingMode
  from .filters import IsDone, HasFocus, RendererHeightIsKnown, to_simple_filter, to_cli_filter, Condition
  from .history import InMemoryHistory
  from .interface import CommandLineInterface, Application, AbortAction
  from .key_binding.defaults import load_key_bindings_for_prompt
  from .key_binding.registry import Registry
  from .keys import Keys
  from .layout import Window, HSplit, FloatContainer, Float
  from .layout.containers import ConditionalContainer
  from .layout.controls import BufferControl, TokenListControl
  from .layout.dimension import LayoutDimension
  from .layout.lexers import PygmentsLexer
  from .layout.margins import PromptMargin, ConditionalMargin
  from .layout.menus import CompletionsMenu, MultiColumnCompletionsMenu
  from .layout.processors import PasswordProcessor, ConditionalProcessor, AppendAutoSuggestion, HighlightSearchProcessor, HighlightSelectionProcessor, DisplayMultipleCursors
  from .layout.prompt import DefaultPrompt
  from .layout.screen import Char
  from .layout.toolbars import ValidationToolbar, SystemToolbar, ArgToolbar, SearchToolbar
  from .layout.utils import explode_tokens
  from .renderer import print_tokens
  from .styles import DEFAULT_STYLE, Style, style_from_dict
  from .token import Token
  from .utils import is_conemu_ansi, is_windows, DummyContext
  from six import text_type, exec_, PY2
  import os
  import sys
  import textwrap
  import threading
  import time
label_desc: Use image node_id 4 for calling a global function with example usage: _split_multiline_prompt(get_prompt_tokens) and returns: has_before_tokens,  before,  first_input_line, False, result, result, True