code: def test_should_retrain_only_non_trained_subunits(self):
      # Given
      dataset_stream = io.StringIO(
          """
  ---
  type: intent
  name: greeting1
  utterances:
  - hello [greeted:name](john)"""
      )
      dataset = Dataset.from_yaml_files("en", [dataset_stream]).json
  
      @IntentParser.register("test_intent_parser", True)
      class TestIntentParser(MockIntentParser):
          def __init__(self, config=None, **shared):
              super(TestIntentParser, self).__init__(config, **shared)
              self.sub_unit_1 = dict(fitted=False, calls=0)
              self.sub_unit_2 = dict(fitted=False, calls=0)
  
          def fit(self, dataset, force_retrain):
              if force_retrain:
                  self.sub_unit_1["fitted"] = True
                  self.sub_unit_1["calls"] += 1
                  self.sub_unit_2["fitted"] = True
                  self.sub_unit_2["calls"] += 1
              else:
                  if not self.sub_unit_1["fitted"]:
                      self.sub_unit_1["fitted"] = True
                      self.sub_unit_1["calls"] += 1
                  if not self.sub_unit_2["fitted"]:
                      self.sub_unit_2["fitted"] = True
                      self.sub_unit_2["calls"] += 1
  
              return self
  
          @property
          def fitted(self):
              return (
                  self.sub_unit_1["fitted"]
                  and self.sub_unit_2["fitted"]
              )
  
      nlu_engine_config = NLUEngineConfig(["test_intent_parser"])
      nlu_engine = SnipsNLUEngine(nlu_engine_config)
  
      intent_parser = TestIntentParser()
      intent_parser.sub_unit_1.update(dict(fitted=True, calls=0))
      nlu_engine.intent_parsers.append(intent_parser)
  
      # When
      nlu_engine.fit(dataset, force_retrain=False)
  
      # Then
      self.assertDictEqual(
          dict(fitted=True, calls=0), intent_parser.sub_unit_1
      )
      self.assertDictEqual(
          dict(fitted=True, calls=1), intent_parser.sub_unit_2
      )
  
imports: from __future__ import unicode_literals
  import io
  import shutil
  import sys
  from builtins import str
  from unittest import skipIf
  from checksumdir import dirhash
  from mock import MagicMock, patch
  from snips_nlu_parsers import get_all_languages
  import snips_nlu
  from snips_nlu.common.io_utils import temp_dir
  from snips_nlu.constants import END, LANGUAGE, LANGUAGE_EN, RES_ENTITY, RES_INPUT, RES_INTENT, RES_INTENT_NAME, RES_MATCH_RANGE, RES_RAW_VALUE, RES_SLOTS, RES_SLOT_NAME, RES_VALUE, START
  from snips_nlu.dataset import Dataset, validate_and_format_dataset
  from snips_nlu.entity_parser import BuiltinEntityParser, CustomEntityParser, CustomEntityParserUsage
  from snips_nlu.exceptions import IntentNotFoundError, InvalidInputError, NotTrained, IncompatibleModelError, PersistingError, LoadingError
  from snips_nlu.intent_parser import IntentParser
  from snips_nlu.nlu_engine import SnipsNLUEngine
  from snips_nlu.pipeline.configs import NLUEngineConfig
  from snips_nlu.resources import load_resources
  from snips_nlu.result import custom_slot, empty_result, intent_classification_result, parsing_result, resolved_slot, unresolved_slot, extraction_result
  from snips_nlu.tests.utils import FixtureTest, MockIntentParser, get_empty_dataset
label_desc: Use image node_id 7 for calling the TestSnipsNLUEngine obj's underlying member method code with example usage: obj.test_should_retrain_only_non_trained_subunits() and returns: self, unknown