code: def test_add_evauation_metrics_from_s3(session, caplog):
      json_path = os.path.join(
          DATA_DIR, "evaluation_metrics/clarify_bias.json"
      )
      with open(json_path, "r", encoding="utf-8") as istr:
          data = json.dumps(json.load(istr))
          response = {
              "Body": botocore.response.StreamingBody(
                  io.BytesIO(bytes(data, "utf-8")),
                  content_length=len(data),
              ),
              "ContentType": "application/json",
          }
      session.client.return_value.get_object.side_effect = [
          response,
          S3_MISSING_KEY_CLIENT_ERROR,
      ]
  
      evaluation_job = EvaluationJob(name=EVALUATION_JOB_NAME)
      evaluation_job.add_metric_group_from_s3(
          session=session,
          s3_url="s3://test/clarify_bias.json",
          metric_type=EvaluationMetricTypeEnum.CLARIFY_BIAS,
      )
      assert len(evaluation_job.metric_groups) == 3
  
      evaluation_job.add_metric_group_from_s3(
          session=session,
          s3_url="s3://test/clarify_bias.json",
          metric_type=EvaluationMetricTypeEnum.CLARIFY_BIAS,
      )
      assert (
          "Metric file clarify_bias.json does not exist in test."
          in caplog.text
      )
  
imports: from __future__ import absolute_import
  import io
  import os
  import json
  import datetime
  import re
  import logging
  import pytest
  from mock import patch, Mock
  from botocore.exceptions import ClientError
  import botocore.response
  from sagemaker.model_card import schema_constraints
  from sagemaker.model_card import Environment, ModelOverview, IntendedUses, BusinessDetails, ObjectiveFunction, TrainingMetric, HyperParameter, Metric, TrainingDetails, MetricGroup, EvaluationJob, AdditionalInformation, ModelCard, Function, TrainingJobDetails, ModelPackage
  from sagemaker.model_card.model_card import ModelCardExportJob, ModelPackageCreator, SourceAlgorithm, Container, InferenceSpecification
  from sagemaker.model_card.helpers import _MaxSizeArray, _IsList, _OneOf, _IsModelCardObject, _JSONEncoder, _hash_content_str, _DefaultToRequestDict, _SkipEncodingDecoding
  from sagemaker.model_card.evaluation_metric_parsers import EvaluationMetricTypeEnum, EVALUATION_METRIC_PARSERS
label_desc: Use image node_id 39 for calling a global function with example usage: test_add_evauation_metrics_from_s3(session, caplog) without return types