def __init__(self, command=None, active_mode=False, dummy_mode=False, **kwargs):
        """'command' is the full command-line necessary to run VW.  E.g.
        vw --loss_function logistic -p /dev/stdout --quiet
        -p /dev/stdout --quiet is mandatory for compatibility,
        and certain options like 
            --save_resume
        are suggested, while some options make no sense in this context:
            -d
            --passes
        wabbit_wappa.py does not support any mode that turns off piping to
        stdin or stdout

        active_mode: Launch VW in port-listening active learning mode, controlled via
            a simulated subprocess.
        dummy_mode: Don't actually start any VW process.  (Used for assembling
            VW command lines separately.)

        If no command is given, any additional keyword arguments are passed to
            make_command_line() and the resulting command is used.  (This provides
            sensible defaults.)
        """
        if command is None:
            if active_mode:
                active_settings = active_learner.get_active_default_settings()
                # Overwrite active settings with kwargs
                active_settings.update(kwargs)
                kwargs = active_settings
                port = kwargs.get('port')
            command = make_command_line(**kwargs)
        self.active_mode = active_mode
        self.dummy_mode = dummy_mode
        if dummy_mode:
            self.vw_process = None
        else:
            if active_mode:
                self.vw_process = active_learner.ActiveVWProcess(command, port=port)
            else:
                self.vw_process = pexpect.spawn(command)
                # Turn off delaybeforesend; this is necessary only in non-applicable cases
                self.vw_process.delaybeforesend = 0
                self.vw_process.setecho(False)
        logging.info("Started VW({})".format(command))
        self.command = command
        self.namespaces = []
        self._line = None
def __init__ ( self , command = None , active_mode = False , dummy_mode = False , ** kwargs ) : if command is None : if active_mode : active_settings = active_learner . get_active_default_settings ( ) active_settings . update ( kwargs ) kwargs = active_settings port = kwargs . get ( 'port' ) command = make_command_line ( ** kwargs ) self . active_mode = active_mode self . dummy_mode = dummy_mode if dummy_mode : self . vw_process = None else : if active_mode : self . vw_process = active_learner . ActiveVWProcess ( command , port = port ) else : self . vw_process = pexpect . spawn ( command ) self . vw_process . delaybeforesend = 0 self . vw_process . setecho ( False ) logging . info ( "Started VW({})" . format ( command ) ) self . command = command self . namespaces = [ ] self . _line = None
command' is the full command-line necessary to run VW.  E.g.
        vw --loss_function logistic -p /dev/stdout --quiet
        -p /dev/stdout --quiet is mandatory for compatibility,
        and certain options like 
            --save_resume
        are suggested, while some options make no sense in this context:
            -d
            --passes
        wabbit_wappa.py does not support any mode that turns off piping to
        stdin or stdout

        active_mode: Launch VW in port-listening active learning mode, controlled via
            a simulated subprocess.
        dummy_mode: Don't actually start any VW process.  (Used for assembling
            VW command lines separately.)

        If no command is given, any additional keyword arguments are passed to
            make_command_line() and the resulting command is used.  (This provides
            sensible defaults.)