def __setattr__(self, key, value):
        if '_ElasticSearchModel__initialised' not in list(self.__dict__.keys()):  # this test allows attributes to be set in the __init__ method
            return dict.__setattr__(self, key, value)
        elif key in list(self.__dict__.keys()):       # any normal attributes are handled normally
            dict.__setattr__(self, key, value)
        else:
            self.__setitem__(key, value)
dataset/ETHPy150Open aparo/pyes/pyes/models.py/ElasticSearchModel.__setattr__/original