def mac(dic, data, macro=None, noRd=False, noWr=False, all=False, **kwargs):
    """
    Dispatcher similar to the MAC command.

    Parameters
    ----------
    dic : dict
        Dictionary of NMRPipe parameters
    data : ndarray
        Array of NMR data.
    macro : callable
        Python function to apply.
    kwargs : keyword arguments
        Keyword arguments that get passed to the macro

    Returns
    -------
    ndic : dict
        Dictionary of updated NMRPipe parameters.
    ndata : ndarray
        Array of data with macro function applied.

    Notes
    -----
    This is not intended to be a true macro interpreter.  Instead, the purpose
    is to act as a dispatch mechanism to other Python code so that the
    look and feel of nmrPipe is maintained.  The -var and -str parameters
    are not used, as they can be passed directly to the macro as keyword
    arguements.
    """
    if macro is None:
        return dic, data
    if noRd and noWr:
        return macro(dic, data, **kwargs)
    raise NotImplementedError('Only noRd and noWr macros work for now.')
