<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_filter(self, new_filter, as_last=True):
 """ Compose this filter with the given ``new_filter`` filter. :param new_filter: the filter to be composed :type new_filter: :class:`~aeneas.textfile.TextFilter` :param bool as_last: if ``True``, compose to the right, otherwise to the left """

        if as_last:
            self.filters.append(new_filter)
        else:
            self.filters = [new_filter] + self.filters