def build(self, obj, context=None) -> bytes:
        """
        Build bytes from the python object.

        :param obj: Python object to build bytes from.
        :param context: Optional context dictionary.
        """
        stream = BytesIO()
        self.build_stream(obj, stream, context)
        return stream.getvalue()
def build ( self , obj , context = None ) -> bytes : stream = BytesIO ( ) self . build_stream ( obj , stream , context ) return stream . getvalue ( )
Build bytes from the python object.

        :param obj: Python object to build bytes from.
        :param context: Optional context dictionary.