code: def set_flags(self):
          
          offset = self.template['flagoffset']//8
  
          # comm keys provided?
          self.tpl_buff = bytes_transform(self.tpl_buff, offset+1, offset+2, lambda x: self.set_flag_bit(x))
docs: Set flags representing generation way accordingly - commkeys are client generated, app key is server generated.
          :return: