def get_raw_bytes(self):
        output = bytearray()
        bits_read = 0
        byte = 0
        for name, field in self.__class__._fields.items():
            if name not in self._raw_values:
                setattr(self, name, getattr(self, name))
            bits_read += field.size
            bits = self._raw_values[name]
            byte = (byte << field.size) + bits
            while bits_read >= 8:
                byte >>= 8
                output.append(byte & 0xFF)
                bits_read -= 8
        return bytes(output)
dataset/ETHPy150Open gulopine/steel/steel/bits/base.py/Structure.get_raw_bytes/original