code: def test_quantize_factor(
      self, factor, quantiles, bins, by_group, zero_aware, expected_vals
  ):
      quantized_factor = quantize_factor(
          factor,
          quantiles=quantiles,
          bins=bins,
          by_group=by_group,
          zero_aware=zero_aware,
      )
      expected = Series(
          index=factor.index, data=expected_vals, name="factor_quantile"
      ).dropna()
      assert_series_equal(quantized_factor, expected)
  
file_path: alphalens/alphalens/tests/test_utils.py
imports: from __future__ import division
  from unittest import TestCase
  from parameterized import parameterized
  from numpy import nan
  from pandas import Series, DataFrame, date_range, MultiIndex, Timedelta, Timestamp, concat
  from pandas.util.testing import assert_frame_equal, assert_series_equal
  from ..utils import get_clean_factor_and_forward_returns, compute_forward_returns, quantize_factor
label_desc: Use image node_id 4 for calling the UtilsTestCase obj's underlying member method code with example usage: obj.test_quantize_factor(factor, quantiles, bins, by_group, zero_aware, expected_vals) without return types