code: def extract_properties(
      execution: metadata_store_pb2.Execution,
  ) -> Dict[str, types.ExecPropertyTypes]:
      """Extracts execution properties from mlmd Execution."""
      result = {}
      for key, prop in itertools.chain(
          execution.properties.items(),
          execution.custom_properties.items(),
      ):
          if execution_lib.is_schema_key(key):
              continue
  
          schema_key = execution_lib.get_schema_key(key)
          schema = None
          if schema_key in execution.custom_properties:
              schema = proto_utils.json_to_proto(
                  data_types_utils.get_metadata_value(
                      execution.custom_properties[schema_key]
                  ),
                  pipeline_pb2.Value.Schema(),
              )
          value = data_types_utils.get_parsed_value(prop, schema)
  
          if value is None:
              raise ValueError(
                  f"Unexpected property with empty value; key: {key}"
              )
          result[key] = value
      return result
  
imports: import collections
  import itertools
  import json
  import sys
  import textwrap
  from typing import Callable, Dict, Iterable, List, MutableMapping, Optional, Sequence, Type
  import uuid
  from absl import logging
  import attr
  from tfx import types
  from tfx.dsl.compiler import constants
  from tfx.dsl.compiler import placeholder_utils
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable import inputs_utils
  from tfx.orchestration.portable import outputs_utils
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.mlmd import common_utils
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import event_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.orchestration.portable.mlmd import filter_query_builder
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import proto_utils
  from tfx.utils import status
  from tfx.utils import typing_utils
  from tfx.orchestration.experimental.core import deployment_config_utils
  import ml_metadata
  from ml_metadata import errors
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling a global function with example usage: extract_properties(execution) and returns: result