def get_class(kls: str) ->type:
    """
    Gets class by name and imports all modules needed
    :param kls:
    :return:
    """
    parts = kls.split('.')
    module = '.'.join(parts[:-1])
    m = __import__(module)
    for comp in parts[1:]:
        m = getattr(m, comp)
    return m
