docs: def is_excluded_path(args, filepath):
      """Returns true if the filepath is under the one of the exclude path."""
      # Try regular expressions first.
      for regexp_exclude_path in args.regexp:
          if re.match(regexp_exclude_path, filepath):
              return True
      abspath = os.path.abspath(filepath)
      if args.include:
          # If the file is outside of any include directories.
          out_of_include_dirs = True
          for incl_path in args.include:
              absolute_include_path = os.path.abspath(os.path.join(args.root, incl_path))
              if is_child_dir(absolute_include_path, abspath):
                  out_of_include_dirs = False
                  break
          if out_of_include_dirs:
              return True
  
      excl_rules = create_exclude_rules(args)
      for i, rule in enumerate(excl_rules):
          if rule[0] == abspath:
              return rule[1]
          if is_child_dir(rule[0], abspath):
              # continue to try to longest match.
              last_result = rule[1]
              for j in range(i + 1, len(excl_rules)):
                  rule_deep = excl_rules[j]
                  if not is_child_dir(rule_deep[0], abspath):
                      break
                  last_result = rule_deep[1]
              return last_result
      return False