<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_children(self, pattern=r".*", flags=0, candidates=None):
 """ Finds the children matching the given patten. Usage:: [<AbstractCompositeNode object at 0x101078040>] :param pattern: Matching pattern. :type pattern: unicode :param flags: Matching regex flags. :type flags: int :param candidates: Matching candidates. :type candidates: list :return: Matching children. :rtype: list """


        if candidates is None:
            candidates = []

        for child in self.__children:
            if re.search(pattern, child.name, flags):
                child not in candidates and candidates.append(child)
            child.find_children(pattern, flags, candidates)
        return candidates