code: def get_dict_entry_by_value(x: dict, value_select_fn=max):
      """Get from dictionary the entry with value that returned from value_select_fn.
  
      Returns
      -------
      Tuple: key, value
      """
      if not x:
          return None, None
      value = value_select_fn(x.values())
      index = list(x.values()).index(value)
      return list(x.keys())[index], value
  
label_desc: Use image node_id 1 for calling a global function with example usage: get_dict_entry_by_value(x, value_select_fn) and returns: list,  value, None,  None