code: def test_nans_count():
      obj = Series(np.random.default_rng(2).standard_normal(50))
      obj[:10] = np.nan
      obj[-10:] = np.nan
      result = obj.rolling(50, min_periods=30).count()
      tm.assert_almost_equal(
          result.iloc[-1], np.isfinite(obj[10:-10]).astype(float).sum()
      )
  
imports: from datetime import datetime
  import numpy
  import pytest
  import pandas.util._test_decorators
  from pandas import DataFrame, DatetimeIndex, Series, concat, isna, notna
  import pandas._testing
  from pandas.tseries import offsets
label_desc: Use image node_id 6 for calling a global function with example usage: test_nans_count() without return types