code: def export_dashboards(print_stdout, dashboard_file):
      
      data = dashboard_import_export.export_dashboards(db.session)
      if print_stdout or not dashboard_file:
          print(data)
      if dashboard_file:
          logging.info('Exporting dashboards to %s', dashboard_file)
          with open(dashboard_file, 'w') as data_stream:
              data_stream.write(data)
docs: Export dashboards to JSON