'Validate the given value of a Crop() method argument.
Args:
val: float, value of the argument.
val_name: str, name of the argument.
Raises:
TypeError if the args are not of type \'float\'.
BadRequestError when there is something wrong with the given bounding box.'

def _validate_crop_arg(self, val, val_name):

    if (type(val) != float):
        raise TypeError(("arg    '%s'    must    be    of    type    'float'." % val_name))
    if (not (0 <= val <= 1.0)):
        raise BadRequestError(("arg    '%s'    must    be    between    0.0    and    1.0    (inclusive)" % val_name))
