def parse_if_range_header(value):
 if (not value):
  return IfRange()
 date = parse_date(value)
 if (date is not None):
  return IfRange(date=date)
 return IfRange(unquote_etag(value)[0])

def parse_if_range_header ( value ) : if ( not value ) : return IfRange ( ) date = parse_date ( value ) if ( date is not None ) : return IfRange ( date = date ) return IfRange ( unquote_etag ( value ) [ 0 ] )
parses an if-range header which can be an etag or a date .