code: def test_new_factory_subclasses_detection():
      """Verify that Factory finds all subclasses"""
  
      class Base:
          pass
  
      class A(Base):
          pass
  
      class B(Base):
          pass
  
      class AA(A):
          pass
  
      class AB(A):
          pass
  
      class AAA(AA):
          pass
  
      class AA_AB(AA, AB):
          pass
  
      factory = GenericFactory(Base)
  
      assert type(factory.create(of_type="A")) is A
      assert type(factory.create(of_type="B")) is B
      assert type(factory.create(of_type="AA")) is AA
      assert type(factory.create(of_type="AAA")) is AAA
      assert type(factory.create(of_type="AA_AB")) is AA_AB
  
      with pytest.raises(NotImplementedError) as exc_info:
          factory.create(of_type="random")
      assert (
          "Could not find implementation of Base, type = 'random'"
          in str(exc_info.value)
      )
  
      class Random(Base):
          pass
  
      assert type(factory.create(of_type="random")) is Random
  
imports: import pytest
  from orion.core.utils import Factory, GenericFactory, float_to_digits_list
label_desc: Use image node_id 2 for calling a global function with example usage: test_new_factory_subclasses_detection() without return types