def load_component_by_name(component_name, context, config): # type: (Text, Dict[Text, Any], Dict[Text, Any]) -> Optional[Component] """Resolves a components name and calls it's load method to init it based on a previously persisted model.""" from rasa_nlu.components import load_component component_clz = get_component_class(component_name) return load_component(component_clz, context, config)
def test_load_can_handle_none(): assert load_component(None, {}, {}) is None