code: def test_partition():
      from sympy.abc import x
  
      a = Partition([1, 2, 3], [4])
      b = Partition([1, 2], [3, 4])
      c = Partition([x])
      l = [a, b, c]
      l.sort(key=default_sort_key)
      assert l == [c, a, b]
      l.sort(key=lambda w: default_sort_key(w, order="rev-lex"))
      assert l == [c, a, b]
  
      assert (a == b) is False
      assert a <= b
      assert (a > b) is False
      assert a != b
      assert a < b
  
      assert (a + 2).partition == [[1, 2], [3, 4]]
      assert (b - 1).partition == [[1, 2, 4], [3]]
  
      assert (a - 1).partition == [[1, 2, 3, 4]]
      assert (a + 1).partition == [[1, 2, 4], [3]]
      assert (b + 1).partition == [[1, 2], [3], [4]]
  
      assert a.rank == 1
      assert b.rank == 3
  
      assert a.RGS == (0, 0, 0, 1)
      assert b.RGS == (0, 0, 1, 1)
  
file_path: sympy/sympy/combinatorics/tests/test_partitions.py
imports: from sympy.core.sorting import ordered, default_sort_key
  from sympy.combinatorics.partitions import Partition, IntegerPartition, RGS_enum, RGS_unrank, RGS_rank, random_integer_partition
  from sympy.testing.pytest import raises
  from sympy.utilities.iterables import partitions
  from sympy.sets.sets import Set, FiniteSet
label_desc: Use image node_id 2 for calling a global function with example usage: test_partition() without return types