code: def event_return(events):
      '''
      Write event data (return data and non-return data) to file on the master.
      '''
      if not events:
          # events is an empty list.
          # Don't open the logfile in vain.
          return
      opts = _get_options({})  # Pass in empty ret, since this is a list of events
      try:
          with salt.utils.files.flopen(opts['filename'], 'a') as logfile:
              for event in events:
                  salt.utils.json.dump(event, logfile)
                  logfile.write(str('\n'))  # future lint: disable=blacklisted-function
      except Exception:
          log.error('Could not write to rawdata_json file %s', opts['filename'])
          raisf event_return(events):
      '''
      Write event data (return data and non-return data) to file on the master.
      '''
      if not events:
          # events is an empty list.
          # Don't open the logfile in vain.
          return
      opts = _get_options({})  # Pass in empty ret, since this is a list of events
      try:
          with salt.utils.files.flopen(opts['filename'], 'a') as logfile:
              for event in events:
                  salt.utils.json.dump(event, logfile)
                  logfile.write(str('\n'))  # future lint: disable=blacklisted-function
      except Exception:
          log.error('Could not write to rawdata_json file %s', opts['filename'])
          raise
docs: Write event data (return data and non-return data) to file on the master.