code: def dump_as_json(record, output_file):
      """
      Dump an relation record as a json value.
  
      Arguments:
          record -- A RelationRecord instance to dump.
          output_file -- A file to output.
      """
  
      def default_func(value):
          """
          Default conversion for JSON value.
          """
          if isinstance(value, frozenset):
              return sorted(value)
          raise TypeError(repr(value) + " is not JSON serializable")
  
      converted_record = record._replace(
          ordered_statistics=[
              x._asdict() for x in record.ordered_statistics
          ]
      )
      json.dump(
          converted_record._asdict(),
          output_file,
          default=default_func,
          ensure_ascii=False,
      )
      output_file.write(os.linesep)
  
imports: import sys
  import csv
  import argparse
  import json
  import os
  from collections import namedtuple
  from itertools import combinations
  from itertools import chain
label_desc: Use image node_id 8 for calling a global function with example usage: dump_as_json(record, output_file) and returns: sorted