code: def _get_custom_layers(spec):
      """
  
      Returns a list of all neural network custom layers in the spec.
  
      Parameters
      ----------
      spec: mlmodel spec
  
      Returns
      -------
  
      [NN layer] A list of custom layer implementations
      """
      layers = _get_nn_layers(spec)
      layers_out = []
      for layer in layers:
          if layer.WhichOneof("layer") == "custom":
              layers_out.append(layer)
  
      return layers_out
  
imports: from collections.abc import Iterable
  from functools import lru_cache
  import math
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import Optional, Union
  import warnings
  import numpy
  import coremltools
  from coremltools import ComputeUnit
  from coremltools.converters.mil.mil.passes.defs.preprocess import NameSanitizer
  from coremltools.proto import Model_pb2
  import coremltools.proto.MIL_pb2
  from .._deps import _HAS_SCIPY
label_desc: Use image node_id 22 for calling a global function with example usage: _get_custom_layers(spec) and returns: layers_out