def METHOD_NAME(file_or_dir, template_linters, options, summary_results, out):
    """
    For each linter, lints the provided file or directory.
    Arguments:
        file_or_dir: The file or initial directory to lint.
        template_linters: A list of linting objects.
        options: A list of the options.
        summary_results: A SummaryResults with a summary of the violations.
        out: output file
    """
    if file_or_dir is not None and os.path.isfile(file_or_dir):
        _process_file(file_or_dir, template_linters, options, summary_results, out)
    else:
        directory = "."
        if file_or_dir is not None:
            if os.path.exists(file_or_dir):
                directory = file_or_dir
            else:
                raise ValueError(f"Path [{file_or_dir}] is not a valid file or directory.")
        _process_os_dirs(directory, template_linters, options, summary_results, out)
    summary_results.print_results(options, out)