def _analysis_m2m_comply(m2m, m_comply):
    """ Removes m2m records in which one of the sides is on the board
    Parameters
    ----------
    m2m : Member to member
    m_comply : Compliance table (for each timeslice, whether the badge was worn or not)

    Returns
    -------
    pd.DataFrame :
        m2m when no side is on the board.
    """
    # add on_board indicator
    df = m2m.copy().reset_index()
    df = df.join(m_comply, on=['datetime', 'member1']).rename(columns={'comply': 'comply1'})
    df = df.set_index("datetime").reset_index()  # I don't know why, but if you don't this this it acts funny
    df = df.join(m_comply, on=['datetime', 'member2']).rename(columns={'comply': 'comply2'})

    # filter
    df = df[(df.comply1 == True) & (df.comply2 == True)]
    df.dropna(inplace=True)

    # cleanup
    df.drop('comply1', axis=1, inplace=True)
    df.drop('comply2', axis=1, inplace=True)
    df = df.reset_index().set_index(['datetime', 'member1', 'member2'])
    df.sort_index(inplace=True)
    return df