docstr: Create and insert a lineage graph in metadata store.
  
  ExampleGen-1     ExampleGen-2     ExampleGen-3
       │                │                │
       ▼                ▼                ▼
   Example-1       Example-2       Example-3
       │              │ │              │ │
       └─────┬────────┘ └─────┬────────┘ │
             ▼                ▼          │
         Trainer-1        Trainer-2      │
             │                │          │
             ▼                ▼          │
           Model-1          Model-2      │
             │                           │
             └───────────────────────┐   │
                                     ▼   ▼
                                 Evaluator-1
                                     │
                                     ▼
                                 Evaluation-1
docstr_tok: ["Create","and","insert","a","lineage","graph","in","metadata","store",".","ExampleGen-1","ExampleGen-2","ExampleGen-3","\u2502","\u2502","\u2502","\u25bc","\u25bc","\u25bc","Example-1","Example-2","Example-3","\u2502","\u2502","\u2502","\u2502","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518","\u2514\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518","\u2502","\u25bc","\u25bc","\u2502","Trainer-1","Trainer-2","\u2502","\u2502","\u2502","\u2502","\u25bc","\u25bc","\u2502","Model-1","Model-2","\u2502","\u2502","\u2502","\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510","\u2502","\u25bc","\u25bc","Evaluator-1","\u2502","\u25bc","Evaluation-1"]
code: def setUp(self):
      """Create and insert a lineage graph in metadata store.
  
      ExampleGen-1     ExampleGen-2     ExampleGen-3
           │                │                │
           ▼                ▼                ▼
       Example-1       Example-2       Example-3
           │              │ │              │ │
           └─────┬────────┘ └─────┬────────┘ │
                 ▼                ▼          │
             Trainer-1        Trainer-2      │
                 │                │          │
                 ▼                ▼          │
               Model-1          Model-2      │
                 │                           │
                 └───────────────────────┐   │
                                         ▼   ▼
                                     Evaluator-1
                                         │
                                         ▼
                                     Evaluation-1
      """
      super().setUp()
      connection_config = metadata_store_pb2.ConnectionConfig()
      connection_config.fake_database.SetInParent()
      self.store = metadata_store.MetadataStore(connection_config)
      self.resolver = metadata_resolver.MetadataResolver(self.store)
  
      self.exp_type = create_artifact_type(self.store, "Examples")
      self.example_gen_type = create_execution_type(
          self.store, "ExampleGen"
      )
      self.trainer_type = create_execution_type(self.store, "Trainer")
      self.model_type = create_artifact_type(self.store, "Model")
      self.evaluator_type = create_execution_type(
          self.store, "Evaluator"
      )
      self.evaluation_type = create_artifact_type(
          self.store, "Evaluation"
      )
      self.pipe_type = create_context_type(self.store, "pipeline")
      self.run_type = create_context_type(self.store, "pipeline_run")
      self.node_type = create_context_type(self.store, "node")
  
      self.pipe_ctx = create_context(
          self.store, self.pipe_type.id, "my-pipeline"
      )
      self.run1_ctx = create_context(
          self.store, self.run_type.id, "my-pipeline.run-01"
      )
      self.run2_ctx = create_context(
          self.store, self.run_type.id, "my-pipeline.run-02"
      )
      self.run3_ctx = create_context(
          self.store, self.run_type.id, "my-pipeline.run-03"
      )
      self.example_gen_ctx = create_context(
          self.store, self.node_type.id, "my-pipeline.ExampleGen"
      )
      self.trainer_ctx = create_context(
          self.store, self.node_type.id, "my-pipeline.Trainer"
      )
      self.evaluator_ctx = create_context(
          self.store, self.node_type.id, "my-pipeline.Evaluator"
      )
      self.e1 = create_artifact(
          self.store, self.exp_type.id, name="Example-1"
      )
      self.e2 = create_artifact(
          self.store, self.exp_type.id, name="Example-2"
      )
      self.e3 = create_artifact(
          self.store, self.exp_type.id, name="Example-3"
      )
      self.m1 = create_artifact(
          self.store, self.model_type.id, name="Model-1"
      )
      self.m2 = create_artifact(
          self.store, self.model_type.id, name="Model-2"
      )
      self.ev1 = create_artifact(
          self.store, self.evaluation_type.id, name="Evaluation-1"
      )
  
      self.expgen1 = create_execution(
          self.store,
          self.example_gen_type.id,
          name="ExampleGen-1",
          inputs={},
          outputs={"examples": [self.e1]},
          contexts=[self.pipe_ctx, self.run1_ctx, self.example_gen_ctx],
      )
      self.expgen2 = create_execution(
          self.store,
          self.example_gen_type.id,
          name="ExampleGen-2",
          inputs={},
          outputs={"examples": [self.e2]},
          contexts=[self.pipe_ctx, self.run2_ctx, self.example_gen_ctx],
      )
      self.expgen3 = create_execution(
          self.store,
          self.example_gen_type.id,
          name="ExampleGen-3",
          inputs={},
          outputs={"examples": [self.e3]},
          contexts=[self.pipe_ctx, self.run3_ctx, self.example_gen_ctx],
      )
      self.trainer1 = create_execution(
          self.store,
          self.trainer_type.id,
          name="Trainer-1",
          inputs={"examples": [self.e1, self.e2]},
          outputs={"model": [self.m1]},
          contexts=[self.pipe_ctx, self.run1_ctx, self.trainer_ctx],
      )
      self.trainer2 = create_execution(
          self.store,
          self.trainer_type.id,
          name="Trainer-2",
          inputs={"examples": [self.e2, self.e3]},
          outputs={"model": [self.m2]},
          contexts=[self.pipe_ctx, self.run2_ctx, self.trainer_ctx],
          output_event_type=metadata_store_pb2.Event.Type.PENDING_OUTPUT,
      )
      self.evaluator = create_execution(
          self.store,
          self.evaluator_type.id,
          name="Evaluator-1",
          inputs={"examples": [self.e3], "model": [self.m1]},
          outputs={"evaluation": [self.ev1]},
          contexts=[self.pipe_ctx, self.run3_ctx, self.evaluator_ctx],
      )
  
imports: from typing import Dict, List
  from absl.testing import absltest
  from ml_metadata import metadata_store
  from ml_metadata.proto import metadata_store_pb2
  from ml_metadata.tools.mlmd_resolver import metadata_resolver
  from ml_metadata.tools.mlmd_resolver import metadata_resolver_utils
label_desc: Use image node_id 1 for calling the MetadataResolverTest obj's underlying member method code with example usage: obj.setUp() without return types