code: def test_qcut():
      arr = np.random.default_rng(2).standard_normal(1000)
  
      # We store the bins as Index that have been
      # rounded to comparisons are a bit tricky.
      labels, _ = qcut(arr, 4, retbins=True)
      ex_bins = np.quantile(arr, [0, 0.25, 0.5, 0.75, 1.0])
  
      result = labels.categories.left.values
      assert np.allclose(result, ex_bins[:-1], atol=1e-2)
  
      result = labels.categories.right.values
      assert np.allclose(result, ex_bins[1:], atol=1e-2)
  
      ex_levels = cut(arr, ex_bins, include_lowest=True)
      tm.assert_categorical_equal(labels, ex_levels)
  
imports: import os
  import numpy
  import pytest
  import pandas
  from pandas import Categorical, DatetimeIndex, Interval, IntervalIndex, NaT, Series, Timedelta, TimedeltaIndex, Timestamp, cut, date_range, isna, qcut, timedelta_range
  import pandas._testing
  from pandas.api.types import CategoricalDtype
  from pandas.tseries.offsets import Day
label_desc: Use image node_id 1 for calling a global function with example usage: test_qcut() without return types