def _get_primitive_instance(primitive, kwargs): expected_args = load_primitive(primitive).get('hyperparameters', {}).get('fixed', {}) given_args = { key: value for key, value in kwargs.items() if key in expected_args } return MLBlock(primitive, **given_args)
def load_primitive(primitive, arguments=None): arguments = arguments or dict() return MLBlock(primitive, **arguments)