parameters: (
          self, labware_load_info: LegacyLabwareLoadInfo
      )
return_statement: return load_labware_command
docstring: Map a legacy labware load to a ProtocolEngine command.
docstring_summary: Map a legacy labware load to a ProtocolEngine command.
docstring_tokens: Map a legacy labware load to a ProtocolEngine command .
function: def map_labware_load(
          self, labware_load_info: LegacyLabwareLoadInfo
      ) -> pe_commands.Command:
          """Map a legacy labware load to a ProtocolEngine command."""
          now = ModelUtils.get_timestamp()
          count = self._command_count["LOAD_LABWARE"]
          slot = labware_load_info.deck_slot
          location: pe_types.LabwareLocation
          if labware_load_info.on_module:
              location = pe_types.ModuleLocation.construct(
                  moduleId=self._module_id_by_slot[slot]
              )
          else:
              location = pe_types.DeckSlotLocation.construct(slotName=slot)
  
          command_id = f"commands.LOAD_LABWARE-{count}"
          labware_id = f"labware-{count}"
  
          load_labware_command = pe_commands.LoadLabware.construct(
              id=command_id,
              key=command_id,
              status=pe_commands.CommandStatus.SUCCEEDED,
              createdAt=now,
              startedAt=now,
              completedAt=now,
              params=pe_commands.LoadLabwareParams.construct(
                  location=location,
                  loadName=labware_load_info.labware_load_name,
                  namespace=labware_load_info.labware_namespace,
                  version=labware_load_info.labware_version,
              ),
              result=pe_commands.LoadLabwareResult.construct(
                  labwareId=labware_id,
                  definition=LabwareDefinition.parse_obj(
                      labware_load_info.labware_definition
                  ),
                  offsetId=labware_load_info.offset_id,
              ),
          )
  
          self._command_count["LOAD_LABWARE"] = count + 1
          if isinstance(location, pe_types.DeckSlotLocation):
              # TODO (spp, 2021-11-16): Account for labware on modules when mapping legacy
              #  pipetting commands; either in self._labware_id_by_slot or something else
              self._labware_id_by_slot[location.slotName] = labware_id
          return load_labware_command
function_tokens: def map_labware_load ( self , labware_load_info : LegacyLabwareLoadInfo ) -> pe_commands . Command : now = ModelUtils . get_timestamp ( ) count = self . _command_count [ "LOAD_LABWARE" ] slot = labware_load_info . deck_slot location : pe_types . LabwareLocation if labware_load_info . on_module : location = pe_types . ModuleLocation . construct ( moduleId = self . _module_id_by_slot [ slot ] ) else : location = pe_types . DeckSlotLocation . construct ( slotName = slot ) command_id = f"commands.LOAD_LABWARE-{count}" labware_id = f"labware-{count}" load_labware_command = pe_commands . LoadLabware . construct ( id = command_id , key = command_id , status = pe_commands . CommandStatus . SUCCEEDED , createdAt = now , startedAt = now , completedAt = now , params = pe_commands . LoadLabwareParams . construct ( location = location , loadName = labware_load_info . labware_load_name , namespace = labware_load_info . labware_namespace , version = labware_load_info . labware_version , ) , result = pe_commands . LoadLabwareResult . construct ( labwareId = labware_id , definition = LabwareDefinition . parse_obj ( labware_load_info . labware_definition ) , offsetId = labware_load_info . offset_id , ) , ) self . _command_count [ "LOAD_LABWARE" ] = count + 1 if isinstance ( location , pe_types . DeckSlotLocation ) : # TODO (spp, 2021-11-16): Account for labware on modules when mapping legacy #  pipetting commands; either in self._labware_id_by_slot or something else self . _labware_id_by_slot [ location . slotName ] = labware_id return load_labware_command