def jam_pack(jam, **kwargs):
if not hasattr(jam.sandbox, '<STR_LIT>'):<EOL><INDENT>jam.sandbox.muda = jams.Sandbox(history=[],<EOL>state=[],<EOL>version=dict(muda=version,<EOL>librosa=librosa.__version__,<EOL>jams=jams.__version__,<EOL>pysoundfile=psf.__version__))<EOL><DEDENT>elif not isinstance(jam.sandbox.muda, jams.Sandbox):<EOL><INDENT>jam.sandbox.muda = jams.Sandbox(**jam.sandbox.muda)<EOL><DEDENT>jam.sandbox.muda.update(**kwargs)<EOL>return jam<EOL>
Pack data into a jams sandbox.

    If not already present, this creates a `muda` field within `jam.sandbox`,
    along with `history`, `state`, and version arrays which are populated by
    deformation objects.

    Any additional fields can be added to the `muda` sandbox by supplying
    keyword arguments.

    Parameters
    ----------
    jam : jams.JAMS
        A JAMS object

    Returns
    -------
    jam : jams.JAMS
        The updated JAMS object

    Examples
    --------
    >>> jam = jams.JAMS()
    >>> muda.jam_pack(jam, my_data=dict(foo=5, bar=None))
    >>> jam.sandbox
    <Sandbox: muda>
    >>> jam.sandbox.muda
    <Sandbox: state, version, my_data, history>
    >>> jam.sandbox.muda.my_data
    {'foo': 5, 'bar': None}