code: def encoded_query(self):
          
          if self.query is not None and self.query != '' and self.query != {}:
              try:
                  return urlencode(self.query, doseq=True, quote_via=urlquote)
              except TypeError:
                  return '&'.join(["{0}={1}".format(urlquote(k), urlquote(self.query[k][0])) for k in self.query])
          else:
              return ''
docs: Returns the encoded query string of the URL. This may be different from the rawquery element,
          as that contains the query parsed by urllib but unmodified.
          The return value takes the form of key=value&key=value, and it never contains a leading question mark.