code: def test_format_index_dict(styler):
      ctx = styler.format_index({0: lambda v: v.upper()})._translate(
          True, True
      )
      for i, val in enumerate(["X", "Y"]):
          assert ctx["body"][i][0]["display_value"] == val
  
imports: import numpy
  import pytest
  from pandas import NA, DataFrame, IndexSlice, MultiIndex, NaT, Timestamp, option_context
  from pandas.io.formats.style import Styler
  from pandas.io.formats.style_render import _str_escape
label_desc: Use image node_id 8 for calling a global function with example usage: test_format_index_dict(styler) without return types