def _check_ranges(start, end, use_range_set, use_range, range_header):
 if ((end is not None) and (start is None)):
  raise ValueError('May not specify end value without start.')
 use_indexes = (start is not None)
 if use_indexes:
  if (end is not None):
   if (start > end):
    raise ValueError('start must be < end.')
   elif (start < 0):
    raise ValueError('end cannot be set if start < 0.')
  range_indexes = _serialize_range(start, end)
 if (use_range_set and use_range and use_indexes):
  if (range_header != range_indexes):
   raise ValueError(('May not provide non-equivalent range indexes and range headers: (header) %s != (indexes) %s' % (range_header, range_indexes)))
 if (use_range and (range_header is not None)):
  return range_header
 elif use_indexes:
  return range_indexes
 else:
  return None

def _check_ranges ( start , end , use_range_set , use_range , range_header ) : if ( ( end is not None ) and ( start is None ) ) : raise ValueError ( 'May not specify end value without start.' ) use_indexes = ( start is not None ) if use_indexes : if ( end is not None ) : if ( start > end ) : raise ValueError ( 'start must be < end.' ) elif ( start < 0 ) : raise ValueError ( 'end cannot be set if start < 0.' ) range_indexes = _serialize_range ( start , end ) if ( use_range_set and use_range and use_indexes ) : if ( range_header != range_indexes ) : raise ValueError ( ( 'May not provide non-equivalent range indexes and range headers: (header) %s != (indexes) %s' % ( range_header , range_indexes ) ) ) if ( use_range and ( range_header is not None ) ) : return range_header elif use_indexes : return range_indexes else : return None
set the range header .