<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_attr_text(self, attr_key, attr_val, el_idx=0):
 """Set the value of the selected attribute of the selected element. Args: attr_key : str Name of attribute for which to search attr_val : str Text to set for the attribute. el_idx : int Index of element to use in the event that there are multiple sibling elements with the same name. """

        self.get_element_by_attr_key(attr_key, el_idx).attrib[attr_key] = attr_val