nodes: 0, module; 1, function_definition; 2, function_name:sort_common_members; 3, parameters; 4, block; 5, expression_statement; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, expression_statement; 12, for_statement; 13, expression_statement; 14, expression_statement; 15, comment:"""Sorts the keys and members"""; 16, assignment; 17, assignment; 18, assignment; 19, assignment; 20, pattern_list; 21, call; 22, block; 23, assignment; 24, identifier:key; 25, identifier:sorted_keys; 26, block; 27, call; 28, call; 29, identifier:filename; 30, binary_operator:PREFIX + '/common_members.json'; 31, identifier:sorted_json_data; 32, dictionary; 33, identifier:json_data; 34, call; 35, identifier:all_keys; 36, list; 37, identifier:key; 38, identifier:value; 39, attribute; 40, argument_list; 41, expression_statement; 42, identifier:sorted_keys; 43, call; 44, if_statement; 45, identifier:print; 46, argument_list; 47, identifier:write_json; 48, argument_list; 49, identifier:PREFIX; 50, string; 51, identifier:read_json; 52, argument_list; 53, identifier:json_data; 54, identifier:items; 55, call; 56, identifier:sorted; 57, argument_list; 58, comparison_operator:len(json_data[key]) > 0; 59, comment:# Only add modules which have common members; 60, block; 61, binary_operator:'--> Sorted/cleaned ' + os.path.basename(filename); 62, identifier:sorted_json_data; 63, identifier:filename; 64, string_content:/common_members.json; 65, identifier:filename; 66, attribute; 67, argument_list; 68, identifier:all_keys; 69, call; 70, integer:0; 71, expression_statement; 72, string; 73, call; 74, identifier:all_keys; 75, identifier:append; 76, identifier:key; 77, identifier:len; 78, argument_list; 79, assignment; 80, string_content:--> Sorted/cleaned; 81, attribute; 82, argument_list; 83, subscript; 84, subscript; 85, call; 86, attribute; 87, identifier:basename; 88, identifier:filename; 89, identifier:json_data; 90, identifier:key; 91, identifier:sorted_json_data; 92, identifier:key; 93, identifier:sorted; 94, argument_list; 95, identifier:os; 96, identifier:path; 97, subscript; 98, identifier:json_data; 99, identifier:key
code: def sort_common_members():
      """Sorts the keys and members"""
  
      filename = PREFIX + '/common_members.json'
      sorted_json_data = {}
      json_data = read_json(filename)
  
      all_keys = []
      for key, value in json_data.items():
          all_keys.append(key)
      sorted_keys = sorted(all_keys)
  
      for key in sorted_keys:
          if len(json_data[key]) > 0:
              # Only add modules which have common members
              sorted_json_data[key] = sorted(json_data[key])
  
      print('--> Sorted/cleaned ' + os.path.basename(filename))
  
      write_json(sorted_json_data, filename)