code: def test_as_finite_diff():
      x = symbols("x")
      f = Function("f")
      dx = Function("dx")
  
      _as_finite_diff(f(x).diff(x), [x - 2, x - 1, x, x + 1, x + 2])
  
      # Use of undefined functions in ``points``
      df_true = -f(x + dx(x) / 2 - dx(x + dx(x) / 2) / 2) / dx(
          x + dx(x) / 2
      ) + f(x + dx(x) / 2 + dx(x + dx(x) / 2) / 2) / dx(x + dx(x) / 2)
      df_test = diff(f(x), x).as_finite_difference(
          points=dx(x), x0=x + dx(x) / 2
      )
      assert (df_test - df_true).simplify() == 0
  
file_path: sympy/sympy/calculus/tests/test_finite_diff.py
imports: from itertools import product
  from sympy.core.function import Function, diff
  from sympy.core.numbers import Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import symbols
  from sympy.functions.elementary.exponential import exp
  from sympy.calculus.finite_diff import apply_finite_diff, differentiate_finite, finite_diff_weights, _as_finite_diff
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 3 for calling a global function with example usage: test_as_finite_diff() without return types