def slice(self, start_time, end_time, strict=False):
<EOL>if self.file_metadata.duration is None:<EOL><INDENT>raise JamsError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if (start_time < <NUM_LIT:0> or<EOL>start_time > float(self.file_metadata.duration) or<EOL>end_time < start_time or<EOL>end_time > float(self.file_metadata.duration)):<EOL><INDENT>raise ParameterError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(float(self.file_metadata.duration)))<EOL><DEDENT>jam_sliced = JAMS(annotations=None,<EOL>file_metadata=self.file_metadata,<EOL>sandbox=self.sandbox)<EOL>jam_sliced.annotations = self.annotations.slice(<EOL>start_time, end_time, strict=strict)<EOL>jam_sliced.file_metadata.duration = end_time - start_time<EOL>if '<STR_LIT>' not in jam_sliced.sandbox.keys():<EOL><INDENT>jam_sliced.sandbox.update(<EOL>slice=[{'<STR_LIT>': start_time, '<STR_LIT>': end_time}])<EOL><DEDENT>else:<EOL><INDENT>jam_sliced.sandbox.slice.append(<EOL>{'<STR_LIT>': start_time, '<STR_LIT>': end_time})<EOL><DEDENT>return jam_sliced<EOL>
Slice all the annotations inside the jam and return as a new `JAMS`
object.

See `Annotation.slice` for details about how the annotations
are sliced.

This operation is also documented in the jam-level sandbox
with a list keyed by ``JAMS.sandbox.slice`` containing a tuple for each
jam-level slice of the form ``(start_time, end_time)``.

Since slicing is implemented using trimming, the operation will also be
documented in ``JAMS.sandbox.trim`` as described in `JAMS.trim`.

This function also copies over all of the file metadata from the
original jam.

Note: slicing will affect the duration of the jam, i.e. the new value
of ``JAMS.file_metadata.duration`` will be ``end_time - start_time``.

Parameters
----------
start_time : float
    The desired start time for slicing in seconds.
end_time
    The desired end time for slicing in seconds. Must be greater than
    ``start_time``.
strict : bool
    When ``False`` (default) observations that lie at the boundaries of
    the slicing range (see `Annotation.slice` for details), will have
    their time and/or duration adjusted such that only the part of the
    observation that lies within the slice range is kept. When ``True``
    such observations are discarded and not included in the sliced
    annotation.

Returns
-------
jam_sliced: JAMS
    The sliced jam with sliced annotations, returned as a new
    JAMS object.