class_docstr: Margin that displays the line numbers.
  
  :param relative: Number relative to the cursor position. Similar to the Vi
                   'relativenumber' option.
  :param display_tildes: Display tildes after the end of the document, just
      like Vi does.
code: def create_margin(self, cli, window_render_info, width, height):
      relative = self.relative(cli)
  
      token = Token.LineNumber
      token_current = Token.LineNumber.Current
  
      # Get current line number.
      current_lineno = window_render_info.ui_content.cursor_position.y
  
      # Construct margin.
      result = []
      last_lineno = None
  
      for y, lineno in enumerate(window_render_info.displayed_lines):
          # Only display line number if this line is not a continuation of the previous line.
          if lineno != last_lineno:
              if lineno is None:
                  pass
              elif lineno == current_lineno:
                  # Current line.
                  if relative:
                      # Left align current number in relative mode.
                      result.append(
                          (token_current, "%i" % (lineno + 1))
                      )
                  else:
                      result.append(
                          (
                              token_current,
                              ("%i " % (lineno + 1)).rjust(width),
                          )
                      )
              else:
                  # Other lines.
                  if relative:
                      lineno = abs(lineno - current_lineno) - 1
  
                  result.append(
                      (token, ("%i " % (lineno + 1)).rjust(width))
                  )
  
          last_lineno = lineno
          result.append((Token, "\n"))
  
      # Fill with tildes.
      if self.display_tildes(cli):
          while y < window_render_info.window_height:
              result.append((Token.Tilde, "~\n"))
              y += 1
  
      return result
  
imports: from __future__ import unicode_literals
  from abc import ABCMeta, abstractmethod
  from six import with_metaclass
  from six.moves import range
  from prompt_toolkit.filters import to_cli_filter
  from prompt_toolkit.token import Token
  from prompt_toolkit.utils import get_cwidth
  from .utils import token_list_to_text
label_desc: Use image node_id 3 for calling the NumberredMargin obj's underlying member method code with example usage: obj.create_margin(cli, window_render_info, width, height) and returns: result