docstr: Test results from profiling contexts with the same name accumulate correctly.
docstr_tok: ["Test","results","from","profiling","contexts","with","the","same","name","accumulate","correctly","."]
code: def test_profile_context(self):
      """Test results from profiling contexts with the same name accumulate correctly."""
      with WorkflowProfiler() as wp:
          with wp.profile_ctx("context"):
              self.scale(self.test_image)
  
          with wp.profile_ctx("context"):
              self.scale(self.test_image)
  
      results = wp.get_results()
      self.assertSequenceEqual(
          set(results), {"ScaleIntensity.__call__", "context"}
      )
  
      prs = results["context"]
  
      self.assertEqual(len(prs), 2)
  
imports: from __future__ import annotations
  import datetime
  import os
  import unittest
  from io import StringIO
  import torch
  import monai.transforms
  from monai.data import Dataset, ThreadDataLoader
  from monai.utils import first, optional_import
  from monai.utils.enums import CommonKeys
  from monai.utils.profiling import ProfileHandler, ProfileResult, WorkflowProfiler
  from tests.utils import SkipIfNoModule
label_desc: Use image node_id 5 for calling the TestWorkflowProfiler obj's underlying member method code with example usage: obj.test_profile_context() without return types