nodes: 0, module; 1, function_definition; 2, function_name:getFilePathsWithExtensionsInDirectory; 3, parameters; 4, block; 5, identifier:dirTree; 6, identifier:patterns; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, if_statement; 12, return_statement; 13, identifier:sort; 14, True; 15, comment:"""
      Returns all file paths that match any one of patterns in a
      file tree with its root at dirTree.  Sorts the paths by default.
      """; 16, assignment; 17, pattern_list; 18, call; 19, block; 20, identifier:sort; 21, block; 22, identifier:filePaths; 23, identifier:filePaths; 24, list; 25, identifier:root; 26, identifier:dirs; 27, identifier:files; 28, attribute; 29, argument_list; 30, for_statement; 31, expression_statement; 32, identifier:os; 33, identifier:walk; 34, identifier:dirTree; 35, identifier:filePath; 36, identifier:files; 37, block; 38, call; 39, for_statement; 40, attribute; 41, argument_list; 42, identifier:pattern; 43, identifier:patterns; 44, block; 45, identifier:filePaths; 46, identifier:sort; 47, if_statement; 48, call; 49, block; 50, attribute; 51, argument_list; 52, expression_statement; 53, expression_statement; 54, break_statement; 55, identifier:fnmatch; 56, identifier:fnmatch; 57, identifier:filePath; 58, identifier:pattern; 59, assignment; 60, call; 61, identifier:fullPath; 62, call; 63, attribute; 64, argument_list; 65, attribute; 66, argument_list; 67, identifier:filePaths; 68, identifier:append; 69, identifier:fullPath; 70, attribute; 71, identifier:join; 72, identifier:root; 73, identifier:filePath; 74, identifier:os; 75, identifier:path
code: def getFilePathsWithExtensionsInDirectory(dirTree, patterns, sort=True):
      """
      Returns all file paths that match any one of patterns in a
      file tree with its root at dirTree.  Sorts the paths by default.
      """
      filePaths = []
      for root, dirs, files in os.walk(dirTree):
          for filePath in files:
              for pattern in patterns:
                  if fnmatch.fnmatch(filePath, pattern):
                      fullPath = os.path.join(root, filePath)
                      filePaths.append(fullPath)
                      break
      if sort:
          filePaths.sort()
      return filePaths