code: def _flatten_nested_keys(dictionary):
      """
      Flatten the nested values of a dictionary into tuple keys.
  
      E.g., {"a": {"b": [1], "c": [2]}} becomes {("a", "b"): [1], ("a", "c"): [2]}
      """
      # Find the parameters that are nested dictionaries
      nested_keys = {
          k for k, v in dictionary.items() if isinstance(v, dict)
      }
      # Flatten them into tuples
      flattened_nested_keys = {
          (nk, k): dictionary[nk][k]
          for nk in nested_keys
          for k in dictionary[nk]
      }
      # Get original dictionary without the nested keys
      dictionary_without_nested_keys = {
          k: v for k, v in dictionary.items() if k not in nested_keys
      }
      # Return merged dicts
      return {**dictionary_without_nested_keys, **flattened_nested_keys}
  
imports: import logging
  from collections.abc import Iterable
  from itertools import islice, product
  import numpy
  import pandas
  from tqdm import tqdm
  from ..evaluation import hits_at_n_score, mr_score, mrr_score
label_desc: Use image node_id 3 for calling a global function with example usage: _flatten_nested_keys(dictionary) and returns: dict