docs: def json_output(cls, cs, score_dict, output_filename, ds_loc, limit,
                      output_type='json'):
          '''
          Generates JSON output for the ocmpliance score(s)
          @param cs              Compliance Checker Suite
          @param score_groups    List of results
          @param output_filename The file path to output to
          @param ds_loc          List of source datasets
          @param limit           The degree of strictness, 1 being the strictest,
                                 and going up from there.
          @param output_type     Either 'json' or 'json_new'. json_new is the new
                                 json output format that supports multiple datasets
          '''
          results = {}
          # json output keys out at the top level by
          if len(score_dict) > 1 and output_type != 'json_new':
              raise ValueError("output_type must be set to 'json_new' if outputting multiple datasets to a single json file or stdout")
  
          if output_type == 'json':
              for ds, score_groups in six.iteritems(score_dict):
                  for checker, rpair in six.iteritems(score_groups):
                      groups, errors = rpair
                      results[checker] = cs.dict_output(
                          checker, groups, ds, limit,
                      )
          elif output_type == 'json_new':
              for ds, score_groups in six.iteritems(score_dict):
                  for checker, rpair in six.iteritems(score_groups):
                      groups, errors = rpair
                      results[ds] = {}
                      results[ds][checker] = cs.dict_output(
                          checker, groups, ds, limit
                      )
          json_results = json.dumps(results, indent=2, ensure_ascii=False)
  
          if output_filename == '-':
              print(json_results)
          else:
              with io.open(output_filename, 'w', encoding='utf8') as f:
                  f.write(json_results)
  
          return groups