class CaseInsensitiveDict(dict):
    def __init__(self, data=None):
        super().__init__()
        if data is None:
            data = dict()
        for key, value in data.items():
            self[key] = value

    @staticmethod
    def _lower_key(key):
        if not isinstance(key, str):
            key = str(key)
        return key.lower()

    def get(self, key, default=None):
        key = self._lower_key(key)
        return super().get(key, default)

    def __setitem__(self, key, value):
        super().__setitem__(self._lower_key(key), value)

    def __getitem__(self, key):
        return super().__getitem__(self._lower_key(key))

    def __contains__(self, key):
        return super().__contains__(self._lower_key(key))
