def __getstate__(self):
    state = self.__dict__.copy()
    del state['environment']
    return state
def __getstate__(self):
    state = self.__dict__.copy()
    del state['environment']
    return state