code: def not_empty_in(finset_intersection, *syms):
      """
      Finds the domain of the functions in ``finset_intersection`` in which the
      ``finite_set`` is not-empty.
  
      Parameters
      ==========
  
      finset_intersection : Intersection of FiniteSet
          The unevaluated intersection of FiniteSet containing
          real-valued functions with Union of Sets
      syms : Tuple of symbols
          Symbol for which domain is to be found
  
      Raises
      ======
  
      NotImplementedError
          The algorithms to find the non-emptiness of the given FiniteSet are
          not yet implemented.
      ValueError
          The input is not valid.
      RuntimeError
          It is a bug, please report it to the github issue tracker
          (https://github.com/sympy/sympy/issues).
  
      Examples
      ========
  
      >>> from sympy import FiniteSet, Interval, not_empty_in, oo
      >>> from sympy.abc import x
      >>> not_empty_in(FiniteSet(x/2).intersect(Interval(0, 1)), x)
      Interval(0, 2)
      >>> not_empty_in(FiniteSet(x, x**2).intersect(Interval(1, 2)), x)
      Union(Interval(1, 2), Interval(-sqrt(2), -1))
      >>> not_empty_in(FiniteSet(x**2/(x + 2)).intersect(Interval(1, oo)), x)
      Union(Interval.Lopen(-2, -1), Interval(2, oo))
      """
  
      # TODO: handle piecewise defined functions
      # TODO: handle transcendental functions
      # TODO: handle multivariate functions
      if len(syms) == 0:
          raise ValueError("One or more symbols must be given in syms.")
  
      if finset_intersection is S.EmptySet:
          return S.EmptySet
  
      if isinstance(finset_intersection, Union):
          elm_in_sets = finset_intersection.args[0]
          return Union(
              not_empty_in(finset_intersection.args[1], *syms),
              elm_in_sets,
          )
  
      if isinstance(finset_intersection, FiniteSet):
          finite_set = finset_intersection
          _sets = S.Reals
      else:
          finite_set = finset_intersection.args[1]
          _sets = finset_intersection.args[0]
  
      if not isinstance(finite_set, FiniteSet):
          raise ValueError(
              "A FiniteSet must be given, not %s: %s"
              % (type(finite_set), finite_set)
          )
  
      if len(syms) == 1:
          symb = syms[0]
      else:
          raise NotImplementedError(
              "more than one variables %s not handled" % (syms,)
          )
  
      def elm_domain(expr, intrvl):
          """Finds the domain of an expression in any given interval"""
          from sympy.solvers.solveset import solveset
  
          _start = intrvl.start
          _end = intrvl.end
          _singularities = solveset(
              expr.as_numer_denom()[1], symb, domain=S.Reals
          )
  
          if intrvl.right_open:
              if _end is S.Infinity:
                  _domain1 = S.Reals
              else:
                  _domain1 = solveset(expr < _end, symb, domain=S.Reals)
          else:
              _domain1 = solveset(expr <= _end, symb, domain=S.Reals)
  
          if intrvl.left_open:
              if _start is S.NegativeInfinity:
                  _domain2 = S.Reals
              else:
                  _domain2 = solveset(
                      expr > _start, symb, domain=S.Reals
                  )
          else:
              _domain2 = solveset(expr >= _start, symb, domain=S.Reals)
  
          # domain in the interval
          expr_with_sing = Intersection(_domain1, _domain2)
          expr_domain = Complement(expr_with_sing, _singularities)
          return expr_domain
  
      if isinstance(_sets, Interval):
          return Union(
              *[elm_domain(element, _sets) for element in finite_set]
          )
  
      if isinstance(_sets, Union):
          _domain = S.EmptySet
          for intrvl in _sets.args:
              _domain_element = Union(
                  *[
                      elm_domain(element, intrvl)
                      for element in finite_set
                  ]
              )
              _domain = Union(_domain, _domain_element)
          return _domain
  
imports: from .accumulationbounds import AccumBounds, AccumulationBounds
  from .singularities import singularities
  from sympy.core import Pow, S
  from sympy.core.function import diff, expand_mul, Function
  from sympy.core.kind import NumberKind
  from sympy.core.mod import Mod
  from sympy.core.numbers import equal_valued
  from sympy.core.relational import Relational
  from sympy.core.symbol import Symbol, Dummy
  from sympy.core.sympify import _sympify
  from sympy.functions.elementary.complexes import Abs, im, re
  from sympy.functions.elementary.exponential import exp, log
  from sympy.functions.elementary.integers import frac
  from sympy.functions.elementary.piecewise import Piecewise
  from sympy.functions.elementary.trigonometric import TrigonometricFunction, sin, cos, tan, cot, csc, sec, asin, acos, acot, atan, asec, acsc
  from sympy.functions.elementary.hyperbolic import sinh, cosh, tanh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch
  from sympy.polys.polytools import degree, lcm_list
  from sympy.sets.sets import Interval, Intersection, FiniteSet, Union, Complement
  from sympy.sets.fancysets import ImageSet
  from sympy.sets.conditionset import ConditionSet
  from sympy.utilities import filldedent
  from sympy.utilities.iterables import iterable
label_desc: Use image node_id 3 for calling a global function with example usage: not_empty_in(finset_intersection) and returns: S, Union, expr_domain, Union, _domain