code: def safe_merge_config(
      config: DictConfig, inferred_config: DictConfig
  ) -> DictConfig:
      """Merge two configurations.
  
      Args:
          config: The base configuration.
          inferred_config: The custom configuration.
  
      Returns:
          The merged configuration.
      """
      # using base config values if exist
      inferred_config.embedding_dims = (
          config.get("embedding_dims") or inferred_config.embedding_dims
      )
      merged_config = OmegaConf.merge(
          OmegaConf.to_container(config),
          OmegaConf.to_container(inferred_config),
      )
      return merged_config
  
imports: import importlib
  import warnings
  from abc import ABCMeta, abstractmethod
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
  import numpy
  import pytorch_lightning
  import torch
  import torch.nn
  import torchmetrics
  from omegaconf import DictConfig, OmegaConf
  from pandas import DataFrame
  from torch import Tensor
  from torch.optim import Optimizer
  from pytorch_tabular.models.common.heads import blocks
  from pytorch_tabular.models.common.layers import PreEncoded1dLayer
  from pytorch_tabular.utils import get_logger, reset_all_weights
label_desc: Use image node_id 1 for calling a global function with example usage: safe_merge_config(config, inferred_config) and returns: merged_config