def autodiscover():
    """
    Automatically build the template directory list.
    Almost exactly as django.contrib.admin does things, for consistency.
    """
    from django.conf import settings

    for app in settings.INSTALLED_APPS:
        # For each app, we look for a mako_templates directory with a file '.__mako__' within it
        # If it exists we add it to the MAKO_TEMPLATE_DIRS
        try:
            app_path = importlib.import_module(app).__path__
        except __HOLE__:
            continue

        template_directory = os.path.join(app_path[0], 'templates')
        special_file = os.path.join(template_directory, '.__mako__')

        settings.MAKO_TEMPLATE_DIRS = list(settings.MAKO_TEMPLATE_DIRS)

        if os.path.exists( special_file ):
            settings.MAKO_TEMPLATE_DIRS.append(template_directory)
dataset/ETHPy150Open KaySackey/Nemo/nemo/app/__init__.py/autodiscover