<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pack(o, stream, **kwargs):
 """ Pack object `o` and write it to `stream` See :class:`Packer` for options. """

    packer = Packer(**kwargs)
    stream.write(packer.pack(o))