code: def test_dup_from_to_dict():
      assert dup_from_raw_dict({}, ZZ) == []
      assert dup_from_dict({}, ZZ) == []
  
      assert dup_to_raw_dict([]) == {}
      assert dup_to_dict([]) == {}
  
      assert dup_to_raw_dict([], ZZ, zero=True) == {0: ZZ(0)}
      assert dup_to_dict([], ZZ, zero=True) == {(0,): ZZ(0)}
  
      f = [3, 0, 0, 2, 0, 0, 0, 0, 8]
      g = {8: 3, 5: 2, 0: 8}
      h = {(8,): 3, (5,): 2, (0,): 8}
  
      assert dup_from_raw_dict(g, ZZ) == f
      assert dup_from_dict(h, ZZ) == f
  
      assert dup_to_raw_dict(f) == g
      assert dup_to_dict(f) == h
  
      R, x, y = ring("x,y", ZZ)
      K = R.to_domain()
  
      f = [R(3), R(0), R(2), R(0), R(0), R(8)]
      g = {5: R(3), 3: R(2), 0: R(8)}
      h = {(5,): R(3), (3,): R(2), (0,): R(8)}
  
      assert dup_from_raw_dict(g, K) == f
      assert dup_from_dict(h, K) == f
  
      assert dup_to_raw_dict(f) == g
      assert dup_to_dict(f) == h
  
imports: from sympy.polys.densebasic import ninf, dup_LC, dmp_LC, dup_TC, dmp_TC, dmp_ground_LC, dmp_ground_TC, dmp_true_LT, dup_degree, dmp_degree, dmp_degree_in, dmp_degree_list, dup_strip, dmp_strip, dmp_validate, dup_reverse, dup_copy, dmp_copy, dup_normal, dmp_normal, dup_convert, dmp_convert, dup_from_sympy, dmp_from_sympy, dup_nth, dmp_nth, dmp_ground_nth, dmp_zero_p, dmp_zero, dmp_one_p, dmp_one, dmp_ground_p, dmp_ground, dmp_negative_p, dmp_positive_p, dmp_zeros, dmp_grounds, dup_from_dict, dup_from_raw_dict, dup_to_dict, dup_to_raw_dict, dmp_from_dict, dmp_to_dict, dmp_swap, dmp_permute, dmp_nest, dmp_raise, dup_deflate, dmp_deflate, dup_multi_deflate, dmp_multi_deflate, dup_inflate, dmp_inflate, dmp_exclude, dmp_include, dmp_inject, dmp_eject, dup_terms_gcd, dmp_terms_gcd, dmp_list_terms, dmp_apply_pairs, dup_slice, dup_random
  from sympy.polys.specialpolys import f_polys
  from sympy.polys.domains import ZZ, QQ
  from sympy.polys.rings import ring
  from sympy.core.singleton import S
  from sympy.testing.pytest import raises
  from sympy.core.numbers import oo
label_desc: Use image node_id 37 for calling a global function with example usage: test_dup_from_to_dict() without return types