def METHOD_NAME(self, uri):
    parsed = urlparse(uri)
    params = dict(
        Bucket=parsed.netloc,
        Key=parsed.path[1:])
    if parsed.query:
        params.update(dict(parse_qsl(parsed.query)))
    region = params.pop('region', None)
    client = self.session_factory().client('s3', region_name=region)
    result = client.get_object(**params)
    body = result['Body'].read()
    if params['Key'].lower().endswith(('.gz', '.zip', '.gzip')):
        return zlib.decompress(body, ZIP_OR_GZIP_HEADER_DETECT).decode('utf-8')
    elif isinstance(body, str):
        return body
    else:
        return body.decode('utf-8')