code: def _handle_input(self, ctx, component, arg, stage, role, config):
      from fate.arch import URI
  
      for input_pair_dict, artifacts in [
          (self.input_data, component.artifacts.data_inputs),
          (self.input_model, component.artifacts.model_inputs),
      ]:
          if allow_artifacts := artifacts.get(arg):
              if allow_artifacts.is_active_for(stage, role):
                  apply_spec: Union[
                      ArtifactInputApplySpec,
                      List[ArtifactInputApplySpec],
                  ] = config.input_artifacts.get(arg)
                  if apply_spec is not None:
                      try:
                          if allow_artifacts.is_multi:
                              if not isinstance(apply_spec, list):
                                  raise ComponentArtifactApplyError(
                                      f"`{arg}` expected list of artifact, but single artifact get"
                                  )
                              readers = []
                              for c in apply_spec:
                                  uri = URI.from_string(c.uri)
                                  arti = (
                                      allow_artifacts.get_correct_arti(
                                          c
                                      )
                                  )
                                  readers.append(
                                      arti.get_reader(
                                          ctx,
                                          uri,
                                          c.metadata,
                                          arti.get_type().type_name,
                                      )
                                  )
                              input_pair_dict[
                                  arg
                              ] = ComponentExecutionIO.InputPair(
                                  artifact=_ArtifactsType(
                                      [r.artifact for r in readers]
                                  ),
                                  reader=readers,
                              )
                          else:
                              uri = URI.from_string(apply_spec.uri)
                              arti = allow_artifacts.get_correct_arti(
                                  apply_spec
                              )
                              reader = arti.get_reader(
                                  ctx,
                                  uri,
                                  apply_spec.metadata,
                                  arti.get_type().type_name,
                              )
                              input_pair_dict[
                                  arg
                              ] = ComponentExecutionIO.InputPair(
                                  artifact=reader.artifact,
                                  reader=reader,
                              )
                      except Exception as e:
                          raise ComponentArtifactApplyError(
                              f"load as input artifact({allow_artifacts}) error: {e}"
                          ) from e
                  elif allow_artifacts.optional:
                      input_pair_dict[
                          arg
                      ] = ComponentExecutionIO.InputPair(
                          artifact=None, reader=None
                      )
                  else:
                      raise ComponentArtifactApplyError(
                          f"load as input artifact({allow_artifacts}) error: `{arg}` is not optional but None got"
                      )
                  logger.debug(
                      f"apply artifact `{allow_artifacts.name}`: {apply_spec} -> {input_pair_dict[arg].reader}"
                  )
                  return True
              else:
                  logger.debug(
                      f"skip artifact `{allow_artifacts.name}` for stage `{stage}` and role `{role}`"
                  )
                  input_pair_dict[arg] = ComponentExecutionIO.InputPair(
                      artifact=None, reader=None
                  )
                  return True
      return False
  
imports: import logging
  import typing
  from typing import Dict, Generic, List, Optional, Union
  from fate.components.core.essential import Role, Stage
  from .artifacts._base_type import AT, MM, ArtifactDescribe, M, _ArtifactsType, _ArtifactType
label_desc: Use image node_id 3 for calling the ComponentExecutionIO obj's underlying member method code with example usage: obj._handle_input(ctx, component, arg, stage, role, config) and returns: False, True, True