code: def test_series_map_execution(setup):
      raw = pd.Series(np.arange(10))
      s = from_pandas_series(raw, chunk_size=7)
  
      with pytest.raises(ValueError):
          # cannot infer dtype, the inferred is int,
          # but actually it is float
          # just due to nan
          s.map({5: 10})
  
      r = s.map({5: 10}, dtype=float)
      result = r.execute().fetch()
      expected = raw.map({5: 10})
      pd.testing.assert_series_equal(result, expected)
  
      # use skip_infer when infer failed
      r = s.map({5: 10}, skip_infer=True)
      assert r.dtype is None
      result = r.execute().fetch()
      assert np.issubdtype(r.dtype, np.dtype("float"))
      expected = raw.map({5: 10})
      pd.testing.assert_series_equal(result, expected)
  
      r = s.map({i: 10 + i for i in range(7)}, dtype=float)
      result = r.execute().fetch()
      expected = raw.map({i: 10 + i for i in range(7)})
      pd.testing.assert_series_equal(result, expected)
  
      r = s.map({5: 10}, dtype=float, na_action="ignore")
      result = r.execute().fetch()
      expected = raw.map({5: 10}, na_action="ignore")
      pd.testing.assert_series_equal(result, expected)
  
      # dtype can be inferred
      r = s.map({5: 10.0})
      result = r.execute().fetch()
      expected = raw.map({5: 10.0})
      pd.testing.assert_series_equal(result, expected)
  
      r = s.map(lambda x: x + 1, dtype=int)
      result = r.execute().fetch()
      expected = raw.map(lambda x: x + 1)
      pd.testing.assert_series_equal(result, expected)
  
      def f(x: int) -> float:
          return x + 1.0
  
      # dtype can be inferred for function
      r = s.map(f)
      result = r.execute().fetch()
      expected = raw.map(lambda x: x + 1.0)
      pd.testing.assert_series_equal(result, expected)
  
      def f(x: int):
          return x + 1.0
  
      # dtype can be inferred for function
      r = s.map(f)
      result = r.execute().fetch()
      expected = raw.map(lambda x: x + 1.0)
      pd.testing.assert_series_equal(result, expected)
  
      # test arg is a md.Series
      raw2 = pd.Series([10], index=[5])
      s2 = from_pandas_series(raw2)
  
      r = s.map(s2, dtype=float)
      result = r.execute().fetch()
      expected = raw.map(raw2)
      pd.testing.assert_series_equal(result, expected)
  
      # test arg is a md.Series, and dtype can be inferred
      raw2 = pd.Series([10.0], index=[5])
      s2 = from_pandas_series(raw2)
  
      r = s.map(s2)
      result = r.execute().fetch()
      expected = raw.map(raw2)
      pd.testing.assert_series_equal(result, expected)
  
      # test str
      raw = pd.Series(["a", "b", "c", "d"])
      s = from_pandas_series(raw, chunk_size=2)
  
      r = s.map({"c": "e"})
      result = r.execute().fetch()
      expected = raw.map({"c": "e"})
      pd.testing.assert_series_equal(result, expected)
  
      # test map index
      raw = pd.Index(np.random.rand(7))
      idx = from_pandas_index(pd.Index(raw), chunk_size=2)
      r = idx.map(f)
      result = r.execute().fetch()
      expected = raw.map(lambda x: x + 1.0)
      pd.testing.assert_index_equal(result, expected)
  
imports: import random
  from collections import OrderedDict
  import numpy
  import pandas
  import pytest
  import mars
  from ....config import options, option_context
  from ....dataframe import DataFrame, Series
  from ....tensor import arange, tensor
  from ....tensor.random import rand
  from ....tests.core import require_cudf
  from ....utils import lazy_import, pd_release_version, no_default
  from ...None import eval, cut, qcut, get_dummies
  from ...core import DATAFRAME_OR_SERIES_TYPE
  from ...datasource.dataframe import from_pandas
  from ...datasource.series import from_pandas
  from ...datasource.index import from_pandas
  from ..None import to_gpu, to_cpu
  from ..bloom_filter import filter_by_bloom_filter
  from ..shift import _enable_no_default, _with_column_freq_bug
  from ..to_numeric import to_numeric
  from ..rebalance import DataFrameRebalance
label_desc: Use image node_id 4 for calling a global function with example usage: test_series_map_execution(setup) and returns: unknown, unknown