code: def test_background_gradient_nullable_dtypes():
      # GH 50712
      df1 = DataFrame([[1], [0], [np.nan]], dtype=float)
      df2 = DataFrame([[1], [0], [None]], dtype="Int64")
  
      ctx1 = df1.style.background_gradient()._compute().ctx
      ctx2 = df2.style.background_gradient()._compute().ctx
      assert ctx1 == ctx2
  
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 18 for calling a global function with example usage: test_background_gradient_nullable_dtypes() without return types