<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tags(self, tags=None):
 """Filter by tags. :param tags: Tags to filter. :type tags: ``list`` :return: A list of Node objects. :rtype: ``list`` of :class:`Node` """

        if tags is None or not tags:
            return self
        nodes = []
        for node in self.nodes:
            if any(tag in node.extra['tags'] for tag in tags):
                nodes.append(node)
        self.nodes = nodes
        return self