code: def sign(self, hash_type="sha256"):
          
          version = self.params["SignatureVersion"]
          if version == "2":
              self.params["SignatureMethod"] = "Hmac%s" % hash_type.upper()
          self.params["Signature"] = self.signature.compute()
docs: Sign this query using its built in credentials.
  
          @param hash_type: if the SignatureVersion is 2, specify the type of
              hash to use, either "sha1" or "sha256". It defaults to the latter.
  
          This prepares it to be sent, and should be done as the last step before
          submitting the query. Signing is done automatically - this is a public
          method to facilitate testing.