def muninMain(pluginClass, argv=None, env=None, debug=False):
if argv is None:<EOL><INDENT>argv = sys.argv<EOL><DEDENT>if env is None:<EOL><INDENT>env = os.environ<EOL><DEDENT>debug = debug or '<STR_LIT>' in env<EOL>if len(argv) > <NUM_LIT:1> and argv[<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>autoconf = True<EOL><DEDENT>else:<EOL><INDENT>autoconf = False<EOL><DEDENT>try:<EOL><INDENT>plugin = pluginClass(argv, env, debug)<EOL>ret = plugin.run()<EOL>if ret:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT><DEDENT>except Exception:<EOL><INDENT>print("<STR_LIT>" % repr(sys.exc_info()[<NUM_LIT:1>]), file=sys.stderr)<EOL>if autoconf:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>if debug:<EOL><INDENT>raise<EOL><DEDENT>else:<EOL><INDENT>if autoconf:<EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>
Main Block for Munin Plugins.

    @param pluginClass: Child class of MuninPlugin that implements plugin.
    @param argv:        List of command line arguments to Munin Plugin.
    @param env:         Dictionary of environment variables passed to Munin Plugin.
    @param debug:       Print debugging messages if True. (Default: False)