def METHOD_NAME(events, metadata):
    """
    ProtocolFocus event descriptions list the intended focus target. Some piezos have a target tolerance and log their
    landing position with PiezoOnTarget. PiezoOffsetUpdate events are also accounted for.
    Parameters
    ----------
    events: list or structured ndarray
        acquisition events
    metadata: PYME.IO.MetaDataHandler.MDHandlerBase
        metadata with 'Camera.CycleTime' and 'StartTime' entries
    Returns
    -------
    focus_mapping: PYME.Analysis.piecewiseMapping.piecewiseMap
        callable function to return focus positions for each input frame number
    """
    # FIXME - this is only used below in correct_target_positions - is it needed?
    normalized_events = spoof_focus_events_from_ontarget(events, metadata)
    return piecewise_mapping.GeneratePMFromEventList(normalized_events, metadata, metadata['StartTime'],
                                                              metadata.getOrDefault('Protocol.PiezoStartPos', 0.))