nodes: 0, module; 1, function_definition; 2, function_name:list_file_extensions; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_default_parameter; 8, generic_type; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, identifier:path; 15, type; 16, identifier:reportevery; 17, type; 18, integer:1; 19, identifier:List; 20, type_parameter; 21, comment:"""
      Returns a sorted list of every file extension found in a directory
      and its subdirectories.
  
      Args:
          path: path to scan
          reportevery: report directory progress after every *n* steps
  
      Returns:
          sorted list of every file extension found
  
      """; 22, assignment; 23, assignment; 24, pattern_list; 25, call; 26, block; 27, call; 28, identifier:str; 29, identifier:int; 30, type; 31, identifier:extensions; 32, call; 33, identifier:count; 34, integer:0; 35, identifier:root; 36, identifier:dirs; 37, identifier:files; 38, attribute; 39, argument_list; 40, expression_statement; 41, if_statement; 42, for_statement; 43, identifier:sorted; 44, argument_list; 45, identifier:str; 46, identifier:set; 47, argument_list; 48, identifier:os; 49, identifier:walk; 50, identifier:path; 51, augmented_assignment; 52, comparison_operator:count % reportevery == 0; 53, block; 54, identifier:file; 55, identifier:files; 56, block; 57, call; 58, identifier:count; 59, integer:1; 60, binary_operator:count % reportevery; 61, integer:0; 62, expression_statement; 63, expression_statement; 64, expression_statement; 65, identifier:list; 66, argument_list; 67, identifier:count; 68, identifier:reportevery; 69, call; 70, assignment; 71, call; 72, identifier:extensions; 73, attribute; 74, argument_list; 75, pattern_list; 76, call; 77, attribute; 78, argument_list; 79, identifier:log; 80, identifier:debug; 81, string:"Walking directory {}: {!r}"; 82, identifier:count; 83, identifier:root; 84, identifier:filename; 85, identifier:ext; 86, attribute; 87, argument_list; 88, identifier:extensions; 89, identifier:add; 90, identifier:ext; 91, attribute; 92, identifier:splitext; 93, identifier:file; 94, identifier:os; 95, identifier:path
code: def list_file_extensions(path: str, reportevery: int = 1) -> List[str]:
      """
      Returns a sorted list of every file extension found in a directory
      and its subdirectories.
  
      Args:
          path: path to scan
          reportevery: report directory progress after every *n* steps
  
      Returns:
          sorted list of every file extension found
  
      """
      extensions = set()
      count = 0
      for root, dirs, files in os.walk(path):
          count += 1
          if count % reportevery == 0:
              log.debug("Walking directory {}: {!r}", count, root)
          for file in files:
              filename, ext = os.path.splitext(file)
              extensions.add(ext)
      return sorted(list(extensions))