code: def _check_unsupported_layers(model, add_custom_layers=False):
      # When add_custom_layers = True, we just convert all layers not present in
      # registry as custom layer placeholders
      if add_custom_layers:
          return
      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.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/_keras2_converter.py
imports: import logging
  from six import string_types
  from ...models.neural_network import NeuralNetworkBuilder
  from ...models.neural_network.update_optimizer_utils import AdamParams
  from ...models.neural_network.update_optimizer_utils import SgdParams
  from ...proto import FeatureTypes_pb2
  from collections import OrderedDict
  from ...proto import Model_pb2
  from ...models import datatypes
  from ...models import MLModel
  from ...models.utils import save_spec
  from ..._deps import _HAS_KERAS2_TF
label_desc: Use image node_id 3 for calling a global function with example usage: _check_unsupported_layers(model, add_custom_layers) without return types