code: def test_format_with_precision(precision, expected):
      # Issue #13257
      df = DataFrame(
          [[1.0, 2.0090, 3.2121, 4.566]],
          columns=[1.0, 2.0090, 3.2121, 4.566],
      )
      styler = Styler(df)
      styler.format(precision=precision)
      styler.format_index(precision=precision, axis=1)
  
      ctx = styler._translate(True, True)
      for col, exp in enumerate(expected):
          assert (
              ctx["body"][0][col + 1]["display_value"] == exp
          )  # format test
          assert ctx["head"][0][col + 1]["display_value"] == exp
  
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 20 for calling a global function with example usage: test_format_with_precision(precision, expected) without return types