nodes: 0, module; 1, function_definition; 2, function_name:find_vasprun_files; 3, parameters; 4, block; 5, expression_statement; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Search for vasprun files from the current directory.
  
      The precedence order for file locations is:
  
        1. First search for folders named: 'split-0*'
        2. Else, look in the current directory.
  
      The split folder names should always be zero based, therefore easily
      sortable.
      """; 12, assignment; 13, assignment; 14, assignment; 15, identifier:fol; 16, identifier:folders; 17, block; 18, identifier:filenames; 19, identifier:folders; 20, call; 21, identifier:folders; 22, conditional_expression:sorted(folders) if folders else ['.']; 23, identifier:filenames; 24, list; 25, expression_statement; 26, expression_statement; 27, if_statement; 28, attribute; 29, argument_list; 30, call; 31, identifier:folders; 32, list; 33, assignment; 34, assignment; 35, call; 36, block; 37, elif_clause; 38, else_clause; 39, identifier:glob; 40, identifier:glob; 41, string; 42, identifier:sorted; 43, argument_list; 44, string; 45, identifier:vr_file; 46, call; 47, identifier:vr_file_gz; 48, call; 49, attribute; 50, argument_list; 51, expression_statement; 52, call; 53, block; 54, block; 55, string_content:split-*; 56, identifier:folders; 57, string_content:.; 58, attribute; 59, argument_list; 60, attribute; 61, argument_list; 62, attribute; 63, identifier:exists; 64, identifier:vr_file; 65, call; 66, attribute; 67, argument_list; 68, expression_statement; 69, expression_statement; 70, expression_statement; 71, attribute; 72, identifier:join; 73, identifier:fol; 74, string; 75, attribute; 76, identifier:join; 77, identifier:fol; 78, string; 79, identifier:os; 80, identifier:path; 81, attribute; 82, argument_list; 83, attribute; 84, identifier:exists; 85, identifier:vr_file_gz; 86, call; 87, call; 88, call; 89, identifier:os; 90, identifier:path; 91, string_content:vasprun.xml; 92, identifier:os; 93, identifier:path; 94, string_content:vasprun.xml.gz; 95, identifier:filenames; 96, identifier:append; 97, identifier:vr_file; 98, identifier:os; 99, identifier:path; 100, attribute; 101, argument_list; 102, attribute; 103, argument_list; 104, attribute; 105, argument_list; 106, identifier:filenames; 107, identifier:append; 108, identifier:vr_file_gz; 109, identifier:logging; 110, identifier:error; 111, call; 112, identifier:sys; 113, identifier:exit; 114, attribute; 115, argument_list; 116, string; 117, identifier:format; 118, identifier:fol; 119, string_content:ERROR: No vasprun.xml found in {}!
code: def find_vasprun_files():
      """Search for vasprun files from the current directory.
  
      The precedence order for file locations is:
  
        1. First search for folders named: 'split-0*'
        2. Else, look in the current directory.
  
      The split folder names should always be zero based, therefore easily
      sortable.
      """
      folders = glob.glob('split-*')
      folders = sorted(folders) if folders else ['.']
  
      filenames = []
      for fol in folders:
          vr_file = os.path.join(fol, 'vasprun.xml')
          vr_file_gz = os.path.join(fol, 'vasprun.xml.gz')
  
          if os.path.exists(vr_file):
              filenames.append(vr_file)
          elif os.path.exists(vr_file_gz):
              filenames.append(vr_file_gz)
          else:
              logging.error('ERROR: No vasprun.xml found in {}!'.format(fol))
              sys.exit()
  
      return filenames