code: def test_profiling_data():
      ProfilingData.init("abc")
      try:
          for n in ["general", "serialization"]:
              assert isinstance(
                  ProfilingData["abc", n], ProfilingDataOperator
              )
          assert ProfilingData["def"] is DummyOperator
          assert ProfilingData["abc", "def"] is DummyOperator
          assert ProfilingData["abc", "def", 1] is DummyOperator
          ProfilingData["def"].set("a", 1)
          ProfilingData["def"].inc("b", 1)
          assert ProfilingData["def"].empty()
          assert sum(ProfilingData["def"].nest("a").values()) == 0
          ProfilingData["abc", "serialization"].set("a", 1)
          ProfilingData["abc", "serialization"].inc("b", 1)
          with pytest.raises(TypeError):
              assert ProfilingData["abc", "serialization"].nest("a")
          assert (
              sum(
                  ProfilingData["abc", "serialization"]
                  .nest("c")
                  .values()
              )
              == 0
          )
          assert not ProfilingData["abc", "serialization"].empty()
      finally:
          v = ProfilingData.pop("abc")
          check_dict_structure_same(
              v,
              {
                  "general": {},
                  "serialization": {"a": 1, "b": 1, "c": {}},
                  "most_calls": {},
                  "slow_calls": {},
                  "band_subtasks": {},
                  "slow_subtasks": {},
              },
          )
  
file_path: mars/mars/oscar/tests/test_profiling.py
imports: import asyncio
  import dataclasses
  import os
  import pytest
  from ..profiling import ProfilingData, ProfilingDataOperator, DummyOperator, _ProfilingOptions, _CallStats, _SubtaskStats
  from ..backends.message import SendMessage
  from ...tests.core import check_dict_structure_same, mock
label_desc: Use image node_id 1 for calling a global function with example usage: test_profiling_data() without return types