@lazy
    def instances(self):
        result = LazyInstanceDict(self)
        try:
            config = self.config
        except __HOLE__:
            return result
        for instance_id in config.get('instance', {}):
            iconfig = config['instance'][instance_id]
            if 'master' not in iconfig:
                log.error("Instance 'instance:%s' has no master set." % instance_id)
                sys.exit(1)
            master = self.masters[iconfig['master']]
            if instance_id in master.instances:
                log.error("Instance 'instance:%s' conflicts with another instance with id '%s' in master '%s'." % (instance_id, instance_id, master.id))
                sys.exit(1)
            instance_class = master.section_info.get(None)
            if instance_class is None:
                log.error("Master '%s' has no default instance class." % (master.id))
                sys.exit(1)
            instance = instance_class(master, instance_id, iconfig)
            instance.sectiongroupname = 'instance'
            master.instances[instance_id] = instance
        shortname_map = {}
        for master in self.masters.values():
            for instance_id in master.instances:
                instance = master.instances[instance_id]
                key = instance.uid
                result[key] = instance
                shortname_map.setdefault(instance_id, []).append(instance)
        for shortname, instances in shortname_map.items():
            if len(instances) == 1:
                result[shortname] = instances[0]
        result.plugins = self.plugins
        return result
dataset/ETHPy150Open ployground/ploy/ploy/__init__.py/Controller.instances