code: def mac_platforms(
      version: Optional[MacVersion] = None, arch: Optional[str] = None
  ) -> Iterator[str]:
      """
      Yields the platform tags for a macOS system.
  
      The `version` parameter is a two-item tuple specifying the macOS version to
      generate platform tags for. The `arch` parameter is the CPU architecture to
      generate platform tags for. Both parameters default to the appropriate value
      for the current system.
      """
      version_str, _, cpu_arch = platform.mac_ver()
      if version is None:
          version = cast(
              "MacVersion", tuple(map(int, version_str.split(".")[:2]))
          )
          if version == (10, 16):
              # When built against an older macOS SDK, Python will report macOS 10.16
              # instead of the real version.
              version_str = subprocess.run(
                  [
                      sys.executable,
                      "-sS",
                      "-c",
                      "import platform; print(platform.mac_ver()[0])",
                  ],
                  check=True,
                  env={"SYSTEM_VERSION_COMPAT": "0"},
                  stdout=subprocess.PIPE,
                  text=True,
              ).stdout
              version = cast(
                  "MacVersion",
                  tuple(map(int, version_str.split(".")[:2])),
              )
      else:
          version = version
      if arch is None:
          arch = _mac_arch(cpu_arch)
      else:
          arch = arch
  
      if (10, 0) <= version and version < (11, 0):
          # Prior to Mac OS 11, each yearly release of Mac OS bumped the
          # "minor" version number.  The major version was always 10.
          for minor_version in range(version[1], -1, -1):
              compat_version = 10, minor_version
              binary_formats = _mac_binary_formats(compat_version, arch)
              for binary_format in binary_formats:
                  yield "macosx_{major}_{minor}_{binary_format}".format(
                      major=10,
                      minor=minor_version,
                      binary_format=binary_format,
                  )
  
      if version >= (11, 0):
          # Starting with Mac OS 11, each yearly release bumps the major version
          # number.   The minor versions are now the midyear updates.
          for major_version in range(version[0], 10, -1):
              compat_version = major_version, 0
              binary_formats = _mac_binary_formats(compat_version, arch)
              for binary_format in binary_formats:
                  yield "macosx_{major}_{minor}_{binary_format}".format(
                      major=major_version,
                      minor=0,
                      binary_format=binary_format,
                  )
  
      if version >= (11, 0):
          # Mac OS 11 on x86_64 is compatible with binaries from previous releases.
          # Arm64 support was introduced in 11.0, so no Arm binaries from previous
          # releases exist.
          #
          # However, the "universal2" binary format can have a
          # macOS version earlier than 11.0 when the x86_64 part of the binary supports
          # that version of macOS.
          if arch == "x86_64":
              for minor_version in range(16, 3, -1):
                  compat_version = 10, minor_version
                  binary_formats = _mac_binary_formats(
                      compat_version, arch
                  )
                  for binary_format in binary_formats:
                      yield "macosx_{major}_{minor}_{binary_format}".format(
                          major=compat_version[0],
                          minor=compat_version[1],
                          binary_format=binary_format,
                      )
          else:
              for minor_version in range(16, 3, -1):
                  compat_version = 10, minor_version
                  binary_format = "universal2"
                  yield "macosx_{major}_{minor}_{binary_format}".format(
                      major=compat_version[0],
                      minor=compat_version[1],
                      binary_format=binary_format,
                  )
  
imports: import logging
  import platform
  import re
  import struct
  import subprocess
  import sys
  import sysconfig
  from importlib.machinery import EXTENSION_SUFFIXES
  from typing import Dict, FrozenSet, Iterable, Iterator, List, Optional, Sequence, Tuple, Union, cast
  from .None import _manylinux, _musllinux
label_desc: Use image node_id 14 for calling a global function with example usage: mac_platforms(version, arch) without return types