import importlib


def _class_from_module(module_name, class_name):
    """Imports and returns the given class from the given module."""
    module = importlib.import_module('{}.{}'.format(__name__, module_name))
    return getattr(module, class_name)