<commit_before>from simphony.cuds.abc_particles import ABCParticles
from simphony.core.cuds_item import CUDSItem


class LammpsParticles(ABCParticles):
    """ Responsible class to synchronize operations on particles

    Attributes
    ----------
    name : string
        name of particles
    data : DataContainer
        holds data
    data_extension : dict
        holds non-approved CUBA keywords

    """
    def __init__(self, manager, uname):
        # most of the work is delegated here to this manger
        self._manager = manager
        self._uname = uname

    @property
    def name(self):
        return self._manager.get_name(self._uname)

    @name.setter
    def name(self, value):
        self._manager.rename(self._uname, value)

    @property
    def data(self):
        return self._manager.get_data(self._uname)

    @data.setter
    def data(self, value):
        self._manager.set_data(value, self._uname)

    @property
    def data_extension(self):
        return self._manager.get_data_extension(self._uname)

    @data_extension.setter
    def data_extension(self, value):
        self._manager.set_data_extension(value, self._uname)

    # Particle methods ######################################################

    def add_particles(self, particles):
        """Adds a set of particles from the provided iterable
        to the container.

        If any particle have no uids, the container
        will generate a new uids for it. If the particle has
        already an uids, it won't add the particle if a particle
        with the same uid already exists. If the user wants to replace
        an existing particle in the container there is an 'update_particles'
        method for that purpose.

        Parameters
        ----------
        iterable : iterable of Particle objects
            the new set of particles that will be included in the container.

        Returns
        -------
        uids : list of uuid.UUID
            The uids of the added particles.

        Raises
        ------
        ValueError :
            when there is a particle with an uids that already exists
            in the container.
        """
        uids = []
        for particle in particles:
            uids.append(self._manager.add_particle(particle, self._uname))
        return uids

    def update_particles(self, particles):
        """Update particle

        """
        for particle in particles:
            self._manager.update_particle(particle, self._uname)

    def get_particle(self, uid):
        """Get particle

        """
        return self._manager.get_particle(uid, self._uname)
<commit_msg>Fix method paramters to correctly match ABCParticles<commit_after>from simphony.cuds.abc_particles import ABCParticles
from simphony.core.cuds_item import CUDSItem


class LammpsParticles(ABCParticles):
    """ Responsible class to synchronize operations on particles

    Attributes
    ----------
    name : string
        name of particles
    data : DataContainer
        holds data
    data_extension : dict
        holds non-approved CUBA keywords

    """
    def __init__(self, manager, uname):
        # most of the work is delegated here to this manger
        self._manager = manager
        self._uname = uname

    @property
    def name(self):
        return self._manager.get_name(self._uname)

    @name.setter
    def name(self, value):
        self._manager.rename(self._uname, value)

    @property
    def data(self):
        return self._manager.get_data(self._uname)

    @data.setter
    def data(self, value):
        self._manager.set_data(value, self._uname)

    @property
    def data_extension(self):
        return self._manager.get_data_extension(self._uname)

    @data_extension.setter
    def data_extension(self, value):
        self._manager.set_data_extension(value, self._uname)

    # Particle methods ######################################################

    def add_particles(self, iterable):
        """Adds a set of particles from the provided iterable
        to the container.

        If any particle have no uids, the container
        will generate a new uids for it. If the particle has
        already an uids, it won't add the particle if a particle
        with the same uid already exists. If the user wants to replace
        an existing particle in the container there is an 'update_particles'
        method for that purpose.

        Parameters
        ----------
        iterable : iterable of Particle objects
            the new set of particles that will be included in the container.

        Returns
        -------
        uids : list of uuid.UUID
            The uids of the added particles.

        Raises
        ------
        ValueError :
            when there is a particle with an uids that already exists
            in the container.
        """
        uids = []
        for particle in iterable:
            uids.append(self._manager.add_particle(particle, self._uname))
        return uids

    def update_particles(self, iterable):
        """Update particle

        """
        for particle in iterable:
            self._manager.update_particle(particle, self._uname)

    def get_particle(self, uid):
        """Get particle

        """
        return self._manager.get_particle(uid, self._uname)

{'fraction_non_alphanumeric': 0.0949165259801163, 'fraction_numerical': 0.0, 'mean_word_length': 2.1947273816656683, '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': '7633565', 'n_tokens_mistral': 1443, 'n_tokens_neox': 1377, 'n_words': 466}