code: def _sanitize_callable_params(
      params: Dict[str, Any]
  ) -> Dict[str, Any]:
      """Sanitize callable params dict, e.g. ``{'a': <function_**** at 0x****>} -> {'a': 'function_****'}``.
  
      Args:
          params: Dictionary containing the hyperparameters
  
      Returns:
          dictionary with all callables sanitized
  
      """
  
      def _sanitize_callable(val: Any) -> Any:
          # Give them one chance to return a value. Don't go rabbit hole of recursive call
          if callable(val):
              try:
                  _val = val()
                  if callable(_val):
                      return val.__name__
                  return _val
              # todo: specify the possible exception
              except Exception:
                  return getattr(val, "__name__", None)
          return val
  
      return {
          key: _sanitize_callable(val) for key, val in params.items()
      }
  
file_path: pytorch-lightning/src/lightning/fabric/utilities/logger.py
imports: from argparse import Namespace
  from dataclasses import asdict, is_dataclass
  from typing import Any, Dict, Mapping, MutableMapping, Optional, Union
  import numpy
  from torch import Tensor
label_desc: Use image node_id 2 for calling a global function with example usage: _sanitize_callable_params(params) and returns: unknown, val, _val, val, getattr