code: def test_leading_term():
      l = Symbol("l", positive=True)
      assert SingularityFunction(x, 3, 2).as_leading_term(x) == 0
      assert SingularityFunction(x, -2, 1).as_leading_term(x) == 2
      assert SingularityFunction(x, 0, 0).as_leading_term(x) == 1
      assert (
          SingularityFunction(x, 0, 0).as_leading_term(x, cdir=-1) == 0
      )
      assert SingularityFunction(x, 0, -1).as_leading_term(x) == 0
      assert SingularityFunction(x, 0, -2).as_leading_term(x) == 0
      assert (
          SingularityFunction(x + l, 0, 1) / 2
          - SingularityFunction(x + l, l / 2, 1)
          + SingularityFunction(x + l, l, 1) / 2
      ).as_leading_term(x) == -x / 2
  
file_path: sympy/sympy/functions/special/tests/test_singularity_functions.py
imports: from sympy.core.function import Derivative, diff
  from sympy.core.numbers import Float, I, nan, oo, pi
  from sympy.core.relational import Eq
  from sympy.core.symbol import Symbol, symbols
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.functions.special.delta_functions import DiracDelta, Heaviside
  from sympy.functions.special.singularity_functions import SingularityFunction
  from sympy.series.order import O
  from sympy.core.expr import unchanged
  from sympy.core.function import ArgumentIndexError
  from sympy.testing.pytest import raises
label_desc: Use image node_id 3 for calling a global function with example usage: test_leading_term() without return types