code: def set_flag_bit(self, x):
          
          x = bytes_to_byte(x)
          if KeyTypes.COMM_ENC in self.keys:
              x &= ~0x8
          if KeyTypes.APP_KEY in self.keys:
              x &= ~0x10
          return byte_to_bytes(x)
docs: Function internally used in set_flags. No multi-line lambdas in python :/
          :param x:
          :return: