def validate_range_value(value):
if value == (None, None):<EOL><INDENT>return<EOL><DEDENT>if not hasattr(value, '<STR_LIT>'):<EOL><INDENT>raise TypeError('<STR_LIT>' % value)<EOL><DEDENT>if not <NUM_LIT:2> == len(value):<EOL><INDENT>raise ValueError('<STR_LIT>' %<EOL>len(value))<EOL><DEDENT>if not all(isinstance(x, (int,float)) for x in value):<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>' % value)<EOL><DEDENT>if not value[<NUM_LIT:0>] <= value[<NUM_LIT:1>]:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>' % value)<EOL><DEDENT>return<EOL>
Validates given value against `Schema.TYPE_RANGE` data type. Raises
TypeError or ValueError if something is wrong. Returns None if everything
is OK.