<commit_before>"""
.. module:: VisBase
    :platform: Unix, Windows
    :synopsis: Abstract class for NURBS-Python visualization components

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

"""

import abc


class VisAbstract(object):
    """ Visualization abstract class

    Uses Python's *Abstract Base Class* implementation to define a base for all common visualization options
    in NURBS-Python package.

    :param plot_ctrlpts: enables/disables control points plots on the final figure
    :type plot_ctrlpts: bool
    """
    __metaclass__ = abc.ABCMeta

    def __init__(self, plot_ctrlpts=True):
        self._points = []  # control points and evaluated points
        self._sizes = []  # sizes in all directions
        self._colors = []  # color information for the plots
        self._names = []  # names of the plots on the legend
        self._plot_ctrlpts = plot_ctrlpts

    def clear(self):
        """ Clears the points, colors and names lists. """
        if self._points:
            self._points[:] = []
            self._sizes[:] = []
            self._colors[:] = []
            self._names[:] = []

    def add(self, ptsarr=(), size=0, name=None, color=None):
        """ Adds points sets to the visualization instance for plotting.

        :param ptsarr: control, curve or surface points
        :type ptsarr: list, tuple
        :param size: size in all directions
        :type size: int, list
        :param name: name of the point on the legend
        :type name: str
        :param color: color of the point on the legend
        :type color: str
        :return: None
        """
        if not ptsarr or not color or not name:
            return
        # Add points, size, plot color and name on the legend
        self._points.append(ptsarr)
        self._sizes.append(size)
        self._colors.append(color)
        self._names.append(name)

    @abc.abstractmethod
    def render(self):
        """ Abstract method for rendering plots of the point sets.

        This method must be implemented in all subclasses of ``VisAbstract`` class.
        """
        pass


class VisAbstractSurf(VisAbstract):
    """ Visualization abstract class for surfaces

    Implements ``VisABstract`` class and also uses Python's *Abstract Base Class* implementation to define a base
    for **surface** visualization options in NURBS-Python package.

    :param plot_ctrlpts: enables/disables control points plots on the final figure
    :type plot_ctrlpts: bool
    """
    __metaclass__ = abc.ABCMeta

    def __init__(self, plot_ctrlpts=True):
        super(VisAbstractSurf, self).__init__(plot_ctrlpts)
        self._ctrlpts_offset = 0.0

    def set_ctrlpts_offset(self, offset_value):
        """ Sets an offset for the control points grid plot.

        :param offset_value: offset value
        :type offset_value: float
        :return: None
        """
        self._ctrlpts_offset = float(offset_value)

    @abc.abstractmethod
    def render(self):
        """ Abstract method for rendering plots of the point sets.

        This method must be implemented in all subclasses of ``VisAbstract`` class.
        """
        pass
<commit_msg>No need to document when function returns None<commit_after>"""
.. module:: VisBase
    :platform: Unix, Windows
    :synopsis: Abstract class for NURBS-Python visualization components

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

"""

import abc


class VisAbstract(object):
    """ Visualization abstract class

    Uses Python's *Abstract Base Class* implementation to define a base for all common visualization options
    in NURBS-Python package.

    :param plot_ctrlpts: enables/disables control points plots on the final figure
    :type plot_ctrlpts: bool
    """
    __metaclass__ = abc.ABCMeta

    def __init__(self, plot_ctrlpts=True):
        self._points = []  # control points and evaluated points
        self._sizes = []  # sizes in all directions
        self._colors = []  # color information for the plots
        self._names = []  # names of the plots on the legend
        self._plot_ctrlpts = plot_ctrlpts

    def clear(self):
        """ Clears the points, colors and names lists. """
        if self._points:
            self._points[:] = []
            self._sizes[:] = []
            self._colors[:] = []
            self._names[:] = []

    def add(self, ptsarr=(), size=0, name=None, color=None):
        """ Adds points sets to the visualization instance for plotting.

        :param ptsarr: control, curve or surface points
        :type ptsarr: list, tuple
        :param size: size in all directions
        :type size: int, list
        :param name: name of the point on the legend
        :type name: str
        :param color: color of the point on the legend
        :type color: str
        """
        if not ptsarr or not color or not name:
            return
        # Add points, size, plot color and name on the legend
        self._points.append(ptsarr)
        self._sizes.append(size)
        self._colors.append(color)
        self._names.append(name)

    @abc.abstractmethod
    def render(self):
        """ Abstract method for rendering plots of the point sets.

        This method must be implemented in all subclasses of ``VisAbstract`` class.
        """
        pass


class VisAbstractSurf(VisAbstract):
    """ Visualization abstract class for surfaces

    Implements ``VisABstract`` class and also uses Python's *Abstract Base Class* implementation to define a base
    for **surface** visualization options in NURBS-Python package.

    :param plot_ctrlpts: enables/disables control points plots on the final figure
    :type plot_ctrlpts: bool
    """
    __metaclass__ = abc.ABCMeta

    def __init__(self, plot_ctrlpts=True):
        super(VisAbstractSurf, self).__init__(plot_ctrlpts)
        self._ctrlpts_offset = 0.0

    def set_ctrlpts_offset(self, offset_value):
        """ Sets an offset for the control points grid plot.

        :param offset_value: offset value
        :type offset_value: float
        """
        self._ctrlpts_offset = float(offset_value)

    @abc.abstractmethod
    def render(self):
        """ Abstract method for rendering plots of the point sets.

        This method must be implemented in all subclasses of ``VisAbstract`` class.
        """
        pass

{'fraction_non_alphanumeric': 0.08709422011084719, 'fraction_numerical': 0.0009501187648456057, 'mean_word_length': 2.5245535714285716, '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': '5605838', 'n_tokens_mistral': 1736, 'n_tokens_neox': 1671, 'n_words': 621}