code: def test_subsets():
      # combinations
      assert list(subsets([1, 2, 3], 0)) == [()]
      assert list(subsets([1, 2, 3], 1)) == [(1,), (2,), (3,)]
      assert list(subsets([1, 2, 3], 2)) == [(1, 2), (1, 3), (2, 3)]
      assert list(subsets([1, 2, 3], 3)) == [(1, 2, 3)]
      l = list(range(4))
      assert list(subsets(l, 0, repetition=True)) == [()]
      assert list(subsets(l, 1, repetition=True)) == [
          (0,),
          (1,),
          (2,),
          (3,),
      ]
      assert list(subsets(l, 2, repetition=True)) == [
          (0, 0),
          (0, 1),
          (0, 2),
          (0, 3),
          (1, 1),
          (1, 2),
          (1, 3),
          (2, 2),
          (2, 3),
          (3, 3),
      ]
      assert list(subsets(l, 3, repetition=True)) == [
          (0, 0, 0),
          (0, 0, 1),
          (0, 0, 2),
          (0, 0, 3),
          (0, 1, 1),
          (0, 1, 2),
          (0, 1, 3),
          (0, 2, 2),
          (0, 2, 3),
          (0, 3, 3),
          (1, 1, 1),
          (1, 1, 2),
          (1, 1, 3),
          (1, 2, 2),
          (1, 2, 3),
          (1, 3, 3),
          (2, 2, 2),
          (2, 2, 3),
          (2, 3, 3),
          (3, 3, 3),
      ]
      assert len(list(subsets(l, 4, repetition=True))) == 35
  
      assert list(subsets(l[:2], 3, repetition=False)) == []
      assert list(subsets(l[:2], 3, repetition=True)) == [
          (0, 0, 0),
          (0, 0, 1),
          (0, 1, 1),
          (1, 1, 1),
      ]
      assert list(subsets([1, 2], repetition=True)) == [
          (),
          (1,),
          (2,),
          (1, 1),
          (1, 2),
          (2, 2),
      ]
      assert list(subsets([1, 2], repetition=False)) == [
          (),
          (1,),
          (2,),
          (1, 2),
      ]
      assert list(subsets([1, 2, 3], 2)) == [(1, 2), (1, 3), (2, 3)]
      assert list(subsets([1, 2, 3], 2, repetition=True)) == [
          (1, 1),
          (1, 2),
          (1, 3),
          (2, 2),
          (2, 3),
          (3, 3),
      ]
  
imports: from textwrap import dedent
  from itertools import islice, product
  from sympy.core.basic import Basic
  from sympy.core.numbers import Integer
  from sympy.core.sorting import ordered
  from sympy.core.symbol import Dummy, symbols
  from sympy.functions.combinatorial.factorials import factorial
  from sympy.matrices.dense import Matrix
  from sympy.combinatorics import RGS_enum, RGS_unrank, Permutation
  from sympy.utilities.iterables import _partition, _set_partitions, binary_partitions, bracelets, capture, cartes, common_prefix, common_suffix, connected_components, dict_merge, filter_symbols, flatten, generate_bell, generate_derangements, generate_involutions, generate_oriented_forest, group, has_dups, ibin, iproduct, kbins, minlex, multiset, multiset_combinations, multiset_partitions, multiset_permutations, necklaces, numbered_symbols, partitions, permutations, postfixes, prefixes, reshape, rotate_left, rotate_right, runs, sift, strongly_connected_components, subsets, take, topological_sort, unflatten, uniq, variations, ordered_partitions, rotations, is_palindromic, iterable, NotIterable, multiset_derangements, signed_permutations, sequence_partitions, sequence_partitions_empty
  from sympy.utilities.enumerative import factoring_visitor, multiset_partitions_taocp
  from sympy.core.singleton import S
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 6 for calling a global function with example usage: test_subsets() without return types