code: def sincos_to_sum(expr):
      """Convert products and powers of sin and cos to sums.
  
      Explanation
      ===========
  
      Applied power reduction TRpower first, then expands products, and
      converts products to sums with TR8.
  
      Examples
      ========
  
      >>> from sympy.simplify.fu import sincos_to_sum
      >>> from sympy.abc import x
      >>> from sympy import cos, sin
      >>> sincos_to_sum(16*sin(x)**3*cos(2*x)**2)
      7*sin(x) - 5*sin(3*x) + 3*sin(5*x) - sin(7*x)
      """
  
      if not expr.has(cos, sin):
          return expr
      else:
          return TR8(expand_mul(TRpower(expr)))
  
imports: from collections import defaultdict
  from sympy.core.add import Add
  from sympy.core.expr import Expr
  from sympy.core.exprtools import Factors, gcd_terms, factor_terms
  from sympy.core.function import expand_mul
  from sympy.core.mul import Mul
  from sympy.core.numbers import pi, I
  from sympy.core.power import Pow
  from sympy.core.singleton import S
  from sympy.core.sorting import ordered
  from sympy.core.symbol import Dummy
  from sympy.core.sympify import sympify
  from sympy.core.traversal import bottom_up
  from sympy.functions.combinatorial.factorials import binomial
  from sympy.functions.elementary.hyperbolic import cosh, sinh, tanh, coth, sech, csch, HyperbolicFunction
  from sympy.functions.elementary.trigonometric import cos, sin, tan, cot, sec, csc, sqrt, TrigonometricFunction
  from sympy.ntheory.factor_ import perfect_power
  from sympy.polys.polytools import factor
  from sympy.strategies.tree import greedy
  from sympy.strategies.core import identity, debug
  from sympy import SYMPY_DEBUG
label_desc: Use image node_id 36 for calling a global function with example usage: sincos_to_sum(expr) and returns: expr, TR8