docstr: Check the export_coreml() function.
docstr_tok: ["Check","the","export_coreml","(",")","function","."]
code: def test_export_coreml(self):
      """
      Check the export_coreml() function.
      """
      import coremltools
      import platform
  
      # Export the model as a CoreML model file
      filename = tempfile.NamedTemporaryFile(suffix=".mlmodel").name
      self.model.export_coreml(filename)
  
      # Load the model back from the CoreML model file
      coreml_model = coremltools.models.MLModel(filename)
      metadata = coreml_model.user_defined_metadata
  
      self.assertEqual(
          metadata["com.github.apple.turicreate.version"],
          tc.__version__,
      )
      self.assertEqual(
          metadata["com.github.apple.os.platform"], platform.platform()
      )
      self.assertEqual(metadata["target"], self.target)
      self.assertEqual(metadata["type"], "activity_classifier")
      self.assertEqual(
          metadata["prediction_window"], str(self.prediction_window)
      )
      self.assertEqual(metadata["session_id"], self.session_id)
      self.assertEqual(metadata["features"], ",".join(self.features))
      self.assertEqual(metadata["max_iterations"], "10")
      self.assertEqual(metadata["version"], "2")
  
      expected_result = (
          "Activity classifier created by Turi Create (version %s)"
          % (tc.__version__)
      )
      self.assertEquals(expected_result, coreml_model.short_description)
  
      self.check_prediction_match(self.model, coreml_model)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import unittest
  import turicreate
  import random
  import tempfile
  import math
  import numpy
  from numbers import Number
  from .None import util
  import pytest
  from turicreate.toolkits._internal_utils import _mac_ver
  from turicreate.toolkits._main import ToolkitError
  import uuid
label_desc: Use image node_id 4 for calling the ActivityClassifierTest obj's underlying member method code with example usage: obj.test_export_coreml() without return types