code: def test_hard_sigmoid(self):
      # Basic test for random values between 0 and 1
      x = np.random.uniform(0, 1, (2, 5))
      result = activations.hard_sigmoid(x[np.newaxis, :])[0]
      expected = np.vectorize(_ref_hard_sigmoid)(x)
      self.assertAllClose(result, expected, rtol=1e-05)
  
      # Test with 1D array
      x_1d = np.random.uniform(-10, 10, 5)
      result_1d = activations.hard_sigmoid(x_1d)
      expected_1d = np.vectorize(_ref_hard_sigmoid)(x_1d)
      self.assertAllClose(result_1d, expected_1d, rtol=1e-05)
  
      # Test with 3D array
      x_3d = np.random.uniform(-10, 10, (3, 3, 3))
      result_3d = activations.hard_sigmoid(x_3d)
      expected_3d = np.vectorize(_ref_hard_sigmoid)(x_3d)
      self.assertAllClose(result_3d, expected_3d, rtol=1e-05)
  
      # Test with strictly positive values much larger than 1
      x_positive_above_1 = np.random.uniform(
          5, 10, (2, 5)
      )  # Adjusted this range
      result_positive_above_1 = activations.hard_sigmoid(
          x_positive_above_1
      )
      expected_positive_above_1 = np.ones((2, 5))
      self.assertAllClose(
          result_positive_above_1, expected_positive_above_1, rtol=1e-05
      )
  
imports: import numpy
  from keras import activations
  from keras import backend
  from keras import testing
label_desc: Use image node_id 20 for calling the ActivationsTest obj's underlying member method code with example usage: obj.test_hard_sigmoid() without return types