code: def split_user_input(line, pattern=None):
      """Split user input into initial whitespace, escape character, function part
      and the rest.
      """
      # We need to ensure that the rest of this routine deals only with unicode
      encoding = get_stream_enc(sys.stdin, "utf-8")
      line = py3compat.cast_unicode(line, encoding)
  
      if pattern is None:
          pattern = line_split
      match = pattern.match(line)
      if not match:
          # print "match failed for line '%s'" % line
          try:
              ifun, the_rest = line.split(None, 1)
          except ValueError:
              # print "split failed for line '%s'" % line
              ifun, the_rest = line, ""
          pre = re.match("^(\s*)(.*)", line).groups()[0]
          esc = ""
      else:
          pre, esc, ifun, the_rest = match.groups()
  
      # print 'line:<%s>' % line # dbg
      # print 'pre <%s> ifun <%s> rest <%s>' % (pre,ifun.strip(),the_rest) # dbg
      return pre, esc or "", ifun.strip(), the_rest.lstrip()
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/splitinput.py
imports: import re
  import sys
  from IPython.utils import py3compat
  from IPython.utils.encoding import get_stream_enc
label_desc: Use image node_id 1 for calling a global function with example usage: split_user_input(line, pattern) and returns: pre,  unknown,  ifun,  the_rest