def METHOD_NAME(shots_discr, idx_qubit_ro, correlations, num_segments):
    """
    """
    correlations_idx = [
        [idx_qubit_ro.index(c[0]), idx_qubit_ro.index(c[1])] for c in correlations]
    correl_discr = np.zeros((shots_discr.shape[0], len(correlations_idx)))
    correl_avg = np.zeros((num_segments, len(correlations_idx)))
    for i, c in enumerate(correlations_idx):
        correl_discr[:, i] = shots_discr[:, c[0]]*shots_discr[:, c[1]]
        correl_avg[:, i] = [
            np.mean(correl_discr[i_seg::num_segments, i]) for i_seg in range(num_segments)]
    return correl_discr, correl_avg