code: def test_scaling():
      mean_x_small = np.mean(X_small)
      std_x_small = np.std(X_small)
      mean_y_small = np.mean(y_small)
      std_y_small = np.std(y_small)
      scaled_x = (X_small - mean_x_small) / std_x_small
      scaled_y = (y_small - mean_y_small) / std_y_small
      scaled_input_bounds = {0: (np.min(scaled_x), np.max(scaled_x))}
      unscaled_input_bounds = {0: (np.min(X_small), np.max(X_small))}
  
      scaler = omlt.scaling.OffsetScaling(
          offset_inputs=[mean_x_small],
          factor_inputs=[std_x_small],
          offset_outputs=[mean_y_small],
          factor_outputs=[std_y_small],
      )
  
      regr = linear_model_tree(scaled_x, scaled_y)
  
      regr.fit(np.reshape(scaled_x, (-1, 1)), scaled_y)
  
      lt_def2 = LinearTreeDefinition(
          regr,
          unscaled_input_bounds=unscaled_input_bounds,
          scaling_object=scaler,
      )
      assert lt_def2.scaled_input_bounds[0][0] == approx(
          scaled_input_bounds[0][0]
      )
      assert lt_def2.scaled_input_bounds[0][1] == approx(
          scaled_input_bounds[0][1]
      )
      with pytest.raises(
          Exception,
          match="Input Bounds needed to represent linear trees as MIPs",
      ):
          ltmodel_scaled = LinearTreeDefinition(regr)
  
imports: import numpy
  import pyomo.environ
  import pytest
  from omlt.dependencies import lineartree_available
  from pytest import approx
  from omlt import OmltBlock
  import omlt
label_desc: Use image node_id 7 for calling a global function with example usage: test_scaling() without return types