def import_klass(k):
    """
        e.g. importstr= a.b.c.klass
        similar to
        from a.b.c import klass

    :param importstr:
    :return: classobj
    """
    args = k.split('.')
    pkg, klass = '.'.join(args[:-1]), args[-1]
    mod = __import__(pkg, fromlist=[klass])

    return getattr(mod, klass)