def import_modules_from_package(package):
    """Import modules from package and append into sys.modules

    :param package: full package name, e.g. east.asts
    """
    path = [os.path.dirname(__file__), '..'] + package.split('.')
    path = os.path.join(*path)
    for root, dirs, files in os.walk(path):
        for filename in files:
            if filename.startswith('__') or not filename.endswith('.py'):
                continue
            new_package = ".".join(root.split(os.sep)).split("....")[1]
            module_name = '%s.%s' % (new_package, filename[:-3])
            if sys.modules not in module_name:
                __import__(module_name)
dataset/ETHPy150Open mikhaildubov/AST-text-analysis/east/utils.py/import_modules_from_package/swapped operands of `not in`