code: def test_resize():
      p = Permutation(0, 1, 2)
      assert p.resize(5) == Permutation(0, 1, 2, size=5)
      assert p.resize(4) == Permutation(0, 1, 2, size=4)
      assert p.resize(3) == p
      raises(ValueError, lambda: p.resize(2))
  
      p = Permutation(0, 1, 2)(3, 4)(5, 6)
      assert p.resize(3) == Permutation(0, 1, 2)
      raises(ValueError, lambda: p.resize(4))
  
imports: from itertools import permutations
  from copy import copy
  from sympy.core.expr import unchanged
  from sympy.core.numbers import Integer
  from sympy.core.relational import Eq
  from sympy.core.symbol import Symbol
  from sympy.core.singleton import S
  from sympy.combinatorics.permutations import Permutation, _af_parity, _af_rmul, _af_rmuln, AppliedPermutation, Cycle
  from sympy.printing import sstr, srepr, pretty, latex
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 9 for calling a global function with example usage: test_resize() without return types