code: def test_np_sanitization():
      class CustomParamsLogger(CustomLogger):
          def __init__(self):
              super().__init__()
              self.logged_params = None
  
          @rank_zero_only
          def log_hyperparams(self, params):
              params = _convert_params(params)
              params = _sanitize_params(params)
              self.logged_params = params
  
      logger = CustomParamsLogger()
      np_params = {
          "np.bool_": np.bool_(1),
          "np.byte": np.byte(2),
          "np.intc": np.intc(3),
          "np.int_": np.int_(4),
          "np.longlong": np.longlong(5),
          "np.single": np.single(6.0),
          "np.double": np.double(8.9),
          "np.csingle": np.csingle(7 + 2j),
          "np.cdouble": np.cdouble(9 + 4j),
      }
      sanitized_params = {
          "np.bool_": True,
          "np.byte": 2,
          "np.intc": 3,
          "np.int_": 4,
          "np.longlong": 5,
          "np.single": 6.0,
          "np.double": 8.9,
          "np.csingle": "(7+2j)",
          "np.cdouble": "(9+4j)",
      }
      logger.log_hyperparams(Namespace(**np_params))
      assert logger.logged_params == sanitized_params
  
imports: import pickle
  from argparse import Namespace
  from copy import deepcopy
  from typing import Any, Dict, Optional
  from unittest.mock import patch
  import numpy
  import pytest
  import torch
  from lightning.fabric.utilities.logger import _convert_params, _sanitize_params
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel
  from lightning.pytorch.loggers import Logger, TensorBoardLogger
  from lightning.pytorch.loggers.logger import DummyExperiment, DummyLogger
  from lightning.pytorch.loggers.utilities import _scan_checkpoints
  from lightning.pytorch.utilities.rank_zero import rank_zero_only
label_desc: Use image node_id 8 for calling a global function with example usage: test_np_sanitization() without return types