19 log.debug(
"Processing file {0}".
format(
list(input_files.keys())[0]))
20 weights =
list(input_files.values())[0].getElementsByTagName(
"weight")
21 for weight
in weights:
22 weightsList.append({
"value":weight.getAttribute(
"value"),
"unbiased":weight.getAttribute(
"unbiased"),
"id":
str(new_id)})
23 check_weight.append({
"value": weight.getAttribute(
"value"),
"unbiased":weight.getAttribute(
"unbiased")})
25 events =
list(input_files.values())[0].getElementsByTagName(
"e")
27 eventsList.append({
"n":event.getAttribute(
"n"),
"w":event.getAttribute(
"w")})
29 for fin_name, fin
in list(input_files.items())[1:]:
30 log.debug(
"Processing file {0}".
format(fin_name))
32 weights = fin.getElementsByTagName(
"weight")
33 for weight
in weights:
34 element = {
"value": weight.getAttribute(
"value"),
"unbiased":weight.getAttribute(
"unbiased")}
37 if element
not in check_weight:
38 check_weight.append(element.copy())
39 element[
"id"] =
str(new_id)
40 weightsList.append(element)
41 id_map[weight.getAttribute(
"id")]=element[
"id"]
44 id_map[weight.getAttribute(
"id")]=weightsList[check_weight.index(element)][
"id"]
45 events = fin.getElementsByTagName(
"e")
48 eventsList.append({
"n":event.getAttribute(
"n"),
"w":id_map[event.getAttribute(
"w")]})
49 return weightsList, eventsList