code: def Import(context, request):
      
      form = request.form
      # TODO form['file'] sometimes returns a list
      infile = form['instrument_results_file'][0] if \
          isinstance(form['instrument_results_file'], list) else \
          form['instrument_results_file']
      artoapply = form['artoapply']
      override = form['results_override']
  
      instrument = form.get('instrument', None)
      errors = []
      logs = []
  
      # Load the most suitable parser according to file extension/options/etc...
      parser = None
      if not hasattr(infile, 'filename'):
          errors.append(_("No file selected"))
      parser = TwoDimensionCSVParser(infile)
      status = get_instrument_import_ar_allowed_states(artoapply)
      over = get_instrument_import_override(override)
      importer = TwoDimensionImporter(parser=parser,
                                      context=context,
                                      allowed_ar_states=status,
                                      allowed_analysis_states=None,
                                      override=over,
                                      instrument_uid=instrument,
                                      form=form)
      tbex = ''
      try:
          importer.process()
      except:
          tbex = traceback.format_exc()
      errors = importer.errors
      logs = importer.logs
      warns = importer.warns
      if tbex:
          errors.append(tbex)
  
      results = {'errors': errors, 'log': logs, 'warns': warns}
  
      return json.dumps(results)
docs: Read Dimensional-CSV analysis results