code: def lint_file(path):
      fail_rules = [
          # rule, error message, rule-specific exclusions list
          (lambda x: "<mutex>" in x, "Uses <mutex>", []),
          (lambda x: "<iostream>" in x, "Uses <iostream>", []),
          (lambda x: re.match(_NULLPTR_REGEX, x), "Uses nullptr", []),
          (
              lambda x: re.match(_RETURN_NOT_OK_REGEX, x),
              "Use ARROW_RETURN_NOT_OK in header files",
              _paths(
                  """\
           arrow/status.h
           test
           arrow/util/hash.h
           arrow/python/util"""
              ),
          ),
          (
              lambda x: re.match(_ASSIGN_OR_RAISE_REGEX, x),
              "Use ARROW_ASSIGN_OR_RAISE in header files",
              _paths(
                  """\
           arrow/result_internal.h
           test
           """
              ),
          ),
      ]
  
      with open(path) as f:
          for i, line in enumerate(f):
              stripped_line = _strip_comments(line)
              for rule, why, rule_exclusions in fail_rules:
                  if any(
                      [True for excl in rule_exclusions if excl in path]
                  ):
                      continue
  
                  if rule(stripped_line):
                      yield path, why, i, line
  
imports: import argparse
  import re
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: lint_file(path) without return types