code: def map_constructor(self, loader,  node, deep=False):
          
          mapping = {}
          for key_node, value_node in node.value:
              key = loader.construct_object(key_node, deep=deep)
              value = loader.construct_object(value_node, deep=deep)
              if key in mapping:
                  raise ValueError(f"Duplicate key: \"{key}\"")
              mapping[key] = value
  
          return mapping
docs: Walk the mapping, recording any duplicate keys.