nodes: 0, module; 1, function_definition; 2, function_name:__calculate_edge_weights; 3, parameters; 4, block; 5, identifier:dfs_data; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Calculates the weight of each edge, for embedding-order sorting."""; 12, assignment; 13, assignment; 14, identifier:edge_id; 15, call; 16, block; 17, identifier:weights; 18, identifier:graph; 19, subscript; 20, identifier:weights; 21, dictionary; 22, attribute; 23, argument_list; 24, expression_statement; 25, expression_statement; 26, identifier:dfs_data; 27, string; 28, identifier:graph; 29, identifier:get_all_edge_ids; 30, assignment; 31, assignment; 32, string_content:graph; 33, identifier:edge_weight; 34, call; 35, subscript; 36, identifier:edge_weight; 37, identifier:__edge_weight; 38, argument_list; 39, identifier:weights; 40, identifier:edge_id; 41, identifier:edge_id; 42, identifier:dfs_data
code: def __calculate_edge_weights(dfs_data):
      """Calculates the weight of each edge, for embedding-order sorting."""
      graph = dfs_data['graph']
  
      weights = {}
      for edge_id in graph.get_all_edge_ids():
          edge_weight = __edge_weight(edge_id, dfs_data)
          weights[edge_id] = edge_weight
  
      return weights