code: def group_definitions_by_id(
      definitions: Dict[str, Dict],
  ) -> Dict[str, Tuple[str, Dict]]:
      """
      Format ID and extracts plot_definition for each plot.
  
      Arguments:
          definitions: dict of {config_file: config_file_content}.
  
      Returns:
          Dict of {plot_id: (original_plot_id, plot_definition)}.
      """
      groups_by_config: Dict = defaultdict(dict)
      groups_by_id: Dict = {}
      for config_file, config_file_content in definitions.items():
          for plot_id, plot_definition in config_file_content.get(
              "data", {}
          ).items():
              groups_by_config[plot_id][config_file] = (
                  plot_id,
                  plot_definition,
              )
      # only keep config_file if the same plot_id is in multiple config_files
      for plot_id, configs in groups_by_config.items():
          if len(configs) == 1:
              groups_by_id[plot_id] = next(iter(configs.values()))
          else:
              for config_file, content in configs.items():
                  full_id = get_plot_id(plot_id, config_file)
                  groups_by_id[full_id] = content
      return groups_by_id
  
label_desc: Use image node_id 2 for calling a global function with example usage: group_definitions_by_id(definitions) and returns: groups_by_id