MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _block_y

Method _block_y

tensorflow/python/debug/cli/curses_ui.py:127–152  ·  view source on GitHub ↗

Get the 0-based y coordinate of the scroll block. This y coordinate takes into account the presence of the UP and DN buttons present at the top and bottom of the ScrollBar. For example, at the home location, the return value will be 1; at the bottom location, the return value will b

(self, screen_coord_sys=False)

Source from the content-addressed store, hash-verified

125 (self._max_y - self._min_y + 1))
126
127 def _block_y(self, screen_coord_sys=False):
128 """Get the 0-based y coordinate of the scroll block.
129
130 This y coordinate takes into account the presence of the UP and DN buttons
131 present at the top and bottom of the ScrollBar. For example, at the home
132 location, the return value will be 1; at the bottom location, the return
133 value will be self._scroll_bar_height - 2.
134
135 Args:
136 screen_coord_sys: (`bool`) whether the return value will be in the
137 screen coordinate system.
138
139 Returns:
140 (int) 0-based y coordinate of the scroll block, in the ScrollBar
141 coordinate system by default. For example,
142 when scroll position is at the top, this return value will be 1 (not 0,
143 because of the presence of the UP button). When scroll position is at
144 the bottom, this return value will be self._scroll_bar_height - 2
145 (not self._scroll_bar_height - 1, because of the presence of the DOWN
146 button).
147 """
148
149 rel_block_y = int(
150 float(self._scroll_position) / (self._output_num_rows - 1) *
151 (self._scroll_bar_height - 3)) + 1
152 return rel_block_y + self._min_y if screen_coord_sys else rel_block_y
153
154 def layout(self):
155 """Get the RichTextLines layout of the scroll bar.

Callers 2

layoutMethod · 0.95
get_click_commandMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected