nodes: 0, module; 1, function_definition; 2, function_name:filter_by_size; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, typed_parameter; 8, typed_parameter; 9, typed_parameter; 10, generic_type; 11, expression_statement; 12, comment:# TODO Tell the user what utterances we are removing.; 13, expression_statement; 14, expression_statement; 15, return_statement; 16, identifier:feat_dir; 17, type; 18, identifier:prefixes; 19, type; 20, identifier:feat_type; 21, type; 22, identifier:max_samples; 23, type; 24, identifier:List; 25, type_parameter; 26, comment:""" Sorts the files by their length and returns those with less
      than or equal to max_samples length. Returns the filename prefixes of
      those files. The main job of the method is to filter, but the sorting
      may give better efficiency when doing dynamic batching unless it gets
      shuffled downstream.
      """; 27, assignment; 28, assignment; 29, identifier:prefixes; 30, identifier:Path; 31, generic_type; 32, identifier:str; 33, identifier:int; 34, type; 35, identifier:prefix_lens; 36, call; 37, identifier:prefixes; 38, list_comprehension; 39, identifier:List; 40, type_parameter; 41, identifier:str; 42, identifier:get_prefix_lens; 43, argument_list; 44, identifier:prefix; 45, for_in_clause; 46, if_clause; 47, type; 48, call; 49, identifier:prefixes; 50, identifier:feat_type; 51, pattern_list; 52, identifier:prefix_lens; 53, comparison_operator:length <= max_samples; 54, identifier:str; 55, identifier:Path; 56, argument_list; 57, identifier:prefix; 58, identifier:length; 59, identifier:length; 60, identifier:max_samples; 61, identifier:feat_dir
code: def filter_by_size(feat_dir: Path, prefixes: List[str], feat_type: str,
                     max_samples: int) -> List[str]:
      """ Sorts the files by their length and returns those with less
      than or equal to max_samples length. Returns the filename prefixes of
      those files. The main job of the method is to filter, but the sorting
      may give better efficiency when doing dynamic batching unless it gets
      shuffled downstream.
      """
  
      # TODO Tell the user what utterances we are removing.
      prefix_lens = get_prefix_lens(Path(feat_dir), prefixes, feat_type)
      prefixes = [prefix for prefix, length in prefix_lens
                  if length <= max_samples]
      return prefixes