class_docstr: BaseDriver is the base class of all custom drivers.
  
  This can also be used as the default driver of a component if no custom logic
  is needed.
  
  Attributes:
    _metadata_handle: An instance of Metadata.
class_docstr_tok: ["BaseDriver","is","the","base","class","of","all","custom","drivers",".","This","can","also","be","used","as","the","default","driver","of","a","component","if","no","custom","logic","is","needed",".","Attributes",":","_metadata_handle",":","An","instance","of","Metadata","."]
docstr: Prepare output artifacts by assigning uris to each artifact.
docstr_tok: ["Prepare","output","artifacts","by","assigning","uris","to","each","artifact","."]
code: def _prepare_output_artifacts(
      self,
      input_artifacts: Dict[str, List[types.Artifact]],
      output_dict: Dict[str, types.Channel],
      exec_properties: Dict[str, Any],
      execution_id: int,
      pipeline_info: data_types.PipelineInfo,
      component_info: data_types.ComponentInfo,
  ) -> Dict[str, List[types.Artifact]]:
      """Prepare output artifacts by assigning uris to each artifact."""
      del exec_properties
  
      base_output_dir = os.path.join(
          pipeline_info.pipeline_root, component_info.component_id
      )
  
      result = {}
      for name, channel in output_dict.items():
          if channel.matching_channel_name:
              # Decides the artifact count for output Channel at runtime based on the
              # artifact count in specified input Channel.
              count = len(
                  input_artifacts[channel.matching_channel_name]
              )
              output_list = [channel.type() for _ in range(count)]
          else:
              output_list = [channel.type()]
  
          is_single_artifact = len(output_list) == 1
          for i, artifact in enumerate(output_list):
              artifact.name = f"{name}:{pipeline_info.run_id}"
              artifact.producer_component = component_info.component_id
              artifact.uri = _generate_output_uri(
                  base_output_dir,
                  name,
                  execution_id,
                  is_single_artifact,
                  i,
              )
              # TODO(b/147242148): Introduce principled artifact structure (directory
              # or file) definition.
              if isinstance(artifact, types.ValueArtifact):
                  artifact.uri = os.path.join(artifact.uri, "value")
              _prepare_output_paths(artifact)
  
          result[name] = output_list
  
      return result
  
file_path: tfx/tfx/dsl/components/base/base_driver.py
imports: import os
  from typing import Any, Dict, List
  import absl
  from tfx import types
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.types import artifact_utils
  from tfx.types import channel_utils
label_desc: Use image node_id 6 for calling the BaseDriver obj's underlying member method code with example usage: obj._prepare_output_artifacts(input_artifacts, output_dict, exec_properties, execution_id, pipeline_info, component_info) and returns: result