code: def test_op_clip(min_value, max_value, x, device_id, precision):
      from .. import clip
  
      dev = cntk_device(device_id)
  
      expected_forward = np.clip(
          AA([x], dtype=PRECISION_TO_TYPE[precision]),
          AA(min_value, dtype=PRECISION_TO_TYPE[precision]),
          AA(max_value, dtype=PRECISION_TO_TYPE[precision]),
      )
  
      expected_backward = {
          "arg": [
              np.array(
                  np.logical_not(
                      np.logical_or(
                          np.greater(x, max_value),
                          np.less(x, min_value),
                      )
                  ),
                  dtype=PRECISION_TO_TYPE[precision],
              )
          ]
      }
  
      const_min_value = constant(min_value, device=dev)
      const_max_value = constant(max_value, device=dev)
  
      _test_unary_op(
          precision,
          device_id,
          clip,
          x,
          expected_forward,
          expected_backward,
          {"min_value": const_min_value, "max_value": const_max_value},
      )
  
imports: from __future__ import division
  import numpy
  import cntk
  import pytest
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  from cntk.tests.test_utils import TOLERANCE_ABSOLUTE
  from cntk.internal.utils import eval
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
  from cntk.variables import Parameter, Constant
label_desc: Use image node_id 1 for calling a global function with example usage: test_op_clip(min_value, max_value, x, device_id, precision) without return types