def METHOD_NAME(filepath, varargs, auto_group, auto_group_label_prefix, exclude, include):
    """Execute scripts with preloaded AiiDA environment."""
    from aiida.cmdline.utils.shell import DEFAULT_MODULES_LIST
    from aiida.manage import get_manager
    filepath.resolve()
    # Prepare the environment for the script to be run
    globals_dict = {
        '__builtins__': globals()['__builtins__'],
        '__name__': '__main__',
        '__file__': filepath.name,
        '__doc__': None,
        '__package__': None
    }
    # Dynamically load modules (the same of verdi shell) - but in globals_dict, not in the current environment
    for app_mod, model_name, alias in DEFAULT_MODULES_LIST:
        globals_dict[f'{alias}'] = getattr(__import__(app_mod, {}, {}, model_name), model_name)
    if auto_group:
        storage_backend = get_manager().get_profile_storage()
        storage_backend.autogroup.enable()
        # Set the ``group_label_prefix`` if defined, otherwise a default prefix will be used
        storage_backend.autogroup.set_group_label_prefix(auto_group_label_prefix)
        storage_backend.autogroup.set_exclude(exclude)
        storage_backend.autogroup.set_include(include)
    try:
        with filepath.open('r', encoding='utf-8') as handle:
            with update_environment(argv=[str(filepath)] + list(varargs)):
                # Compile the script for execution and pass it to exec with the globals_dict
                exec(compile(handle.read(), str(filepath), 'exec', dont_inherit=True), globals_dict)  # pylint: disable=exec-used
    except SystemExit:  # pylint: disable=try-except-raise
        # Script called ``sys.exit()``, re-raise the exception to have the error code properly returned at the end
        raise
    finally:
        storage_backend = get_manager().get_profile_storage()
        storage_backend.autogroup.disable()