code: def _ref_hard_sigmoid(x):
      x = (x / 6.0) + 0.5
      z = 0.0 if x <= 0 else (1.0 if x >= 1 else x)
      return z
  
imports: import numpy
  from keras import activations
  from keras import backend
  from keras import testing
label_desc: Use image node_id 7 for calling a global function with example usage: _ref_hard_sigmoid(x) and returns: z