code: def test_sanitize_callable_params():
      """Callback function are not serializiable.
  
      Therefore, we get them a chance to return something and if the returned type is not accepted, return None.
  
      """
  
      def return_something():
          return "something"
  
      def wrapper_something():
          return return_something
  
      params = Namespace(
          foo="bar",
          something=return_something,
          wrapper_something_wo_name=(lambda: lambda: "1"),
          wrapper_something=wrapper_something,
      )
  
      params = _convert_params(params)
      params = _flatten_dict(params)
      params = _sanitize_callable_params(params)
      assert params["foo"] == "bar"
      assert params["something"] == "something"
      assert params["wrapper_something"] == "wrapper_something"
      assert params["wrapper_something_wo_name"] == "<lambda>"
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_logger.py
imports: from argparse import Namespace
  from dataclasses import dataclass
  import numpy
  import torch
  from lightning.fabric.utilities.logger import _add_prefix, _convert_params, _flatten_dict, _sanitize_callable_params, _sanitize_params
label_desc: Use image node_id 3 for calling a global function with example usage: test_sanitize_callable_params() and returns: str, return_something