code: def test_scale(self):
      self.assertEqual(1, scale(0, 1, 5, 0, 1))
      self.assertEqual(3, scale(0.5, 1, 5, 0, 1))
      self.assertEqual(5, scale(1, 1, 5, 0, 1))
      self.assertEqual(1, scale(5, 0, 1, 5, 5))
  
      npt.assert_array_equal(
          scale(np.asarray([0, 0.25, 0.5, 0.75, 1]), 1, 5),
          np.asarray([1, 2, 3, 4, 5]),
      )
  
imports: import unittest
  import numpy
  import numpy.testing
  import scipy.sparse
  from cornac.utils.common import sigmoid
  from cornac.utils.common import safe_indexing
  from cornac.utils.common import validate_format
  from cornac.utils.common import scale
  from cornac.utils.common import clip
  from cornac.utils.common import excepts
  from cornac.utils.common import intersects
  from cornac.utils.common import estimate_batches
  from cornac.utils.common import get_rng
  from cornac.utils.common import normalize
label_desc: Use image node_id 2 for calling the TestCommon obj's underlying member method code with example usage: obj.test_scale() without return types