code: def select_by_key(self, key):
          
          self._selected_key = None
          self._selected_item = None
          for item in self.children.values():
              item.attributes['selected'] = False
  
          if key in self.children:
              self.children[key].attributes['selected'] = True
              self._selected_key = key
              self._selected_item = self.children[key]
docs: Selects an item by its key.
  
          Args:
              key (str): The unique string identifier of the item that have to be selected.