code: def test_ewma_nan_handling():
      s = Series([1.0] + [np.nan] * 5 + [1.0])
      result = s.ewm(com=5).mean()
      tm.assert_series_equal(result, Series([1.0] * len(s)))
  
      s = Series([np.nan] * 2 + [1.0] + [np.nan] * 2 + [1.0])
      result = s.ewm(com=5).mean()
      tm.assert_series_equal(result, Series([np.nan] * 2 + [1.0] * 4))
  
imports: import numpy
  import pytest
  from pandas import DataFrame, DatetimeIndex, Series, date_range
  import pandas._testing
label_desc: Use image node_id 19 for calling a global function with example usage: test_ewma_nan_handling() without return types