class_docstr: A helper class to compute and plot lineage of ml-metadata artifacts.
class_docstr_tok: ["A","helper","class","to","compute","and","plot","lineage","of","ml-metadata","artifacts","."]
docstr: Adds the attributes of given artifact or execution to the graph `g`.
docstr_tok: ["Adds","the","attributes","of","given","artifact","or","execution","to","the","graph","`","g","`","."]
code: def _add_node_attribute(self, g, node_id, depth, is_artifact):
      """Adds the attributes of given artifact or execution to the graph `g`."""
      # if it is not an artifact, use negative gnode id
      gnode_id = node_id if is_artifact else -1 * node_id
      g.add_node(gnode_id, depth=depth, is_artifact=is_artifact)
      node_label = ""
      if is_artifact:
          [a] = self.metadata_store.get_artifacts_by_id([node_id])
          [t] = self.metadata_store.get_artifact_types_by_id(
              [a.type_id]
          )
          node_label += t.name
      else:
          [e] = self.metadata_store.get_executions_by_id([node_id])
          [t] = self.metadata_store.get_execution_types_by_id(
              [e.type_id]
          )
          node_label += t.name
      g.nodes[gnode_id]["_label_"] = node_label
  
imports: import re
  from IPython.display import display_html
  import matplotlib.pyplot
  import networkx
  import pandas
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling the _LineageGraphHelper obj's underlying member method code with example usage: obj._add_node_attribute(g, node_id, depth, is_artifact) without return types