code: def _mostfunc(lhs, func, X=None):
      """Returns the term in lhs which contains the most of the
      func-type things e.g. log(log(x)) wins over log(x) if both terms appear.
  
      ``func`` can be a function (exp, log, etc...) or any other SymPy object,
      like Pow.
  
      If ``X`` is not ``None``, then the function returns the term composed with the
      most ``func`` having the specified variable.
  
      Examples
      ========
  
      >>> from sympy.solvers.bivariate import _mostfunc
      >>> from sympy import exp
      >>> from sympy.abc import x, y
      >>> _mostfunc(exp(x) + exp(exp(x) + 2), exp)
      exp(exp(x) + 2)
      >>> _mostfunc(exp(x) + exp(exp(y) + 2), exp)
      exp(exp(y) + 2)
      >>> _mostfunc(exp(x) + exp(exp(y) + 2), exp, x)
      exp(x)
      >>> _mostfunc(x, exp, x) is None
      True
      >>> _mostfunc(exp(x) + exp(x*y), exp, x)
      exp(x)
      """
      fterms = [
          tmp
          for tmp in lhs.atoms(func)
          if (
              not X
              or X.is_Symbol
              and X in tmp.free_symbols
              or not X.is_Symbol
              and tmp.has(X)
          )
      ]
      if len(fterms) == 1:
          return fterms[0]
      elif fterms:
          return max(list(ordered(fterms)), key=lambda x: x.count(func))
      return None
  
imports: from sympy.core.add import Add
  from sympy.core.exprtools import factor_terms
  from sympy.core.function import expand_log, _mexpand
  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.functions.elementary.exponential import LambertW, exp, log
  from sympy.functions.elementary.miscellaneous import root
  from sympy.polys.polyroots import roots
  from sympy.polys.polytools import Poly, factor
  from sympy.simplify.simplify import separatevars
  from sympy.simplify.radsimp import collect
  from sympy.simplify.simplify import powsimp
  from sympy.solvers.solvers import solve, _invert
  from sympy.utilities.iterables import uniq
label_desc: Use image node_id 2 for calling a global function with example usage: _mostfunc(lhs, func, X) and returns: None, fterms, max