def find_cond_by_cond(conditions, cond_target, cond_given):
    """Find the set of target conditions given other conditions.

    Args:
        conditions: A list of tuples of sample conditions.
            E.g.,
            [(16, 'LD', 1, 'I1'), (16, 'SD', 2, 'I2'),
             (16, 'SD', 1, 'I1'), (16, 'Sh', 2, 'I1')]
        cond_target: A list of integers indicating the 0-based
            indices of the target conditions.
            E.g., [1].
        cond_given: A list of integers indicating the 0-based
            indices of the given conditions.
            E.g., [2, 3].

    Returns:
        A dictionary with tuples of given conditions as the keys
        and list of tuples of the target conditions as the values.
    """
    cond_dict = {}
    for cond in conditions:
        target = tuple(cond[i] for i in cond_target)
        given = tuple(cond[i] for i in cond_given)
        if given not in cond_dict:
            cond_dict[given] = [target]
        else:
            if target not in cond_dict[given]:
                cond_dict[given].append(target)
    return cond_dict