def get_min_max(mydata, min_max, mini, maxi, acc):
    """Find minimum and maximum indeces.

    Parameters
    ----------
    mydata : list
        List of cycle numbers to be checked for index of given min/max
    min_max : list
        List of min/max values to search for
    mini : dict
        Dictionary of found min cycle number of lists acc/rej
    maxi : dict
        Dictionary of found max cycle number of lists acc/rej
    acc : string
        'a' or 'r' for acc/rej lists, respectively

    Returns/updates
    ---------------
    mini, maxi : dict
        Stores values for min/max in acc and rej lists to the correct dicts.

    """
    for i, item in enumerate(mydata):
        if item == min_max[0]:
            mini[acc] = i
            break
        elif item > min_max[0]:
            mini[acc] = i - 1 if i > 0 else 0
            break
    for i, item in enumerate(mydata[mini[acc]:]):
        if item > min_max[1]:
            if i == 0:
                maxi[acc] = 0
                break
            else:
                maxi[acc] = mini[acc] + i - 1
                break
        elif i == len(mydata) - 1:
            maxi[acc] = len(mydata) - 1
