code: def _set_artifact_properties(
      artifact: types.Artifact,
      properties: Optional[Dict[str, Any]],
      custom_properties: Optional[Dict[str, Any]],
  ):
      """Sets properties and custom_properties to the given artifact."""
      if properties is not None:
          for key, value in properties.items():
              setattr(artifact, key, value)
      if custom_properties is not None:
          for key, value in custom_properties.items():
              if isinstance(value, int):
                  artifact.set_int_custom_property(key, value)
              elif isinstance(value, (str, bytes)):
                  artifact.set_string_custom_property(key, value)
              else:
                  raise NotImplementedError(
                      f"Unexpected custom_property value type:{type(value)}"
                  )
  
imports: from typing import Any, Dict, List, Optional, Type, Union
  import absl
  from tfx import types
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_node
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.types import channel_utils
  from tfx.utils import doc_controls
  from ml_metadata import errors
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _set_artifact_properties(artifact, properties, custom_properties) without return types