def dump_as_json(record, output_file):
def default_func(value):<EOL><INDENT>"""<STR_LIT>"""<EOL>if isinstance(value, frozenset):<EOL><INDENT>return sorted(value)<EOL><DEDENT>raise TypeError(repr(value) + "<STR_LIT>")<EOL><DEDENT>converted_record = record._replace(<EOL>ordered_statistics=[x._asdict() for x in record.ordered_statistics])<EOL>json.dump(<EOL>converted_record._asdict(), output_file,<EOL>default=default_func, ensure_ascii=False)<EOL>output_file.write(os.linesep)<EOL>
Dump an relation record as a json value.

Arguments:
    record -- A RelationRecord instance to dump.
    output_file -- A file to output.