def cluster(self, method, **kwargs):
from eqcorrscan.utils import clustering<EOL>tribes = []<EOL>func = getattr(clustering, method)<EOL>if method in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>cat = Catalog([t.event for t in self.templates])<EOL>groups = func(cat, **kwargs)<EOL>for group in groups:<EOL><INDENT>new_tribe = Tribe()<EOL>for event in group:<EOL><INDENT>new_tribe.templates.extend([t for t in self.templates<EOL>if t.event == event])<EOL><DEDENT>tribes.append(new_tribe)<EOL><DEDENT><DEDENT>return tribes<EOL>
Cluster the tribe.

Cluster templates within a tribe: returns multiple tribes each of
which could be stacked.

:type method: str
:param method:
    Method of stacking, see :mod:`eqcorrscan.utils.clustering`

:return: List of tribes.

.. rubric:: Example