<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_nodes(self, pattern, attribute, flags=re.IGNORECASE):
 """ Filters the View Nodes on given attribute using given pattern. :param pattern: Filtering pattern. :type pattern: unicode :param attribute: Filtering attribute. :type attribute: unicode :param flags: Regex filtering flags. :type flags: int :return: View filtered nodes. :rtype: list """


        return [node for node in self.get_nodes() if re.search(pattern, getattr(node, attribute), flags)]