code: def get_f77flags(src):
      """
      Search the first 20 lines of fortran 77 code for line pattern
        `CF77FLAGS(<fcompiler type>)=<f77 flags>`
      Return a dictionary {<fcompiler type>:<f77 flags>}.
      """
      flags = {}
      with open(src, encoding="latin1") as f:
          i = 0
          for line in f:
              i += 1
              if i > 20:
                  break
              m = _f77flags_re.match(line)
              if not m:
                  continue
              fcname = m.group("fcname").strip()
              fflags = m.group("fflags").strip()
              flags[fcname] = split_quoted(fflags)
      return flags
  
imports: import os
  import sys
  import re
  from pathlib import Path
  from distutils.sysconfig import get_python_lib
  from distutils.fancy_getopt import FancyGetopt
  from distutils.errors import DistutilsModuleError, DistutilsExecError, CompileError, LinkError, DistutilsPlatformError
  from distutils.util import split_quoted, strtobool
  from numpy.distutils.ccompiler import CCompiler, gen_lib_options
  from numpy.distutils import log
  from numpy.distutils.misc_util import is_string, all_strings, is_sequence, make_temp_file, get_shared_lib_extension
  from numpy.distutils.exec_command import find_executable
  from numpy.distutils import _shell_utils
  from .environment import EnvironmentConfig
label_desc: Use image node_id 13 for calling a global function with example usage: get_f77flags(src) and returns: flags