code: def get_openai_callback() -> (
      Generator[OpenAICallbackHandler, None, None]
  ):
      """Get the OpenAI callback handler in a context manager.
      which conveniently exposes token and cost information.
  
      Yields:
          OpenAICallbackHandler: The OpenAI callback handler.
  
      Example:
          >>> with get_openai_callback() as cb:
          ...     # Use the OpenAI callback handler
      """
      cb = OpenAICallbackHandler()
      openai_callback_var.set(cb)
      yield cb
      openai_callback_var.set(None)
  
file_path: pandas-ai/pandasai/helpers/openai_info.py
imports: from contextlib import contextmanager
  from contextvars import ContextVar
  from typing import Optional, Generator
label_desc: Use image node_id 3 for calling a global function with example usage: get_openai_callback() without return types