import importlib


def get_class(module, klass):
    """Return a class object.

    :param str module: module path
    :param str klass: class name
    """
    try:
        object_module = importlib.import_module(module)
        cls = getattr(object_module, klass)
    except (ImportError, TypeError) as e:
        raise ImportError("Unable to import %s:%s. %r" % (module, klass, e))

    return cls