def import_class(name, get_module=False):
    module_name = get_module and name or '.'.join(name.split('.')[:-1])
    klass = name.split('.')[-1]

    module = get_module and __import__(name) or __import__(module_name)
    if module_name in '.':
        module = reduce(getattr, module_name.split('.')[1:], module)

    return get_module and module or getattr(module, klass)
dataset/ETHPy150Open thumbor/thumbor/thumbor/importer.py/import_class/swapped operands of `in`