def test_undecorated_encoder(self):
    """Simple test to verify that we can register encoders at runtime."""
    # Register the encoder.
    encoder_registry.register_encoder('undecorated_encoder')(UnDecoratedEncoder)

    # Retrieve it.
    encoder_name = encoder_registry.get_registered_encoder(
        'undecorated_encoder')
    self.assertIsNotNone(encoder_name)
    self.assertEqual(encoder_name.__name__, 'UnDecoratedEncoder')

    # Verify that we can still access previously registerd decorated layers.
    encoder_name = encoder_registry.get_registered_encoder('decorated_encoder')
    self.assertIsNotNone(encoder_name)
    self.assertEqual(encoder_name.__name__, 'DecoratedEncoder')
Simple test to verify that we can register encoders at runtime.
language/mentionmemory/encoders/encoder_registry_test.py