code: def __init__(
      self,
      model: tf.keras.Model,
      layer: int = -1,
      input_shape: tuple = None,
      flatten: bool = False,
  ) -> None:
      super().__init__()
      if input_shape and not model.inputs:
          inputs = Input(shape=input_shape)
          model.call(inputs)
      else:
          inputs = model.inputs
      self.model = Model(
          inputs=inputs, outputs=model.layers[layer].output
      )
      self.flatten = Flatten() if flatten else tf.identity
  
file_path: alibi-detect/alibi_detect/cd/tensorflow/preprocess.py
imports: from typing import Callable, Dict, Optional, Type, Union
  import numpy
  import tensorflow
  from alibi_detect.utils.tensorflow.prediction import predict_batch, predict_batch_transformer
  from tensorflow.keras.layers import Dense, Flatten, Input, InputLayer
  from tensorflow.keras.models import Model
label_desc: Use image node_id 1 to create a new HiddenOutput object from inherited base classes: tf.keras with example: obj = HiddenOutput(model, layer, input_shape, flatten)