<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_group_type(self, group, bulb_type):
 """ Set bulb type for specified group. Group must be int between 1 and 4. Type must be "rgbw" or "white". Alternatively, use constructor keywords group_1, group_2 etc. to set bulb types. """

        if bulb_type not in ("rgbw", "white"):
            raise AttributeError("Bulb type must be either rgbw or white")

        self.group[group] = bulb_type
        self.has_white = "white" in self.group.values()
        self.has_rgbw = "rgbw" in self.group.values()