def _get_clip_indices(utt_start, utt_end, batch_start, batch_end):
    """ Cuts the parts of the utterance that do not fit into the batch window.

    Arguments:
        utt_start {int} -- start point of the utterance
        utt_end {int} -- end point of the utterance
        batch_start {int} -- start point of the batch window
        batch_end {int} -- end point of the batch window

    Returns:
        (int, int), bool -- a tuple containing clipped start and end point of an utterance, the boolean flag is True if the end of the utterance is inside the batch window.
    """
    if utt_end <= batch_start:
        return None
    if utt_start >= batch_end:
        return None
    start = 0
    end = utt_end - utt_start
    if utt_start < batch_start:
        start = batch_start - utt_start
    if utt_end > batch_end:
        end = batch_end - utt_start
    ends = utt_end <= batch_end
    return (start, end), ends