nodes: 0, module; 1, function_definition; 2, function_name:get_tdms_files; 3, parameters; 4, block; 5, identifier:directory; 6, expression_statement; 7, expression_statement; 8, comment:# get all tdms files; 9, expression_statement; 10, comment:# exclude traces files; 11, expression_statement; 12, return_statement; 13, comment:"""Recursively find projects based on '.tdms' file endings
  
      Searches the `directory` recursively and return a sorted list
      of all found '.tdms' project files, except fluorescence
      data trace files which end with `_traces.tdms`.
      """; 14, assignment; 15, assignment; 16, assignment; 17, call; 18, identifier:path; 19, call; 20, identifier:tdmslist; 21, list_comprehension; 22, identifier:tdmslist; 23, list_comprehension; 24, identifier:sorted; 25, argument_list; 26, attribute; 27, argument_list; 28, identifier:r; 29, for_in_clause; 30, if_clause; 31, identifier:r; 32, for_in_clause; 33, if_clause; 34, identifier:tdmslist; 35, call; 36, identifier:resolve; 37, identifier:r; 38, call; 39, call; 40, identifier:r; 41, identifier:tdmslist; 42, not_operator; 43, attribute; 44, argument_list; 45, attribute; 46, argument_list; 47, attribute; 48, argument_list; 49, call; 50, identifier:pathlib; 51, identifier:Path; 52, identifier:directory; 53, identifier:path; 54, identifier:rglob; 55, string:"*.tdms"; 56, identifier:r; 57, identifier:is_file; 58, attribute; 59, argument_list; 60, attribute; 61, identifier:endswith; 62, string:"_traces.tdms"; 63, identifier:r; 64, identifier:name
code: def get_tdms_files(directory):
      """Recursively find projects based on '.tdms' file endings
  
      Searches the `directory` recursively and return a sorted list
      of all found '.tdms' project files, except fluorescence
      data trace files which end with `_traces.tdms`.
      """
      path = pathlib.Path(directory).resolve()
      # get all tdms files
      tdmslist = [r for r in path.rglob("*.tdms") if r.is_file()]
      # exclude traces files
      tdmslist = [r for r in tdmslist if not r.name.endswith("_traces.tdms")]
      return sorted(tdmslist)