code: def test_map():
      arr = SparseArray([0, 1, 2])
      expected = SparseArray([10, 11, 12], fill_value=10)
  
      # dict
      result = arr.map({0: 10, 1: 11, 2: 12})
      tm.assert_sp_array_equal(result, expected)
  
      # series
      result = arr.map(pd.Series({0: 10, 1: 11, 2: 12}))
      tm.assert_sp_array_equal(result, expected)
  
      # function
      result = arr.map(pd.Series({0: 10, 1: 11, 2: 12}))
      expected = SparseArray([10, 11, 12], fill_value=10)
      tm.assert_sp_array_equal(result, expected)
  
imports: import re
  import numpy
  import pytest
  from pandas._libs.sparse import IntIndex
  import pandas
  from pandas import SparseDtype, isna
  import pandas._testing
  from pandas.core.arrays.sparse import SparseArray
label_desc: Use image node_id 9 for calling a global function with example usage: test_map() without return types