code: def separatevars(expr, symbols=[], dict=False, force=False):
      """
      Separates variables in an expression, if possible.  By
      default, it separates with respect to all symbols in an
      expression and collects constant coefficients that are
      independent of symbols.
  
      Explanation
      ===========
  
      If ``dict=True`` then the separated terms will be returned
      in a dictionary keyed to their corresponding symbols.
      By default, all symbols in the expression will appear as
      keys; if symbols are provided, then all those symbols will
      be used as keys, and any terms in the expression containing
      other symbols or non-symbols will be returned keyed to the
      string 'coeff'. (Passing None for symbols will return the
      expression in a dictionary keyed to 'coeff'.)
  
      If ``force=True``, then bases of powers will be separated regardless
      of assumptions on the symbols involved.
  
      Notes
      =====
  
      The order of the factors is determined by Mul, so that the
      separated expressions may not necessarily be grouped together.
  
      Although factoring is necessary to separate variables in some
      expressions, it is not necessary in all cases, so one should not
      count on the returned factors being factored.
  
      Examples
      ========
  
      >>> from sympy.abc import x, y, z, alpha
      >>> from sympy import separatevars, sin
      >>> separatevars((x*y)**y)
      (x*y)**y
      >>> separatevars((x*y)**y, force=True)
      x**y*y**y
  
      >>> e = 2*x**2*z*sin(y)+2*z*x**2
      >>> separatevars(e)
      2*x**2*z*(sin(y) + 1)
      >>> separatevars(e, symbols=(x, y), dict=True)
      {'coeff': 2*z, x: x**2, y: sin(y) + 1}
      >>> separatevars(e, [x, y, alpha], dict=True)
      {'coeff': 2*z, alpha: 1, x: x**2, y: sin(y) + 1}
  
      If the expression is not really separable, or is only partially
      separable, separatevars will do the best it can to separate it
      by using factoring.
  
      >>> separatevars(x + x*y - 3*x**2)
      -x*(3*x - y - 1)
  
      If the expression is not separable then expr is returned unchanged
      or (if dict=True) then None is returned.
  
      >>> eq = 2*x + y*sin(x)
      >>> separatevars(eq) == eq
      True
      >>> separatevars(2*x + y*sin(x), symbols=(x, y), dict=True) is None
      True
  
      """
      expr = sympify(expr)
      if dict:
          return _separatevars_dict(_separatevars(expr, force), symbols)
      else:
          return _separatevars(expr, force)
  
imports: from collections import defaultdict
  from sympy.concrete.products import Product
  from sympy.concrete.summations import Sum
  from sympy.core import Basic, S, Add, Mul, Pow, Symbol, sympify, expand_func, Function, Dummy, Expr, factor_terms, expand_power_exp, Eq
  from sympy.core.exprtools import factor_nc
  from sympy.core.parameters import global_parameters
  from sympy.core.function import expand_log, count_ops, _mexpand, nfloat, expand_mul, expand
  from sympy.core.numbers import Float, I, pi, Rational
  from sympy.core.relational import Relational
  from sympy.core.rules import Transform
  from sympy.core.sorting import ordered
  from sympy.core.sympify import _sympify
  from sympy.core.traversal import bottom_up, walk
  from sympy.functions import gamma, exp, sqrt, log, exp_polar, re
  from sympy.functions.combinatorial.factorials import CombinatorialFunction
  from sympy.functions.elementary.complexes import unpolarify, Abs, sign
  from sympy.functions.elementary.exponential import ExpBase
  from sympy.functions.elementary.hyperbolic import HyperbolicFunction
  from sympy.functions.elementary.integers import ceiling
  from sympy.functions.elementary.piecewise import Piecewise, piecewise_fold, piecewise_simplify
  from sympy.functions.elementary.trigonometric import TrigonometricFunction
  from sympy.functions.special.bessel import BesselBase, besselj, besseli, besselk, bessely, jn
  from sympy.functions.special.tensor_functions import KroneckerDelta
  from sympy.integrals.integrals import Integral
  from sympy.matrices.expressions import MatrixExpr, MatAdd, MatMul, MatPow, MatrixSymbol
  from sympy.polys import together, cancel, factor
  from sympy.polys.numberfields.minpoly import _is_sum_surds, _minimal_polynomial_sq
  from sympy.simplify.combsimp import combsimp
  from sympy.simplify.cse_opts import sub_pre, sub_post
  from sympy.simplify.hyperexpand import hyperexpand
  from sympy.simplify.powsimp import powsimp
  from sympy.simplify.radsimp import radsimp, fraction, collect_abs
  from sympy.simplify.sqrtdenest import sqrtdenest
  from sympy.simplify.trigsimp import trigsimp, exptrigsimp
  from sympy.utilities.decorator import deprecated
  from sympy.utilities.iterables import has_variety, sift, subsets, iterable
  from sympy.utilities.misc import as_int
  import mpmath
label_desc: Use image node_id 1 for calling a global function with example usage: separatevars(expr, symbols, dict, force) and returns: _separatevars_dict, _separatevars