class_docstr: Content generated by a user control. This content consists of a list of
  lines.
  
  :param get_line: Callable that returns the current line. This is a list of
      (Token, text) tuples.
  :param line_count: The number of lines.
  :param cursor_position: a :class:`.Point` for the cursor position.
  :param menu_position: a :class:`.Point` for the menu position.
  :param show_cursor: Make the cursor visible.
  :param default_char: The default :class:`.Char` for filling the background.
class_docstr_tok: ["Content","generated","by","a","user","control",".","This","content","consists","of","a","list","of","lines",".",":","param","get_line",":","Callable","that","returns","the","current","line",".","This","is","a","list","of","(","Token",",","text",")","tuples",".",":","param","line_count",":","The","number","of","lines",".",":","param","cursor_position",":","a",":","class",":","`",".Point","`","for","the","cursor","position",".",":","param","menu_position",":","a",":","class",":","`",".Point","`","for","the","menu","position",".",":","param","show_cursor",":","Make","the","cursor","visible",".",":","param","default_char",":","The","default",":","class",":","`",".Char","`","for","filling","the","background","."]
docstr: Return the height that a given line would need if it is rendered in a
  space with the given width.
docstr_tok: ["Return","the","height","that","a","given","line","would","need","if","it","is","rendered","in","a","space","with","the","given","width","."]
code: def get_height_for_line(self, lineno, width):
      """
      Return the height that a given line would need if it is rendered in a
      space with the given width.
      """
      try:
          return self._line_heights[lineno, width]
      except KeyError:
          text = token_list_to_text(self.get_line(lineno))
          result = self.get_height_for_text(text, width)
  
          # Cache and return
          self._line_heights[lineno, width] = result
          return result
  
imports: from __future__ import unicode_literals
  from abc import ABCMeta, abstractmethod
  from collections import namedtuple
  from six import with_metaclass
  from six.moves import range
  from prompt_toolkit.cache import SimpleCache
  from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
  from prompt_toolkit.filters import to_cli_filter
  from prompt_toolkit.mouse_events import MouseEventType
  from prompt_toolkit.search_state import SearchState
  from prompt_toolkit.selection import SelectionType
  from prompt_toolkit.token import Token
  from prompt_toolkit.utils import get_cwidth
  from .lexers import Lexer, SimpleLexer
  from .processors import Processor
  from .screen import Char, Point
  from .utils import token_list_width, split_lines, token_list_to_text
  import six
  import time
label_desc: Use image node_id 3 for calling the UIContent obj's underlying member method code with example usage: obj.get_height_for_line(lineno, width) and returns: self, result