code: def test_label_encoder_str_bad_shape(setup, dtype):
      le = LabelEncoder()
      le.fit(mt.tensor(np.array(["apple", "orange"], dtype=dtype)))
      msg = "should be a 1d array"
      with pytest.raises(ValueError, match=msg):
          le.transform("apple")
  
imports: import numpy
  import pytest
  import scipy.sparse
  from sklearn.preprocessing._label import _inverse_binarize_thresholding
  from sklearn.preprocessing._label import _inverse_binarize_multiclass
  from sklearn.utils._testing import assert_array_equal, ignore_warnings
  from sklearn.utils.multiclass import type_of_target
  from ....None import tensor
  from ..None import LabelBinarizer, label_binarize, LabelEncoder
label_desc: Use image node_id 14 for calling a global function with example usage: test_label_encoder_str_bad_shape(setup, dtype) without return types