def find_balancing_cutoff_index(data, trials):
    """find the length of the shortest trial to balance the other experimental trials accordingly
    
    Parameters
    ----------
    data : dictionary
        data dictionary consisting of trials from each subject
    trials : list
        list of experimental trials provided in config.yml
    
    Returns
    -------
    min_ind : int
        length of the shortest trial across the trials
    """

    ind_list = [data[trial]['labels'].shape[0] for trial in trials]
    min_ind = min(ind_list)

    # making the index odd i.e length of vector even for balancing the data in the next step  
    if (min_ind % 2) == 0:
        min_ind -= 1

    return min_ind