code: def test_cut_pass_labels_compat():
      # see gh-16459
      arr = [50, 5, 10, 15, 20, 30, 70]
      labels = ["Good", "Medium", "Bad"]
  
      result = cut(arr, 3, labels=labels)
      exp = cut(
          arr,
          3,
          labels=Categorical(labels, categories=labels, ordered=True),
      )
      tm.assert_categorical_equal(result, exp)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Categorical, DataFrame, DatetimeIndex, Index, Interval, IntervalIndex, Series, TimedeltaIndex, Timestamp, cut, date_range, interval_range, isna, qcut, timedelta_range, to_datetime
  import pandas._testing
  from pandas.api.types import CategoricalDtype
  import pandas.core.reshape.tile
label_desc: Use image node_id 22 for calling a global function with example usage: test_cut_pass_labels_compat() without return types