def main(test): import math filter_key = [\'x\', \'y\', \'z\'] rs = [] for e in test: data = {key: e[\'data\'][key] for key in filter_key} data[\'A\'] = math.sqr