code: def scroll_backward(event, half=False):
      """
      Scroll window up.
      """
      w = _current_window_for_event(event)
      b = event.cli.current_buffer
  
      if w and w.render_info:
          info = w.render_info
  
          # Height to scroll.
          scroll_height = info.window_height
          if half:
              scroll_height //= 2
  
          # Calculate how many lines is equivalent to that vertical space.
          y = max(0, b.document.cursor_position_row - 1)
          height = 0
          while y > 0:
              line_height = info.get_height_for_line(y)
  
              if height + line_height < scroll_height:
                  height += line_height
                  y -= 1
              else:
                  break
  
          b.cursor_position = b.document.translate_row_col_to_index(
              y, 0
          )
  
file_path: catboost/contrib/python/prompt-toolkit/py2/prompt_toolkit/key_binding/bindings/scroll.py
imports: from __future__ import unicode_literals
  from prompt_toolkit.layout.utils import find_window_for_buffer_name
  from six.moves import range
label_desc: Use image node_id 3 for calling a global function with example usage: scroll_backward(event, half) without return types