code: def _ivl(cond, x):
      """return the interval corresponding to the condition
  
      Conditions in spline's Piecewise give the range over
      which an expression is valid like (lo <= x) & (x <= hi).
      This function returns (lo, hi).
      """
      if isinstance(cond, And) and len(cond.args) == 2:
          a, b = cond.args
          if a.lts == x:
              a, b = b, a
          return a.lts, b.gts
      raise TypeError("unexpected cond type: %s" % cond)
  
file_path: sympy/sympy/functions/special/bsplines.py
imports: from sympy.core import S, sympify
  from sympy.core.symbol import Dummy, symbols
  from sympy.functions import Piecewise, piecewise_fold
  from sympy.logic.boolalg import And
  from sympy.sets.sets import Interval
  from functools import lru_cache
label_desc: Use image node_id 1 for calling a global function with example usage: _ivl(cond, x) and returns: a,  b