code: def embedding_bag_configs_from_feature_configs(
      configs: List[rlt.ModelFeatureConfig],
  ) -> List[EmbeddingBagConfig]:
      """
      Obtain a list of EmbeddingBagConfigs from multiple ModelFeatureConfigs.
      The returned list will be used for defining sparse model architectures
      """
      merged_id_mapping_config: Dict[str, rlt.IdMappingConfig] = {}
      for config in configs:
          for (
              id_mapping_name,
              id_mapping_config,
          ) in config.id_mapping_config.items():
              if id_mapping_name in merged_id_mapping_config:
                  assert (
                      merged_id_mapping_config[id_mapping_name]
                      == id_mapping_config
                  ), f"Conflicting IdMappingConfigs for id_mapping_name={id_mapping_name}"
              else:
                  merged_id_mapping_config[
                      id_mapping_name
                  ] = id_mapping_config
  
      id_mapping_to_feature_names = defaultdict(list)
      for config in configs:
          for id_list_feature_config in config.id_list_feature_configs:
              id_mapping_to_feature_names[
                  id_list_feature_config.id_mapping_name
              ].append(id_list_feature_config.name)
          for (
              id_score_list_feature_config
          ) in config.id_score_list_feature_configs:
              id_mapping_to_feature_names[
                  id_score_list_feature_config.id_mapping_name
              ].append(id_score_list_feature_config.name)
  
      embedding_bag_configs: List[EmbeddingBagConfig] = []
      for id_mapping_name, config in merged_id_mapping_config.items():
          embedding_bag_configs.append(
              EmbeddingBagConfig(
                  name=id_mapping_name,
                  feature_names=id_mapping_to_feature_names[
                      id_mapping_name
                  ],
                  num_embeddings=config.embedding_table_size,
                  embedding_dim=config.embedding_dim,
                  pooling=config.pooling_type,
              )
          )
      logger.info(
          f"Generate EmbeddingBagConfigs: {embedding_bag_configs}"
      )
      return embedding_bag_configs
  
file_path: ReAgent/reagent/core/utils.py
imports: import logging
  import pdb
  import sys
  from collections import defaultdict
  from typing import Dict, List
  import reagent.core.types
  import torch
  from torchrec import EmbeddingBagConfig
label_desc: Use image node_id 1 for calling a global function with example usage: embedding_bag_configs_from_feature_configs(configs) and returns: embedding_bag_configs