code: def _(a, b):
      # handle (-oo, oo)
      infty = S.NegativeInfinity, S.Infinity
      if a == Interval(*infty):
          l, r = a.left, a.right
          if l.is_real or l in infty or r.is_real or r in infty:
              return b
  
      # We can't intersect [0,3] with [x,6] -- we don't know if x>0 or x<0
      if not a._is_comparable(b):
          return None
  
      empty = False
  
      if a.start <= b.end and b.start <= a.end:
          # Get topology right.
          if a.start < b.start:
              start = b.start
              left_open = b.left_open
          elif a.start > b.start:
              start = a.start
              left_open = a.left_open
          else:
              start = a.start
              if not _aresame(a.start, b.start):
                  # For example Integer(2) != Float(2)
                  # Prefer the Float boundary because Floats should be
                  # contagious in calculations.
                  if b.start.has(Float) and not a.start.has(Float):
                      start = b.start
                  elif a.start.has(Float) and not b.start.has(Float):
                      start = a.start
                  else:
                      # this is to ensure that if Eq(a.start, b.start) but
                      # type(a.start) != type(b.start) the order of a and b
                      # does not matter for the result
                      start = list(ordered([a, b]))[0].start
              left_open = a.left_open or b.left_open
  
          if a.end < b.end:
              end = a.end
              right_open = a.right_open
          elif a.end > b.end:
              end = b.end
              right_open = b.right_open
          else:
              # see above for logic with start
              end = a.end
              if not _aresame(a.end, b.end):
                  if b.end.has(Float) and not a.end.has(Float):
                      end = b.end
                  elif a.end.has(Float) and not b.end.has(Float):
                      end = a.end
                  else:
                      end = list(ordered([a, b]))[0].end
              right_open = a.right_open or b.right_open
  
          if end - start == 0 and (left_open or right_open):
              empty = True
      else:
          empty = True
  
      if empty:
          return S.EmptySet
  
      return Interval(start, end, left_open, right_open)
  
imports: from sympy.core.basic import _aresame
  from sympy.core.function import Lambda, expand_complex
  from sympy.core.mul import Mul
  from sympy.core.numbers import ilcm, Float
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy, symbols
  from sympy.core.sorting import ordered
  from sympy.functions.elementary.complexes import sign
  from sympy.functions.elementary.integers import floor, ceiling
  from sympy.sets.fancysets import ComplexRegion
  from sympy.sets.sets import FiniteSet, Intersection, Interval, Set, Union
  from sympy.multipledispatch import Dispatcher
  from sympy.sets.conditionset import ConditionSet
  from sympy.sets.fancysets import Integers, Naturals, Reals, Range, ImageSet, Rationals
  from sympy.sets.sets import EmptySet, UniversalSet, imageset, ProductSet
  from sympy.simplify.radsimp import numer
label_desc: Use image node_id 15 for calling a global function with example usage: _(a, b) and returns: Interval, None, S, b