def _include_meta_events_within_range(events, st, ed, shift=True, front=True):
    """
    For time, key signatutr
    """
    proc_events = []
    num = len(events)
    if not events:
        return events
    i = num - 1
    while i >= 0:
        event = events[i]
        if event.time < st:
            break
        if event.time < ed:
            proc_events.append(event)
        i -= 1
    if front and i >= 0:
        if not proc_events:
            proc_events = [events[i]]
        elif proc_events[-1].time != st:
            proc_events.append(events[i])
        else:
            pass
    proc_events = proc_events[::-1]
    result = []
    shift = st if shift else 0
    for event in proc_events:
        event.time -= st
        event.time = int(max(event.time, 0))
        result.append(event)
    return proc_events
