code: def as_bytes(self) -> bytes:
          
          logger = logging.getLogger(__name__)
          logger.debug("BlsEntity.as_bytes: >>> self: %r", self)
  
          xbytes = POINTER(c_ubyte)()
          xbytes_len = c_size_t()
  
          do_call(self.as_bytes_handler, self.c_instance, byref(xbytes), byref(xbytes_len))
          res = bytes(xbytes[:xbytes_len.value])
  
          logger.debug("BlsEntity.as_bytes: <<< res: %r", res)
          return res
docs: Returns BLS entity bytes representation.
          :return: BLS entity bytes representation