code: def check_files(
      filenames: List[str],
      flake8_plugins_path: Optional[str],
      severities: Dict[str, LintSeverity],
      retries: int,
  ) -> List[LintMessage]:
      try:
          proc = run_command(
              [sys.executable, "-mflake8", "--exit-zero"] + filenames,
              extra_env={"FLAKE8_PLUGINS_PATH": flake8_plugins_path}
              if flake8_plugins_path
              else None,
              retries=retries,
          )
      except (OSError, subprocess.CalledProcessError) as err:
          return [
              LintMessage(
                  path=None,
                  line=None,
                  char=None,
                  code="FLAKE8",
                  severity=LintSeverity.ERROR,
                  name="command-failed",
                  original=None,
                  replacement=None,
                  description=(
                      f"Failed due to {err.__class__.__name__}:\n{err}"
                      if not isinstance(
                          err, subprocess.CalledProcessError
                      )
                      else (
                          "COMMAND (exit code {returncode})\n"
                          "{command}\n\n"
                          "STDERR\n{stderr}\n\n"
                          "STDOUT\n{stdout}"
                      ).format(
                          returncode=err.returncode,
                          command=" ".join(
                              as_posix(x) for x in err.cmd
                          ),
                          stderr=err.stderr.strip() or "(empty)",
                          stdout=err.stdout.strip() or "(empty)",
                      )
                  ),
              )
          ]
  
      return [
          LintMessage(
              path=match["file"],
              name=match["code"],
              description=f"{match['message']}\nSee {get_issue_documentation_url(match['code'])}",
              line=int(match["line"]),
              char=int(match["column"])
              if match["column"] is not None
              and not match["column"].startswith("-")
              else None,
              code="FLAKE8",
              severity=severities.get(match["code"])
              or get_issue_severity(match["code"]),
              original=None,
              replacement=None,
          )
          for match in RESULTS_RE.finditer(proc.stdout)
      ]
  
imports: import argparse
  import json
  import logging
  import os
  import re
  import subprocess
  import sys
  import time
  from enum import Enum
  from typing import Any, Dict, List, NamedTuple, Optional, Pattern, Set
label_desc: Use image node_id 8 for calling a global function with example usage: check_files(filenames, flake8_plugins_path, severities, retries) and returns: unknown, list