<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def set_world(self, world):
        '''
        Sets the world an entity belongs to.
        Checks for tag conflicts before adding.
        '''
        if world.get_entity_by_tag(self._tag) and self._tag != '':
            raise NonUniqueTagError(self._tag)
        else:
            self._world = world
            world.add_entity(self, True)