@utils.check_messages('duplicate-key')
def visit_dict(self, node):
    'check duplicate key in dictionary'
    keys = set()
    for (k, _) in node.items:
        if isinstance(k, astroid.Const):
            key = k.value
            if (key in keys):
                self.add_message('duplicate-key', node=node, args=key)
            keys.add(key)
check duplicate key in dictionary
@utils.check_messages('duplicate-key')
def visit_dict(self, node):
    
    keys = set()
    for (k, _) in node.items:
        if isinstance(k, astroid.Const):
            key = k.value
            if (key in keys):
                self.add_message('duplicate-key', node=node, args=key)
            keys.add(key)