code: def test_raises_on_bad_key(self):
      # given
      bad_key = 12.0
      p = Pipeline([])
  
      # when & then
      with pytest.raises(ValueError) as err:
          p[bad_key]
      assert str(err.value) == "key must be either an int or a slice"
  
imports: from typing import Any, Mapping
  import pytest
  from darts import TimeSeries
  from darts.dataprocessing import Pipeline
  from darts.dataprocessing.transformers import BaseDataTransformer, FittableDataTransformer, InvertibleDataTransformer, InvertibleMapper, Mapper
  from darts.utils.timeseries_generation import constant_timeseries
label_desc: Use image node_id 10 for calling the TestPipeline obj's underlying member method code with example usage: obj.test_raises_on_bad_key() without return types