code: def test_export_coreml_with_prediction(self):
      import resampy
      import coremltools
  
      with TempDirectory() as temp_dir:
          file_name = temp_dir + "/model.mlmodel"
          self.model.export_coreml(file_name)
          core_ml_model = coremltools.models.MLModel(file_name)
  
      # Check predictions
      for cur_audio in self.data["audio"]:
          resampled_data = resampy.resample(
              cur_audio["data"], cur_audio["sample_rate"], 16000
          )
          first_audio_frame = resampled_data[:15600]
  
          tc_x = {"data": first_audio_frame, "sample_rate": 16000}
          tc_prob_vector = self.model.predict(
              tc_x, output_type="probability_vector"
          )[0]
  
          coreml_x = np.float32(
              first_audio_frame / 32768.0
          )  # Convert to [-1.0, +1.0]
          coreml_y = core_ml_model.predict({"audio": coreml_x})
  
          core_ml_prob_output_name = self.model.target + "Probability"
          for i, cur_class in enumerate(self.model.classes):
              self.assertAlmostEquals(
                  tc_prob_vector[i],
                  coreml_y[core_ml_prob_output_name][cur_class],
                  delta=0.001,
              )
      # Check metadata
      metadata = core_ml_model.get_spec().description.metadata
      self.assertTrue("sampleRate" in metadata.userDefined)
      self.assertEqual(metadata.userDefined["sampleRate"], "16000")
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from .util import TempDirectory
  from copy import copy
  import math
  from os import mkdir
  import unittest
  import pytest
  import numpy
  import sys
  import turicreate
  from turicreate.toolkits._internal_utils import _raise_error_if_not_sarray
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits._internal_utils import _mac_ver
label_desc: Use image node_id 7 for calling the ClassifierTestTwoClassesStringLabels obj's underlying member method code with example usage: obj.test_export_coreml_with_prediction() without return types