<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_pattern(self, pattern, root=".", depth=None, source_type=DefaultSourceType):
 """ Add a recursive folder scan using a linux-style patterns. :param pattern: pattern or list of patterns to match. :param root: root to start from (default to '.') :param depth: if provided will be depth limit. 0 = first level only. :param source_type: what to return; files only, folders only, or both. """

        self.add_source(PatternSource(pattern, root, depth, **source_type))
        return self