original_docstring: Select menu item with given number and scroll menu to be sure that it's visible.
  
          :param item: item to be selected
          
docstring: Select menu item with given number and scroll menu to be sure that it's visible.
docstring_tokens: Select menu item with given number and scroll menu to be sure that it ' s visible .
code: def select_and_scroll_to_item(self, item: int) -> None:
          """Select menu item with given number and scroll menu to be sure that it's visible.
  
          :param item: item to be selected
          """
          if item < 0:
              self.selected_item = 0
          elif item >= len(self.menu.items):
              self.selected_item = len(self.menu.items) - 1
          else:
              self.selected_item = item
  
          self.scroll_to_item(self.selected_item)
code_tokens: def select_and_scroll_to_item ( self , item : int ) -> None : if item < 0 : self . selected_item = 0 elif item >= len ( self . menu . items ) : self . selected_item = len ( self . menu . items ) - 1 else : self . selected_item = item self . scroll_to_item ( self . selected_item )
short_docstring: Select menu item with given number and scroll menu to be sure that it's visible.
short_docstring_tokens: Select menu item with given number and scroll menu to be sure that it ' s visible .
comment: """Select menu item with given number and scroll menu to be sure that it's visible.
  
          :param item: item to be selected
          """