code: def build_module(
      source_files, options=[], skip=[], only=[], module_name=None
  ):
      """
      Compile and import a f2py module, built from the given files.
  
      """
  
      code = f"import sys; sys.path = {sys.path!r}; import numpy.f2py; numpy.f2py.main()"
  
      d = get_module_dir()
  
      # Copy files
      dst_sources = []
      f2py_sources = []
      for fn in source_files:
          if not os.path.isfile(fn):
              raise RuntimeError("%s is not a file" % fn)
          dst = os.path.join(d, os.path.basename(fn))
          shutil.copyfile(fn, dst)
          dst_sources.append(dst)
  
          base, ext = os.path.splitext(dst)
          if ext in (".f90", ".f", ".c", ".pyf"):
              f2py_sources.append(dst)
  
      assert f2py_sources
  
      # Prepare options
      if module_name is None:
          module_name = get_temp_module_name()
      f2py_opts = ["-c", "-m", module_name] + options + f2py_sources
      f2py_opts += ["--backend", "meson"]
      if skip:
          f2py_opts += ["skip:"] + skip
      if only:
          f2py_opts += ["only:"] + only
  
      # Build
      cwd = os.getcwd()
      try:
          os.chdir(d)
          cmd = [sys.executable, "-c", code] + f2py_opts
          p = subprocess.Popen(
              cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
          )
          out, err = p.communicate()
          if p.returncode != 0:
              raise RuntimeError(
                  "Running f2py failed: %s\n%s"
                  % (cmd[4:], asunicode(out))
              )
      finally:
          os.chdir(cwd)
  
          # Partial cleanup
          for fn in dst_sources:
              os.unlink(fn)
  
      # Rebase (Cygwin-only)
      if sys.platform == "cygwin":
          # If someone starts deleting modules after import, this will
          # need to change to record how big each module is, rather than
          # relying on rebase being able to find that from the files.
          _module_list.extend(
              glob.glob(os.path.join(d, "{:s}*".format(module_name)))
          )
          subprocess.check_call(
              [
                  "/usr/bin/rebase",
                  "--database",
                  "--oblivious",
                  "--verbose",
              ]
              + _module_list
          )
  
      # Import
      return import_module(module_name)
  
imports: import glob
  import os
  import sys
  import subprocess
  import tempfile
  import shutil
  import atexit
  import textwrap
  import re
  import pytest
  import contextlib
  import numpy
  import concurrent.futures
  from pathlib import Path
  from numpy._utils import asunicode
  from numpy.testing import temppath, IS_WASM
  from importlib import import_module
  from numpy.f2py._backends._meson import MesonBackend
label_desc: Use image node_id 5 for calling a global function with example usage: build_module(source_files, options, skip, only, module_name) and returns: import_module