code: def document_quote (document):
      
      doc, query = urllib.splitquery(document)
      doc = url_quote_part(doc, '/=,')
      if query:
          return "%s?%s" % (doc, query)
      return doc
docs: Quote given document.