import inspect


def get_class(obj):
    """
    Get class of the given object. If given object is a class it is returned as
    is.

    :param obj: Class or instance to return class for
    :return: Class of object
    """

    return obj if inspect.isclass(obj) else obj.__class__