<commit_before>from rest_framework.views import APIView
from rest_framework.response import Response

from . import utils

class FindAvatarKey(APIView):
    """
    Search for named avatars and return a list of matching keys
    """
    def get(self, request, name, format=None):
        keys = utils.find_avatar_key(name)
        return Response(keys)

class AvatarInfo(APIView):
    """
    Return full name, user name, display name, image url, description of the given uuid
    """
    def get(self, request, uuid, format=None):
        info = utils.avatar_info(uuid)
        names = utils.parse_fullname(info.fullName)
        return Response({**info._asdict(), **names._asdict()})

class FindMarketplaceStore(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, name, format=None):
        stores = utils.find_marketplace_store(name)
        return Response([store._asdict() for store in stores])

class MarketplaceStoreInfo(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, url, format=None):
        store = utils.marketplace_store_info(url)
        return Response(store._asdict())

class MarketplaceProductInfo(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, url, format=None):
        info = utils.marketplace_product_info(url)
        return Response(info._asdict())

<commit_msg>Finally got the website deployed to elasticbeanstalk. Fixing python 3.6 dependency<commit_after>from rest_framework.views import APIView
from rest_framework.response import Response

from . import utils

class FindAvatarKey(APIView):
    """
    Search for named avatars and return a list of matching keys
    """
    def get(self, request, name, format=None):
        keys = utils.find_avatar_key(name)
        return Response(keys)

class AvatarInfo(APIView):
    """
    Return full name, user name, display name, image url, description of the given uuid
    """
    def get(self, request, uuid, format=None):
        info = utils.avatar_info(uuid)
        names = utils.parse_fullname(info.fullName)
        #return Response({**info._asdict(), **names._asdict()}) # Only in Python 3.5+
        response = info._asdict()
        response.update(names._asdict())
        return Response(response)

class FindMarketplaceStore(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, name, format=None):
        stores = utils.find_marketplace_store(name)
        return Response([store._asdict() for store in stores])

class MarketplaceStoreInfo(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, url, format=None):
        store = utils.marketplace_store_info(url)
        return Response(store._asdict())

class MarketplaceProductInfo(APIView):
    """
    Search for the store for the given avatar name
    """
    def get(self, request, url, format=None):
        info = utils.marketplace_product_info(url)
        return Response(info._asdict())


{'fraction_non_alphanumeric': 0.10177133655394525, 'fraction_numerical': 0.0012882447665056361, 'mean_word_length': 3.3379888268156424, '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': '6927630', 'n_tokens_mistral': 886, 'n_tokens_neox': 891, 'n_words': 269}