code: def test_inheritance(self):
      # Also exercises optional replaceables
      class FruitBowl(ReplaceableBase):
          main_fruit: Fruit
          main_fruit_class_type: str = "Orange"
  
          def __post_init__(self):
              raise ValueError("This doesn't get called")
  
      class LargeFruitBowl(FruitBowl):
          extra_fruit: Optional[Fruit]
          extra_fruit_class_type: str = "Kiwi"
          no_fruit: Optional[Fruit]
          no_fruit_class_type: Optional[str] = None
  
          def __post_init__(self):
              run_auto_creation(self)
  
      large_args = get_default_args(LargeFruitBowl)
      self.assertNotIn("extra_fruit", large_args)
      self.assertNotIn("main_fruit", large_args)
      large = LargeFruitBowl(**large_args)
      self.assertIsInstance(large.main_fruit, Orange)
      self.assertIsInstance(large.extra_fruit, Kiwi)
      self.assertIsNone(large.no_fruit)
      self.assertIn("no_fruit_Kiwi_args", large_args)
  
      remove_unused_components(large_args)
      large2 = LargeFruitBowl(**large_args)
      self.assertIsInstance(large2.main_fruit, Orange)
      self.assertIsInstance(large2.extra_fruit, Kiwi)
      self.assertIsNone(large2.no_fruit)
      needed_args = [
          "extra_fruit_Kiwi_args",
          "extra_fruit_class_type",
          "main_fruit_Orange_args",
          "main_fruit_class_type",
          "no_fruit_class_type",
      ]
      self.assertEqual(sorted(large_args.keys()), needed_args)
  
      with self.assertRaisesRegex(
          ValueError, "NotAFruit has not been registered."
      ):
          LargeFruitBowl(extra_fruit_class_type="NotAFruit")
  
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 8 for calling the TestConfig obj's underlying member method code with example usage: obj.test_inheritance() without return types