def serialize_properties(self):
        # write
        shift = 15
        flag_bits = 0
        flags = []
        prop_writer = AMQPWriter()
        for prop_name, data_type in self.PROPERTIES:
            val = self.properties.get(prop_name)
            if val is not None:
                if shift == 0:
                    flags.append(flag_bits)
                    flag_bits = 0
                    shift = 15

                flag_bits |= (1 << shift)
                if data_type != 'bit':
                    getattr(prop_writer, 'write_' + data_type)(val)
            shift -= 1
        flags.append(flag_bits)

        # write final data
        writer = AMQPWriter()
        for flag_bits in flags:
            writer.write_short(flag_bits)
        writer.write(prop_writer.getvalue())

        return writer.getvalue()
transform a CSW response into an SRU response
dataset/ETHPy150Open veegee/amqpy/amqpy/message.py/GenericContent.serialize_properties--crossover with--dataset/ETHPy150Open geopython/pycsw/pycsw/sru.py/Sru.response_csw2sru