def group_relative_focus(group, mode, rl):
    """Measure the relative focus of a group with respect to an execution
    mode.

    Parameters
    ----------
    group : iterator
        Id of resources as a resource group.
    mode : 3-tuple
        An execution mode.
    rl : DataFrame
        A resource log.

    Returns
    -------
    float
        The measured relative focus.
    """
    rl = rl.loc[rl['resource'].isin(group)]
    grouped_by_modes = rl.groupby(['case_type', 'activity_type', 'time_type'])
    if mode in grouped_by_modes.groups:
        return len(grouped_by_modes.get_group(mode)) / len(rl)
    else:
        return 0.0
