(number, low, high, precision=_TOL)
return np.clip(number, low, high)
Clips input to provided range, checking precision.

  Args:
    number: (float) number to be clipped.
    low: (float) lower bound.
    high: (float) upper bound.
    precision: (float) tolerance.

  Returns:
    Input clipped to given range.

  Raises:
    ValueError: If number is outside given range by more than given precision.
Clips input to provided range, checking precision.
Clips input to provided range checking precision .
def _clip_within_precision(number, low, high, precision=_TOL):
  """Clips input to provided range, checking precision.

  Args:
    number: (float) number to be clipped.
    low: (float) lower bound.
    high: (float) upper bound.
    precision: (float) tolerance.

  Returns:
    Input clipped to given range.

  Raises:
    ValueError: If number is outside given range by more than given precision.
  """
  if (number < low - precision).any() or (number > high + precision).any():
    raise ValueError(
        'Input {:.12f} not inside range [{:.12f}, {:.12f}] with precision {}'.
        format(number, low, high, precision))

  return np.clip(number, low, high)
def _clip_within_precision ( number , low , high , precision = _TOL ) : if ( number < low - precision ) . any ( ) or ( number > high + precision ) . any ( ) : raise ValueError ( 'Input {:.12f} not inside range [{:.12f}, {:.12f}] with precision {}' . format ( number , low , high , precision ) ) return np . clip ( number , low , high )