class_docstr: A collection of parameters, metrics, and artifacts to create a ML model.
class_docstr_tok: ["A","collection","of","parameters",",","metrics",",","and","artifacts","to","create","a","ML","model","."]
docstr: Log an artifact.
  
  Logs an artifact by uploading data to S3, creating an artifact, and associating that
  artifact with the run trial component.
  
  Args:
      data (dict): Artifacts data that will be saved to S3.
      graph_type (str):  The type of the artifact.
      is_output (bool): Determines direction of association to the
          trial component. Defaults to True (output artifact).
          If set to False then represented as input association.
      artifact_name (str): Name of the artifact (default: None).
docstr_tok: ["Log","an","artifact",".","Logs","an","artifact","by","uploading","data","to","S3",",","creating","an","artifact",",","and","associating","that","artifact","with","the","run","trial","component",".","Args",":","data","(","dict",")",":","Artifacts","data","that","will","be","saved","to","S3",".","graph_type","(","str",")",":","The","type","of","the","artifact",".","is_output","(","bool",")",":","Determines","direction","of","association","to","the","trial","component",".","Defaults","to","True","(","output","artifact",")",".","If","set","to","False","then","represented","as","input","association",".","artifact_name","(","str",")",":","Name","of","the","artifact","(","default",":","None",")","."]
code: def _log_graph_artifact(
      self, data, graph_type, is_output, artifact_name=None
  ):
      """Log an artifact.
  
      Logs an artifact by uploading data to S3, creating an artifact, and associating that
      artifact with the run trial component.
  
      Args:
          data (dict): Artifacts data that will be saved to S3.
          graph_type (str):  The type of the artifact.
          is_output (bool): Determines direction of association to the
              trial component. Defaults to True (output artifact).
              If set to False then represented as input association.
          artifact_name (str): Name of the artifact (default: None).
      """
      # generate an artifact name
      if not artifact_name:
          unique_name_from_base(graph_type)
  
      # create a json file in S3
      s3_uri, etag = self._artifact_uploader.upload_object_artifact(
          artifact_name, data, file_extension="json"
      )
  
      # create an artifact and association for the table
      if is_output:
          self._lineage_artifact_tracker.add_output_artifact(
              name=artifact_name,
              source_uri=s3_uri,
              etag=etag,
              artifact_type=graph_type,
          )
      else:
          self._lineage_artifact_tracker.add_input_artifact(
              name=artifact_name,
              source_uri=s3_uri,
              etag=etag,
              artifact_type=graph_type,
          )
  
imports: from __future__ import absolute_import
  import datetime
  import logging
  from enum import Enum
  from math import isnan, isinf
  from numbers import Number
  from typing import Optional, List, Dict, TYPE_CHECKING, Union
  import dateutil
  from numpy import array
  from sagemaker.apiutils import _utils
  from sagemaker.experiments import _api_types
  from sagemaker.experiments._api_types import TrialComponentArtifact, _TrialComponentStatusType
  from sagemaker.experiments._helper import _ArtifactUploader, _LineageArtifactTracker, _DEFAULT_ARTIFACT_PREFIX
  from sagemaker.experiments._environment import _RunEnvironment
  from sagemaker.experiments._run_context import _RunContext
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments._metrics import _MetricsManager
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.utils import get_module, unique_name_from_base, format_tags, Tags, TagsDict
  from sagemaker.experiments._utils import guess_media_type, resolve_artifact_name, verify_length_of_true_and_predicted, validate_invoked_inside_run_context, get_tc_and_exp_config_from_job_env, verify_load_input_names, is_run_trial_component
label_desc: Use image node_id 14 for calling the Run obj's underlying member method code with example usage: obj._log_graph_artifact(data, graph_type, is_output, artifact_name) without return types