code: def clip_(array, min_value, max_value):
      # uint64 is disallowed, because numpy's clip seems to convert it to float64
      # int64 is disallowed, because numpy's clip converts it to float64 since
      # 1.17
      # TODO find the cause for that
      gate_dtypes_strs(
          {array.dtype},
          allowed="bool uint8 uint16 uint32 int8 int16 int32 "
          "float16 float32 float64 float128",
          disallowed="uint64 int64",
      )
  
      # If the min of the input value range is above the allowed min, we do not
      # have to clip to the allowed min as we cannot exceed it anyways.
      # Analogous for max. In fact, we must not clip then to min/max as that can
      # lead to errors in numpy's clip. E.g.
      #     >>> arr = np.zeros((1,), dtype=np.int32)
      #     >>> np.clip(arr, 0, np.iinfo(np.dtype("uint32")).max)
      # will return
      #     array([-1], dtype=int32)
      # (observed on numpy version 1.15.2).
      min_value_arrdt, _, max_value_arrdt = get_value_range_of_dtype(
          array.dtype
      )
      if min_value is not None and min_value < min_value_arrdt:
          min_value = None
      if max_value is not None and max_value_arrdt < max_value:
          max_value = None
  
      if min_value is not None or max_value is not None:
          # for scalar arrays, i.e. with shape = (), "out" is not a valid
          # argument
          if len(array.shape) == 0:
              array = np.clip(array, min_value, max_value)
          elif array.dtype.name == "int32":
              # Since 1.17 (before maybe too?), numpy.clip() turns int32
              # to float64. float64 should cover the whole value range of int32,
              # so the dtype is not rejected here.
              # TODO Verify this. Is rounding needed before conversion?
              array = np.clip(array, min_value, max_value).astype(
                  array.dtype
              )
          else:
              array = np.clip(array, min_value, max_value, out=array)
      return array
  
imports: from __future__ import print_function, division, absolute_import
  import numpy
  import six.moves
  import imgaug
label_desc: Use image node_id 12 for calling a global function with example usage: clip_(array, min_value, max_value) and returns: array