code: def _get_mac_os_homebrew_prefix() -> str:
      """macOS on Apple Silicon can run binaries as native arm64, or in x86_64 emulation.
      Homebrew therefore supports both use cases, and sets up independent sysroots in /opt/homebrew (for arm64 packages)
      and /usr/local/ (for x86_64 packages). We'll need to dynamically check the architecture of the running Python
      version to infer the correct location to search for FFTW.
      """
      # Sanity check
      if platform.system() != "Darwin":
          raise RuntimeError(
              "We only expect this to be called on macOS hosts"
          )
  
      arch = platform.machine()
      if arch == "arm64":
          return "/opt/homebrew"
      elif arch == "x86_64":
          return "/usr/local"
  
      raise ValueError(f"Unrecognized architecture {arch}")
  
imports: from setuptools import setup, Command
  from setuptools.command.build_ext import build_ext
  from sysconfig import get_platform
  from contextlib import redirect_stderr, redirect_stdout
  import os
  import logging
  import platform
  import sys
  import versioneer
label_desc: Use image node_id 1 for calling a global function with example usage: _get_mac_os_homebrew_prefix() and returns: str, str