def write_block_summary_report(course_data):
 (block_summary_counts, unique_course_counts) = _get_block_summary_totals(course_data)
 with open('xblock_summary_counts.csv', 'wb') as csvfile:
  summary_writer = csv.writer(csvfile, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
  summary_writer.writerow(['XBLOCK_NAME', 'UNIQUE_COURSES', 'NUM_TOTAL_INSTANCES'])
  for block_type in sorted(block_summary_counts):
   block_count = block_summary_counts.get(block_type)
   summary_writer.writerow([block_type, str(unique_course_counts[block_type]), str(block_count)])
  csvfile.close()

def write_block_summary_report ( course_data ) : ( block_summary_counts , unique_course_counts ) = _get_block_summary_totals ( course_data ) with open ( 'xblock_summary_counts.csv' , 'wb' ) as csvfile : summary_writer = csv . writer ( csvfile , delimiter = ',' , quotechar = '"' , quoting = csv . QUOTE_MINIMAL ) summary_writer . writerow ( [ 'XBLOCK_NAME' , 'UNIQUE_COURSES' , 'NUM_TOTAL_INSTANCES' ] ) for block_type in sorted ( block_summary_counts ) : block_count = block_summary_counts . get ( block_type ) summary_writer . writerow ( [ block_type , str ( unique_course_counts [ block_type ] ) , str ( block_count ) ] ) csvfile . close ( )
generate a csv file containing a summary of the xblock usage arguments: course_data : a list of course_data objects returns: nothing .