<commit_before>from rest_framework import serializers


class Tag(object):
    def __init__(self, name, related_tags, equivalent_names):
        self.name = name
        self.related_tags = related_tags
        self.equivalent_names = equivalent_names


class TagSerializer(serializers.Serializer):
    name = serializers.CharField()
    related_tags = serializers.ListField(child=serializers.CharField(), allow_null=True)
    equivalent_names = serializers.ListField(child=serializers.CharField(), allow_null=True)

    def create(self, validated_data):
        return Tag(**validated_data)


class Followable(object):
    def __init__(self, name, type, game, object_id, thumbnail_url=""):
        self.name = name
        self.type = type
        self.game = game
        self.object_id = object_id
        self.thumbnail_url = thumbnail_url


class FollowableSerializer(serializers.Serializer):
    name = serializers.CharField()
    type = serializers.IntegerField()
    game = serializers.IntegerField()
    object_id = serializers.IntegerField()
    thumbnail_url = serializers.CharField(allow_blank=True, allow_null=True)

    def create(self, validated_data):
        return Followable(**validated_data)<commit_msg>Quickfix for migration<commit_after>from rest_framework import serializers


class Tag(object):
    def __init__(self, name, related_tags, equivalent_names):
        self.name = name
        self.related_tags = related_tags
        self.equivalent_names = equivalent_names


class TagSerializer(serializers.Serializer):
    name = serializers.CharField()
    related_tags = serializers.ListField(child=serializers.CharField(), allow_null=True)
    equivalent_names = serializers.ListField(child=serializers.CharField(), allow_null=True)

    def create(self, validated_data):
        return Tag(**validated_data)


class Followable(object):
    def __init__(self, name, type, game, object_id, thumbnail_url="", old_object_id=None):
        self.name = name
        self.type = type
        self.game = game
        self.object_id = object_id
        self.thumbnail_url = thumbnail_url
        self.old_object_id = old_object_id


class FollowableSerializer(serializers.Serializer):
    name = serializers.CharField()
    type = serializers.IntegerField()
    game = serializers.IntegerField()
    object_id = serializers.IntegerField()
    old_object_id = serializers.IntegerField(allow_null=True)
    thumbnail_url = serializers.CharField(allow_blank=True, allow_null=True)

    def create(self, validated_data):
        return Followable(**validated_data)
{'fraction_non_alphanumeric': 0.09108527131782945, 'fraction_numerical': 0.0, 'mean_word_length': 4.080708661417323, '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': '3792225', 'n_tokens_mistral': 751, 'n_tokens_neox': 727, 'n_words': 144}