code: def test_data_frame_value_counts_dropna(
      nulls_fixture,
      dropna,
      normalize,
      name,
      expected_data,
      expected_index,
  ):
      # GH 41334
      # 3-way compare with :meth:`~DataFrame.value_counts`
      # Tests with nulls from frame/methods/test_value_counts.py
      names_with_nulls_df = DataFrame(
          {
              "key": [1, 1, 1, 1],
              "first_name": ["John", "Anne", "John", "Beth"],
              "middle_name": [
                  "Smith",
                  nulls_fixture,
                  nulls_fixture,
                  "Louise",
              ],
          },
      )
      result_frame = names_with_nulls_df.value_counts(
          dropna=dropna, normalize=normalize
      )
      expected = Series(
          data=expected_data,
          index=expected_index,
          name=name,
      )
      if normalize:
          expected /= float(len(expected_data))
  
      tm.assert_series_equal(result_frame, expected)
  
      result_frame_groupby = names_with_nulls_df.groupby(
          "key"
      ).value_counts(dropna=dropna, normalize=normalize)
  
      tm.assert_series_equal(result_frame_groupby, expected)
  
imports: import numpy
  import pytest
  import pandas.util._test_decorators
  from pandas import Categorical, CategoricalIndex, DataFrame, Grouper, Index, MultiIndex, Series, date_range, to_datetime
  import pandas._testing
  from pandas.util.version import Version
label_desc: Use image node_id 18 for calling a global function with example usage: test_data_frame_value_counts_dropna(nulls_fixture, dropna, normalize, name, expected_data, expected_index) without return types