@staticmethod
    def fetch_content_instances(nodes):
        # Build a mapping of content_types -> ids
        contents = defaultdict(set)
        for node in nodes:
            contents[node.content_type_id].add(node.content_id)

        # Convert that mapping to content_types -> Content instances
        for content_type_id, content_ids in contents.items():
            try:
                ct = ContentType.objects.get_for_id(content_type_id)
                model_class = ct.model_class()
            except AttributeError:
                # get_for_id raises AttributeError when there's no model_class in django < 1.6.
                model_class = None
            if model_class:
                contents[content_type_id] = ct.model_class().objects.in_bulk(content_ids)
            else:
                ct = ContentType.objects.get(id=content_type_id)
                contents[content_type_id] = dict((id, UnknownWidget(ct, id)) for id in content_ids)
                # Warn about using an UnknownWidget. It doesn't matter which instance we use.
                next(iter(contents[content_type_id].values()), UnknownWidget(ct, None)).warn()
        return contents
Return the name of the device.
dataset/ETHPy150Open fusionbox/django-widgy/widgy/models/base.py/Node.fetch_content_instances--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/media_player/mpd.py/MpdDevice.name