def _get_canonicalized_amz_headers(self, headers):

        # New dict for the amazon headers
        amz_dict = {}

        # Go over the existing headers
        for k, v in headers.items():
            # Decode the keys if they are encoded
            if isinstance(k, bytes):
                k = k.decode('ascii')

            # to lower case
            k = k.lower()

            # If it starts with 'x-amz' add it to our dict
            if k.startswith('x-amz'):
                amz_dict[k] = v

        result = ""
        # Sort the keys and iterate through them
        for k in sorted(amz_dict.keys()):
            # add stripped key and value to the result string
            result += "%s:%s\n" % (k.strip(), amz_dict[k].strip().replace('\n', ' '))

        # Return the result string
        return result
Collect the special Amazon headers, prepare them for signing
dataset/ETHPy150Open smore-inc/tinys3/tinys3/auth.py/S3Auth._get_canonicalized_amz_headers