code: def format_parameters(self, params):
          # type: (Dict[str, str]) -> None
          
          query = urlparse(self.url).query
          if query:
              self.url = self.url.partition('?')[0]
              existing_params = {
                  p[0]: p[-1]
                  for p in [p.partition('=') for p in query.split('&')]
              }
              params.update(existing_params)
          query_params = ["{}={}".format(k, v) for k, v in params.items()]
          query = '?' + '&'.join(query_params)
          self.url = self.url + query
docs: Format parameters into a valid query string.
          It's assumed all parameters have already been quoted as
          valid URL strings.
  
          :param dict params: A dictionary of parameters.