code: def testLatestCreatedResolverFn_E2E(self):
      channel = canned_resolver_functions.latest_created(
          channel_utils.artifact_query(
              artifact_type=test_utils.DummyArtifact
          ),
          n=2,
      )
      pipeline_node = test_utils.compile_inputs({"x": channel})
  
      # Populate the MLMD database with DummyArtifacts to test the input
      # resolution end to end.
      mlmd_artifact_1 = self.put_artifact("DummyArtifact")
      mlmd_artifact_2 = self.put_artifact("DummyArtifact")
      mlmd_artifact_3 = self.put_artifact("DummyArtifact")
  
      for mlmd_artifact in [
          mlmd_artifact_1,
          mlmd_artifact_2,
          mlmd_artifact_3,
      ]:
          self.put_execution(
              "ProducerNode",
              inputs={},
              outputs={"x": [mlmd_artifact]},
              contexts=[self.mlmd_context],
          )
  
      resolved = inputs_utils.resolve_input_artifacts(
          pipeline_node=pipeline_node, metadata_handle=self.mlmd_handle
      )
      self.assertNotEmpty(
          resolved
      )  # Non-empty resolution implies Trigger.
  
      # Check that actual_artifacts = [mlmd_artifact_2, mlmd_artifact_3] because
      # those two artifacts are the latest artifacts and n=2.
      actual_artifacts = [r.mlmd_artifact for r in resolved[0]["x"]]
      expected_artifacts = [mlmd_artifact_2, mlmd_artifact_3]
      self.assertResolvedAndMLMDArtifactListEqual(
          actual_artifacts, expected_artifacts
      )
  
imports: from typing import Sequence
  import tensorflow
  from tfx import types
  from tfx.dsl.control_flow import for_each
  from tfx.dsl.input_resolution import canned_resolver_functions
  from tfx.dsl.input_resolution import resolver_op
  from tfx.dsl.input_resolution.ops import test_utils
  from tfx.orchestration import pipeline
  from tfx.orchestration.portable import inputs_utils
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.types import channel_utils
  from tfx.types import resolved_channel
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 6 for calling the CannedResolverFunctionsTest obj's underlying member method code with example usage: obj.testLatestCreatedResolverFn_E2E() without return types