code: def gfortran_legacy_flag_hook(cmd, ext):
      """
      Pre-build hook to add dd gfortran legacy flag -fallow-argument-mismatch
      """
      from .compiler_helper import try_add_flag
      from distutils.version import LooseVersion
  
      if isinstance(ext, dict):
          # build_clib
          compilers = (
              (
                  cmd._f_compiler,
                  ext.setdefault("extra_f77_compile_args", []),
              ),
              (
                  cmd._f_compiler,
                  ext.setdefault("extra_f90_compile_args", []),
              ),
          )
      else:
          # build_ext
          compilers = (
              (cmd._f77_compiler, ext.extra_f77_compile_args),
              (cmd._f90_compiler, ext.extra_f90_compile_args),
          )
  
      for compiler, args in compilers:
          if compiler is None:
              continue
  
          if (
              compiler.compiler_type == "gnu95"
              and compiler.version >= LooseVersion("10")
          ):
              try_add_flag(args, compiler, "-fallow-argument-mismatch")
  
imports: import re
  import os
  import sys
  from distutils.util import get_platform
  import numpy
  from .system_info import combine_dict
label_desc: Use image node_id 6 for calling a global function with example usage: gfortran_legacy_flag_hook(cmd, ext) without return types