code: def _convert_params(
      params: Union[Dict[str, Any], Namespace]
  ) -> Dict[str, Any]:
      # in case converting from namespace
      if isinstance(params, Namespace):
          params = vars(params)
  
      if params is None:
          params = {}
  
      return params
  
file_path: aim/aim/sdk/adapters/pytorch_lightning.py
imports: import os
  from typing import Any, Dict, Optional, Union
  from argparse import Namespace
  import packaging.version
  from aim.sdk.run import Run
  from aim.sdk.repo import Repo
  from aim.sdk.utils import clean_repo_path, get_aim_repo_name
  from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT
label_desc: Use image node_id 2 for calling the AimLogger obj's underlying member method code with example usage: obj._convert_params(params) and returns: params