code: def _check_unsupported_layers(model):
      for i, layer in enumerate(model.layers):
          if isinstance(layer, _keras.models.Sequential) or isinstance(
              layer, _keras.models.Model
          ):
              _check_unsupported_layers(layer)
          else:
              if type(layer) not in _KERAS_LAYER_REGISTRY:
                  raise ValueError(
                      "Keras layer '%s' not supported. "
                      % str(type(layer))
                  )
              if isinstance(layer, _keras.engine.topology.Merge):
                  if layer.layers is None:
                      continue
                  for merge_layer in layer.layers:
                      if isinstance(
                          merge_layer, _keras.models.Sequential
                      ) or isinstance(merge_layer, _keras.models.Model):
                          _check_unsupported_layers(merge_layer)
              if isinstance(
                  layer, _keras.layers.wrappers.TimeDistributed
              ):
                  if type(layer.layer) not in _KERAS_LAYER_REGISTRY:
                      raise ValueError(
                          "Keras layer '%s' not supported. "
                          % str(type(layer.layer))
                      )
              if isinstance(
                  layer, _keras.layers.wrappers.Bidirectional
              ):
                  if not isinstance(
                      layer.layer, _keras.layers.recurrent.LSTM
                  ):
                      raise ValueError(
                          "Keras bi-directional wrapper conversion supports only "
                          "LSTM layer at this time. "
                      )
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/keras/_keras_converter.py
imports: from six import string_types
  from ...models.neural_network import NeuralNetworkBuilder
  from ...proto import FeatureTypes_pb2
  from collections import OrderedDict
  from ...models import datatypes, _METADATA_VERSION, _METADATA_SOURCE
  from ...models import MLModel
  from ...models import _MLMODEL_FULL_PRECISION, _MLMODEL_HALF_PRECISION, _VALID_MLMODEL_PRECISION_TYPES
  from ...models.utils import _convert_neural_network_spec_weights_to_fp16
  from ..._deps import _HAS_KERAS_TF
  from ..._deps import _HAS_KERAS2_TF
  from coremltools import __version__
label_desc: Use image node_id 1 for calling a global function with example usage: _check_unsupported_layers(model) without return types