<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_alert_community(self, community, channel=None):
 """Set the community string for alerts This configures the string the BMC will use as the community string for PET alerts/traps. :param community: The community string :param channel: The LAN channel (defaults to auto detect) """

        if channel is None:
            channel = self.get_network_channel()
        community = community.encode('utf-8')
        community += b'\x00' * (18 - len(community))
        cmddata = bytearray((channel, 16))
        cmddata += community
        self.xraw_command(netfn=0xc, command=1, data=cmddata)