import importlib


def load_class(module_name, class_name, class_param, pass_params_as_dict=False):
    """Loads a class given it's module name, class name, and dict of params"""
    module = importlib.import_module(module_name)
    class_n = getattr(module, class_name)
    if pass_params_as_dict:
        return class_n(**class_param)
    return class_n(class_param)