def ReportCommonScopes(scope_summary, flags):
  scope_counter = scope_summary.CalculateRankings()
  csv_header = ['NUM_USERS', 'SCOPE']
  if flags.console:
    PrintReportLine('\n%s' % BORDER)
    PrintReportLine('MOST COMMON SCOPES:')
    PrintReportLine(BORDER)
    PrintReportLine('%s' % '\t'.join(csv_header), indent=True)
    for scope, user_count in scope_counter.FilterAndSortMostCommon(flags.top_n):
      PrintReportLine(
          '%d:\t%s' % (user_count, token_report_utils.LookupScope(scope)),
          indent=True)
      if flags.long_list:
        for token in scope_summary.GetTokenList(scope):
          client_id_set, user_set = token
          sorted_domains = sorted(client_id_set)
          PrintReportLine('%2d: %s' % (len(user_set), sorted_domains[0]),
                          indent=True, indent_level=2)
          for client_id in sorted_domains[1:]:
            PrintReportLine(client_id, indent=True, indent_level=3)
          if flags.show_users:
            users_string = ', '.join(sorted(user_set))
            PrintReportLine(SEPARATOR, indent=True, indent_level=3)
            PrintReportLine(WrapReportText(users_string))

  if flags.csv:
    # Swap scope and user_count for printing.
    csv_rows = [
        (v, k) for k, v in scope_counter.FilterAndSortMostCommon(flags.top_n)]
    filename_path = FILE_MANAGER.WriteCSVFile(_SCOPES_REPORT_FILE_NAME,
                                              csv_rows, csv_header,
                                              overwrite_ok=flags.force)
    print 'Wrote common scopes report: %s.' % filename_path
Computes the Kolmogorov-Smirnof statistic on 2 samples.  From
dataset/ETHPy150Open google/gfw-toolkit/toolkit/cmds/report_domain_token_status.py/ReportCommonScopes--crossover with--dataset/ETHPy150Open radlab/sparrow/src/main/python/third_party/stats.py/lks_2samp