def run_wf(wf, plugin='MultiProc', n_cpus=2, **plugin_kwargs):
    """ Execute `wf` with `plugin`.

    Parameters
    ----------
    wf: nipype Workflow

    plugin: str
        The pipeline execution plugin.
        See wf.run docstring for choices.

    n_cpus: int
        Number of CPUs to use with the 'MultiProc' plugin.

    plugin_kwargs: keyword argumens
        Keyword arguments for the plugin if using something different
        then 'MultiProc'.
    """
    if plugin == 'MultiProc' or n_cpus > 1:
        wf.run('MultiProc', plugin_args={'n_procs': n_cpus})
    elif not plugin or plugin is None or n_cpus <= 1:
        wf.run(plugin=None)
    else:
        wf.run(plugin=plugin, **plugin_kwargs)
