code: def test_sorting():
      i, j = symbols("i,j", below_fermi=True)
      a, b = symbols("a,b", above_fermi=True)
      p, q = symbols("p,q")
  
      # p, q
      assert _sort_anticommuting_fermions([Fd(p), F(q)]) == (
          [Fd(p), F(q)],
          0,
      )
      assert _sort_anticommuting_fermions([F(p), Fd(q)]) == (
          [Fd(q), F(p)],
          1,
      )
  
      # i, p
      assert _sort_anticommuting_fermions([F(p), Fd(i)]) == (
          [F(p), Fd(i)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(i), F(p)]) == (
          [F(p), Fd(i)],
          1,
      )
      assert _sort_anticommuting_fermions([Fd(p), Fd(i)]) == (
          [Fd(p), Fd(i)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(i), Fd(p)]) == (
          [Fd(p), Fd(i)],
          1,
      )
      assert _sort_anticommuting_fermions([F(p), F(i)]) == (
          [F(i), F(p)],
          1,
      )
      assert _sort_anticommuting_fermions([F(i), F(p)]) == (
          [F(i), F(p)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(p), F(i)]) == (
          [F(i), Fd(p)],
          1,
      )
      assert _sort_anticommuting_fermions([F(i), Fd(p)]) == (
          [F(i), Fd(p)],
          0,
      )
  
      # a, p
      assert _sort_anticommuting_fermions([F(p), Fd(a)]) == (
          [Fd(a), F(p)],
          1,
      )
      assert _sort_anticommuting_fermions([Fd(a), F(p)]) == (
          [Fd(a), F(p)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(p), Fd(a)]) == (
          [Fd(a), Fd(p)],
          1,
      )
      assert _sort_anticommuting_fermions([Fd(a), Fd(p)]) == (
          [Fd(a), Fd(p)],
          0,
      )
      assert _sort_anticommuting_fermions([F(p), F(a)]) == (
          [F(p), F(a)],
          0,
      )
      assert _sort_anticommuting_fermions([F(a), F(p)]) == (
          [F(p), F(a)],
          1,
      )
      assert _sort_anticommuting_fermions([Fd(p), F(a)]) == (
          [Fd(p), F(a)],
          0,
      )
      assert _sort_anticommuting_fermions([F(a), Fd(p)]) == (
          [Fd(p), F(a)],
          1,
      )
  
      # i, a
      assert _sort_anticommuting_fermions([F(i), Fd(j)]) == (
          [F(i), Fd(j)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(j), F(i)]) == (
          [F(i), Fd(j)],
          1,
      )
      assert _sort_anticommuting_fermions([Fd(a), Fd(i)]) == (
          [Fd(a), Fd(i)],
          0,
      )
      assert _sort_anticommuting_fermions([Fd(i), Fd(a)]) == (
          [Fd(a), Fd(i)],
          1,
      )
      assert _sort_anticommuting_fermions([F(a), F(i)]) == (
          [F(i), F(a)],
          1,
      )
      assert _sort_anticommuting_fermions([F(i), F(a)]) == (
          [F(i), F(a)],
          0,
      )
  
imports: from sympy.physics.secondquant import Dagger, Bd, VarBosonicBasis, BBra, B, BKet, FixedBosonicBasis, matrix_rep, apply_operators, InnerProduct, Commutator, KroneckerDelta, AnnihilateBoson, CreateBoson, BosonicOperator, F, Fd, FKet, BosonState, CreateFermion, AnnihilateFermion, evaluate_deltas, AntiSymmetricTensor, contraction, NO, wicks, PermutationOperator, simplify_index_permutations, _sort_anticommuting_fermions, _get_ordered_dummies, substitute_dummies, FockStateBosonKet, ContractionAppliesOnlyToFermions
  from sympy.concrete.summations import Sum
  from sympy.core.function import Function, expand
  from sympy.core.numbers import I, Rational
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy, Symbol, symbols
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.printing.repr import srepr
  from sympy.simplify.simplify import simplify
  from sympy.testing.pytest import slow, raises
  from sympy.printing.latex import latex
label_desc: Use image node_id 23 for calling a global function with example usage: test_sorting() without return types