code: def _get_one_hop_executions(
      store: mlmd.MetadataStore,
      artifact_ids: Iterable[int],
      direction: _Direction,
      filter_type: Optional[metadata_store_pb2.ExecutionType] = None,
  ) -> List[metadata_store_pb2.Execution]:
      """Gets a list of executions within 1-hop neighborhood of the `artifact_ids`.
  
      Args:
        store: A ml-metadata MetadataStore to look for neighborhood executions.
        artifact_ids: The artifacts' ids in the `store`.
        direction: A direction to specify whether returning ancestors or successors.
        filter_type: An optional type filter of the returned executions, if given
          then only executions of that type is returned.
  
      Returns:
        A list of qualified executions within 1-hop neighborhood in the `store`.
      """
      if direction == _Direction.ANCESTOR:
          traverse_event = (
              metadata_store_pb2.Event.OUTPUT,
              metadata_store_pb2.Event.DECLARED_OUTPUT,
          )
      elif direction == _Direction.SUCCESSOR:
          traverse_event = (
              metadata_store_pb2.Event.INPUT,
              metadata_store_pb2.Event.DECLARED_INPUT,
          )
      executions_ids = set(
          event.execution_id
          for event in store.get_events_by_artifact_ids(artifact_ids)
          if event.type in traverse_event
      )
      return [
          execution
          for execution in store.get_executions_by_id(executions_ids)
          if not filter_type or execution.type_id == filter_type.id
      ]
  
imports: import enum
  import os
  from typing import Any, Dict, Iterable, List, Optional, Sequence, Union
  import attr
  import ml_metadata
  import tensorflow
  import tensorflow_model_analysis
  from absl import logging
  from ml_metadata.proto import metadata_store_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from model_card_toolkit import model_card
label_desc: Use image node_id 4 for calling a global function with example usage: _get_one_hop_executions(store, artifact_ids, direction, filter_type) and returns: unknown