nodes: 0, module; 1, function_definition; 2, function_name:find_germanet_xml_files; 3, parameters; 4, block; 5, identifier:xml_path; 6, expression_statement; 7, expression_statement; 8, comment:# sort out the lexical files; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, comment:# sort out the GermaNet relations file; 13, expression_statement; 14, expression_statement; 15, if_statement; 16, comment:# sort out the wiktionary paraphrase files; 17, expression_statement; 18, expression_statement; 19, if_statement; 20, comment:# sort out the interlingual index file; 21, expression_statement; 22, expression_statement; 23, if_statement; 24, if_statement; 25, return_statement; 26, string; 27, assignment; 28, assignment; 29, assignment; 30, not_operator; 31, block; 32, assignment; 33, assignment; 34, not_operator; 35, block; 36, else_clause; 37, assignment; 38, assignment; 39, not_operator; 40, block; 41, assignment; 42, assignment; 43, not_operator; 44, block; 45, identifier:xml_files; 46, block; 47, expression_list; 48, string_content:Globs the XML files contained in the given directory and sorts
      them into sections for import into the MongoDB database.
  
      Arguments:
      - `xml_path`: the path to the directory containing the GermaNet
        XML files; 49, identifier:xml_files; 50, call; 51, identifier:lex_files; 52, list_comprehension; 53, identifier:xml_files; 54, call; 55, identifier:lex_files; 56, expression_statement; 57, identifier:gn_rels_file; 58, list_comprehension; 59, identifier:xml_files; 60, call; 61, identifier:gn_rels_file; 62, expression_statement; 63, expression_statement; 64, block; 65, identifier:wiktionary_files; 66, list_comprehension; 67, identifier:xml_files; 68, call; 69, identifier:wiktionary_files; 70, expression_statement; 71, identifier:ili_files; 72, list_comprehension; 73, identifier:xml_files; 74, call; 75, identifier:ili_files; 76, expression_statement; 77, expression_statement; 78, identifier:lex_files; 79, identifier:gn_rels_file; 80, identifier:wiktionary_files; 81, identifier:ili_files; 82, identifier:sorted; 83, argument_list; 84, identifier:xml_file; 85, for_in_clause; 86, if_clause; 87, identifier:sorted; 88, argument_list; 89, call; 90, identifier:xml_file; 91, for_in_clause; 92, if_clause; 93, identifier:sorted; 94, argument_list; 95, call; 96, assignment; 97, if_statement; 98, expression_statement; 99, identifier:xml_file; 100, for_in_clause; 101, if_clause; 102, identifier:sorted; 103, argument_list; 104, call; 105, identifier:xml_file; 106, for_in_clause; 107, if_clause; 108, identifier:sorted; 109, argument_list; 110, call; 111, call; 112, call; 113, identifier:xml_file; 114, identifier:xml_files; 115, call; 116, binary_operator:set(xml_files) - set(lex_files); 117, identifier:print; 118, argument_list; 119, identifier:xml_file; 120, identifier:xml_files; 121, comparison_operator:os.path.basename(xml_file).lower() == 'gn_relations.xml'; 122, binary_operator:set(xml_files) - set(gn_rels_file); 123, identifier:print; 124, argument_list; 125, identifier:gn_rels_file; 126, None; 127, comparison_operator:1 < len(gn_rels_file); 128, block; 129, assignment; 130, identifier:xml_file; 131, identifier:xml_files; 132, call; 133, binary_operator:set(xml_files) - set(wiktionary_files); 134, identifier:print; 135, argument_list; 136, identifier:xml_file; 137, identifier:xml_files; 138, call; 139, binary_operator:set(xml_files) - set(ili_files); 140, identifier:print; 141, argument_list; 142, identifier:print; 143, argument_list; 144, attribute; 145, argument_list; 146, attribute; 147, argument_list; 148, call; 149, call; 150, string; 151, call; 152, string; 153, call; 154, call; 155, string; 156, integer:1; 157, call; 158, expression_statement; 159, identifier:gn_rels_file; 160, subscript; 161, attribute; 162, argument_list; 163, call; 164, call; 165, string; 166, attribute; 167, argument_list; 168, call; 169, call; 170, string; 171, string; 172, identifier:xml_files; 173, identifier:glob; 174, identifier:glob; 175, call; 176, identifier:re; 177, identifier:match; 178, string; 179, call; 180, identifier:set; 181, argument_list; 182, identifier:set; 183, argument_list; 184, string_content:ERROR: cannot find lexical information files; 185, attribute; 186, argument_list; 187, string_content:gn_relations.xml; 188, identifier:set; 189, argument_list; 190, identifier:set; 191, argument_list; 192, string_content:ERROR: cannot find relations file gn_relations.xml; 193, identifier:len; 194, argument_list; 195, call; 196, identifier:gn_rels_file; 197, integer:0; 198, identifier:re; 199, identifier:match; 200, string; 201, call; 202, identifier:set; 203, argument_list; 204, identifier:set; 205, argument_list; 206, string_content:WARNING: cannot find wiktionary paraphrase files; 207, call; 208, identifier:startswith; 209, string; 210, identifier:set; 211, argument_list; 212, identifier:set; 213, argument_list; 214, string_content:WARNING: cannot find interlingual index file; 215, string_content:WARNING: unrecognised xml files:; 216, attribute; 217, argument_list; 218, string_content:(adj|nomen|verben)\.; 219, attribute; 220, argument_list; 221, identifier:xml_files; 222, identifier:lex_files; 223, call; 224, identifier:lower; 225, identifier:xml_files; 226, identifier:gn_rels_file; 227, identifier:gn_rels_file; 228, identifier:print; 229, argument_list; 230, string_content:wiktionaryparaphrases-; 231, attribute; 232, argument_list; 233, identifier:xml_files; 234, identifier:wiktionary_files; 235, attribute; 236, argument_list; 237, string_content:interlingualindex; 238, identifier:xml_files; 239, identifier:ili_files; 240, attribute; 241, identifier:join; 242, identifier:xml_path; 243, string; 244, call; 245, identifier:lower; 246, attribute; 247, argument_list; 248, concatenated_string; 249, call; 250, identifier:lower; 251, call; 252, identifier:lower; 253, identifier:os; 254, identifier:path; 255, string_content:*.xml; 256, attribute; 257, argument_list; 258, attribute; 259, identifier:basename; 260, identifier:xml_file; 261, string; 262, string; 263, attribute; 264, argument_list; 265, attribute; 266, argument_list; 267, attribute; 268, identifier:basename; 269, identifier:xml_file; 270, identifier:os; 271, identifier:path; 272, string_content:WARNING: more than one relations file gn_relations.xml,; 273, string_content:taking first match; 274, attribute; 275, identifier:basename; 276, identifier:xml_file; 277, attribute; 278, identifier:basename; 279, identifier:xml_file; 280, identifier:os; 281, identifier:path; 282, identifier:os; 283, identifier:path; 284, identifier:os; 285, identifier:path
code: def find_germanet_xml_files(xml_path):
      '''
      Globs the XML files contained in the given directory and sorts
      them into sections for import into the MongoDB database.
  
      Arguments:
      - `xml_path`: the path to the directory containing the GermaNet
        XML files
      '''
      xml_files = sorted(glob.glob(os.path.join(xml_path, '*.xml')))
  
      # sort out the lexical files
      lex_files = [xml_file for xml_file in xml_files if
                   re.match(r'(adj|nomen|verben)\.',
                            os.path.basename(xml_file).lower())]
      xml_files = sorted(set(xml_files) - set(lex_files))
  
      if not lex_files:
          print('ERROR: cannot find lexical information files')
  
      # sort out the GermaNet relations file
      gn_rels_file = [xml_file for xml_file in xml_files if
                      os.path.basename(xml_file).lower() == 'gn_relations.xml']
      xml_files = sorted(set(xml_files) - set(gn_rels_file))
  
      if not gn_rels_file:
          print('ERROR: cannot find relations file gn_relations.xml')
          gn_rels_file = None
      else:
          if 1 < len(gn_rels_file):
              print ('WARNING: more than one relations file gn_relations.xml, '
                     'taking first match')
          gn_rels_file = gn_rels_file[0]
  
      # sort out the wiktionary paraphrase files
      wiktionary_files = [xml_file for xml_file in xml_files if
                          re.match(r'wiktionaryparaphrases-',
                                   os.path.basename(xml_file).lower())]
      xml_files = sorted(set(xml_files) - set(wiktionary_files))
  
      if not wiktionary_files:
          print('WARNING: cannot find wiktionary paraphrase files')
  
      # sort out the interlingual index file
      ili_files = [xml_file for xml_file in xml_files if
                  os.path.basename(xml_file).lower().startswith(
              'interlingualindex')]
      xml_files = sorted(set(xml_files) - set(ili_files))
  
      if not ili_files:
          print('WARNING: cannot find interlingual index file')
  
      if xml_files:
          print('WARNING: unrecognised xml files:', xml_files)
  
      return lex_files, gn_rels_file, wiktionary_files, ili_files