def _ipython_in_multiline(ip):
    """
    Return ``False`` if the user has entered only one line of input so far,
    including the current line, or ``True`` if it is the second or later line.

    :type ip:
      ``InteractiveShell``
    :rtype:
      ``bool``
    """
    if hasattr(ip, 'input_splitter'):
        return bool(ip.input_splitter.source)
    elif hasattr(ip, 'buffer'):
        return bool(ip.buffer)
    else:
        return False
