code: def dup_cyclotomic_p(f, K, irreducible=False):
      """
      Efficiently test if ``f`` is a cyclotomic polynomial.
  
      Examples
      ========
  
      >>> from sympy.polys import ring, ZZ
      >>> R, x = ring("x", ZZ)
  
      >>> f = x**16 + x**14 - x**10 + x**8 - x**6 + x**2 + 1
      >>> R.dup_cyclotomic_p(f)
      False
  
      >>> g = x**16 + x**14 - x**10 - x**8 - x**6 + x**2 + 1
      >>> R.dup_cyclotomic_p(g)
      True
  
      References
      ==========
  
      Bradford, Russell J., and James H. Davenport. "Effective tests for
      cyclotomic polynomials." In International Symposium on Symbolic and
      Algebraic Computation, pp. 244-251. Springer, Berlin, Heidelberg, 1988.
  
      """
      if K.is_QQ:
          try:
              K0, K = K, K.get_ring()
              f = dup_convert(f, K0, K)
          except CoercionFailed:
              return False
      elif not K.is_ZZ:
          return False
  
      lc = dup_LC(f, K)
      tc = dup_TC(f, K)
  
      if lc != 1 or (tc != -1 and tc != 1):
          return False
  
      if not irreducible:
          coeff, factors = dup_factor_list(f, K)
  
          if coeff != K.one or factors != [(f, 1)]:
              return False
  
      n = dup_degree(f)
      g, h = [], []
  
      for i in range(n, -1, -2):
          g.insert(0, f[i])
  
      for i in range(n - 1, -1, -2):
          h.insert(0, f[i])
  
      g = dup_sqr(dup_strip(g), K)
      h = dup_sqr(dup_strip(h), K)
  
      F = dup_sub(g, dup_lshift(h, 1, K), K)
  
      if K.is_negative(dup_LC(F, K)):
          F = dup_neg(F, K)
  
      if F == f:
          return True
  
      g = dup_mirror(f, K)
  
      if K.is_negative(dup_LC(g, K)):
          g = dup_neg(g, K)
  
      if F == g and dup_cyclotomic_p(g, K):
          return True
  
      G = dup_sqf_part(F, K)
  
      if dup_sqr(G, K) == F and dup_cyclotomic_p(G, K):
          return True
  
      return False
  
imports: from sympy.external.gmpy import GROUND_TYPES
  from sympy.core.random import _randint
  from sympy.polys.galoistools import gf_from_int_poly, gf_to_int_poly, gf_lshift, gf_add_mul, gf_mul, gf_div, gf_rem, gf_gcdex, gf_sqf_p, gf_factor_sqf, gf_factor
  from sympy.polys.densebasic import dup_LC, dmp_LC, dmp_ground_LC, dup_TC, dup_convert, dmp_convert, dup_degree, dmp_degree, dmp_degree_in, dmp_degree_list, dmp_from_dict, dmp_zero_p, dmp_one, dmp_nest, dmp_raise, dup_strip, dmp_ground, dup_inflate, dmp_exclude, dmp_include, dmp_inject, dmp_eject, dup_terms_gcd, dmp_terms_gcd
  from sympy.polys.densearith import dup_neg, dmp_neg, dup_add, dmp_add, dup_sub, dmp_sub, dup_mul, dmp_mul, dup_sqr, dmp_pow, dup_div, dmp_div, dup_quo, dmp_quo, dmp_expand, dmp_add_mul, dup_sub_mul, dmp_sub_mul, dup_lshift, dup_max_norm, dmp_max_norm, dup_l1_norm, dup_mul_ground, dmp_mul_ground, dup_quo_ground, dmp_quo_ground
  from sympy.polys.densetools import dup_clear_denoms, dmp_clear_denoms, dup_trunc, dmp_ground_trunc, dup_content, dup_monic, dmp_ground_monic, dup_primitive, dmp_ground_primitive, dmp_eval_tail, dmp_eval_in, dmp_diff_eval_in, dmp_compose, dup_shift, dup_mirror
  from sympy.polys.euclidtools import dmp_primitive, dup_inner_gcd, dmp_inner_gcd
  from sympy.polys.sqfreetools import dup_sqf_p, dup_sqf_norm, dmp_sqf_norm, dup_sqf_part, dmp_sqf_part
  from sympy.polys.polyutils import _sort_factors
  from sympy.polys.polyconfig import query
  from sympy.polys.polyerrors import ExtraneousFactors, DomainError, CoercionFailed, EvaluationFailed
  from sympy.utilities import subsets
  from math import ceil, log
label_desc: Use image node_id 10 for calling a global function with example usage: dup_cyclotomic_p(f, K, irreducible) and returns: False, False, True, True, True, False, False, False