code: def test_resample_count_empty_series(freq, index, resample_method):
      # GH28427
      ser = Series(index=index)
      if freq == "ME" and isinstance(ser.index, TimedeltaIndex):
          msg = (
              "Resampling on a TimedeltaIndex requires fixed-duration `freq`, "
              "e.g. '24h' or '3D', not <MonthEnd>"
          )
          with pytest.raises(ValueError, match=msg):
              ser.resample(freq)
          return
      elif freq == "ME" and isinstance(ser.index, PeriodIndex):
          # index is PeriodIndex, so convert to corresponding Period freq
          freq = "M"
  
      warn = None
      if isinstance(ser.index, PeriodIndex):
          warn = FutureWarning
      msg = "Resampling with a PeriodIndex is deprecated"
      with tm.assert_produces_warning(warn, match=msg):
          rs = ser.resample(freq)
  
      result = getattr(rs, resample_method)()
  
      index = _asfreq_compat(ser.index, freq)
  
      expected = Series([], dtype="int64", index=index, name=ser.name)
  
      tm.assert_series_equal(result, expected)
  
imports: from datetime import datetime
  import numpy
  import pytest
  from pandas import DataFrame, DatetimeIndex, Index, MultiIndex, NaT, PeriodIndex, Series, TimedeltaIndex
  import pandas._testing
  from pandas.core.groupby.groupby import DataError
  from pandas.core.groupby.grouper import Grouper
  from pandas.core.indexes.datetimes import date_range
  from pandas.core.indexes.period import period_range
  from pandas.core.indexes.timedeltas import timedelta_range
  from pandas.core.resample import _asfreq_compat
label_desc: Use image node_id 7 for calling a global function with example usage: test_resample_count_empty_series(freq, index, resample_method) without return types