<commit_before>class Cluster:

    def __init__( self, sites ):
        self.sites = set( sites )
        self.neighbours = set()
        for s in self.sites:
            self.neighbours.update( s.p_neighbours ) 
        self.neighbours = self.neighbours.difference( self.sites )

    def merge( self, other_cluster ):
        new_cluster = Cluster( self.sites | other_cluster.sites )
        new_cluster.neighbours = ( self.neighbours | other_cluster.neighbours ).difference( new_cluster.sites )
        return new_cluster

    def is_neighbouring( self, other_cluster ):
        """
        logical check whether the neighbour list for cluster A includes any sites in cluster B
        
        Args:
            other_cluster (Cluster): the other cluster we are testing for neighbour connectivity

        Returns:
            (Bool): True if the other cluster neighbours this cluster.
        """
        return bool( self.neighbours & other_cluster.sites )

    def size( self ):
        return len( self.sites )

    def sites_at_edges( self ):
        """
        Returns:
             (List(List)): In the order [ +x, -x, +y, -y, +z, -z ]<commit_msg>Added docstrings to cluster class<commit_after>class Cluster:
    """
    Clusters are sets of sites.
    """
    def __init__( self, sites ):
        """
        Initialise an Cluster instance.

        Args:
            sites (List(Site): The list of sites that make up the cluster.

        Returns:
            None
        """
        self.sites = set( sites )
        self.neighbours = set()
        for s in self.sites:
            self.neighbours.update( s.p_neighbours ) 
        self.neighbours = self.neighbours.difference( self.sites )

    def merge( self, other_cluster ):
        """
        Combine two clusters into a single cluster.

        Args:
            other_cluster (Cluster): The second cluster to combine.

        Returns:
            (Cluster):   The combination of both clusters.
        """
        new_cluster = Cluster( self.sites | other_cluster.sites )
        new_cluster.neighbours = ( self.neighbours | other_cluster.neighbours ).difference( new_cluster.sites )
        return new_cluster

    def is_neighbouring( self, other_cluster ):
        """
        logical check whether the neighbour list for cluster A includes any sites in cluster B
        
        Args:
            other_cluster (Cluster): the other cluster we are testing for neighbour connectivity

        Returns:
            (Bool): True if the other cluster neighbours this cluster.
        """
        return bool( self.neighbours & other_cluster.sites )

    def size( self ):
        """
        Number of sites in this cluster.

        Args:
            None

        Returns:
            (Int): The number of sites in this cluster.
        """
        return len( self.sites )

    def sites_at_edges( self ):
        """
        Finds the six sites with the maximum and minimum coordinates along x, y, and z.

        Args:
            None

        Returns:
             (List(List)): In the order [ +x, -x, +y, -y, +z, -z ]
{'fraction_non_alphanumeric': 0.08612903225806452, 'fraction_numerical': 0.0, 'mean_word_length': 1.9090056285178236, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '620461', 'n_tokens_mistral': 882, 'n_tokens_neox': 815, 'n_words': 283}