def create_margin(self, cli, window_render_info, width, height):
        # First line.
        tokens = self.get_prompt_tokens(cli)[:]

        # Next lines. (Show line numbering when numbering is enabled.)
        if self.get_continuation_tokens:
            tokens2 = self.get_continuation_tokens(cli, width)
        else:
            tokens2 = []

        show_numbers = self.show_numbers(cli)
        last_y = None

        for y in window_render_info.displayed_lines[1:]:
            tokens.append((Token, '\n'))
            if show_numbers:
                if y != last_y:
                    tokens.append((Token.LineNumber, ('%i ' % (y + 1)).rjust(width)))
            else:
                tokens.extend(tokens2)
            last_y = y

        return tokens
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/layout/margins.py/PromptMargin.create_margin/original