def METHOD_NAME(self, entities):
    # map entity indexes to module containers
    module_containers = {}
    modules = entities.get_modules()
    for ent in modules:
        entity_index = ent[0]
        device = self._device_from_entity(ent)
        if not device:
            continue  # this device was ignored
        module = self._module_from_entity(ent)
        module.device = device
        module_containers[entity_index] = module
        self._logger.debug("module (entPhysIndex=%s): %r", entity_index, module)
    return module_containers