code: def test_bins_from_interval_index_doc_example():
      # Make sure we preserve the bins.
      ages = np.array([10, 15, 13, 12, 23, 25, 28, 59, 60])
      c = cut(ages, bins=[0, 18, 35, 70])
      expected = IntervalIndex.from_tuples(
          [(0, 18), (18, 35), (35, 70)]
      )
      tm.assert_index_equal(c.categories, expected)
  
      result = cut([25, 20, 50], bins=c.categories)
      tm.assert_index_equal(result.categories, expected)
      tm.assert_numpy_array_equal(
          result.codes, np.array([1, 1, 2], dtype="int8")
      )
  
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 6 for calling a global function with example usage: test_bins_from_interval_index_doc_example() without return types