code: def test_docnn_with_torchscript_export_target(self):
      # prepare config
      config_dict = find_and_patch_config(
          "docnn_wo_export.json", config_base_path=self.config_base_path
      )
      config_json = json.dumps(config_dict)
  
      # train model
      result = self.runner.invoke(
          main, args=["--config-json", config_json, "train"]
      )
      assert not result.exception, result.exception
  
      tgts = ["cpu", "nnpi"]
      for tgt in tgts:
          # export the trained model
          result = self.runner.invoke(
              main,
              args=[
                  "--config-json",
                  config_json,
                  "torchscript-export",
                  "--export-json",
                  os.path.join(
                      self.config_base_path, "export_list.json"
                  ),
                  "--target",
                  tgt,
              ],
          )
          # assert the target option was accepted as legitimate.
          assert not result.exception, result.exception
  
file_path: pytext/tests/main_test.py
imports: import json
  import os
  import tempfile
  import unittest
  from click.testing import CliRunner
  from pytext.main import main
  from pytext.tests.utils import find_and_patch_config
  from pytext.utils import test
  from pytext.utils.path import PYTEXT_HOME
label_desc: Use image node_id 5 for calling the TestMain obj's underlying member method code with example usage: obj.test_docnn_with_torchscript_export_target() without return types