<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_registered_instances(self, include_removed=False):
 """ Return the persisted names of all instances across all registered configs. """

        rval = []
        configs = self.state.get('config_files', {}).values()
        if include_removed:
            configs.extend(self.state.get('remove_configs', {}).values())
        for config in configs:
            if config['instance_name'] not in rval:
                rval.append(config['instance_name'])
        return rval