code: def snapshot(model, filename, pytest_args, exclusive, skip, solver,
               experimental, custom_tests, custom_config):
      
      model_obj, sbml_ver, notifications = api.validate_model(
          model)
      if model_obj is None:
          LOGGER.critical(
              "The model could not be loaded due to the following SBML errors.")
          utils.stdout_notifications(notifications)
          api.validation_report(model, notifications, filename)
          sys.exit(1)
      if not any(a.startswith("--tb") for a in pytest_args):
          pytest_args = ["--tb", "no"] + pytest_args
      # Add further directories to search for tests.
      pytest_args.extend(custom_tests)
      config = ReportConfiguration.load()
      # Update the default test configuration with custom ones (if any).
      for custom in custom_config:
          config.merge(ReportConfiguration.load(custom))
      model_obj.solver = solver
      _, results = api.test_model(model_obj, sbml_version=sbml_ver, results=True,
                                  pytest_args=pytest_args, skip=skip,
                                  exclusive=exclusive, experimental=experimental)
      with open(filename, "w", encoding="utf-8") as file_handle:
          LOGGER.info("Writing snapshot report to '%s'.", filename)
          file_handle.write(api.snapshot_report(results, config))
docs: Take a snapshot of a model's state and generate a report.
  
      MODEL: Path to model file. Can also be supplied via the environment variable
      MEMOTE_MODEL or configured in 'setup.cfg' or 'memote.ini'.