Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _emit_json_stats(self, where):
stats = {}
for who in self.what:
report, cm = self.accu[who]
stats[who] = {
'accuracy': serialize_classification_report(report),
'cm': serialize_cm(cm)
}
json.dump(stats, where)