code: def check_labels(
      labels: List[str], filename: str, line_number: int
  ) -> List[LintMessage]:
      lint_messages = []
      for label in labels:
          if label not in PYTORCH_LABELS:
              lint_messages.append(
                  LintMessage(
                      path=filename,
                      line=line_number,
                      char=None,
                      code=LINTER_CODE,
                      severity=LintSeverity.ERROR,
                      name="[invalid-label]",
                      original=None,
                      replacement=None,
                      description=(
                          f"{label} is not a PyTorch label "
                          "(please choose from https://github.com/pytorch/pytorch/labels)"
                      ),
                  )
              )
  
          if (
              label.startswith(("module:", "oncall:"))
              or label in ACCEPTABLE_OWNER_LABELS
          ):
              continue
  
          lint_messages.append(
              LintMessage(
                  path=filename,
                  line=line_number,
                  char=None,
                  code=LINTER_CODE,
                  severity=LintSeverity.ERROR,
                  name="[invalid-owner]",
                  original=None,
                  replacement=None,
                  description=(
                      f"{label} is not an acceptable owner "
                      "(please update to another label or edit ACCEPTABLE_OWNERS_LABELS "
                      "in tools/linters/adapters/testowners_linter.py"
                  ),
              )
          )
  
      return lint_messages
  
file_path: pytorch/tools/linter/adapters/testowners_linter.py
imports: import argparse
  import json
  from enum import Enum
  from typing import Any, List, NamedTuple, Optional
  from urllib.request import urlopen
label_desc: Use image node_id 2 for calling a global function with example usage: check_labels(labels, filename, line_number) and returns: lint_messages