code: def test_dup_count_real_roots():
      R, x = ring("x", ZZ)
  
      assert R.dup_count_real_roots(0) == 0
      assert R.dup_count_real_roots(7) == 0
  
      f = x - 1
      assert R.dup_count_real_roots(f) == 1
      assert R.dup_count_real_roots(f, inf=1) == 1
      assert R.dup_count_real_roots(f, sup=0) == 0
      assert R.dup_count_real_roots(f, sup=1) == 1
      assert R.dup_count_real_roots(f, inf=0, sup=1) == 1
      assert R.dup_count_real_roots(f, inf=0, sup=2) == 1
      assert R.dup_count_real_roots(f, inf=1, sup=2) == 1
  
      f = x**2 - 2
      assert R.dup_count_real_roots(f) == 2
      assert R.dup_count_real_roots(f, sup=0) == 1
      assert R.dup_count_real_roots(f, inf=-1, sup=1) == 0
  
imports: from sympy.polys.rings import ring
  from sympy.polys.domains import ZZ, QQ, ZZ_I, EX
  from sympy.polys.polyerrors import DomainError, RefinementFailed, PolynomialError
  from sympy.polys.rootisolation import dup_cauchy_upper_bound, dup_cauchy_lower_bound, dup_mignotte_sep_bound_squared
  from sympy.testing.pytest import raises
label_desc: Use image node_id 10 for calling a global function with example usage: test_dup_count_real_roots() without return types