def tagged_projects(<EOL>self,<EOL>tag):
self.refresh<EOL>projectList = []<EOL>tag = tag.replace("<STR_LIT:@>", "<STR_LIT>").lower()<EOL>for p in self.projects:<EOL><INDENT>for aTag in p.tags:<EOL><INDENT>if "<STR_LIT:(>" not in tag:<EOL><INDENT>aTag = aTag.split("<STR_LIT:(>")[<NUM_LIT:0>]<EOL><DEDENT>if aTag.lower() == tag:<EOL><INDENT>projectList.append(p)<EOL>break<EOL><DEDENT><DEDENT>subProjects = p.tagged_projects(tag)<EOL>projectList += subProjects<EOL><DEDENT>return projectList<EOL>
*return a list of projects contained within this taskpaper object filtered by a given tag*

        **Key Arguments:**
            - ``tag`` -- the tag to filter the projects by.

        **Return:**
            - ``projectList`` -- the list of filtered projects

        **Usage:**

            To filter the projects recursively found with a taskpaper document object and return only those projects tagged with ``flag``, using the following:

            .. code-block:: python

                filteredProjects = doc.tagged_projects("flag")
                for p in filteredProjects:
                    print p.title

            Note you can give the tag with or without the *@*, and you can also give a tag attribute, e.g. ``@due(today)``