code: def test_series_ret_bins():
      # see gh-8589
      ser = Series(np.arange(4))
      result, bins = cut(ser, 2, retbins=True)
  
      expected = Series(
          IntervalIndex.from_breaks(
              [-0.003, 1.5, 3], closed="right"
          ).repeat(2)
      ).astype(CategoricalDtype(ordered=True))
      tm.assert_series_equal(result, expected)
  
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 26 for calling a global function with example usage: test_series_ret_bins() without return types