<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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()