code: def create_execution(
      store: metadata_store.MetadataStore,
      execution_type_id: int,
      name: str,
      inputs: Dict[str, List[metadata_store_pb2.Artifact]],
      outputs: Dict[str, List[metadata_store_pb2.Artifact]],
      contexts: List[metadata_store_pb2.Context],
      output_event_type: metadata_store_pb2.Event.Type = metadata_store_pb2.Event.OUTPUT,
  ) -> metadata_store_pb2.Execution:
      """Put an Execution in the MLMD database.
  
      Args:
          store: metadata store
          execution_type_id: type id of the execution
          name: name of the execution
          inputs: a mapping of the event step key to a list of input artifacts.
          outputs: a mapping of the event step key to a list of output artifacts.
          contexts: a list of contexts that the execution is associated with.
          output_event_type: the event type of all output events. It must be one of
            the valid output event types.
  
      Returns:
      Created execution.
      """
      if (
          output_event_type
          not in metadata_resolver_utils.OUTPUT_EVENT_TYPES
      ):
          raise ValueError(
              f"{output_event_type} is not a valid output event type."
          )
      execution = metadata_store_pb2.Execution(
          type_id=execution_type_id,
          name=name,
      )
      artifact_and_events = []
      for input_key, artifacts in inputs.items():
          for i, artifact in enumerate(artifacts):
              event = metadata_store_pb2.Event(
                  type=metadata_store_pb2.Event.INPUT,
                  artifact_id=artifact.id,
              )
              event.path.steps.add().key = input_key
              event.path.steps.add().index = i
              artifact_and_events.append((artifact, event))
      for output_key, artifacts in outputs.items():
          for i, artifact in enumerate(artifacts):
              event = metadata_store_pb2.Event(
                  type=output_event_type, artifact_id=artifact.id
              )
              event.path.steps.add().key = output_key
              event.path.steps.add().index = i
              artifact_and_events.append((artifact, event))
      execution.id, _, _ = store.put_execution(
          execution, artifact_and_events, contexts
      )
      return execution
  
imports: from typing import Dict, List
  from absl.testing import absltest
  from ml_metadata import metadata_store
  from ml_metadata.proto import metadata_store_pb2
  from ml_metadata.tools.mlmd_resolver import metadata_resolver
  from ml_metadata.tools.mlmd_resolver import metadata_resolver_utils
label_desc: Use image node_id 4 for calling a global function with example usage: create_execution(store, execution_type_id, name, inputs, outputs, contexts, output_event_type) and returns: execution