code: def is_input_layer(
      layer: Layer, ignore_reshape_layers: bool = True
  ) -> bool:
      """Checks if layer is an input layer."""
      # Triggers if ALL inputs of layer are connected
      # to a Keras input layer object.
      # Note: In the sequential api the Sequential object
      # adds the Input layer if the user does not.
  
      layer_inputs = get_input_layers(layer)
      # We ignore certain layers, that do not modify
      # the data content.
      # TODO: update this list!
      ignored_layers = (
          klayers.Flatten,
          klayers.Permute,
          klayers.Reshape,
      )
      while any(isinstance(x, ignored_layers) for x in layer_inputs):
          tmp = set()
          for l in layer_inputs:
              if ignore_reshape_layers and isinstance(
                  l, ignored_layers
              ):
                  tmp.update(get_input_layers(l))
              else:
                  tmp.add(l)
          layer_inputs = tmp
  
      return all(
          isinstance(x, klayers.InputLayer) for x in layer_inputs
      )
  
imports: from __future__ import annotations
  import tensorflow.keras.layers
  from tensorflow import Module, keras
  import innvestigate.backend
  from innvestigate.backend.types import Layer, Model
label_desc: Use image node_id 16 for calling a global function with example usage: is_input_layer(layer, ignore_reshape_layers) and returns: all