#!/usr/bin/env python3

import importlib
import os


# automatically import any Python files in the models/ directory
for file in sorted(os.listdir(os.path.dirname(__file__))):
    if file.endswith(".py") and not file.startswith("_"):
        model_name = file[: file.find(".py")]
        importlib.import_module("pytorch_translate.models." + model_name)

[((8, 30, 8, 55), 'os.path.dirname', 'os.path.dirname', ({(8, 46, 8, 54): '__file__'}, {}), '(__file__)', False, 'import os\n'), ((11, 8, 11, 73), 'importlib.import_module', 'importlib.import_module', ({(11, 32, 11, 72): "('pytorch_translate.models.' + model_name)"}, {}), "('pytorch_translate.models.' + model_name)", False, 'import importlib\n')]