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: Returns a `nx.DiGraph` representing the lineage of given `artifact_id`.
  
  Args:
    artifact_id: An `int` indicating the id of an Artifact.
    max_depth: (Optional): An `int` indicating how far back the lineage should
      be computed for `artifact_id`. By default the entire lineage is
      computed.
  
  Returns:
    A `nx.DiGraph` for the lineage of given `artifact_id`.
    Nodes with positive ids indicate an Artifact.
    Nodes with negative ids indicate an Execution.
docstr_tok: ["Returns","a","`","nx.DiGraph","`","representing","the","lineage","of","given","`","artifact_id","`",".","Args",":","artifact_id",":","An","`","int","`","indicating","the","id","of","an","Artifact",".","max_depth",":","(","Optional",")",":","An","`","int","`","indicating","how","far","back","the","lineage","should","be","computed","for","`","artifact_id","`",".","By","default","the","entire","lineage","is","computed",".","Returns",":","A","`","nx.DiGraph","`","for","the","lineage","of","given","`","artifact_id","`",".","Nodes","with","positive","ids","indicate","an","Artifact",".","Nodes","with","negative","ids","indicate","an","Execution","."]
code: def get_artifact_lineage(self, artifact_id, max_depth=None):
      """Returns a `nx.DiGraph` representing the lineage of given `artifact_id`.
  
      Args:
        artifact_id: An `int` indicating the id of an Artifact.
        max_depth: (Optional): An `int` indicating how far back the lineage should
          be computed for `artifact_id`. By default the entire lineage is
          computed.
  
      Returns:
        A `nx.DiGraph` for the lineage of given `artifact_id`.
        Nodes with positive ids indicate an Artifact.
        Nodes with negative ids indicate an Execution.
      """
      g = nx.DiGraph(query_artifact_id=artifact_id)
      if max_depth is None or max_depth > 0:
          self._add_parents(g, artifact_id, True, 1, max_depth)
      return g
  
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 6 for calling the _LineageGraphHelper obj's underlying member method code with example usage: obj.get_artifact_lineage(artifact_id, max_depth) and returns: g