code: def test_retry(self):
      attempts = [0]
      value = randint(0, 1000)
  
      def failing_func():
          attempts[0] += 1
          if attempts[0] != 2:
              raise ValueError("Attempt {} failed".format(attempts[0]))
          return value
  
      retval = util.retry(
          failing_func,
          no_retries=2,
          sleep_time=1,
          exception_class=ValueError,
      )
  
      self.assertEqual(retval, value)
      self.assertEqual(attempts, [2])
  
      # test out for catching different exception class
      try:
          retval = util.retry(
              failing_func,
              no_retries=2,
              sleep_time=1,
              exception_class=OSError,
          )
      except ValueError:
          pass
      else:
          self.assertTrue(False)
  
imports: import unittest
  from studio import util
  from random import randint
label_desc: Use image node_id 2 for calling the UtilTest obj's underlying member method code with example usage: obj.test_retry() and returns: value