def _get_canonicalized_resource(self, request):

        r = ""

        # parse our url
        parts = urlparse(request.url)

        # get the host, remove any port identifiers
        host = parts.netloc.split(':')[0]

        if host:
            # try to match our host to <hostname>.s3.amazonaws.com/s3.amazonaws.com
            m = BUCKET_VHOST_MATCH.match(host)
            if m:
                bucket = (m.groups()[0] or '').rstrip('.')

                if bucket:
                    r += ('/' + bucket)
            else:
                # It's a virtual host, add it to the result
                r += ('/' + host)

        # Add the path string
        r += parts.path or '/'

        # add the special query strings
        r += self._get_subresource(parts.query)

        return r
Get Relative Value
dataset/ETHPy150Open smore-inc/tinys3/tinys3/auth.py/S3Auth._get_canonicalized_resource--crossover with--dataset/ETHPy150Open treeio/treeio/treeio/finance/models.py/Transaction.get_relative_value