code: def test_bad_input_spec(self):
      # Single input
      inputs = Input(shape=(4,))
      outputs = layers.Dense(2)(inputs)
      model = Functional(inputs, outputs)
      with self.assertRaisesRegex(
          ValueError,
          r"expected shape=\(None, 4\), found shape=\(2, 3\)",
      ):
          model(np.zeros((2, 3)))
      with self.assertRaisesRegex(ValueError, "expected 1 input"):
          model([np.zeros((2, 4)), np.zeros((2, 4))])
  
      # List input
      input_a = Input(shape=(4,), name="a")
      input_b = Input(shape=(4,), name="b")
      x = input_a + input_b
      outputs = layers.Dense(2)(x)
      model = Functional([input_a, input_b], outputs)
      with self.assertRaisesRegex(ValueError, "expected 2 input"):
          model(np.zeros((2, 3)))
      with self.assertRaisesRegex(
          ValueError,
          r"expected shape=\(None, 4\), found shape=\(2, 3\)",
      ):
          model([np.zeros((2, 3)), np.zeros((2, 4))])
  
      # Dict input
      model = Functional({"a": input_a, "b": input_b}, outputs)
      with self.assertRaisesRegex(ValueError, "expected 2 input"):
          model(np.zeros((2, 3)))
      with self.assertRaisesRegex(
          ValueError,
          r"expected shape=\(None, 4\), found shape=\(2, 3\)",
      ):
          model({"a": np.zeros((2, 3)), "b": np.zeros((2, 4))})
  
imports: import warnings
  import numpy
  import pytest
  from keras import backend
  from keras import layers
  from keras import testing
  from keras.layers.core.input_layer import Input
  from keras.layers.input_spec import InputSpec
  from keras.models import Functional
  from keras.models import Model
label_desc: Use image node_id 15 for calling the FunctionalTest obj's underlying member method code with example usage: obj.test_bad_input_spec() without return types