class_docstr: A SageMaker lineage artifact representing a model.
  
  Common model specific lineage traversals to discover how the model is connected
  to other entities.
class_docstr_tok: ["A","SageMaker","lineage","artifact","representing","a","model",".","Common","model","specific","lineage","traversals","to","discover","how","the","model","is","connected","to","other","entities","."]
docstr: Get contexts representing endpoints from the models's lineage.
  
  Args:
      direction (LineageQueryDirectionEnum, optional): The query direction.
  
  Returns:
      list of Contexts: Contexts representing an endpoint.
docstr_tok: ["Get","contexts","representing","endpoints","from","the","models","'s","lineage",".","Args",":","direction","(","LineageQueryDirectionEnum",",","optional",")",":","The","query","direction",".","Returns",":","list","of","Contexts",":","Contexts","representing","an","endpoint","."]
code: def endpoint_contexts(
      self,
      direction: LineageQueryDirectionEnum = LineageQueryDirectionEnum.DESCENDANTS,
  ) -> List[Context]:
      """Get contexts representing endpoints from the models's lineage.
  
      Args:
          direction (LineageQueryDirectionEnum, optional): The query direction.
  
      Returns:
          list of Contexts: Contexts representing an endpoint.
      """
      query_filter = LineageFilter(
          entities=[LineageEntityEnum.CONTEXT],
          sources=[LineageSourceEnum.ENDPOINT],
      )
      query_result = LineageQuery(self.sagemaker_session).query(
          start_arns=[self.artifact_arn],
          query_filter=query_filter,
          direction=direction,
          include_edges=False,
      )
  
      endpoint_contexts = []
      for vertex in query_result.vertices:
          endpoint_contexts.append(vertex.to_lineage_object())
      return endpoint_contexts
  
imports: from __future__ import absolute_import
  import logging
  import math
  from datetime import datetime
  from typing import Iterator, Union, Any, Optional, List
  from sagemaker.apiutils import _base_types, _utils
  from sagemaker.lineage import _api_types
  from sagemaker.lineage._api_types import ArtifactSource, ArtifactSummary
  from sagemaker.lineage.query import LineageQuery, LineageFilter, LineageSourceEnum, LineageEntityEnum, LineageQueryDirectionEnum
  from sagemaker.lineage._utils import _disassociate, get_resource_name_from_arn
  from sagemaker.lineage.association import Association
  from sagemaker.utils import get_module, format_tags
label_desc: Use image node_id 2 for calling the ModelArtifact obj's underlying member method code with example usage: obj.endpoint_contexts(direction) and returns: endpoint_contexts