code: def test_rgs():
      raises(ValueError, lambda: RGS_unrank(-1, 3))
      raises(ValueError, lambda: RGS_unrank(3, 0))
      raises(ValueError, lambda: RGS_unrank(10, 1))
  
      raises(
          ValueError,
          lambda: Partition.from_rgs(list(range(3)), list(range(2))),
      )
      raises(
          ValueError,
          lambda: Partition.from_rgs(list(range(1, 3)), list(range(2))),
      )
      assert RGS_enum(-1) == 0
      assert RGS_enum(1) == 1
      assert RGS_unrank(7, 5) == [0, 0, 1, 0, 2]
      assert RGS_unrank(23, 14) == [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          1,
          0,
          2,
          2,
      ]
      assert RGS_rank(RGS_unrank(40, 100)) == 40
  
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 4 for calling a global function with example usage: test_rgs() without return types