def _parse_range_value(range_value):
  end = None
  if range_value.startswith('-'):
    start = int(range_value)
    if start == 0:
      raise ValueError('-0 is not a valid range.')
  else:
    split_range = range_value.split('-', 1)
    start = int(split_range[0])
    if len(split_range) > 1 and split_range[1].strip():
      end = int(split_range[1])
      if start > end:
        raise ValueError('start must be <= end.')
  return (start, end)
Parses a single range value from a Range header.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/ext/webapp/blobstore_handlers.py/_parse_range_value