<commit_before>from __future__ import unicode_literals

import json
from six.moves.urllib_parse import urlparse

from moto.core.responses import BaseResponse
from moto.s3 import s3_backend
from .models import cloudformation_backends


class CloudFormationResponse(BaseResponse):

    @property
    def cloudformation_backend(self):
        return cloudformation_backends[self.region]

    def _get_stack_from_s3_url(self, template_url):
        template_url_parts = urlparse(template_url)
        bucket_name = template_url_parts.netloc.split(".")[0]
        key_name = template_url_parts.path.lstrip("/")<commit_msg>Fix six import. Closes #299.<commit_after>from __future__ import unicode_literals

import json
from six.moves.urllib.parse import urlparse

from moto.core.responses import BaseResponse
from moto.s3 import s3_backend
from .models import cloudformation_backends


class CloudFormationResponse(BaseResponse):

    @property
    def cloudformation_backend(self):
        return cloudformation_backends[self.region]

    def _get_stack_from_s3_url(self, template_url):
        template_url_parts = urlparse(template_url)
        bucket_name = template_url_parts.netloc.split(".")[0]
        key_name = template_url_parts.path.lstrip("/")
{'fraction_non_alphanumeric': 0.07365892714171338, 'fraction_numerical': 0.008807045636509208, 'mean_word_length': 4.841121495327103, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6591109', 'n_tokens_mistral': 386, 'n_tokens_neox': 375, 'n_words': 79}