def _get_frames(d, cross=False, mask=None):
    """gets two frames (or one frame and NoneType) from dual (or single) frame data"""
    if cross == True:
        x1, x2 = d
        if mask is not None:
            x1, x2 = x1[mask], x2[mask]
    else:
        if len(d) == 1 and isinstance(d, tuple):
            x1, = d
        else:
            x1 = d
        if mask is not None:
            x1 = x1[mask]
        x2 = None
    return x1, x2
