class_docstr: Base Profiler class to be inherited for custom profiler.
docstr: setattr 'profiler' to all sub-models via "model_dependencies" recursively
docstr_tok: ["setattr","'profiler","'","to","all","sub-models","via","``","model_dependencies","''","recursively"]
code: def _build(
      self, model: typing.Union[Model, AsyncModel, WrappedAsyncModel]
  ):
      """setattr 'profiler' to all sub-models via "model_dependencies" recursively"""
      model.profiler = self  # type: ignore
      if isinstance(model, WrappedAsyncModel):
          # let's work on the wrapped model instead of the wrapper
          model = model.async_model
      for model_dependency in model.model_dependencies.values():
          self._build(model_dependency)
  
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 6 for calling the BaseProfiler obj's underlying member method code with example usage: obj._build(model) without return types