code: def clip_by_value(x, min, max):
      r"""Clip inputs by values.
  
      .. math::
  
          y = \begin{cases}
                  max & (x > max) \\
                  x & (otherwise) \\
                  min & (x < min)
              \end{cases}.
  
      Args:
          x (Variable): An input variable.
          min (Variable or float): A min variable or float value by which `x` is clipped. Note that if Variable is given, its shape must be the same as `x`'s.
          max (Variable or float): A max variable or float value by which `x` is clipped. Note that if Variable is given, its shape must be the same as `x`'s
  
      Returns:
          ~nnabla.Variable: N-D array.
  
      """
      if np.isscalar(min):
          maximum_base = maximum_scalar
      elif isinstance(min, (nn.Variable, nn.NdArray)):
          maximum_base = maximum2
      else:
          raise TypeError("min must be Variable, NdArray, or scalar.")
  
      if np.isscalar(max):
          minimum_base = minimum_scalar
      elif isinstance(max, (nn.Variable, nn.NdArray)):
          minimum_base = minimum2
      else:
          raise TypeError("max must be Variable, NdArray, or scalar.")
  
      return minimum_base(maximum_base(x, min), max)
  
imports: from __future__ import absolute_import
  from .function_bases import *
  from .None import dtypes
  import nnabla
  import numpy
  from .normalization_functions import *
  from .numpy_compat_functions import *
label_desc: Use image node_id 17 for calling a global function with example usage: clip_by_value(x, min, max) and returns: minimum_base