code: def test_bad_input_args(bad_components):
      """Check that exception is raised for bad input args."""
      X = _make_nested_from_array(
          np.ones(10), n_instances=10, n_columns=1
      )
  
      if isinstance(bad_components, str):
          with pytest.raises(TypeError):
              PCATransformer(n_components=bad_components).fit(X)
      else:
          with pytest.raises(ValueError):
              PCATransformer(n_components=bad_components).fit(X)
  
imports: import numpy
  import pytest
  from sktime.transformations.panel.pca import PCATransformer
  from sktime.utils._testing.panel import _make_nested_from_array
label_desc: Use image node_id 1 for calling a global function with example usage: test_bad_input_args(bad_components) without return types