code: def _get_type_proto(
      type_name: str, types: simple_types_pb2.SimpleTypes
  ) -> Union[
      metadata_store_pb2.ArtifactType, metadata_store_pb2.ExecutionType
  ]:
      for artifact_type in types.artifact_types:
          if artifact_type.name == type_name:
              return artifact_type
      for execution_type in types.execution_types:
          if execution_type.name == type_name:
              return execution_type
      raise _make_exception(
          "Type name: {} is not found".format(type_name),
          errors.NOT_FOUND,
      )
  
imports: import abc
  from typing import Union
  from ml_metadata import errors
  from ml_metadata.metadata_store.pywrap.metadata_store_extension import metadata_store
  from ml_metadata.proto import metadata_store_pb2
  from ml_metadata.simple_types.proto import simple_types_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: _get_type_proto(type_name, types) and returns: artifact_type, execution_type