Extracts a cluster of atoms based on bond lengths

        Args:
            target_sites ([Site]): List of initial sites to nucleate cluster.
            \\*\\*kwargs: kwargs passed through to CovalentBond.is_bonded.

        Returns:
            [Site/PeriodicSite] Cluster of atoms.

def extract_cluster(self, target_sites, **kwargs):
        """
        Extracts a cluster of atoms based on bond lengths

        Args:
            target_sites ([Site]): List of initial sites to nucleate cluster.
            \\*\\*kwargs: kwargs passed through to CovalentBond.is_bonded.

        Returns:
            [Site/PeriodicSite] Cluster of atoms.
        """
        cluster = list(target_sites)
        others = [site for site in self if site not in cluster]
        size = 0
        while len(cluster) > size:
            size = len(cluster)
            new_others = []
            for site in others:
                for site2 in cluster:
                    if CovalentBond.is_bonded(site, site2, **kwargs):
                        cluster.append(site)
                        break
                else:
                    new_others.append(site)
            others = new_others
        return cluster