<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def analysis_output(self, location: Optional[str] = None) -> None: """Sets the location of the output from the static analysis tool. Parameters: location: str Filesystem location for the results. """

        try:
            if not location:
                location = self.prompt(
                    "Analysis results: ",
                    history_key="analysis_results",
                    completer=PathCompleter(),
                )
            self.current_analysis_output = AnalysisOutput.from_str(location)
        except AnalysisOutputError as e:
            raise UserError(f"Error loading results: {e}")