<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compare_annotations(ref_sample, test_sample, window_width, signal=None):
 """ Compare a set of reference annotation locations against a set of test annotation locations. See the Comparitor class docstring for more information. Parameters ref_sample : 1d numpy array Array of reference sample locations test_sample : 1d numpy array Array of test sample locations to compare window_width : int The maximum absolute difference in sample numbers that is permitted for matching annotations. signal : 1d numpy array, optional The original signal of the two annotations. Only used for plotting. Returns ------- comparitor : Comparitor object Object containing parameters about the two sets of annotations Examples -------- xqrs.qrs_inds, int(0.1 * fields['fs']), sig[:,0]) """

    comparitor = Comparitor(ref_sample=ref_sample, test_sample=test_sample,
                            window_width=window_width, signal=signal)
    comparitor.compare()

    return comparitor