class_docstr: Various Series and DataFrame methods.
class_docstr_tok: ["Various","Series","and","DataFrame","methods","."]
code: def test_value_counts_with_normalize(self, data):
      # GH 33172
      data = data[:10].unique()
      values = np.array(data[~data.isna()])
      ser = pd.Series(data, dtype=data.dtype)
  
      result = ser.value_counts(normalize=True).sort_index()
  
      if not isinstance(data, pd.Categorical):
          expected = pd.Series(
              [1 / len(values)] * len(values),
              index=result.index,
              name="proportion",
          )
      else:
          expected = pd.Series(
              0.0, index=result.index, name="proportion"
          )
          expected[result > 0] = 1 / len(values)
  
      if getattr(data.dtype, "storage", "") == "pyarrow" or isinstance(
          data.dtype, pd.ArrowDtype
      ):
          # TODO: avoid special-casing
          expected = expected.astype("double[pyarrow]")
      elif getattr(data.dtype, "storage", "") == "pyarrow_numpy":
          # TODO: avoid special-casing
          expected = expected.astype("float64")
      elif na_value_for_dtype(data.dtype) is pd.NA:
          # TODO(GH#44692): avoid special-casing
          expected = expected.astype("Float64")
  
      tm.assert_series_equal(result, expected)
  
imports: import inspect
  import operator
  import numpy
  import pytest
  from pandas._typing import Dtype
  from pandas.core.dtypes.common import is_bool_dtype
  from pandas.core.dtypes.dtypes import NumpyEADtype
  from pandas.core.dtypes.missing import na_value_for_dtype
  import pandas
  import pandas._testing
  from pandas.core.sorting import nargsort
label_desc: Use image node_id 4 for calling the BaseMethodsTests obj's underlying member method code with example usage: obj.test_value_counts_with_normalize(data) without return types