code: def test_offset_scaling():
      x_offset = [42, 65]
      x_factor = [1975, 1964]
      y_offset = [-4, 2, 1.784]
      y_factor = [2, 1.5, 1.3]
  
      x = {0: 1, 1: 2}
      y = {0: -1, 1: 2, 2: 3}
      x_scal = {
          k: (v - x_offset[k]) / x_factor[k] for (k, v) in x.items()
      }
      y_scal = {
          k: (v - y_offset[k]) / y_factor[k] for (k, v) in y.items()
      }
  
      scaling = OffsetScaling(
          offset_inputs=x_offset,
          factor_inputs=x_factor,
          offset_outputs=y_offset,
          factor_outputs=y_factor,
      )
  
      test_x_scal = scaling.get_scaled_input_expressions(x)
      test_x = scaling.get_unscaled_input_expressions(test_x_scal)
      test_y = scaling.get_unscaled_output_expressions(y_scal)
      test_y_scal = scaling.get_scaled_output_expressions(y)
      np.testing.assert_almost_equal(
          list(test_x_scal.values()), list(x_scal.values())
      )
      np.testing.assert_almost_equal(
          list(test_x.values()), list(x.values())
      )
      np.testing.assert_almost_equal(
          list(test_y.values()), list(y.values())
      )
      np.testing.assert_almost_equal(
          list(test_y_scal.values()), list(y_scal.values())
      )
  
file_path: OMLT/tests/test_scaling.py
imports: import numpy
  import pytest
  from omlt import OffsetScaling
  from omlt.scaling import convert_to_dict
label_desc: Use image node_id 2 for calling a global function with example usage: test_offset_scaling() without return types