code: def parse(text, encoding='utf8'):
      
  
      # Decode the text if we got bytes.
      if isinstance(text, six.binary_type):
          text = text.decode(encoding)
  
      return Query(text, split_segments(text))
docs: Parse the querystring into a normalized form.