class_docstr: Base Profiler class to be inherited for custom profiler.
docstr: Override this function for your custom profiler.
  
  Example:
      try:
          self.start(model_name)
          yield model_name
      finally:
          self.end(model_name)
  Usage:
      with self.profile('do something'):
          # do something
docstr_tok: ["Override","this","function","for","your","custom","profiler",".","Example",":","try",":","self.start","(","model_name",")","yield","model_name","finally",":","self.end","(","model_name",")","Usage",":","with","self.profile","(","'do","something","'",")",":","#","do","something"]
code: def profile(self, *args, **kwargs) -> Generator:  # type: ignore
      """Override this function for your custom profiler.
  
      Example:
          try:
              self.start(model_name)
              yield model_name
          finally:
              self.end(model_name)
      Usage:
          with self.profile('do something'):
              # do something
      """
      raise NotImplementedError
  
file_path: modelkit/modelkit/core/profilers/base.py
imports: import typing
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from typing import Dict, Generator, Set
  from modelkit.core.model import AsyncModel, Model, WrappedAsyncModel
label_desc: Use image node_id 5 for calling the BaseProfiler obj's underlying member method code with example usage: obj.profile() without return types