def addMapping(self, key, value, comment, setting=False):
        """
        Add a key-value mapping with a comment.

        @param key: The key for the mapping.
        @type key: str
        @param value: The value for the mapping.
        @type value: any
        @param comment: The comment for the key (can be None).
        @type comment: str
        @param setting: If True, ignore clashes. This is set
        to true when called from L{__setattr__}.
        @raise ConfigFormatError: If an existing key is seen
        again and setting is False.
        """
        data = object.__getattribute__(self, 'data')
        order = object.__getattribute__(self, 'order')
        comments = object.__getattribute__(self, 'comments')

        data[key] = value
        if key not in order:
            order.append(key)
        elif not setting:
            raise ConfigFormatError("repeated key: %s" % key)
        comments[key] = comment
dataset/ETHPy150Open twitterdev/twitter-for-bigquery/libs/config.py/Mapping.addMapping/original