def __init__(self, initial_state, workspace_url=None, policy='random', **kwargs):
        """

        :param initial_state: State to start from.
        :param workspace_url: workspace folder name
        :param policy: scheduling policy
        :param kwargs: other kwargs, e.g.
        """
        super().__init__()

        if isinstance(workspace_url, str):
            if ':' not in workspace_url:
                ws_path = f'fs:{workspace_url}'
            else:
                ws_path = workspace_url
        else:
            if workspace_url is not None:
                raise TypeError(f'Invalid workspace type: {type(workspace_url).__name__}')
            ws_path = None

        self._output = ManticoreOutput(ws_path)
        self._context = {}
        self._last_run_stats = {}

        # sugar for 'will_execute_instruction"
        self._hooks = {}
        self._executor = Executor(store=self._output.store, policy=policy)
        self._workers = []

        self.plugins = set()

        # Link Executor events to default callbacks in manticore object
        self.forward_events_from(self._executor)

        if not isinstance(initial_state, StateBase):
            raise TypeError(f'Invalid initial_state type: {type(initial_state).__name__}')

        self._initial_state = initial_state
        self._executor.forward_events_from(self._initial_state, True)

        # Move the following into a linux plugin
        self._assertions = {}
        self._coverage_file = None
        self.trace = None

        # FIXME move the following to a plugin
        self.subscribe('did_finish_run', self._did_finish_run_callback)
        self.subscribe('internal_generate_testcase', self._publish_generate_testcase)
def __init__ ( self , initial_state , workspace_url = None , policy = 'random' , ** kwargs ) : super ( ) . __init__ ( ) if isinstance ( workspace_url , str ) : if ':' not in workspace_url : ws_path = f'fs:{workspace_url}' else : ws_path = workspace_url else : if workspace_url is not None : raise TypeError ( f'Invalid workspace type: {type(workspace_url).__name__}' ) ws_path = None self . _output = ManticoreOutput ( ws_path ) self . _context = { } self . _last_run_stats = { } self . _hooks = { } self . _executor = Executor ( store = self . _output . store , policy = policy ) self . _workers = [ ] self . plugins = set ( ) self . forward_events_from ( self . _executor ) if not isinstance ( initial_state , StateBase ) : raise TypeError ( f'Invalid initial_state type: {type(initial_state).__name__}' ) self . _initial_state = initial_state self . _executor . forward_events_from ( self . _initial_state , True ) self . _assertions = { } self . _coverage_file = None self . trace = None self . subscribe ( 'did_finish_run' , self . _did_finish_run_callback ) self . subscribe ( 'internal_generate_testcase' , self . _publish_generate_testcase )
:param initial_state: State to start from.
        :param workspace_url: workspace folder name
        :param policy: scheduling policy
        :param kwargs: other kwargs, e.g.