def unloadAllPlugins(skipErrors=False, exclude=('DirectConnect',)):
    import logging
    logger = logging.getLogger('pymel')
    
    logger.debug("unloading all plugins...")
    loadedPlugins = maya.cmds.pluginInfo(q=True, listPlugins=True)
    # loadedPlugins may be None
    if loadedPlugins:
        # could just unload all plugins at once with:
        # maya.cmds.unloadPlugin(force=True, *loadedPlugins)
        # ...but if we do one at a time, we can at least get debugging info
        # on which one crashed...
        for plug in loadedPlugins:
            if plug in exclude:
                continue
            logger.debug("...unloading: %s" % plug)
            try:
                maya.cmds.unloadPlugin(plug, force=True)
            except Exception:
                if skipErrors:
                    import traceback
                    logger.warning(plug % "Error unloading plugin %s:")
                    logger.warning(traceback.format_exc())
                else:
                    raise
    logger.debug("...done unloading all plugins")

# It's not possible to query all plugin commands that a plugin registers with
# pluginInfo, so this holds a list of plugin commands that we still want to
# wrap.
# With 2012, we can now query modelEditor, constraint, and control commands.
# Unfortunately, we still can't get context commands... so UNREPORTED_COMMANDS
# is still necessary
# We sort by type of command, so that if pluginInfo does have the necessary
# flag for reporting, we can just use that.
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/maya/site-packages/pymel-1.0.3/pymel/api/plugins.py/unloadAllPlugins/swapped operands of `%`