def format_range(value):
 if (len(value) == 4):
  result = ('%s %s-%s/%s' % (value[3], value[0], value[1], value[2]))
 else:
  result = ('bytes %s-%s/%s' % (value[0], value[1], value[2]))
 if six.PY2:
  result = str(result)
 return result

def format_range ( value ) : if ( len ( value ) == 4 ) : result = ( '%s %s-%s/%s' % ( value [ 3 ] , value [ 0 ] , value [ 1 ] , value [ 2 ] ) ) else : result = ( 'bytes %s-%s/%s' % ( value [ 0 ] , value [ 1 ] , value [ 2 ] ) ) if six . PY2 : result = str ( result ) return result
formats a range header tuple per the http spec .