code: def _search_layer_backwards(model, condition):
      # type: (Model, Callable[[Model, Layer], bool]) -> Layer
      """
      Search for a layer in ``model``, backwards (starting from the output layer),
      checking if the layer is suitable with the callable ``condition``,
      """
      # linear search in reverse through the flattened layers
      for layer in model.layers[::-1]:
          if condition(model, layer):
              # linear search succeeded
              return layer
      # linear search ended with no results
      raise ValueError(
          "Could not find a suitable target layer automatically."
      )
  
imports: from __future__ import absolute_import
  from typing import Union, Optional, Callable, Tuple, List, TYPE_CHECKING
  import numpy
  import keras
  import keras.backend
  from keras.models import Model
  from keras.layers import Layer
  from keras.layers import Conv2D, MaxPooling2D, AveragePooling2D, GlobalMaxPooling2D, GlobalAveragePooling2D
  from keras.preprocessing.image import array_to_img
  from eli5.base import Explanation, TargetExplanation
  from eli5.explain import explain_prediction
  from .gradcam import gradcam, gradcam_backend
label_desc: Use image node_id 11 for calling a global function with example usage: _search_layer_backwards(model, condition) and returns: layer