code: def test_impls(self):
      # Check that create_x actually uses create_x_impl to do its work
      # by using all the member types, both with a faked impl function
      # and without.
      # members with _0 are optional and absent, those with _o are
      # optional and present.
      control_args = []
  
      def fake_impl(self, control, args):
          control_args.append(control)
  
      for fake in [False, True]:
  
          class MyClass(Configurable):
              fruit: Fruit
              fruit_class_type: str = "Orange"
              fruit_o: Optional[Fruit]
              fruit_o_class_type: str = "Orange"
              fruit_0: Optional[Fruit]
              fruit_0_class_type: Optional[str] = None
              boring: BoringConfigurable
              boring_o: Optional[BoringConfigurable]
              boring_o_enabled: bool = True
              boring_0: Optional[BoringConfigurable]
              boring_0_enabled: bool = False
  
              def __post_init__(self):
                  run_auto_creation(self)
  
          if fake:
              MyClass.create_fruit_impl = fake_impl
              MyClass.create_fruit_o_impl = fake_impl
              MyClass.create_boring_impl = fake_impl
              MyClass.create_boring_o_impl = fake_impl
  
          expand_args_fields(MyClass)
          instance = MyClass()
          for name in ["fruit", "fruit_o", "boring", "boring_o"]:
              self.assertEqual(
                  hasattr(instance, name),
                  not fake,
                  msg=f"{name} {fake}",
              )
  
          self.assertIsNone(instance.fruit_0)
          self.assertIsNone(instance.boring_0)
          if not fake:
              self.assertIsInstance(instance.fruit, Orange)
              self.assertIsInstance(instance.fruit_o, Orange)
              self.assertIsInstance(instance.boring, BoringConfigurable)
              self.assertIsInstance(
                  instance.boring_o, BoringConfigurable
              )
  
      self.assertEqual(control_args, ["Orange", "Orange", True, True])
  
imports: import pickle
  import textwrap
  import unittest
  from dataclasses import dataclass, field, is_dataclass
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple
  from unittest.mock import Mock
  from omegaconf import DictConfig, ListConfig, OmegaConf, ValidationError
  from pytorch3d.implicitron.tools.config import _get_type_to_process, _is_actually_dataclass, _ProcessType, _Registry, Configurable, enable_get_default_args, expand_args_fields, get_default_args, get_default_args_field, registry, remove_unused_components, ReplaceableBase, run_auto_creation
label_desc: Use image node_id 22 for calling the TestConfig obj's underlying member method code with example usage: obj.test_impls() without return types