code: def _raise_error_if_not_detection_sframe(
      dataset, feature, annotations, require_annotations
  ):
      _raise_error_if_not_sframe(dataset, "datset")
      if feature not in dataset.column_names():
          raise _ToolkitError(
              "Feature column '%s' does not exist" % feature
          )
      if dataset[feature].dtype != _tc.Image:
          raise _ToolkitError("Feature column must contain images")
  
      if require_annotations:
          if annotations not in dataset.column_names():
              raise _ToolkitError(
                  "Annotations column '%s' does not exist" % annotations
              )
          if dataset[annotations].dtype not in [list, dict]:
              raise _ToolkitError(
                  "Annotations column must be of type dict or list"
              )
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import time
  from datetime import datetime
  import six
  import turicreate
  from turicreate.toolkits._model import Model
  import turicreate.toolkits._internal_utils
  from turicreate.toolkits import _coreml_utils
  from turicreate.toolkits._internal_utils import _raise_error_if_not_sframe, _numeric_param_check_range, _raise_error_if_not_iterable
  from turicreate.toolkits._main import ToolkitError
  from turicreate._deps.minimal_package import _minimal_package_import_check
  from ..None import _pre_trained_models
  from .._mps_utils import MpsGraphAPI, MpsGraphNetworkType
label_desc: Use image node_id 2 for calling a global function with example usage: _raise_error_if_not_detection_sframe(dataset, feature, annotations, require_annotations) without return types