code: def test_map():
      data = {
          "A": [0.0, 1.0, 2.0, 3.0, 4.0],
          "B": [0.0, 1.0, 0.0, 1.0, 0.0],
          "C": ["foo1", "foo2", "foo3", "foo4", "foo5"],
          "D": bdate_range("1/1/2009", periods=5),
      }
  
      source = Series(data["B"], index=data["C"])
      target = Series(data["C"][:4], index=data["D"][:4])
  
      merged = target.map(source)
  
      for k, v in merged.items():
          assert v == source[target[k]]
  
      # input could be a dict
      merged = target.map(source.to_dict())
  
      for k, v in merged.items():
          assert v == source[target[k]]
  
imports: from collections import Counter, defaultdict
  from decimal import Decimal
  import math
  import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, bdate_range, date_range, isna, timedelta_range
  import pandas._testing
label_desc: Use image node_id 11 for calling a global function with example usage: test_map() without return types