def _get_output_values(self, exit_code, stdout, stderr, timed_out):
        """
        Return sanitized output values.

        :return: Tuple with status, output and None

        :rtype: ``tuple``
        """
        if timed_out:
            error = "Action failed to complete in %s seconds" % (self._timeout)
        else:
            error = None

        if exit_code == PYTHON_RUNNER_INVALID_ACTION_STATUS_EXIT_CODE:
            # TODO: Mark as failed instead
            raise ValueError(stderr)

        if ACTION_OUTPUT_RESULT_DELIMITER in stdout:
            split = stdout.split(ACTION_OUTPUT_RESULT_DELIMITER)
            if len(split) != 3:
                raise ValueError(f"The result length should be 3, was {len(split)}.")
            action_result = split[1].strip()
            stdout = split[0] + split[2]
        else:
            # Timeout or similar
            action_result = None

        # Parse the serialized action result object (if available)
        if action_result:
            try:
                action_result = json_decode(action_result)
            except Exception as e:
                # Failed to de-serialize the result, probably it contains non-simple type or similar
                LOG.warning(
                    'Failed to de-serialize result "%s": %s'
                    % (str(action_result), six.text_type(e))
                )

        if action_result:
            if isinstance(action_result, dict):
                result = action_result.get("result", None)
                status = action_result.get("status", None)
            else:
                # Failed to de-serialize action result aka result is a string
                match = re.search("'result': (.*?)$", action_result or "")

                if match:
                    action_result = match.groups()[0]

                result = action_result
                status = None
        else:
            result = "None"
            status = None

        output = {
            "stdout": stdout,
            "stderr": stderr,
            "exit_code": exit_code,
            "result": result,
        }

        if error:
            output["error"] = error

        status = self._get_final_status(
            action_status=status, timed_out=timed_out, exit_code=exit_code
        )
        return (status, output, None)

        Return sanitized output values.

        :return: Tuple with status, output and None

        :rtype: ``tuple``
        
contrib/runners/python_runner/python_runner/python_runner.py