class_docstr: Completion menu that displays all the completions in several columns.
  When there are more completions than space for them to be displayed, an
  arrow is shown on the left or right side.
  
  `min_rows` indicates how many rows will be available in any possible case.
  When this is langer than one, in will try to use less columns and more
  rows until this value is reached.
  Be careful passing in a too big value, if less than the given amount of
  rows are available, more columns would have been required, but
  `preferred_width` doesn't know about that and reports a too small value.
  This results in less completions displayed and additional scrolling.
  (It's a limitation of how the layout engine currently works: first the
  widths are calculated, then the heights.)
  
  :param suggested_max_column_width: The suggested max width of a column.
      The column can still be bigger than this, but if there is place for two
      columns of this width, we will display two columns. This to avoid that
      if there is one very wide completion, that it doesn't significantly
      reduce the amount of columns.
class_docstr_tok: ["Completion","menu","that","displays","all","the","completions","in","several","columns",".","When","there","are","more","completions","than","space","for","them","to","be","displayed",",","an","arrow","is","shown","on","the","left","or","right","side",".","`","min_rows","`","indicates","how","many","rows","will","be","available","in","any","possible","case",".","When","this","is","langer","than","one",",","in","will","try","to","use","less","columns","and","more","rows","until","this","value","is","reached",".","Be","careful","passing","in","a","too","big","value",",","if","less","than","the","given","amount","of","rows","are","available",",","more","columns","would","have","been","required",",","but","`","preferred_width","`","does","n't","know","about","that","and","reports","a","too","small","value",".","This","results","in","less","completions","displayed","and","additional","scrolling",".","(","It","'s","a","limitation","of","how","the","layout","engine","currently","works",":","first","the","widths","are","calculated",",","then","the","heights",".",")",":","param","suggested_max_column_width",":","The","suggested","max","width","of","a","column",".","The","column","can","still","be","bigger","than","this",",","but","if","there","is","place","for","two","columns","of","this","width",",","we","will","display","two","columns",".","This","to","avoid","that","if","there","is","one","very","wide","completion",",","that","it","does","n't","significantly","reduce","the","amount","of","columns","."]
docstr: Preferred height: as much as needed in order to display all the completions.
docstr_tok: ["Preferred","height",":","as","much","as","needed","in","order","to","display","all","the","completions","."]
code: def preferred_height(
      self, cli, width, max_available_height, wrap_lines
  ):
      """
      Preferred height: as much as needed in order to display all the completions.
      """
      complete_state = cli.current_buffer.complete_state
      column_width = self._get_column_width(complete_state)
      column_count = max(
          1, (width - self._required_margin) // column_width
      )
  
      return int(
          math.ceil(
              len(complete_state.current_completions)
              / float(column_count)
          )
      )
  
imports: from __future__ import unicode_literals
  from six.moves import zip_longest, range
  from prompt_toolkit.filters import HasCompletions, IsDone, Condition, to_cli_filter
  from prompt_toolkit.mouse_events import MouseEventType
  from prompt_toolkit.token import Token
  from prompt_toolkit.utils import get_cwidth
  from .containers import Window, HSplit, ConditionalContainer, ScrollOffsets
  from .controls import UIControl, UIContent
  from .dimension import LayoutDimension
  from .margins import ScrollbarMargin
  from .screen import Point, Char
  import math
label_desc: Use image node_id 5 for calling the MultiColumnCompletionMenuControl obj's underlying member method code with example usage: obj.preferred_height(cli, width, max_available_height, wrap_lines) and returns: int