code: def clip(values, lower_bound, upper_bound):
      """Perform clipping to enforce values to lie
      in a specific range [lower_bound, upper_bound]
  
      Parameters
      ----------
      values : Numpy array, required
          Values to be clipped.
  
      lower_bound : scalar, required
          Lower bound of the output.
  
      upper_bound : scalar, required
          Upper bound of the output.
  
      Returns
      -------
      res: Numpy array
          Clipped values in range [lower_bound, upper_bound]
      """
      values = np.where(values > upper_bound, upper_bound, values)
      values = np.where(values < lower_bound, lower_bound, values)
  
      return values
  
file_path: cornac/cornac/utils/common.py
imports: import numbers
  import numpy
  import scipy.sparse
  from .fast_sparse_funcs import inplace_csr_row_normalize_l1, inplace_csr_row_normalize_l2
label_desc: Use image node_id 3 for calling a global function with example usage: clip(values, lower_bound, upper_bound) and returns: values