code: def transform(self, x, bounds, slopes, intercepts):
      n = len(slopes)
      x_ = self.constrain(x, bounds[0], bounds[-1])
      index = np.minimum(
          np.maximum(np.searchsorted(bounds, x_) - 1, 0), n - 1
      )
      y = slopes[index] * x_ + intercepts[index]
      return y
  
file_path: pytorch/caffe2/python/operator_test/piecewise_linear_transform_test.py
imports: from caffe2.python import core
  import caffe2.python.hypothesis_test_util
  import caffe2.python.serialized_test.serialized_test_util
  from hypothesis import given, settings
  import hypothesis.strategies
  import numpy
  import unittest
label_desc: Use image node_id 2 for calling the TestPiecewiseLinearTransform obj's underlying member method code with example usage: obj.transform(x, bounds, slopes, intercepts) and returns: y