def replace(self, **kwargs):
        other = copy.copy(self)
        for key, value in kwargs.items():
            if not self._is_valid_field(key):
                raise TypeError(
                    'replace() got an unexpected keyword argument "%s"' % key)
            other._set_field(key, value)
        return other
Checks for slug collisions on children of a non root page - uses API to create pages
dataset/ETHPy150Open mopidy/mopidy/mopidy/models/immutable.py/ImmutableObject.replace--crossover with--dataset/ETHPy150Open divio/django-cms/cms/tests/test_page.py/PagesTestCase.test_slug_collisions_api_3