def import_class(class_object):
    """
    Import a class given a string with its name in the format module.module.classname
    """
    d = class_object.rfind(".")
    class_name = class_object[d + 1:len(class_object)]
    m = __import__(class_object[0:d], globals(), locals(), [class_name])
    return getattr(m, class_name)