class InspectorReport:
    def __init__(self, func_name, exec_time, memory_used, peak_memory, call_count, exception, result):
        self.func_name = func_name
        self.exec_time = exec_time
        self.memory_used = memory_used
        self.peak_memory = peak_memory
        self.call_count = call_count
        self.exception = exception
        self.result = result

    def __str__(self):
        lines = [
            f"Function: {self.func_name}",
            "-"*40,
            f"Execution Time  :  {self.exec_time:.6f} sec",
            f"Memory Used     :  {self.memory_used/1024:.2f} KB",
            f"Peak Memory     :  {self.peak_memory/1024:.2f} KB",
            f"Call Count      :  {self.call_count}",
            f"Exception       :  {self.exception if self.exception else 'None'}",
            "-"*40,
            f"Return Value    :  {self.result}"
        ]
        return "\n".join(lines)

    def __getitem__(self, key):
        mapping = {
            "function_name": self.func_name,
            "execution_time": self.exec_time,
            "memory_used": float(self.memory_used),
            "peak_memory": float(self.peak_memory),
            "call_count": self.call_count,
            "exception": self.exception,
            "return_value": self.result
        }
        return mapping[key]

    def keys(self):
        return [
            "function_name", "execution_time", "memory_used",
            "peak_memory", "call_count", "exception", "return_value"
        ]
