def __eq__(self, other, verbose=False, shallow_event_check=False):
for key in self.__dict__.keys():<EOL><INDENT>if key == '<STR_LIT>':<EOL><INDENT>self_is_stream = isinstance(self.st, Stream)<EOL>other_is_stream = isinstance(other.st, Stream)<EOL>if self_is_stream and other_is_stream:<EOL><INDENT>for tr, oth_tr in zip(self.st.sort(),<EOL>other.st.sort()):<EOL><INDENT>if not np.array_equal(tr.data, oth_tr.data):<EOL><INDENT>if verbose:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(tr.id))<EOL><DEDENT>return False<EOL><DEDENT>for trkey in ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT:location>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>']:<EOL><INDENT>if tr.stats[trkey] != oth_tr.stats[trkey]:<EOL><INDENT>if verbose:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(trkey))<EOL><DEDENT>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>elif self_is_stream and not other_is_stream:<EOL><INDENT>return False<EOL><DEDENT>elif not self_is_stream and other_is_stream:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif key == '<STR_LIT>':<EOL><INDENT>self_is_event = isinstance(self.event, Event)<EOL>other_is_event = isinstance(other.event, Event)<EOL>if self_is_event and other_is_event:<EOL><INDENT>if not _test_event_similarity(<EOL>self.event, other.event, verbose=verbose,<EOL>shallow=shallow_event_check):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif self_is_event and not other_is_event:<EOL><INDENT>return False<EOL><DEDENT>elif not self_is_event and other_is_event:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>elif not self.__dict__[key] == other.__dict__[key]:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL>
Check for Template equality, rich comparison operator '=='

.. rubric:: Example

>>> template_a = Template(
...     name='a', st=read(), lowcut=2.0, highcut=8.0, samp_rate=100,
...     filt_order=4, process_length=3600, prepick=0.5)
>>> template_b = template_a.copy()
>>> template_a == template_b
True


This will check all parameters of template including the data in the
stream.

>>> template_b.st[0].data = template_b.st[0].data[0:-1]
>>> template_a == template_b
False

>>> template_b = template_a.copy()
>>> template_b.st[0].stats.station = 'MIS'
>>> template_a == template_b
False

>>> template_b = template_a.copy()
>>> template_b.st = template_b.st[0]
>>> template_a == template_b
False

>>> template_b = template_a.copy()
>>> template_b.lowcut = 5.0
>>> template_a == template_b
False


This will also test if the events in the templates are the same,
ignoring resource ID's as obspy will alter these so that they do not
match.

>>> party = Party().read()
>>> template_a = party.families[0].template
>>> template_b = template_a.copy()
>>> template_b.event.origins[0].time = \
    template_a.event.origins[0].time + 20
>>> template_a == template_b
False