<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def re_thresh_csv(path, old_thresh, new_thresh, chan_thresh):
 """ Remove detections by changing the threshold. Can only be done to remove detection by increasing threshold, threshold lowering will have no effect. :type path: str :param path: Path to the .csv detection file :type old_thresh: float :param old_thresh: Old threshold MAD multiplier :type new_thresh: float :param new_thresh: New threshold MAD multiplier :type chan_thresh: int :param chan_thresh: Minimum number of channels for a detection :returns: List of detections :rtype: list .. rubric:: Example Read in 22 detections Left with 17 detections .. Note:: This is a legacy function, and will read detections from all versions. .. Warning:: Only works if thresholding was done by MAD. """

    from eqcorrscan.core.match_filter import read_detections
    warnings.warn('Legacy function, please use '
                  'eqcorrscan.core.match_filter.Party.rethreshold.')
    old_detections = read_detections(path)
    old_thresh = float(old_thresh)
    new_thresh = float(new_thresh)
    # Be nice, ensure that the thresholds are float
    detections = []
    detections_in = 0
    detections_out = 0
    for detection in old_detections:
        detections_in += 1
        con1 = (new_thresh / old_thresh) * detection.threshold
        con2 = detection.no_chans >= chan_thresh
        requirted_thresh = (new_thresh / old_thresh) * detection.threshold
        con3 = abs(detection.detect_val) >= requirted_thresh
        if all([con1, con2, con3]):
            detections_out += 1
            detections.append(detection)
    print('Read in %i detections' % detections_in)
    print('Left with %i detections' % detections_out)
    return detections