code: def test_text_color_threshold(cmap, expected):
      # GH 39888
      df = DataFrame(np.arange(100).reshape(10, 10))
      result = (
          df.style.background_gradient(cmap=cmap, axis=None)
          ._compute()
          .ctx
      )
      for k in expected.keys():
          assert result[k] == expected[k]
  
imports: import gc
  import numpy
  import pytest
  from pandas import DataFrame, IndexSlice, Series
  import matplotlib
  from pandas.io.formats.style import Styler
label_desc: Use image node_id 9 for calling a global function with example usage: test_text_color_threshold(cmap, expected) without return types