code: def _json_deserial_task_result(d: dict) -> Optional[TaskResult]:
      if not d:
          return None
      if "error" in d:
          d["error"] = deserialize_serializable(
              base64.b64decode(d["error"])
          )
          d["traceback"] = deserialize_serializable(
              base64.b64decode(d["traceback"])
          )
          load_traceback_code(d.pop("traceback_code"))
      d["status"] = TaskStatus(d["status"])
      return TaskResult(**d)
  
file_path: mars/mars/services/task/api/web.py
imports: import asyncio
  import base64
  import json
  from typing import Callable, List, Optional, Union
  from ....core import TileableGraph, Tileable
  from ....lib.tbcode import load_traceback_code, dump_traceback_code
  from ....utils import serialize_serializable, deserialize_serializable
  from ...web import web_api, MarsServiceWebAPIHandler, MarsWebAPIClientMixin
  from ..core import TaskResult, TaskStatus
  from .core import AbstractTaskAPI
label_desc: Use image node_id 2 for calling a global function with example usage: _json_deserial_task_result(d) and returns: TaskResult, None