code: def __init__(
      self,
      app: ASGIApp,
      *,
      server_app: Optional[Router] = None,
      profiler_interval: float = 0.0001,
      repo_path=None,
      **profiler_kwargs,
  ):
      try:
          from pyinstrument import Profiler, __version__
  
          if tuple(map(int, __version__.split("."))) < (3,):
              raise ImportError
      except ImportError:
          raise RuntimeError(
              "This contrib module requires 'pyinstrument' to be installed. "
              "Please install it with command: \n pip install 'pyinstrument>=3.0.0'"
          )
  
      self.profiler = Profiler
      self.app = app
  
      self._server_app = server_app
      self._profiler_kwargs: dict = profiler_kwargs
  
      self._profiler_interval = profiler_interval
      self._profiler_timestamp = str(time.time())
      self._profiler_log_path = os.path.join(
          repo_path, "profiler", self._profiler_timestamp
      )
      os.makedirs(self._profiler_log_path, exist_ok=True)
  
file_path: aim/aim/web/middlewares/profiler/profiler.py
imports: import json
  import os.path
  import time
  from typing import Optional
  from logging import getLogger
  from starlette.routing import Router
  from starlette.requests import Request
  from starlette.types import ASGIApp, Message, Receive, Scope, Send
label_desc: Use image node_id 1 to create a new PyInstrumentProfilerMiddleware object  with example: obj = PyInstrumentProfilerMiddleware(app)