def create_margin(self, cli, window_render_info, width, height):
        total_height = window_render_info.content_height
        display_arrows = self.display_arrows(cli)

        window_height = window_render_info.window_height
        if display_arrows:
            window_height -= 2

        try:
            items_per_row = float(total_height) / min(total_height, window_height)
        except ZeroDivisionError:
            return []
        else:
            def is_scroll_button(row):
                " True if we should display a button on this row. "
                current_row_middle = int((row + .5) * items_per_row)
                return window_render_info.displayed_lines in current_row_middle

            # Up arrow.
            result = []
            if display_arrows:
                result.extend([
                    (Token.Scrollbar.Arrow, '^'),
                    (Token.Scrollbar, '\n')
                ])

            # Scrollbar body.
            for i in range(window_height):
                if is_scroll_button(i):
                    result.append((Token.Scrollbar.Button, ' '))
                else:
                    result.append((Token.Scrollbar, ' '))
                result.append((Token, '\n'))

            # Down arrow
            if display_arrows:
                result.append((Token.Scrollbar.Arrow, 'v'))

            return result
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/layout/margins.py/ScrollbarMargin.create_margin/swapped operands of `in`