code: def _handle_bounds(bounds):
      # introduce auxilliary variables as needed for univariate
      # inequalities
  
      unbound = []
      R = [0] * len(bounds)  # a (growing) row of zeros
  
      def n():
          return len(R) - 1
  
      def Arow(inc=1):
          R.extend([0] * inc)
          return R[:]
  
      row = []
      for x, (a, b) in enumerate(bounds):
          if a is None and b is None:
              unbound.append(x)
          elif a is None:
              # r[x] = b - u
              A = Arow()
              A[x] = 1
              A[n()] = 1
              B = [b]
              row.append((A, B))
              A = [0] * len(A)
              A[x] = -1
              A[n()] = -1
              B = [-b]
              row.append((A, B))
          elif b is None:
              if a:
                  # r[x] = a + u
                  A = Arow()
                  A[x] = 1
                  A[n()] = -1
                  B = [a]
                  row.append((A, B))
                  A = [0] * len(A)
                  A[x] = -1
                  A[n()] = 1
                  B = [-a]
                  row.append((A, B))
              else:
                  # standard nonnegative relationship
                  pass
          else:
              # r[x] = u + a
              A = Arow()
              A[x] = 1
              A[n()] = -1
              B = [a]
              row.append((A, B))
              A = [0] * len(A)
              A[x] = -1
              A[n()] = 1
              B = [-a]
              row.append((A, B))
              # u <= b - a
              A = [0] * len(A)
              A[x] = 0
              A[n()] = 1
              B = [b - a]
              row.append((A, B))
  
      # make change of variables for unbound variables
      for x in unbound:
          # r[x] = u - v
          A = Arow(2)
          B = [0]
          A[x] = 1
          A[n()] = 1
          A[n() - 1] = -1
          row.append((A, B))
          A = [0] * len(A)
          A[x] = -1
          A[n()] = -1
          A[n() - 1] = 1
          row.append((A, B))
  
      return Matrix(
          [r + [0] * (len(R) - len(r)) for r, _ in row]
      ), Matrix([i[1] for i in row])
  
imports: from sympy.core import sympify
  from sympy.core.exprtools import factor_terms
  from sympy.core.relational import Le, Ge, Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Dummy
  from sympy.core.sorting import ordered
  from sympy.functions.elementary.complexes import sign
  from sympy.matrices.dense import Matrix, zeros
  from sympy.solvers.solveset import linear_eq_to_matrix
  from sympy.utilities.iterables import numbered_symbols
  from sympy.utilities.misc import filldedent
label_desc: Use image node_id 12 for calling a global function with example usage: _handle_bounds(bounds) and returns: Matrix,  Matrix, unknown, R