code: def test_docnn(self):
      # prepare config
      config_dict = find_and_patch_config(
          "docnn.json", config_base_path=self.config_base_path
      )
      model_path = config_dict["save_snapshot_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
  
      # export the trained model
      result = self.runner.invoke(
          main, args=["--config-json", config_json, "export"]
      )
      print(result.output)
      assert not result.exception, result.exception
  
      # predict with PyTorch model
      result = self.runner.invoke(
          main,
          args=["predict-py", "--model-file", model_path],
          input='{"text": "create an alarm for 1:30 pm"}',
      )
      assert "'prediction':" in result.output, 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 2 for calling the TestMain obj's underlying member method code with example usage: obj.test_docnn() without return types