*return a list of tasks contained within this taskpaper object filtered by a given tag*

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

        **Return:**
            - ``taskList`` -- the list of filtered tasks

        **Usage:**

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

            .. code-block:: python

               filteredTasks = doc.tagged_tasks("@flag")
               for t in filteredTasks:
                    print t.title

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

def tagged_tasks(
            self,
            tag):
        """*return a list of tasks contained within this taskpaper object filtered by a given tag*

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

        **Return:**
            - ``taskList`` -- the list of filtered tasks

        **Usage:**

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

            .. code-block:: python

               filteredTasks = doc.tagged_tasks("@flag")
               for t in filteredTasks:
                    print t.title

            Note you can give the tag with or without the *@*, and you can also give a tag attribute, e.g. ``@due(today)``
        """
        self.refresh
        tasksList = []
        tag = tag.replace("@", "").lower()
        for t in self.tasks:
            for aTag in t.tags:
                if "(" not in tag:
                    aTag = aTag.split("(")[0]
                if aTag.lower() == tag:
                    tasksList.append(t)
                    break

            subtasks = t.tagged_tasks(tag)
            tasksList += subtasks

        isProject = False
        try:
            this = self.projects
            isProject = True
        except:
            pass

        if isProject:
            for p in self.projects:
                subtasks = p.tagged_tasks(tag)
                tasksList += subtasks

        return tasksList