<commit_before>"""
Module for working with map custom visualizations (aka Kuvizs)

.. module:: carto.Kuvizs
   :platform: Unix, Windows
   :synopsis: Module for working with map custom visualizations (aka Kuvizs)

.. moduleauthor:: <NAME> <<EMAIL>>

"""

import base64

from pyrestcli.fields import CharField, DateTimeField

from .resources import Manager, WarnResource
from .paginators import CartoPaginator


API_VERSION = "v4"
API_ENDPOINT = "api/{api_version}/kuviz/"


class Kuviz(WarnResource):
    """
    Represents a map custom visualization in CARTO.
    """
    created_at = DateTimeField()
    data = CharField()
    name = CharField()
    privacy = CharField()
    updated_at = DateTimeField()
    url = CharField()
    visualization = CharField()

    class Meta:
        collection_endpoint = API_ENDPOINT.format(api_version=API_VERSION)
        name_field = "visualization"


class KuvizManager(Manager):
    """
    Manager for the Kuviz class.
    """
    resource_class = Kuviz
    paginator_class = CartoPaginator

    def create(self, html, name):
        """
        Creates a Kuviz.

        :param html: The visualization HTML
        :param name: The visualization name
        :type html: str
        :type name: str

        :return: A Kuviz instance with the `url` and `visualization` properties
                    of the new Kuviz
        """
        data = base64.b64encode(html.encode()).decode('ascii')
        return super(KuvizManager, self).create(data=data, name=name)
<commit_msg>id property and avoiding rest of methods<commit_after>"""
Module for working with map custom visualizations (aka Kuvizs)

.. module:: carto.Kuvizs
   :platform: Unix, Windows
   :synopsis: Module for working with map custom visualizations (aka Kuvizs)

.. moduleauthor:: <NAME> <<EMAIL>>

"""

import base64

from pyrestcli.fields import CharField, DateTimeField

from .resources import Manager, WarnResource
from .paginators import CartoPaginator


API_VERSION = "v4"
API_ENDPOINT = "api/{api_version}/kuviz/"


class Kuviz(WarnResource):
    """
    Represents a map custom visualization in CARTO.
    """
    created_at = DateTimeField()
    data = CharField()
    id = CharField()
    name = CharField()
    privacy = CharField()
    updated_at = DateTimeField()
    url = CharField()

    class Meta:
        collection_endpoint = API_ENDPOINT.format(api_version=API_VERSION)
        name_field = "id"


class KuvizManager(Manager):
    """
    Manager for the Kuviz class.
    """
    resource_class = Kuviz
    paginator_class = CartoPaginator

    def get(self):
        pass

    def filter(self, **search_args):
        pass

    def all(self):
        pass

    def create(self, html, name):
        """
        Creates a Kuviz.

        :param html: The visualization HTML
        :param name: The visualization name
        :type html: str
        :type name: str

        :return: A Kuviz instance with the `url` and `visualization` properties
                    of the new Kuviz
        """
        data = base64.b64encode(html.encode()).decode('ascii')
        return super(KuvizManager, self).create(data=data, name=name)
{'fraction_non_alphanumeric': 0.0975609756097561, 'fraction_numerical': 0.004434589800443459, 'mean_word_length': 2.8843788437884377, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '754851', 'n_tokens_mistral': 963, 'n_tokens_neox': 934, 'n_words': 278}