code: def ref_grad_clip_grad_by_value(x, min_, max_, dy, **kw):
      dx = dy
      idx_min = np.where(dy < min_)
      idx_max = np.where(dy > max_)
  
      dx[idx_min] = min_[idx_min]
      dx[idx_max] = max_[idx_max]
      return dx.flatten()
  
imports: import pytest
  import numpy
  import nnabla.functions
  from nbla_test_utils import list_context
label_desc: Use image node_id 2 for calling a global function with example usage: ref_grad_clip_grad_by_value(x, min_, max_, dy) and returns: dx