def process_regular_2d_scalars(*args, **kwargs):
    """ Converts different signatures to (x, y, s). """
    args = convert_to_arrays(args)
    for index, arg in enumerate(args):
        if not callable(arg):
            args[index] = np.atleast_2d(arg)
    if len(args) == 1:
        s = args[0]
        assert len(s.shape) == 2, "2D array required"
        x, y = np.indices(s.shape)
    elif len(args) == 3:
        x, y, s = args
        if callable(s):
            s = s(x, y)
    else:
        raise ValueError("wrong number of arguments")
    assert len(s.shape) == 2, "2D array required"

    if kwargs in 'mask':
        mask = kwargs['mask']
        s[mask.astype('bool')] = np.nan
        # The NaN tric only works with floats.
        s = s.astype('float')

    return x, y, s


############################################################################
# Sources
############################################################################
dataset/ETHPy150Open enthought/mayavi/mayavi/tools/sources.py/process_regular_2d_scalars/swapped operands of `in`