code: def test_compare_series_nans_assert_equal() -> None:
      srs1 = pl.Series([1.0, 2.0, nan, 4.0, None, 6.0])
      srs2 = pl.Series([1.0, nan, 3.0, 4.0, None, 6.0])
      srs3 = pl.Series([1.0, 2.0, 3.0, 4.0, None, 6.0])
  
      for srs in (srs1, srs2, srs3):
          assert_series_equal(srs, srs)
          assert_series_equal(srs, srs, check_exact=True)
  
      for check_exact in (False, True):
          if check_exact:
              check_msg = "exact value mismatch"
          else:
              check_msg = "Series are different.*value mismatch.*"
  
          with pytest.raises(AssertionError, match=check_msg):
              assert_series_equal(srs1, srs2, check_exact=check_exact)
          with pytest.raises(AssertionError, match=check_msg):
              assert_series_equal(srs1, srs3, check_exact=check_exact)
  
      srs4 = pl.Series([1.0, 2.0, 3.0, 4.0, None, 6.0])
      srs5 = pl.Series([1.0, 2.0, 3.0, 4.0, nan, 6.0])
      srs6 = pl.Series([1, 2, 3, 4, None, 6])
  
      assert_series_equal(srs4, srs6, check_dtype=False)
      with pytest.raises(AssertionError):
          assert_series_equal(srs5, srs6, check_dtype=False)
      assert_series_not_equal(srs5, srs6, check_dtype=True)
  
      # nested
      for float_type in (pl.Float32, pl.Float64):
          srs = pl.Series([[0.0, nan]], dtype=pl.List(float_type))
          assert srs.dtype == pl.List(float_type)
          assert_series_equal(srs, srs)
  
imports: from __future__ import annotations
  import math
  from datetime import datetime, time, timedelta
  from decimal import Decimal
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_series_equal, assert_series_not_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_compare_series_nans_assert_equal() without return types