code: def _build_output_bounds(model_def, input_bounds):
      """
      This helper function develops bounds of the output variable based on the
      values of the input_bounds and the signs of the slope
  
      Arguments:
          model_def -- Model definition
          input_bounds -- Dict of input bounds
  
      Returns:
          List that contains the conservative lower and upper bounds of the
          output variable
      """
      leaves = model_def.leaves
      n_inputs = model_def.n_inputs
      tree_ids = np.array(list(leaves.keys()))
      features = np.arange(0, n_inputs)
  
      # Initialize bounds and variables
      bounds = [0, 0]
      upper_bound = 0
      lower_bound = 0
      for tree in tree_ids:
          for leaf in leaves[tree]:
              slopes = leaves[tree][leaf]["slope"]
              intercept = leaves[tree][leaf]["intercept"]
              for k in features:
                  if slopes[k] <= 0:
                      upper_bound += (
                          slopes[k] * input_bounds[k][0] + intercept
                      )
                      lower_bound += (
                          slopes[k] * input_bounds[k][1] + intercept
                      )
                  else:
                      upper_bound += (
                          slopes[k] * input_bounds[k][1] + intercept
                      )
                      lower_bound += (
                          slopes[k] * input_bounds[k][0] + intercept
                      )
                  if upper_bound >= bounds[1]:
                      bounds[1] = upper_bound
                  if lower_bound <= bounds[0]:
                      bounds[0] = lower_bound
              upper_bound = 0
              lower_bound = 0
  
      return bounds
  
file_path: OMLT/src/omlt/linear_tree/lt_formulation.py
imports: import numpy
  import pyomo.environ
  from pyomo.gdp import Disjunct
  from omlt.formulation import _PyomoFormulation, _setup_scaled_inputs_outputs
label_desc: Use image node_id 1 for calling a global function with example usage: _build_output_bounds(model_def, input_bounds) and returns: bounds