code: def _create_tfx_artifact(
      uri: str, state: Optional[str] = None
  ) -> types.Artifact:
      tfx_artifact = _DEFAULT_ARTIFACT_TYPE()
      tfx_artifact.uri = uri
      if state:
          tfx_artifact.state = state
      return tfx_artifact
  
file_path: tfx/tfx/orchestration/portable/mlmd/artifact_lib_test.py
imports: from typing import Optional, Sequence
  import tensorflow
  from tfx import types
  from tfx.orchestration import metadata
  from tfx.orchestration.portable.mlmd import artifact_lib
  from tfx.types import standard_artifacts
  from tfx.utils import test_case_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: _create_tfx_artifact(uri, state) and returns: tfx_artifact