parameters: (
          self,
          model: ModuleModel,
          location: DeckSlotLocation,
          module_id: Optional[str],
      )
return_statement: return LoadedModuleData(
              module_id=self._model_utils.ensure_id(module_id),
              serial_number=attached_module.serial_number,
              definition=attached_module.definition,
          )
docstring: Ensure the required module is attached.
  
          Args:
              model: The model name of the module.
              location: The deck location of the module
              module_id: Optional ID assigned to the module.
                         If None, an ID will be generated.
  
          Returns:
              A LoadedModuleData object.
  
          Raises:
              ModuleNotAttachedError: A not-yet-assigned module matching the requested
                  parameters could not be found in the attached modules list.
              ModuleAlreadyPresentError: A module of a different type is already
                  assigned to the requested location.
docstring_summary: Ensure the required module is attached.
docstring_tokens: Ensure the required module is attached .
function: async def load_module(
          self,
          model: ModuleModel,
          location: DeckSlotLocation,
          module_id: Optional[str],
      ) -> LoadedModuleData:
          """Ensure the required module is attached.
  
          Args:
              model: The model name of the module.
              location: The deck location of the module
              module_id: Optional ID assigned to the module.
                         If None, an ID will be generated.
  
          Returns:
              A LoadedModuleData object.
  
          Raises:
              ModuleNotAttachedError: A not-yet-assigned module matching the requested
                  parameters could not be found in the attached modules list.
              ModuleAlreadyPresentError: A module of a different type is already
                  assigned to the requested location.
          """
          attached_modules = [
              HardwareModule(
                  serial_number=hw_mod.device_info["serial"],
                  definition=self._module_data_provider.get_definition(
                      ModuleModel(hw_mod.model())
                  ),
              )
              for hw_mod in self._hardware_api.attached_modules
          ]
  
          attached_module = self._state_store.modules.find_attached_module(
              model=model,
              location=location,
              attached_modules=attached_modules,
          )
  
          return LoadedModuleData(
              module_id=self._model_utils.ensure_id(module_id),
              serial_number=attached_module.serial_number,
              definition=attached_module.definition,
          )
function_tokens: async def load_module ( self , model : ModuleModel , location : DeckSlotLocation , module_id : Optional [ str ] , ) -> LoadedModuleData : attached_modules = [ HardwareModule ( serial_number = hw_mod . device_info [ "serial" ] , definition = self . _module_data_provider . get_definition ( ModuleModel ( hw_mod . model ( ) ) ) , ) for hw_mod in self . _hardware_api . attached_modules ] attached_module = self . _state_store . modules . find_attached_module ( model = model , location = location , attached_modules = attached_modules , ) return LoadedModuleData ( module_id = self . _model_utils . ensure_id ( module_id ) , serial_number = attached_module . serial_number , definition = attached_module . definition , )