code: def test_bins(func):
      data = func([0.2, 1.4, 2.5, 6.2, 9.7, 2.1])
      result, bins = cut(data, 3, retbins=True)
  
      intervals = IntervalIndex.from_breaks(bins.round(3))
      intervals = intervals.take([0, 0, 0, 1, 2, 0])
      expected = Categorical(intervals, ordered=True)
  
      tm.assert_categorical_equal(result, expected)
      tm.assert_almost_equal(
          bins, np.array([0.1905, 3.36666667, 6.53333333, 9.7])
      )
  
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 2 for calling a global function with example usage: test_bins(func) without return types