code: def test_isna(setup, inf_as_na):
      from ..checkna import isna
      from ....config import options
  
      old_mars_inf_as_na = options.dataframe.mode.use_inf_as_na
      options.dataframe.mode.use_inf_as_na = inf_as_na
      # this option could be changed by mars execution.
      old_pd_inf_as_na = pd.get_option("mode.use_inf_as_na")
      pd.options.mode.use_inf_as_na = inf_as_na
  
      # scalars
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      assert isna("dog") == pd.isna("dog")
      assert isna(None) == pd.isna(None)
      assert isna(md.NA) == pd.isna(pd.NA)
      assert isna(md.NaT) == pd.isna(pd.NaT)
      assert isna(mt.NaN) == pd.isna(np.NaN)
      assert isna(type) == pd.isna(type)
  
      # multi index
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      with pytest.raises(NotImplementedError):
          midx = MultiIndex()
          isna(midx)
  
      # list
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      l = [1, 2, 3, np.Inf, np.NaN, pd.NA, pd.NaT]
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      actual = isna(l).execute().fetch()
      expected = pd.isna(l)
      np.testing.assert_array_equal(expected, actual)
  
      # tuple
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      t = (1, 2, 3, np.Inf, np.NaN, pd.NA, pd.NaT)
      assert not isna(t)
  
      # numpy ndarray
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      narr = np.array((1, 2, 3, np.Inf, np.NaN))
      actual = isna(narr).execute().fetch()
      expected = pd.isna(narr)
      np.testing.assert_array_equal(expected, actual)
  
      # pandas index
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      pi = pd.Index((1, 2, 3, np.Inf, np.NaN, pd.NA, pd.NaT))
      actual = isna(pi).execute().fetch()
      expected = pd.isna(pi)
      np.testing.assert_array_equal(expected, actual)
  
      # pandas series
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      ps = pd.Series((1, 2, 3, np.Inf, np.NaN, pd.NA, pd.NaT))
      actual = isna(ps).execute().fetch()
      expected = pd.isna(ps)
      pd.testing.assert_series_equal(expected, actual)
  
      # pandas dataframe
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      pdf = pd.DataFrame(
          {
              "foo": (1, 2, 3, np.Inf, pd.NA),
              "bar": (4, 5, 6, np.NaN, pd.NaT),
          }
      )
      actual = isna(pdf).execute().fetch()
      expected = pd.isna(pdf)
      pd.testing.assert_frame_equal(expected, actual)
  
      # mars tensor
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      marr = mt.tensor(narr)
      actual = isna(marr).execute().fetch()
      expected = pd.isna(narr)
      np.testing.assert_array_equal(expected, actual)
  
      # mars index
      from ...datasource.index import from_pandas as from_pandas_index
  
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      mi = from_pandas_index(pi)
      actual = isna(mi).execute().fetch()
      expected = pd.isna(pi)
      np.testing.assert_array_equal(expected, actual)
  
      # mars series
      from ...datasource.series import from_pandas as from_pandas_series
  
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      ms = from_pandas_series(ps)
      actual = isna(ms).execute().fetch()
      expected = pd.isna(ps)
      pd.testing.assert_series_equal(expected, actual)
  
      # mars dataframe
      from ...datasource.dataframe import from_pandas as from_pandas_df
  
      assert pd.get_option("mode.use_inf_as_na") == inf_as_na
      mdf = from_pandas_df(pdf)
      actual = isna(mdf).execute().fetch()
      expected = pd.isna(pdf)
      pd.testing.assert_frame_equal(expected, actual)
  
      options.dataframe.mode.use_inf_as_na = old_mars_inf_as_na
      pd.options.mode.use_inf_as_na = old_pd_inf_as_na
  
file_path: mars/mars/dataframe/missing/tests/test_missing.py
imports: import random
  import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....None import tensor
  from ....core import tile
  from ....core.operand import OperandStage
  from ....utils import pd_release_version
  from ...core import MultiIndex
label_desc: Use image node_id 4 for calling a global function with example usage: test_isna(setup, inf_as_na) without return types