def _parse_bytes(range_header):
 try:
  parsed_ranges = []
  (units, ranges) = range_header.split('=', 1)
  for range_value in ranges.split(','):
   range_value = range_value.strip()
   if range_value:
    parsed_ranges.append(_parse_range_value(range_value))
  if (not parsed_ranges):
   return None
  return (units, parsed_ranges)
 except ValueError:
  return None

def _parse_bytes ( range_header ) : try : parsed_ranges = [ ] ( units , ranges ) = range_header . split ( '=' , 1 ) for range_value in ranges . split ( ',' ) : range_value = range_value . strip ( ) if range_value : parsed_ranges . append ( _parse_range_value ( range_value ) ) if ( not parsed_ranges ) : return None return ( units , parsed_ranges ) except ValueError : return None
parses a full http range header .