class_docstr: If you wish to write a custom profiler, you should inherit from this class.
docstr: Yields a context manager to encapsulate the scope of a profiled action.
  
  Example::
  
      with self.profile('load training data'):
          # load training data code
  
  The profiler will start once you've entered the context and will automatically
  stop once you exit the code block.
docstr_tok: ["Yields","a","context","manager","to","encapsulate","the","scope","of","a","profiled","action",".","Example",":",":","with","self.profile","(","'load","training","data","'",")",":","#","load","training","data","code","The","profiler","will","start","once","you","'ve","entered","the","context","and","will","automatically","stop","once","you","exit","the","code","block","."]
code: def profile(self, action_name: str) -> Generator:
      """Yields a context manager to encapsulate the scope of a profiled action.
  
      Example::
  
          with self.profile('load training data'):
              # load training data code
  
      The profiler will start once you've entered the context and will automatically
      stop once you exit the code block.
  
      """
      try:
          self.start(action_name)
          yield action_name
      finally:
          self.stop(action_name)
  
imports: import logging
  import os
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Any, Callable, Dict, Generator, Optional, TextIO, Union
  from lightning.fabric.utilities.cloud_io import get_filesystem
label_desc: Use image node_id 5 for calling the Profiler obj's underlying member method code with example usage: obj.profile(action_name) without return types