code: def dict_raise_error_on_duplicate_keys(ordered_pairs):
      """Reject duplicate keys."""
      d = dict((k, v) for k, v in ordered_pairs)
      if len(d) != len(ordered_pairs):
          counter = collections.Counter(
              [pair[0] for pair in ordered_pairs]
          )
          keys = [key for key, value in counter.items() if value > 1]
          raise ValueError(
              "Duplicate keys in DeepSpeed config: {}".format(keys)
          )
      return d
  
imports: import json
  import collections
  import collections.abc
  from functools import reduce
  from pydantic import BaseModel
  from deepspeed.utils import logger
label_desc: Use image node_id 4 for calling a global function with example usage: dict_raise_error_on_duplicate_keys(ordered_pairs) and returns: d